From owner-svn-src-all@freebsd.org Sun Feb 7 00:49:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B693CA9F164; Sun, 7 Feb 2016 00:49:16 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 8863D1076; Sun, 7 Feb 2016 00:49:16 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u170nFis047493; Sun, 7 Feb 2016 00:49:15 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u170nFBo047492; Sun, 7 Feb 2016 00:49:15 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201602070049.u170nFBo047492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sun, 7 Feb 2016 00:49:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295357 - head/sys/boot/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 00:49:16 -0000 Author: allanjude Date: Sun Feb 7 00:49:15 2016 New Revision: 295357 URL: https://svnweb.freebsd.org/changeset/base/295357 Log: Do not set vfs.root.mountfrom unnecessarily This causes boot from external media (installer USB image) to mount / from the default ZFS BE, rather than the USB device. Reported by: kmoore MFC after: 5 days Sponsored by: ScaleEngine Inc. Modified: head/sys/boot/zfs/zfs.c Modified: head/sys/boot/zfs/zfs.c ============================================================================== --- head/sys/boot/zfs/zfs.c Sat Feb 6 22:01:25 2016 (r295356) +++ head/sys/boot/zfs/zfs.c Sun Feb 7 00:49:15 2016 (r295357) @@ -722,8 +722,6 @@ init_zfs_bootenv(char *currdev) currdev[strlen(currdev) - 1] = '\0'; setenv("zfs_be_active", currdev, 1); setenv("zfs_be_currpage", "1", 1); - /* Do not overwrite if already set */ - setenv("vfs.root.mountfrom", currdev, 0); /* Forward past zfs: */ currdev = strchr(currdev, ':'); currdev++; From owner-svn-src-all@freebsd.org Sun Feb 7 00:55:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C400A9F4B5 for ; Sun, 7 Feb 2016 00:55:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-x236.google.com (mail-qg0-x236.google.com [IPv6:2607:f8b0:400d:c04::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC4151470 for ; Sun, 7 Feb 2016 00:55:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qg0-x236.google.com with SMTP id b35so95109047qge.0 for ; Sat, 06 Feb 2016 16:55:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=c3iIhC1Z7cAj32e5QaSK+IxNKm+jxanwhVimXDYgn7o=; b=wbwVwukTymj6ByoDmY/uoVh4A63IxlE9SYxG2U2l06HvdVCfDW5ASHi+skzjjZcDzx EdrJH+oM27+lrVJv8/G7OtAEnQdXGytiNUwdtpettxaZb0wqAFnqbPnlM1b84qP1fwke 47HcZzxxwfdMRwhJjz5Nyrw8t7hp6rxFhFapGwFuM7qtWW0L10ipZPfUzzl55mEcxlXt yjPdj0CFQObcgbKpJco94GekrHQW1n/jHfhqolzIBSZ4baCwLfnCUtWOOiEHfYgXzHDW 0WTDgTV4K0CBEaVbpAMKCFr/FKupGzMn4YfZJYYmmt0/zyAF254k0YZodEJm+GfG0eq1 qFAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=c3iIhC1Z7cAj32e5QaSK+IxNKm+jxanwhVimXDYgn7o=; b=ELBXzCM8w28BFIRdzJNfURs5BBS8IxfufGyrNjzxCpWuhr+tBB7iH8C9Ys32zngQ/P 45LI7+RTvRwSWruqeVbP16ZvtKxR1MNSGot90IW6+Hhm0IfgLx7yquuHfZMHhNRlj77F P0gfKx8udTzHK/oBTVCoLsBPFKDxcfiC35OzhwaPwAoWGYQ4cUJ8Elmhnxj3oc8HYRcy NqIpM+Awu34ERxOysUxEd5LL1vor9R7Zn3oTeqQEKdevZasNnWB5lAfzDS+UnJ7H3gi2 8wbaTOBb6OmSDWvceqBM8c5SomLrzsBMXzflClolpN8y8cds9JEcAs2lJLNWrS0A9wyD 2/Ww== X-Gm-Message-State: AG10YOQ5nrBdT6pGMongrKMGOImzM9KgDtVO7TkNpXJVRWgcCoiBpDprnwnv6lDpb/iZU/t6ldZIi+DKbEI4vA== MIME-Version: 1.0 X-Received: by 10.140.28.162 with SMTP id 31mr18470919qgz.81.1454806539848; Sat, 06 Feb 2016 16:55:39 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.30.166 with HTTP; Sat, 6 Feb 2016 16:55:39 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <201602070049.u170nFBo047492@repo.freebsd.org> References: <201602070049.u170nFBo047492@repo.freebsd.org> Date: Sat, 6 Feb 2016 17:55:39 -0700 X-Google-Sender-Auth: OyNVB6ZqhSarTMNXNok1kiKFXac Message-ID: Subject: Re: svn commit: r295357 - head/sys/boot/zfs From: Warner Losh To: Allan Jude Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 00:55:41 -0000 On Sat, Feb 6, 2016 at 5:49 PM, Allan Jude wrote: > Author: allanjude > Date: Sun Feb 7 00:49:15 2016 > New Revision: 295357 > URL: https://svnweb.freebsd.org/changeset/base/295357 > > Log: > Do not set vfs.root.mountfrom unnecessarily > > This causes boot from external media (installer USB image) to mount / > from > the default ZFS BE, rather than the USB device. > Sure this didn't just break zfs booting? Warner > Reported by: kmoore > MFC after: 5 days > Sponsored by: ScaleEngine Inc. > > Modified: > head/sys/boot/zfs/zfs.c > > Modified: head/sys/boot/zfs/zfs.c > > ============================================================================== > --- head/sys/boot/zfs/zfs.c Sat Feb 6 22:01:25 2016 (r295356) > +++ head/sys/boot/zfs/zfs.c Sun Feb 7 00:49:15 2016 (r295357) > @@ -722,8 +722,6 @@ init_zfs_bootenv(char *currdev) > currdev[strlen(currdev) - 1] = '\0'; > setenv("zfs_be_active", currdev, 1); > setenv("zfs_be_currpage", "1", 1); > - /* Do not overwrite if already set */ > - setenv("vfs.root.mountfrom", currdev, 0); > /* Forward past zfs: */ > currdev = strchr(currdev, ':'); > currdev++; > > From owner-svn-src-all@freebsd.org Sun Feb 7 01:04:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F3F4A9F824; Sun, 7 Feb 2016 01:04:42 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id E563F1A15; Sun, 7 Feb 2016 01:04:41 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 72DAEDCFA; Sun, 7 Feb 2016 01:04:35 +0000 (UTC) Subject: Re: svn commit: r295357 - head/sys/boot/zfs To: Warner Losh References: <201602070049.u170nFBo047492@repo.freebsd.org> Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Allan Jude Message-ID: <56B69836.7020709@freebsd.org> Date: Sat, 6 Feb 2016 20:04:54 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="oIovhPnoVQVmm6SgU5xLvIvKc5cGgQ9Lj" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 01:04:42 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --oIovhPnoVQVmm6SgU5xLvIvKc5cGgQ9Lj Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2016-02-06 19:55, Warner Losh wrote: >=20 >=20 > On Sat, Feb 6, 2016 at 5:49 PM, Allan Jude > wrote: >=20 > Author: allanjude > Date: Sun Feb 7 00:49:15 2016 > New Revision: 295357 > URL: https://svnweb.freebsd.org/changeset/base/295357 >=20 > Log: > Do not set vfs.root.mountfrom unnecessarily >=20 > This causes boot from external media (installer USB image) to > mount / from > the default ZFS BE, rather than the USB device. >=20 >=20 > Sure this didn't just break zfs booting? >=20 > Warner > =20 I tested in in a VM and on two laptops. The var was only being set if it was not already set by loader.conf, and only to provide a 'default' for the 'Active' item in the ZFS BE Menu. The system will derive the default root mountpoint from the loader 'currdev' (with ZFS, this is set by the bootfs pool property) variable if it is not overridden by vfs.root.mountfrom --=20 Allan Jude --oIovhPnoVQVmm6SgU5xLvIvKc5cGgQ9Lj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJWtpg6AAoJEBmVNT4SmAt+XsUQAOAQrBKXFlckQBhGUPVcqSTE QLNJ5j3Tw/chawtWSuqxEJPTGVaAYTPAnOV8TM8VBaN+IJ2zTUPo2OKS7/MD/mgd JUwzPFbMDnRbfWpgRNlKxqtvP5oogqkhWofRil8jqZtc26K7WXzEfBbQB2vWZOhm feIri45rkQuoPg9UNBJjGCEMitK+Nmhoub8VjC7dCAsvTO59ZjBMKJRqEob2VyIk 5k4lpO1xrGR7MBoxXGmV3tTAmJXNnGvXbuRqr1Jx/coPkk6ZQHX1xXdLBebeBTwE CZ6aggjZEG/2Bu0o5tZ/SLck7qVzLZ1xNH9T+3GFIgte12C1Pgo15s9p2kaHBz+h Cz86gLt3CY5eE4Kb3dhiMnglurJlGczECW+Q3pP/TZrUVT/2dI3r8qTvuHna2/Vq Dx/mXFTKEHApAqs5+igfjtWflpflK6ZQJLF8hpVWm02ECrNsCjV7vBpupyDUc/O7 zmdCpQYjm2K0Ps01xRA4wtHKOw54QL/J239sbrvfIrlDb81cZjEV4khW5Ic+gM16 YU8kJeL15vh4GJhHVr+fO0FMLINIKyCSgf5J3jOJsKqXfZd89mnIzsoMW44UeFZX Jp1eChA+MJt44Z1x1CsQPJwIQA1dn/iIZCoNuqeS6YEAFyk527XD/QSanTXR0Ica Doesg99VpYhMsDZhCnRE =+yKv -----END PGP SIGNATURE----- --oIovhPnoVQVmm6SgU5xLvIvKc5cGgQ9Lj-- From owner-svn-src-all@freebsd.org Sun Feb 7 01:04:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EEE0A9F85A; Sun, 7 Feb 2016 01:04:49 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 C84371B12; Sun, 7 Feb 2016 01:04:48 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1714luq053083; Sun, 7 Feb 2016 01:04:47 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1714lNV053082; Sun, 7 Feb 2016 01:04:47 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201602070104.u1714lNV053082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sun, 7 Feb 2016 01:04:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295358 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 01:04:49 -0000 Author: mckusick Date: Sun Feb 7 01:04:47 2016 New Revision: 295358 URL: https://svnweb.freebsd.org/changeset/base/295358 Log: Clarify a comment in kern_openat() about the use of falloc_noinstall(). Suggested by: Steve Jacobson Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Sun Feb 7 00:49:15 2016 (r295357) +++ head/sys/kern/vfs_syscalls.c Sun Feb 7 01:04:47 2016 (r295358) @@ -987,7 +987,8 @@ kern_openat(struct thread *td, int fd, c } /* - * Allocate the file descriptor, but don't install a descriptor yet. + * Allocate a file structure. The descriptor to reference it + * is allocated and set by finstall() below. */ error = falloc_noinstall(td, &fp); if (error != 0) From owner-svn-src-all@freebsd.org Sun Feb 7 01:09:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55D9BA9FA87; Sun, 7 Feb 2016 01:09:40 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 2411A1D21; Sun, 7 Feb 2016 01:09:40 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1719d7A053282; Sun, 7 Feb 2016 01:09:39 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1719dcr053281; Sun, 7 Feb 2016 01:09:39 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602070109.u1719dcr053281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 7 Feb 2016 01:09:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295359 - head/sys/fs/fdescfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 01:09:40 -0000 Author: pfg Date: Sun Feb 7 01:09:38 2016 New Revision: 295359 URL: https://svnweb.freebsd.org/changeset/base/295359 Log: fdesc_setattr: unitialized pointer read CID: 1018688 Modified: head/sys/fs/fdescfs/fdesc_vnops.c Modified: head/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- head/sys/fs/fdescfs/fdesc_vnops.c Sun Feb 7 01:04:47 2016 (r295358) +++ head/sys/fs/fdescfs/fdesc_vnops.c Sun Feb 7 01:09:38 2016 (r295359) @@ -465,7 +465,7 @@ fdesc_setattr(ap) { struct vattr *vap = ap->a_vap; struct vnode *vp; - struct mount *mp; + struct mount *mp = NULL; struct file *fp; struct thread *td = curthread; cap_rights_t rights; From owner-svn-src-all@freebsd.org Sun Feb 7 01:38:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46A14AA0A87; Sun, 7 Feb 2016 01:38:53 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 E4D851CA7; Sun, 7 Feb 2016 01:38:52 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u171cp0r061966; Sun, 7 Feb 2016 01:38:51 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u171coMp061951; Sun, 7 Feb 2016 01:38:50 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602070138.u171coMp061951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 7 Feb 2016 01:38:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295360 - in vendor/NetBSD/libedit/dist: . readline X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 01:38:53 -0000 Author: pfg Date: Sun Feb 7 01:38:50 2016 New Revision: 295360 URL: https://svnweb.freebsd.org/changeset/base/295360 Log: Import libedit 2016-01-16 Obtained from: NetBSD Modified: vendor/NetBSD/libedit/dist/Makefile vendor/NetBSD/libedit/dist/chartype.c vendor/NetBSD/libedit/dist/chartype.h vendor/NetBSD/libedit/dist/editline.3 vendor/NetBSD/libedit/dist/el.c vendor/NetBSD/libedit/dist/eln.c vendor/NetBSD/libedit/dist/hist.h vendor/NetBSD/libedit/dist/keymacro.h vendor/NetBSD/libedit/dist/map.c vendor/NetBSD/libedit/dist/readline.c vendor/NetBSD/libedit/dist/readline/readline.h vendor/NetBSD/libedit/dist/search.c vendor/NetBSD/libedit/dist/tokenizer.c vendor/NetBSD/libedit/dist/tty.c vendor/NetBSD/libedit/dist/vi.c Modified: vendor/NetBSD/libedit/dist/Makefile ============================================================================== --- vendor/NetBSD/libedit/dist/Makefile Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/Makefile Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.52 2014/06/14 20:49:37 mrg Exp $ +# $NetBSD: Makefile,v 1.53 2015/01/29 20:30:02 joerg Exp $ # @(#)Makefile 8.1 (Berkeley) 6/4/93 USE_SHLIBDIR= yes @@ -13,6 +13,7 @@ LIBDPLIBS+= terminfo ${.CURDIR}/../l COPTS+= -Wunused-parameter CWARNFLAGS.gcc+= -Wconversion +CWARNFLAGS.clang+= -Wno-cast-qual OSRCS= chared.c common.c el.c emacs.c fcns.c filecomplete.c help.c \ hist.c keymacro.c map.c chartype.c \ Modified: vendor/NetBSD/libedit/dist/chartype.c ============================================================================== --- vendor/NetBSD/libedit/dist/chartype.c Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/chartype.c Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -/* $NetBSD: chartype.c,v 1.10 2011/08/16 16:25:15 christos Exp $ */ +/* $NetBSD: chartype.c,v 1.12 2015/02/22 02:16:19 christos Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: chartype.c,v 1.10 2011/08/16 16:25:15 christos Exp $"); +__RCSID("$NetBSD: chartype.c,v 1.12 2015/02/22 02:16:19 christos Exp $"); #endif /* not lint && not SCCSID */ #include "el.h" #include @@ -46,31 +46,46 @@ __RCSID("$NetBSD: chartype.c,v 1.10 2011 #define CT_BUFSIZ ((size_t)1024) #ifdef WIDECHAR -protected void -ct_conv_buff_resize(ct_buffer_t *conv, size_t mincsize, size_t minwsize) +protected int +ct_conv_cbuff_resize(ct_buffer_t *conv, size_t csize) { void *p; - if (mincsize > conv->csize) { - conv->csize = mincsize; - p = el_realloc(conv->cbuff, conv->csize * sizeof(*conv->cbuff)); - if (p == NULL) { - conv->csize = 0; - el_free(conv->cbuff); - conv->cbuff = NULL; - } else - conv->cbuff = p; + + if (csize <= conv->csize) + return 0; + + conv->csize = csize; + + p = el_realloc(conv->cbuff, conv->csize * sizeof(*conv->cbuff)); + if (p == NULL) { + conv->csize = 0; + el_free(conv->cbuff); + conv->cbuff = NULL; + return -1; } + conv->cbuff = p; + return 0; +} - if (minwsize > conv->wsize) { - conv->wsize = minwsize; - p = el_realloc(conv->wbuff, conv->wsize * sizeof(*conv->wbuff)); - if (p == NULL) { - conv->wsize = 0; - el_free(conv->wbuff); - conv->wbuff = NULL; - } else - conv->wbuff = p; +protected int +ct_conv_wbuff_resize(ct_buffer_t *conv, size_t wsize) +{ + void *p; + + if (wsize <= conv->wsize) + return 0; + + conv->wsize = wsize; + + p = el_realloc(conv->wbuff, conv->wsize * sizeof(*conv->wbuff)); + if (p == NULL) { + conv->wsize = 0; + el_free(conv->wbuff); + conv->wbuff = NULL; + return -1; } + conv->wbuff = p; + return 0; } @@ -78,26 +93,22 @@ public char * ct_encode_string(const Char *s, ct_buffer_t *conv) { char *dst; - ssize_t used = 0; + ssize_t used; if (!s) return NULL; - if (!conv->cbuff) - ct_conv_buff_resize(conv, CT_BUFSIZ, (size_t)0); - if (!conv->cbuff) - return NULL; dst = conv->cbuff; - while (*s) { - used = (ssize_t)(conv->csize - (size_t)(dst - conv->cbuff)); - if (used < 5) { - used = dst - conv->cbuff; - ct_conv_buff_resize(conv, conv->csize + CT_BUFSIZ, - (size_t)0); - if (!conv->cbuff) + for (;;) { + used = (ssize_t)(dst - conv->cbuff); + if ((conv->csize - (size_t)used) < 5) { + if (ct_conv_cbuff_resize(conv, + conv->csize + CT_BUFSIZ) == -1) return NULL; dst = conv->cbuff + used; } + if (!*s) + break; used = ct_encode_char(dst, (size_t)5, *s); if (used == -1) /* failed to encode, need more buffer space */ abort(); @@ -111,22 +122,19 @@ ct_encode_string(const Char *s, ct_buffe public Char * ct_decode_string(const char *s, ct_buffer_t *conv) { - size_t len = 0; + size_t len; if (!s) return NULL; - if (!conv->wbuff) - ct_conv_buff_resize(conv, (size_t)0, CT_BUFSIZ); - if (!conv->wbuff) - return NULL; len = ct_mbstowcs(NULL, s, (size_t)0); if (len == (size_t)-1) return NULL; - if (len > conv->wsize) - ct_conv_buff_resize(conv, (size_t)0, len + 1); - if (!conv->wbuff) - return NULL; + + if (conv->wsize < ++len) + if (ct_conv_wbuff_resize(conv, len + CT_BUFSIZ) == -1) + return NULL; + ct_mbstowcs(conv->wbuff, s, conv->wsize); return conv->wbuff; } @@ -145,9 +153,9 @@ ct_decode_argv(int argc, const char *arg * the argv strings. */ for (i = 0, bufspace = 0; i < argc; ++i) bufspace += argv[i] ? strlen(argv[i]) + 1 : 0; - ct_conv_buff_resize(conv, (size_t)0, bufspace); - if (!conv->wsize) - return NULL; + if (conv->wsize < ++bufspace) + if (ct_conv_wbuff_resize(conv, bufspace + CT_BUFSIZ) == -1) + return NULL; wargv = el_malloc((size_t)argc * sizeof(*wargv)); Modified: vendor/NetBSD/libedit/dist/chartype.h ============================================================================== --- vendor/NetBSD/libedit/dist/chartype.h Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/chartype.h Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -/* $NetBSD: chartype.h,v 1.10 2011/11/16 01:45:10 christos Exp $ */ +/* $NetBSD: chartype.h,v 1.15 2015/05/17 13:14:41 christos Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -44,7 +44,7 @@ * supports non-BMP code points without requiring UTF-16, but nothing * seems to actually advertise this properly, despite Unicode 3.1 having * been around since 2001... */ -#if !defined(__NetBSD__) && !defined(__sun) && !(defined(__APPLE__) && defined(__MACH__)) +#if !defined(__NetBSD__) && !defined(__sun) && !(defined(__APPLE__) && defined(__MACH__)) && !defined(__OpenBSD__) && !defined(__FreeBSD__) #ifndef __STDC_ISO_10646__ /* In many places it is assumed that the first 127 code points are ASCII * compatible, so ensure wchar_t indeed does ISO 10646 and not some other @@ -72,6 +72,7 @@ #define FUN(prefix,rest) prefix ## _w ## rest #define FUNW(type) type ## _w #define TYPE(type) type ## W +#define FCHAR "%lc" #define FSTR "%ls" #define STR(x) L ## x #define UC(c) c @@ -126,6 +127,7 @@ Width(wchar_t c) #define FUN(prefix,rest) prefix ## _ ## rest #define FUNW(type) type #define TYPE(type) type +#define FCHAR "%c" #define FSTR "%s" #define STR(x) x #define UC(c) (unsigned char)(c) @@ -189,7 +191,8 @@ public Char *ct_decode_string(const char protected Char **ct_decode_argv(int, const char *[], ct_buffer_t *); /* Resizes the conversion buffer(s) if needed. */ -protected void ct_conv_buff_resize(ct_buffer_t *, size_t, size_t); +protected int ct_conv_cbuff_resize(ct_buffer_t *, size_t); +protected int ct_conv_wbuff_resize(ct_buffer_t *, size_t); protected ssize_t ct_encode_char(char *, size_t, Char); protected size_t ct_enc_width(Char); @@ -199,7 +202,8 @@ protected size_t ct_enc_width(Char); #define ct_encode_string(s, b) (s) #define ct_decode_string(s, b) (s) #define ct_decode_argv(l, s, b) (s) -#define ct_conv_buff_resize(b, os, ns) +#define ct_conv_cbuff_resize(b, s) ((s) == (0)) +#define ct_conv_wbuff_resize(b, s) ((s) == (0)) #define ct_encode_char(d, l, s) (*d = s, 1) #define ct_free_argv(s) #endif Modified: vendor/NetBSD/libedit/dist/editline.3 ============================================================================== --- vendor/NetBSD/libedit/dist/editline.3 Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/editline.3 Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -.\" $NetBSD: editline.3,v 1.84 2014/12/25 13:39:41 wiz Exp $ +.\" $NetBSD: editline.3,v 1.85 2015/11/03 21:36:59 christos Exp $ .\" .\" Copyright (c) 1997-2014 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -26,7 +26,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd December 25, 2014 +.Dd November 3, 2015 .Dt EDITLINE 3 .Os .Sh NAME @@ -189,7 +189,7 @@ counterparts. The following functions are available: .Bl -tag -width 4n .It Fn el_init -Initialise the line editor, and return a data structure +Initialize the line editor, and return a data structure to be used by all other line editing functions, or .Dv NULL on failure. @@ -519,61 +519,68 @@ are supported, along with actual type of .Fa result : .Bl -tag -width 4n .It Dv EL_PROMPT , Fa "char *(*f)(EditLine *)" , Fa "char *c" -Return a pointer to the function that displays the prompt in +Set .Fa f . +to a pointer to the function that displays the prompt. If .Fa c is not .Dv NULL , -return the start/stop literal prompt character in it. +set it to the start/stop literal prompt character. .It Dv EL_RPROMPT , Fa "char *(*f)(EditLine *)" , Fa "char *c" -Return a pointer to the function that displays the prompt in +Set .Fa f . +to a pointer to the function that displays the prompt. If .Fa c is not .Dv NULL , -return the start/stop literal prompt character in it. -.It Dv EL_EDITOR , Fa "const char **" -Return the name of the editor, which will be one of +set it to the start/stop literal prompt character. +.It Dv EL_EDITOR , Fa "const char **n" +Set the name of the editor in +.Fa n , +which will be one of .Dq emacs or .Dq vi . .It Dv EL_GETTC , Fa "const char *name" , Fa "void *value" -Return non-zero if +If .Fa name is a valid .Xr termcap 5 -capability -and set +capability set .Fa value to the current value of that capability. -.It Dv EL_SIGNAL , Fa "int *" -Return non-zero if +.It Dv EL_SIGNAL , Fa "int *s" +Set +.Fa s +to non zero if .Nm has installed private signal handlers (see .Fn el_get above). -.It Dv EL_EDITMODE , Fa "int *" -Return non-zero if editing is enabled. +.It Dv EL_EDITMODE , Fa "int *c" +Set +.Fa c +to non-zero if editing is enabled. .It Dv EL_GETCFN , Fa "int (**f)(EditLine *, char *)" Return a pointer to the function that read characters, which is equal to .Dq Dv EL_BUILTIN_GETCFN in the case of the default builtin function. .It Dv EL_CLIENTDATA , Fa "void **data" -Retrieve +Set .Fa data -previously registered with the corresponding +to the previously registered client data set by an .Fn el_set call. -.It Dv EL_UNBUFFERED , Fa "int" -Return non-zero if unbuffered mode is enabled. -.It Dv EL_PREP_TERM , Fa "int" -Sets or clears terminal editing mode. +.It Dv EL_UNBUFFERED , Fa "int *c" +Set +.Fa c +to non-zero if unbuffered mode is enabled. .It Dv EL_GETFP , Fa "int fd", Fa "FILE **fp" -Return in +Set .Fa fp -the current +to the current .Nm editline file pointer for .Dq input @@ -591,7 +598,7 @@ or .Dv 2 . .El .It Fn el_source -Initialise +Initialize .Nm by reading the contents of .Fa file . @@ -669,7 +676,7 @@ and freed by The following functions are available: .Bl -tag -width 4n .It Fn history_init -Initialise the history list, and return a data structure +Initialize the history list, and return a data structure to be used by all other history list functions, or .Dv NULL on failure. @@ -808,7 +815,7 @@ and freed by The following functions are available: .Bl -tag -width 4n .It Fn tok_init -Initialise the tokenizer, and return a data structure +Initialize the tokenizer, and return a data structure to be used by all other tokenizer functions. .Fa IFS contains the Input Field Separators, which defaults to Modified: vendor/NetBSD/libedit/dist/el.c ============================================================================== --- vendor/NetBSD/libedit/dist/el.c Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/el.c Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -/* $NetBSD: el.c,v 1.73 2014/06/18 18:12:28 christos Exp $ */ +/* $NetBSD: el.c,v 1.74 2015/12/08 12:56:55 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)el.c 8.2 (Berkeley) 1/3/94"; #else -__RCSID("$NetBSD: el.c,v 1.73 2014/06/18 18:12:28 christos Exp $"); +__RCSID("$NetBSD: el.c,v 1.74 2015/12/08 12:56:55 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -135,7 +135,8 @@ el_end(EditLine *el) terminal_end(el); keymacro_end(el); map_end(el); - tty_end(el); + if (!(el->el_flags & NO_TTY)) + tty_end(el); ch_end(el); search_end(el); hist_end(el); Modified: vendor/NetBSD/libedit/dist/eln.c ============================================================================== --- vendor/NetBSD/libedit/dist/eln.c Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/eln.c Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -/* $NetBSD: eln.c,v 1.17 2014/06/18 18:12:28 christos Exp $ */ +/* $NetBSD: eln.c,v 1.19 2015/05/18 15:07:04 christos Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: eln.c,v 1.17 2014/06/18 18:12:28 christos Exp $"); +__RCSID("$NetBSD: eln.c,v 1.19 2015/05/18 15:07:04 christos Exp $"); #endif /* not lint && not SCCSID */ #include "histedit.h" @@ -76,9 +76,17 @@ el_gets(EditLine *el, int *nread) { const wchar_t *tmp; - el->el_flags |= IGNORE_EXTCHARS; + if (!(el->el_flags & CHARSET_IS_UTF8)) + el->el_flags |= IGNORE_EXTCHARS; tmp = el_wgets(el, nread); - el->el_flags &= ~IGNORE_EXTCHARS; + if (tmp != NULL) { + size_t nwread = 0; + for (int i = 0; i < *nread; i++) + nwread += ct_enc_width(tmp[i]); + *nread = (int)nwread; + } + if (!(el->el_flags & CHARSET_IS_UTF8)) + el->el_flags &= ~IGNORE_EXTCHARS; return ct_encode_string(tmp, &el->el_lgcyconv); } Modified: vendor/NetBSD/libedit/dist/hist.h ============================================================================== --- vendor/NetBSD/libedit/dist/hist.h Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/hist.h Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -/* $NetBSD: hist.h,v 1.14 2014/05/11 01:05:17 christos Exp $ */ +/* $NetBSD: hist.h,v 1.15 2016/01/30 15:05:27 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -46,10 +46,10 @@ typedef int (*hist_fun_t)(void *, TYPE(H typedef struct el_history_t { Char *buf; /* The history buffer */ - size_t sz; /* Size of history buffer */ + size_t sz; /* Size of history buffer */ Char *last; /* The last character */ int eventno; /* Event we are looking for */ - void * ref; /* Argument for history fcns */ + void *ref; /* Argument for history fcns */ hist_fun_t fun; /* Event access */ TYPE(HistEvent) ev; /* Event cookie */ } el_history_t; Modified: vendor/NetBSD/libedit/dist/keymacro.h ============================================================================== --- vendor/NetBSD/libedit/dist/keymacro.h Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/keymacro.h Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -/* $NetBSD: keymacro.h,v 1.2 2011/07/28 03:44:36 christos Exp $ */ +/* $NetBSD: keymacro.h,v 1.3 2016/01/29 19:59:11 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -47,7 +47,7 @@ typedef union keymacro_value_t { typedef struct keymacro_node_t keymacro_node_t; -typedef struct el_keymacromacro_t { +typedef struct el_keymacro_t { Char *buf; /* Key print buffer */ keymacro_node_t *map; /* Key map */ keymacro_value_t val; /* Local conversion buffer */ Modified: vendor/NetBSD/libedit/dist/map.c ============================================================================== --- vendor/NetBSD/libedit/dist/map.c Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/map.c Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -/* $NetBSD: map.c,v 1.34 2014/07/06 18:15:34 christos Exp $ */ +/* $NetBSD: map.c,v 1.35 2015/05/14 10:44:15 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)map.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: map.c,v 1.34 2014/07/06 18:15:34 christos Exp $"); +__RCSID("$NetBSD: map.c,v 1.35 2015/05/14 10:44:15 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -1300,8 +1300,8 @@ map_bind(EditLine *el, int argc, const C return 0; default: (void) fprintf(el->el_errfile, - "" FSTR ": Invalid switch `%c'.\n", - argv[0], p[1]); + "" FSTR ": Invalid switch `" FCHAR "'.\n", + argv[0], (Int)p[1]); } else break; Modified: vendor/NetBSD/libedit/dist/readline.c ============================================================================== --- vendor/NetBSD/libedit/dist/readline.c Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/readline.c Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -/* $NetBSD: readline.c,v 1.113 2014/10/18 08:33:23 snj Exp $ */ +/* $NetBSD: readline.c,v 1.117 2015/06/02 15:35:31 christos Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: readline.c,v 1.113 2014/10/18 08:33:23 snj Exp $"); +__RCSID("$NetBSD: readline.c,v 1.117 2015/06/02 15:35:31 christos Exp $"); #endif /* not lint && not SCCSID */ #include @@ -78,7 +78,7 @@ FILE *rl_outstream = NULL; int rl_point = 0; int rl_end = 0; char *rl_line_buffer = NULL; -VCPFunction *rl_linefunc = NULL; +rl_vcpfunc_t *rl_linefunc = NULL; int rl_done = 0; VFunction *rl_event_hook = NULL; KEYMAP_ENTRY_ARRAY emacs_standard_keymap, @@ -107,9 +107,9 @@ int rl_attempted_completion_over = 0; char *rl_basic_word_break_characters = break_chars; char *rl_completer_word_break_characters = NULL; char *rl_completer_quote_characters = NULL; -Function *rl_completion_entry_function = NULL; +rl_compentry_func_t *rl_completion_entry_function = NULL; char *(*rl_completion_word_break_hook)(void) = NULL; -CPPFunction *rl_attempted_completion_function = NULL; +rl_completion_func_t *rl_attempted_completion_function = NULL; Function *rl_pre_input_hook = NULL; Function *rl_startup1_hook = NULL; int (*rl_getc_function)(FILE *) = NULL; @@ -160,7 +160,7 @@ int rl_completion_append_character = ' ' static History *h = NULL; static EditLine *e = NULL; -static Function *map[256]; +static rl_command_func_t *map[256]; static jmp_buf topbuf; /* internal functions */ @@ -362,6 +362,37 @@ rl_initialize(void) _el_rl_tstp); el_set(e, EL_BIND, "^Z", "rl_tstp", NULL); + /* + * Set some readline compatible key-bindings. + */ + el_set(e, EL_BIND, "^R", "em-inc-search-prev", NULL); + + /* + * Allow the use of Home/End keys. + */ + el_set(e, EL_BIND, "\\e[1~", "ed-move-to-beg", NULL); + el_set(e, EL_BIND, "\\e[4~", "ed-move-to-end", NULL); + el_set(e, EL_BIND, "\\e[7~", "ed-move-to-beg", NULL); + el_set(e, EL_BIND, "\\e[8~", "ed-move-to-end", NULL); + el_set(e, EL_BIND, "\\e[H", "ed-move-to-beg", NULL); + el_set(e, EL_BIND, "\\e[F", "ed-move-to-end", NULL); + + /* + * Allow the use of the Delete/Insert keys. + */ + el_set(e, EL_BIND, "\\e[3~", "ed-delete-next-char", NULL); + el_set(e, EL_BIND, "\\e[2~", "ed-quoted-insert", NULL); + + /* + * Ctrl-left-arrow and Ctrl-right-arrow for word moving. + */ + el_set(e, EL_BIND, "\\e[1;5C", "em-next-word", NULL); + el_set(e, EL_BIND, "\\e[1;5D", "ed-prev-word", NULL); + el_set(e, EL_BIND, "\\e[5C", "em-next-word", NULL); + el_set(e, EL_BIND, "\\e[5D", "ed-prev-word", NULL); + el_set(e, EL_BIND, "\\e\\e[C", "em-next-word", NULL); + el_set(e, EL_BIND, "\\e\\e[D", "ed-prev-word", NULL); + /* read settings from configuration file */ el_source(e, NULL); @@ -948,7 +979,8 @@ loop: for (; str[j]; j++) { if (str[j] == '\\' && str[j + 1] == history_expansion_char) { - (void)strcpy(&str[j], &str[j + 1]); + len = strlen(&str[j + 1]) + 1; + memmove(&str[j], &str[j + 1], len); continue; } if (!loop_again) { @@ -1795,9 +1827,11 @@ rl_complete(int ignore __attribute__((__ else breakchars = rl_basic_word_break_characters; + _rl_update_pos(); + /* Just look at how many global variables modify this operation! */ return fn_complete(e, - (CPFunction *)rl_completion_entry_function, + (rl_compentry_func_t *)rl_completion_entry_function, rl_attempted_completion_function, ct_decode_string(rl_basic_word_break_characters, &wbreak_conv), ct_decode_string(breakchars, &sprefix_conv), @@ -1926,7 +1960,7 @@ rl_bind_wrapper(EditLine *el __attribute _rl_update_pos(); - (*map[c])(NULL, c); + (*map[c])(1, c); /* If rl_done was set by the above call, deal with it here */ if (rl_done) @@ -1936,7 +1970,7 @@ rl_bind_wrapper(EditLine *el __attribute } int -rl_add_defun(const char *name, Function *fun, int c) +rl_add_defun(const char *name, rl_command_func_t *fun, int c) { char dest[8]; if ((size_t)c >= sizeof(map) / sizeof(map[0]) || c < 0) @@ -1975,7 +2009,7 @@ rl_callback_read_char(void) } void -rl_callback_handler_install(const char *prompt, VCPFunction *linefunc) +rl_callback_handler_install(const char *prompt, rl_vcpfunc_t *linefunc) { if (e == NULL) { rl_initialize(); Modified: vendor/NetBSD/libedit/dist/readline/readline.h ============================================================================== --- vendor/NetBSD/libedit/dist/readline/readline.h Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/readline/readline.h Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -/* $NetBSD: readline.h,v 1.34 2013/05/28 00:10:34 christos Exp $ */ +/* $NetBSD: readline.h,v 1.37 2015/06/02 15:36:45 christos Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -39,9 +39,8 @@ /* typedefs */ typedef int Function(const char *, int); typedef void VFunction(void); -typedef void VCPFunction(char *); -typedef char *CPFunction(const char *, int); -typedef char **CPPFunction(const char *, int, int); +typedef void rl_vcpfunc_t(char *); +typedef char **rl_completion_func_t(const char *, int, int); typedef char *rl_compentry_func_t(const char *, int); typedef int rl_command_func_t(int, int); @@ -108,9 +107,9 @@ extern int max_input_history; extern char *rl_basic_word_break_characters; extern char *rl_completer_word_break_characters; extern char *rl_completer_quote_characters; -extern Function *rl_completion_entry_function; +extern rl_compentry_func_t *rl_completion_entry_function; extern char *(*rl_completion_word_break_hook)(void); -extern CPPFunction *rl_attempted_completion_function; +extern rl_completion_func_t *rl_attempted_completion_function; extern int rl_attempted_completion_over; extern int rl_completion_type; extern int rl_completion_query_items; @@ -175,7 +174,7 @@ char *filename_completion_function(cons char *username_completion_function(const char *, int); int rl_complete(int, int); int rl_read_key(void); -char **completion_matches(const char *, CPFunction *); +char **completion_matches(const char *, rl_compentry_func_t *); void rl_display_match_list(char **, int, int); int rl_insert(int, int); @@ -184,7 +183,7 @@ void rl_reset_terminal(const char *); int rl_bind_key(int, rl_command_func_t *); int rl_newline(int, int); void rl_callback_read_char(void); -void rl_callback_handler_install(const char *, VCPFunction *); +void rl_callback_handler_install(const char *, rl_vcpfunc_t *); void rl_callback_handler_remove(void); void rl_redisplay(void); int rl_get_previous_history(int, int); @@ -194,7 +193,7 @@ int rl_read_init_file(const char *); int rl_parse_and_bind(const char *); int rl_variable_bind(const char *, const char *); void rl_stuff_char(int); -int rl_add_defun(const char *, Function *, int); +int rl_add_defun(const char *, rl_command_func_t *, int); HISTORY_STATE *history_get_history_state(void); void rl_get_screen_size(int *, int *); void rl_set_screen_size(int, int); Modified: vendor/NetBSD/libedit/dist/search.c ============================================================================== --- vendor/NetBSD/libedit/dist/search.c Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/search.c Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -/* $NetBSD: search.c,v 1.30 2011/10/04 15:27:04 christos Exp $ */ +/* $NetBSD: search.c,v 1.31 2016/01/30 04:02:51 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)search.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: search.c,v 1.30 2011/10/04 15:27:04 christos Exp $"); +__RCSID("$NetBSD: search.c,v 1.31 2016/01/30 04:02:51 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -147,7 +147,7 @@ el_match(const Char *str, const Char *pa if (re_comp(ct_encode_string(pat, &conv)) != NULL) return 0; else - return re_exec(ct_encode_string(str, &conv) == 1); + return re_exec(ct_encode_string(str, &conv)) == 1; #endif } Modified: vendor/NetBSD/libedit/dist/tokenizer.c ============================================================================== --- vendor/NetBSD/libedit/dist/tokenizer.c Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/tokenizer.c Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -/* $NetBSD: tokenizer.c,v 1.21 2011/08/16 16:25:15 christos Exp $ */ +/* $NetBSD: tokenizer.c,v 1.22 2016/01/30 04:02:51 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)tokenizer.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: tokenizer.c,v 1.21 2011/08/16 16:25:15 christos Exp $"); +__RCSID("$NetBSD: tokenizer.c,v 1.22 2016/01/30 04:02:51 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -446,5 +446,5 @@ FUN(tok,str)(TYPE(Tokenizer) *tok, const memset(&li, 0, sizeof(li)); li.buffer = line; li.cursor = li.lastchar = Strchr(line, '\0'); - return FUN(tok,line(tok, &li, argc, argv, NULL, NULL)); + return FUN(tok,line)(tok, &li, argc, argv, NULL, NULL); } Modified: vendor/NetBSD/libedit/dist/tty.c ============================================================================== --- vendor/NetBSD/libedit/dist/tty.c Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/tty.c Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -/* $NetBSD: tty.c,v 1.46 2014/06/18 18:52:49 christos Exp $ */ +/* $NetBSD: tty.c,v 1.49 2015/12/08 16:53:27 gson Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)tty.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: tty.c,v 1.46 2014/06/18 18:52:49 christos Exp $"); +__RCSID("$NetBSD: tty.c,v 1.49 2015/12/08 16:53:27 gson Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -580,6 +580,9 @@ protected void /*ARGSUSED*/ tty_end(EditLine *el) { + if (el->el_flags & EDIT_DISABLED) + return; + if (tty_setty(el, TCSAFLUSH, &el->el_tty.t_or) == -1) { #ifdef DEBUG_TTY (void) fprintf(el->el_errfile, @@ -1171,8 +1174,8 @@ tty_stty(EditLine *el, int argc __attrib break; default: (void) fprintf(el->el_errfile, - "%s: Unknown switch `%c'.\n", - name, argv[0][1]); + "%s: Unknown switch `" FCHAR "'.\n", + name, (Int)argv[0][1]); return -1; } Modified: vendor/NetBSD/libedit/dist/vi.c ============================================================================== --- vendor/NetBSD/libedit/dist/vi.c Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/vi.c Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -/* $NetBSD: vi.c,v 1.45 2014/06/18 18:12:28 christos Exp $ */ +/* $NetBSD: vi.c,v 1.47 2015/10/21 21:45:30 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)vi.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: vi.c,v 1.45 2014/06/18 18:12:28 christos Exp $"); +__RCSID("$NetBSD: vi.c,v 1.47 2015/10/21 21:45:30 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -1038,12 +1038,12 @@ vi_histedit(EditLine *el, Int c __attrib while (waitpid(pid, &status, 0) != pid) continue; lseek(fd, (off_t)0, SEEK_SET); - st = read(fd, cp, TMP_BUFSIZ); + st = read(fd, cp, TMP_BUFSIZ - 1); if (st > 0) { - len = (size_t)(el->el_line.lastchar - - el->el_line.buffer); + cp[st] = '\0'; + len = (size_t)(el->el_line.limit - el->el_line.buffer); len = ct_mbstowcs(el->el_line.buffer, cp, len); - if (len > 0 && el->el_line.buffer[len -1] == '\n') + if (len > 0 && el->el_line.buffer[len - 1] == '\n') --len; } else From owner-svn-src-all@freebsd.org Sun Feb 7 01:45:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29950AA0D40; Sun, 7 Feb 2016 01:45:26 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 E43DC1002; Sun, 7 Feb 2016 01:45:25 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u171jP87064802; Sun, 7 Feb 2016 01:45:25 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u171jOAV064797; Sun, 7 Feb 2016 01:45:24 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602070145.u171jOAV064797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 7 Feb 2016 01:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295361 - in vendor/NetBSD/libedit/2016-01-16: . readline X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 01:45:26 -0000 Author: pfg Date: Sun Feb 7 01:45:24 2016 New Revision: 295361 URL: https://svnweb.freebsd.org/changeset/base/295361 Log: Tag import of libedit 2016-01-16. Added: vendor/NetBSD/libedit/2016-01-16/ - copied from r295359, vendor/NetBSD/libedit/dist/ Replaced: vendor/NetBSD/libedit/2016-01-16/Makefile - copied unchanged from r295360, vendor/NetBSD/libedit/dist/Makefile vendor/NetBSD/libedit/2016-01-16/chartype.c - copied unchanged from r295360, vendor/NetBSD/libedit/dist/chartype.c vendor/NetBSD/libedit/2016-01-16/chartype.h - copied unchanged from r295360, vendor/NetBSD/libedit/dist/chartype.h vendor/NetBSD/libedit/2016-01-16/editline.3 - copied unchanged from r295360, vendor/NetBSD/libedit/dist/editline.3 vendor/NetBSD/libedit/2016-01-16/el.c - copied unchanged from r295360, vendor/NetBSD/libedit/dist/el.c vendor/NetBSD/libedit/2016-01-16/eln.c - copied unchanged from r295360, vendor/NetBSD/libedit/dist/eln.c vendor/NetBSD/libedit/2016-01-16/hist.h - copied unchanged from r295360, vendor/NetBSD/libedit/dist/hist.h vendor/NetBSD/libedit/2016-01-16/keymacro.h - copied unchanged from r295360, vendor/NetBSD/libedit/dist/keymacro.h vendor/NetBSD/libedit/2016-01-16/map.c - copied unchanged from r295360, vendor/NetBSD/libedit/dist/map.c vendor/NetBSD/libedit/2016-01-16/readline.c - copied unchanged from r295360, vendor/NetBSD/libedit/dist/readline.c vendor/NetBSD/libedit/2016-01-16/readline/readline.h - copied unchanged from r295360, vendor/NetBSD/libedit/dist/readline/readline.h vendor/NetBSD/libedit/2016-01-16/search.c - copied unchanged from r295360, vendor/NetBSD/libedit/dist/search.c vendor/NetBSD/libedit/2016-01-16/tokenizer.c - copied unchanged from r295360, vendor/NetBSD/libedit/dist/tokenizer.c vendor/NetBSD/libedit/2016-01-16/tty.c - copied unchanged from r295360, vendor/NetBSD/libedit/dist/tty.c vendor/NetBSD/libedit/2016-01-16/vi.c - copied unchanged from r295360, vendor/NetBSD/libedit/dist/vi.c Copied: vendor/NetBSD/libedit/2016-01-16/Makefile (from r295360, vendor/NetBSD/libedit/dist/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/libedit/2016-01-16/Makefile Sun Feb 7 01:45:24 2016 (r295361, copy of r295360, vendor/NetBSD/libedit/dist/Makefile) @@ -0,0 +1,135 @@ +# $NetBSD: Makefile,v 1.53 2015/01/29 20:30:02 joerg Exp $ +# @(#)Makefile 8.1 (Berkeley) 6/4/93 + +USE_SHLIBDIR= yes + +WIDECHAR ?= yes +WARNS?= 5 +LIB= edit + +LIBDPLIBS+= terminfo ${.CURDIR}/../libterminfo + +.include "bsd.own.mk" + +COPTS+= -Wunused-parameter +CWARNFLAGS.gcc+= -Wconversion +CWARNFLAGS.clang+= -Wno-cast-qual + +OSRCS= chared.c common.c el.c emacs.c fcns.c filecomplete.c help.c \ + hist.c keymacro.c map.c chartype.c \ + parse.c prompt.c read.c refresh.c search.c sig.c terminal.c tty.c vi.c + +MAN= editline.3 editrc.5 + +MLINKS= editline.3 el_init.3 editline.3 el_end.3 editline.3 el_reset.3 \ + editline.3 el_gets.3 editline.3 el_getc.3 editline.3 el_push.3 \ + editline.3 el_parse.3 editline.3 el_set.3 editline.3 el_get.3 \ + editline.3 el_source.3 editline.3 el_resize.3 editline.3 el_line.3 \ + editline.3 el_insertstr.3 editline.3 el_deletestr.3 \ + editline.3 history_init.3 editline.3 history_end.3 \ + editline.3 history.3 \ + editline.3 tok_init.3 editline.3 tok_end.3 editline.3 tok_reset.3 \ + editline.3 tok_line.3 editline.3 tok_str.3 + +# For speed and debugging +#SRCS= ${OSRCS} readline.c tokenizer.c history.c +# For protection +SRCS= editline.c readline.c tokenizer.c history.c + +.if ${WIDECHAR} == "yes" +OSRCS += eln.c +SRCS += tokenizern.c historyn.c +CLEANFILES+=tokenizern.c.tmp tokenizern.c historyn.c.tmp historyn.c +CPPFLAGS+=-DWIDECHAR +.endif + +LIBEDITDIR?=${.CURDIR} + +INCS= histedit.h +INCSDIR=/usr/include + +CLEANFILES+=editline.c +CLEANFILES+=common.h.tmp editline.c.tmp emacs.h.tmp fcns.c.tmp fcns.h.tmp +CLEANFILES+=help.c.tmp help.h.tmp vi.h.tmp tc1.o tc1 +CLEANFILES+=tokenizern.c.tmp tokenizern.c tokenizerw.c.tmp tokenizerw.c +CPPFLAGS+=-I. -I${LIBEDITDIR} +CPPFLAGS+=-I. -I${.CURDIR} +CPPFLAGS+=#-DDEBUG_TTY -DDEBUG_KEY -DDEBUG_READ -DDEBUG -DDEBUG_REFRESH +CPPFLAGS+=#-DDEBUG_PASTE -DDEBUG_EDIT + +AHDR=vi.h emacs.h common.h +ASRC=${LIBEDITDIR}/vi.c ${LIBEDITDIR}/emacs.c ${LIBEDITDIR}/common.c + +DPSRCS+= ${AHDR} fcns.h help.h fcns.c help.c +CLEANFILES+= ${AHDR} fcns.h help.h fcns.c help.c + +SUBDIR= readline + +vi.h: vi.c makelist Makefile + ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -h ${LIBEDITDIR}/vi.c \ + > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + +emacs.h: emacs.c makelist Makefile + ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -h ${LIBEDITDIR}/emacs.c \ + > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + +common.h: common.c makelist Makefile + ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -h ${LIBEDITDIR}/common.c \ + > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + +fcns.h: ${AHDR} makelist Makefile + ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -fh ${AHDR} > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + +fcns.c: ${AHDR} fcns.h help.h makelist Makefile + ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -fc ${AHDR} > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + +help.c: ${ASRC} makelist Makefile + ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -bc ${ASRC} > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + +help.h: ${ASRC} makelist Makefile + ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -bh ${ASRC} > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + +editline.c: ${OSRCS} makelist Makefile + ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -e ${OSRCS:T} > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + +tokenizern.c: makelist Makefile + ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -n tokenizer.c > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + +historyn.c: makelist Makefile + ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -n history.c > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + +tc1.o: ${LIBEDITDIR}/TEST/tc1.c + +tc1: libedit.a tc1.o + ${_MKTARGET_LINK} + ${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} libedit.a ${LDADD} -ltermlib + +.include +.include + +# XXX +.if defined(HAVE_GCC) +COPTS.editline.c+= -Wno-cast-qual +COPTS.tokenizer.c+= -Wno-cast-qual +COPTS.tokenizern.c+= -Wno-cast-qual +.endif Copied: vendor/NetBSD/libedit/2016-01-16/chartype.c (from r295360, vendor/NetBSD/libedit/dist/chartype.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/libedit/2016-01-16/chartype.c Sun Feb 7 01:45:24 2016 (r295361, copy of r295360, vendor/NetBSD/libedit/dist/chartype.c) @@ -0,0 +1,364 @@ +/* $NetBSD: chartype.c,v 1.12 2015/02/22 02:16:19 christos Exp $ */ + +/*- + * Copyright (c) 2009 The NetBSD Foundation, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * chartype.c: character classification and meta information + */ +#include "config.h" +#if !defined(lint) && !defined(SCCSID) +__RCSID("$NetBSD: chartype.c,v 1.12 2015/02/22 02:16:19 christos Exp $"); +#endif /* not lint && not SCCSID */ +#include "el.h" +#include + +#define CT_BUFSIZ ((size_t)1024) + +#ifdef WIDECHAR +protected int +ct_conv_cbuff_resize(ct_buffer_t *conv, size_t csize) +{ + void *p; + + if (csize <= conv->csize) + return 0; + + conv->csize = csize; + + p = el_realloc(conv->cbuff, conv->csize * sizeof(*conv->cbuff)); + if (p == NULL) { + conv->csize = 0; + el_free(conv->cbuff); + conv->cbuff = NULL; + return -1; + } + conv->cbuff = p; + return 0; +} + +protected int +ct_conv_wbuff_resize(ct_buffer_t *conv, size_t wsize) +{ + void *p; + + if (wsize <= conv->wsize) + return 0; + + conv->wsize = wsize; + + p = el_realloc(conv->wbuff, conv->wsize * sizeof(*conv->wbuff)); + if (p == NULL) { + conv->wsize = 0; + el_free(conv->wbuff); + conv->wbuff = NULL; + return -1; + } + conv->wbuff = p; + return 0; +} + + +public char * +ct_encode_string(const Char *s, ct_buffer_t *conv) +{ + char *dst; + ssize_t used; + + if (!s) + return NULL; + + dst = conv->cbuff; + for (;;) { + used = (ssize_t)(dst - conv->cbuff); + if ((conv->csize - (size_t)used) < 5) { + if (ct_conv_cbuff_resize(conv, + conv->csize + CT_BUFSIZ) == -1) + return NULL; + dst = conv->cbuff + used; + } + if (!*s) + break; + used = ct_encode_char(dst, (size_t)5, *s); + if (used == -1) /* failed to encode, need more buffer space */ + abort(); + ++s; + dst += used; + } + *dst = '\0'; + return conv->cbuff; +} + +public Char * +ct_decode_string(const char *s, ct_buffer_t *conv) +{ + size_t len; + + if (!s) + return NULL; + + len = ct_mbstowcs(NULL, s, (size_t)0); + if (len == (size_t)-1) + return NULL; + + if (conv->wsize < ++len) + if (ct_conv_wbuff_resize(conv, len + CT_BUFSIZ) == -1) + return NULL; + + ct_mbstowcs(conv->wbuff, s, conv->wsize); + return conv->wbuff; +} + + +protected Char ** +ct_decode_argv(int argc, const char *argv[], ct_buffer_t *conv) +{ + size_t bufspace; + int i; + Char *p; + Char **wargv; + ssize_t bytes; + + /* Make sure we have enough space in the conversion buffer to store all + * the argv strings. */ + for (i = 0, bufspace = 0; i < argc; ++i) + bufspace += argv[i] ? strlen(argv[i]) + 1 : 0; + if (conv->wsize < ++bufspace) + if (ct_conv_wbuff_resize(conv, bufspace + CT_BUFSIZ) == -1) + return NULL; + + wargv = el_malloc((size_t)argc * sizeof(*wargv)); + + for (i = 0, p = conv->wbuff; i < argc; ++i) { + if (!argv[i]) { /* don't pass null pointers to mbstowcs */ + wargv[i] = NULL; + continue; + } else { + wargv[i] = p; + bytes = (ssize_t)mbstowcs(p, argv[i], bufspace); + } + if (bytes == -1) { + el_free(wargv); + return NULL; + } else + bytes++; /* include '\0' in the count */ + bufspace -= (size_t)bytes; + p += bytes; + } + + return wargv; +} + + +protected size_t +ct_enc_width(Char c) +{ + /* UTF-8 encoding specific values */ + if (c < 0x80) + return 1; + else if (c < 0x0800) + return 2; + else if (c < 0x10000) + return 3; + else if (c < 0x110000) + return 4; + else + return 0; /* not a valid codepoint */ +} + +protected ssize_t +ct_encode_char(char *dst, size_t len, Char c) +{ + ssize_t l = 0; + if (len < ct_enc_width(c)) + return -1; + l = ct_wctomb(dst, c); + + if (l < 0) { + ct_wctomb_reset; + l = 0; + } + return l; +} +#endif + +protected const Char * +ct_visual_string(const Char *s) +{ + static Char *buff = NULL; + static size_t buffsize = 0; + void *p; + Char *dst; + ssize_t used = 0; + + if (!s) + return NULL; + if (!buff) { + buffsize = CT_BUFSIZ; + buff = el_malloc(buffsize * sizeof(*buff)); + } + dst = buff; + while (*s) { + used = ct_visual_char(dst, buffsize - (size_t)(dst - buff), *s); + if (used == -1) { /* failed to encode, need more buffer space */ + used = dst - buff; + buffsize += CT_BUFSIZ; + p = el_realloc(buff, buffsize * sizeof(*buff)); + if (p == NULL) + goto out; + buff = p; + dst = buff + used; + /* don't increment s here - we want to retry it! */ + } + else + ++s; + dst += used; + } + if (dst >= (buff + buffsize)) { /* sigh */ + buffsize += 1; + p = el_realloc(buff, buffsize * sizeof(*buff)); + if (p == NULL) + goto out; + buff = p; + dst = buff + buffsize - 1; + } + *dst = 0; + return buff; +out: + el_free(buff); + buffsize = 0; + return NULL; +} + + + +protected int +ct_visual_width(Char c) +{ + int t = ct_chr_class(c); + switch (t) { + case CHTYPE_ASCIICTL: + return 2; /* ^@ ^? etc. */ + case CHTYPE_TAB: + return 1; /* Hmm, this really need to be handled outside! */ + case CHTYPE_NL: + return 0; /* Should this be 1 instead? */ +#ifdef WIDECHAR + case CHTYPE_PRINT: + return wcwidth(c); + case CHTYPE_NONPRINT: + if (c > 0xffff) /* prefer standard 4-byte display over 5-byte */ + return 8; /* \U+12345 */ + else + return 7; /* \U+1234 */ +#else + case CHTYPE_PRINT: + return 1; + case CHTYPE_NONPRINT: + return 4; /* \123 */ +#endif + default: + return 0; /* should not happen */ + } +} + + +protected ssize_t +ct_visual_char(Char *dst, size_t len, Char c) +{ + int t = ct_chr_class(c); + switch (t) { + case CHTYPE_TAB: + case CHTYPE_NL: + case CHTYPE_ASCIICTL: + if (len < 2) + return -1; /* insufficient space */ + *dst++ = '^'; + if (c == '\177') + *dst = '?'; /* DEL -> ^? */ + else + *dst = c | 0100; /* uncontrolify it */ + return 2; + case CHTYPE_PRINT: + if (len < 1) + return -1; /* insufficient space */ + *dst = c; + return 1; + case CHTYPE_NONPRINT: + /* we only use single-width glyphs for display, + * so this is right */ + if ((ssize_t)len < ct_visual_width(c)) + return -1; /* insufficient space */ +#ifdef WIDECHAR + *dst++ = '\\'; + *dst++ = 'U'; + *dst++ = '+'; +#define tohexdigit(v) "0123456789ABCDEF"[v] + if (c > 0xffff) /* prefer standard 4-byte display over 5-byte */ + *dst++ = tohexdigit(((unsigned int) c >> 16) & 0xf); + *dst++ = tohexdigit(((unsigned int) c >> 12) & 0xf); + *dst++ = tohexdigit(((unsigned int) c >> 8) & 0xf); + *dst++ = tohexdigit(((unsigned int) c >> 4) & 0xf); + *dst = tohexdigit(((unsigned int) c ) & 0xf); + return c > 0xffff ? 8 : 7; +#else + *dst++ = '\\'; +#define tooctaldigit(v) ((v) + '0') + *dst++ = tooctaldigit(((unsigned int) c >> 6) & 0x7); + *dst++ = tooctaldigit(((unsigned int) c >> 3) & 0x7); + *dst++ = tooctaldigit(((unsigned int) c ) & 0x7); +#endif + /*FALLTHROUGH*/ + /* these two should be handled outside this function */ + default: /* we should never hit the default */ + return 0; + } +} + + + + +protected int +ct_chr_class(Char c) +{ + if (c == '\t') + return CHTYPE_TAB; + else if (c == '\n') + return CHTYPE_NL; + else if (IsASCII(c) && Iscntrl(c)) + return CHTYPE_ASCIICTL; + else if (Isprint(c)) + return CHTYPE_PRINT; + else + return CHTYPE_NONPRINT; +} Copied: vendor/NetBSD/libedit/2016-01-16/chartype.h (from r295360, vendor/NetBSD/libedit/dist/chartype.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/libedit/2016-01-16/chartype.h Sun Feb 7 01:45:24 2016 (r295361, copy of r295360, vendor/NetBSD/libedit/dist/chartype.h) @@ -0,0 +1,254 @@ +/* $NetBSD: chartype.h,v 1.15 2015/05/17 13:14:41 christos Exp $ */ + +/*- + * Copyright (c) 2009 The NetBSD Foundation, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _h_chartype_f +#define _h_chartype_f + + + +#ifdef WIDECHAR + +/* Ideally we should also test the value of the define to see if it + * supports non-BMP code points without requiring UTF-16, but nothing + * seems to actually advertise this properly, despite Unicode 3.1 having + * been around since 2001... */ +#if !defined(__NetBSD__) && !defined(__sun) && !(defined(__APPLE__) && defined(__MACH__)) && !defined(__OpenBSD__) && !defined(__FreeBSD__) +#ifndef __STDC_ISO_10646__ +/* In many places it is assumed that the first 127 code points are ASCII + * compatible, so ensure wchar_t indeed does ISO 10646 and not some other + * funky encoding that could break us in weird and wonderful ways. */ + #error wchar_t must store ISO 10646 characters +#endif +#endif + +/* Oh for a with char32_t and __STDC_UTF_32__ in it... + * ref: ISO/IEC DTR 19769 + */ +#if WCHAR_MAX < INT32_MAX +#warning Build environment does not support non-BMP characters +#endif + +#define ct_mbtowc mbtowc +#define ct_mbtowc_reset mbtowc(0,0,(size_t)0) +#define ct_wctomb wctomb +#define ct_wctomb_reset wctomb(0,0) +#define ct_wcstombs wcstombs +#define ct_mbstowcs mbstowcs + +#define Char wchar_t +#define Int wint_t +#define FUN(prefix,rest) prefix ## _w ## rest +#define FUNW(type) type ## _w +#define TYPE(type) type ## W +#define FCHAR "%lc" +#define FSTR "%ls" +#define STR(x) L ## x +#define UC(c) c +#define Isalpha(x) iswalpha(x) +#define Isalnum(x) iswalnum(x) +#define Isgraph(x) iswgraph(x) +#define Isspace(x) iswspace(x) +#define Isdigit(x) iswdigit(x) +#define Iscntrl(x) iswcntrl(x) +#define Isprint(x) iswprint(x) + +#define Isupper(x) iswupper(x) +#define Islower(x) iswlower(x) +#define Toupper(x) towupper(x) +#define Tolower(x) towlower(x) + +#define IsASCII(x) (x < 0x100) + +#define Strlen(x) wcslen(x) +#define Strchr(s,c) wcschr(s,c) +#define Strrchr(s,c) wcsrchr(s,c) +#define Strstr(s,v) wcsstr(s,v) +#define Strdup(x) wcsdup(x) +#define Strcpy(d,s) wcscpy(d,s) +#define Strncpy(d,s,n) wcsncpy(d,s,n) +#define Strncat(d,s,n) wcsncat(d,s,n) + +#define Strcmp(s,v) wcscmp(s,v) +#define Strncmp(s,v,n) wcsncmp(s,v,n) +#define Strcspn(s,r) wcscspn(s,r) + +#define Strtol(p,e,b) wcstol(p,e,b) + +static inline int +Width(wchar_t c) +{ + int w = wcwidth(c); + return w < 0 ? 0 : w; +} + +#else /* NARROW */ + +#define ct_mbtowc error +#define ct_mbtowc_reset +#define ct_wctomb error +#define ct_wctomb_reset +#define ct_wcstombs(a, b, c) (strncpy(a, b, c), strlen(a)) +#define ct_mbstowcs(a, b, c) (strncpy(a, b, c), strlen(a)) + +#define Char char +#define Int int +#define FUN(prefix,rest) prefix ## _ ## rest +#define FUNW(type) type +#define TYPE(type) type +#define FCHAR "%c" +#define FSTR "%s" +#define STR(x) x +#define UC(c) (unsigned char)(c) + +#define Isalpha(x) isalpha((unsigned char)x) +#define Isalnum(x) isalnum((unsigned char)x) +#define Isgraph(x) isgraph((unsigned char)x) +#define Isspace(x) isspace((unsigned char)x) +#define Isdigit(x) isdigit((unsigned char)x) +#define Iscntrl(x) iscntrl((unsigned char)x) +#define Isprint(x) isprint((unsigned char)x) + +#define Isupper(x) isupper((unsigned char)x) +#define Islower(x) islower((unsigned char)x) +#define Toupper(x) toupper((unsigned char)x) +#define Tolower(x) tolower((unsigned char)x) + +#define IsASCII(x) isascii((unsigned char)x) + +#define Strlen(x) strlen(x) +#define Strchr(s,c) strchr(s,c) +#define Strrchr(s,c) strrchr(s,c) +#define Strstr(s,v) strstr(s,v) +#define Strdup(x) strdup(x) +#define Strcpy(d,s) strcpy(d,s) +#define Strncpy(d,s,n) strncpy(d,s,n) +#define Strncat(d,s,n) strncat(d,s,n) + +#define Strcmp(s,v) strcmp(s,v) +#define Strncmp(s,v,n) strncmp(s,v,n) +#define Strcspn(s,r) strcspn(s,r) + +#define Strtol(p,e,b) strtol(p,e,b) + +#define Width(c) 1 + +#endif + + +#ifdef WIDECHAR +/* + * Conversion buffer + */ +typedef struct ct_buffer_t { + char *cbuff; + size_t csize; + Char *wbuff; + size_t wsize; +} ct_buffer_t; + +#define ct_encode_string __ct_encode_string +/* Encode a wide-character string and return the UTF-8 encoded result. */ +public char *ct_encode_string(const Char *, ct_buffer_t *); + +#define ct_decode_string __ct_decode_string +/* Decode a (multi)?byte string and return the wide-character string result. */ +public Char *ct_decode_string(const char *, ct_buffer_t *); + +/* Decode a (multi)?byte argv string array. + * The pointer returned must be free()d when done. */ +protected Char **ct_decode_argv(int, const char *[], ct_buffer_t *); + +/* Resizes the conversion buffer(s) if needed. */ +protected int ct_conv_cbuff_resize(ct_buffer_t *, size_t); +protected int ct_conv_wbuff_resize(ct_buffer_t *, size_t); +protected ssize_t ct_encode_char(char *, size_t, Char); +protected size_t ct_enc_width(Char); + +#define ct_free_argv(s) el_free(s) + +#else +#define ct_encode_string(s, b) (s) +#define ct_decode_string(s, b) (s) +#define ct_decode_argv(l, s, b) (s) +#define ct_conv_cbuff_resize(b, s) ((s) == (0)) +#define ct_conv_wbuff_resize(b, s) ((s) == (0)) +#define ct_encode_char(d, l, s) (*d = s, 1) +#define ct_free_argv(s) +#endif + +#ifndef NARROWCHAR +/* Encode a characted into the destination buffer, provided there is sufficent + * buffer space available. Returns the number of bytes used up (zero if the + * character cannot be encoded, -1 if there was not enough space available). */ + +/* The maximum buffer size to hold the most unwieldly visual representation, + * in this case \U+nnnnn. */ +#define VISUAL_WIDTH_MAX ((size_t)8) + +/* The terminal is thought of in terms of X columns by Y lines. In the cases + * where a wide character takes up more than one column, the adjacent + * occupied column entries will contain this faux character. */ +#define MB_FILL_CHAR ((Char)-1) + +/* Visual width of character c, taking into account ^? , \0177 and \U+nnnnn + * style visual expansions. */ +protected int ct_visual_width(Char); + +/* Turn the given character into the appropriate visual format, matching + * the width given by ct_visual_width(). Returns the number of characters used + * up, or -1 if insufficient space. Buffer length is in count of Char's. */ +protected ssize_t ct_visual_char(Char *, size_t, Char); + +/* Convert the given string into visual format, using the ct_visual_char() + * function. Uses a static buffer, so not threadsafe. */ +protected const Char *ct_visual_string(const Char *); + + +/* printable character, use ct_visual_width() to find out display width */ +#define CHTYPE_PRINT ( 0) +/* control character found inside the ASCII portion of the charset */ +#define CHTYPE_ASCIICTL (-1) +/* a \t */ +#define CHTYPE_TAB (-2) +/* a \n */ +#define CHTYPE_NL (-3) +/* non-printable character */ +#define CHTYPE_NONPRINT (-4) +/* classification of character c, as one of the above defines */ +protected int ct_chr_class(Char c); +#endif + + +#endif /* _chartype_f */ Copied: vendor/NetBSD/libedit/2016-01-16/editline.3 (from r295360, vendor/NetBSD/libedit/dist/editline.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/libedit/2016-01-16/editline.3 Sun Feb 7 01:45:24 2016 (r295361, copy of r295360, vendor/NetBSD/libedit/dist/editline.3) @@ -0,0 +1,937 @@ +.\" $NetBSD: editline.3,v 1.85 2015/11/03 21:36:59 christos Exp $ +.\" +.\" Copyright (c) 1997-2014 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This file was contributed to The NetBSD Foundation by Luke Mewburn. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd November 3, 2015 +.Dt EDITLINE 3 +.Os +.Sh NAME +.Nm editline , +.Nm el_init , +.Nm el_init_fd , +.Nm el_end , +.Nm el_reset , +.Nm el_gets , +.Nm el_wgets , +.Nm el_getc , +.Nm el_wgetc , +.Nm el_push , +.Nm el_wpush , +.Nm el_parse , +.Nm el_wparse , +.Nm el_set , +.Nm el_wset , +.Nm el_get , +.Nm el_wget , +.Nm el_source , +.Nm el_resize , +.Nm el_cursor , +.Nm el_line , +.Nm el_wline , +.Nm el_insertstr , +.Nm el_winsertstr , +.Nm el_deletestr , +.Nm el_wdeletestr , +.Nm history_init , +.Nm history_winit , +.Nm history_end , +.Nm history_wend , +.Nm history , +.Nm history_w , +.Nm tok_init , +.Nm tok_winit , +.Nm tok_end , +.Nm tok_wend , +.Nm tok_reset , +.Nm tok_wreset , +.Nm tok_line , +.Nm tok_wline , +.Nm tok_str +.Nm tok_wstr +.Nd line editor, history and tokenization functions +.Sh LIBRARY +.Lb libedit +.Sh SYNOPSIS +.In histedit.h +.Ft EditLine * +.Fn el_init "const char *prog" "FILE *fin" "FILE *fout" "FILE *ferr" +.Ft EditLine * +.Fn el_init_fd "const char *prog" "FILE *fin" "FILE *fout" "FILE *ferr" "int fdin" "int fdout" "int fderr" +.Ft void +.Fn el_end "EditLine *e" +.Ft void +.Fn el_reset "EditLine *e" +.Ft const char * +.Fn el_gets "EditLine *e" "int *count" +.Ft const wchar_t * +.Fn el_wgets "EditLine *e" "int *count" +.Ft int +.Fn el_getc "EditLine *e" "char *ch" +.Ft int +.Fn el_wgetc "EditLine *e" "wchar_t *ch" +.Ft void +.Fn el_push "EditLine *e" "const char *str" +.Ft void +.Fn el_wpush "EditLine *e" "const wchar_t *str" +.Ft int +.Fn el_parse "EditLine *e" "int argc" "const char *argv[]" +.Ft int +.Fn el_wparse "EditLine *e" "int argc" "const wchar_t *argv[]" +.Ft int +.Fn el_set "EditLine *e" "int op" "..." +.Ft int +.Fn el_wset "EditLine *e" "int op" "..." +.Ft int +.Fn el_get "EditLine *e" "int op" "..." +.Ft int +.Fn el_wget "EditLine *e" "int op" "..." +.Ft int +.Fn el_source "EditLine *e" "const char *file" +.Ft void +.Fn el_resize "EditLine *e" +.Fn int +.Fn el_cursor "EditLine *e" "int count" +.Ft const LineInfo * +.Fn el_line "EditLine *e" +.Ft const LineInfoW * +.Fn el_wline "EditLine *e" +.Ft int +.Fn el_insertstr "EditLine *e" "const char *str" +.Ft int +.Fn el_winsertstr "EditLine *e" "const wchar_t *str" +.Ft void +.Fn el_deletestr "EditLine *e" "int count" +.Ft void +.Fn el_wdeletestr "EditLine *e" "int count" +.Ft History * +.Fn history_init +.Ft HistoryW * +.Fn history_winit +.Ft void +.Fn history_end "History *h" +.Ft void +.Fn history_wend "HistoryW *h" +.Ft int +.Fn history "History *h" "HistEvent *ev" "int op" "..." +.Ft int +.Fn history_w "HistoryW *h" "HistEventW *ev" "int op" "..." +.Ft Tokenizer * +.Fn tok_init "const char *IFS" +.Ft TokenizerW * +.Fn tok_winit "const wchar_t *IFS" +.Ft void +.Fn tok_end "Tokenizer *t" +.Ft void +.Fn tok_wend "TokenizerW *t" +.Ft void +.Fn tok_reset "Tokenizer *t" +.Ft void +.Fn tok_wreset "TokenizerW *t" +.Ft int +.Fn tok_line "Tokenizer *t" "const LineInfo *li" "int *argc" "const char **argv[]" "int *cursorc" "int *cursoro" +.Ft int +.Fn tok_wline "TokenizerW *t" "const LineInfoW *li" "int *argc" "const wchar_t **argv[]" "int *cursorc" "int *cursoro" +.Ft int +.Fn tok_str "Tokenizer *t" "const char *str" "int *argc" "const char **argv[]" +.Ft int +.Fn tok_wstr "TokenizerW *t" "const wchar_t *str" "int *argc" "const wchar_t **argv[]" +.Sh DESCRIPTION +The +.Nm +library provides generic line editing, history and tokenization functions, +similar to those found in +.Xr sh 1 . +.Pp +These functions are available in the +.Nm libedit +library (which needs the +.Nm libtermcap +library). +Programs should be linked with +.Fl ledit ltermcap . +.Sh LINE EDITING FUNCTIONS +The line editing functions use a common data structure, +.Fa EditLine , +which is created by +.Fn el_init +or +.Fn el_init_fd +and freed by +.Fn el_end . +.Pp +The wide-character functions behave the same way as their narrow +counterparts. +.Pp +The following functions are available: +.Bl -tag -width 4n +.It Fn el_init +Initialize the line editor, and return a data structure +to be used by all other line editing functions, or +.Dv NULL +on failure. +.Fa prog +is the name of the invoking program, used when reading the +.Xr editrc 5 +file to determine which settings to use. +.Fa fin , +.Fa fout +and +.Fa ferr +are the input, output, and error streams (respectively) to use. +In this documentation, references to +.Dq the tty +are actually to this input/output stream combination. +.It Fn el_init_fd +Like +.Fn el_init +but allows specifying file descriptors for the +.Xr stdio 3 +corresponding streams, in case those were created with +.Xr funopen 3 . +.It Fn el_end +Clean up and finish with +.Fa e , +assumed to have been created with +.Fn el_init +or +.Fn el_init_fd . +.It Fn el_reset +Reset the tty and the parser. +This should be called after an error which may have upset the tty's +state. +.It Fn el_gets +Read a line from the tty. +.Fa count +is modified to contain the number of characters read. +Returns the line read if successful, or +.Dv NULL +if no characters were read or if an error occurred. +If an error occurred, +.Fa count +is set to \-1 and *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Feb 7 03:48:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8FFCA9E5D2; Sun, 7 Feb 2016 03:48:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 AC7961256; Sun, 7 Feb 2016 03:48:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u173meP4000315; Sun, 7 Feb 2016 03:48:40 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u173meT4000314; Sun, 7 Feb 2016 03:48:40 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602070348.u173meT4000314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 7 Feb 2016 03:48:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295362 - head/sys/fs/cd9660 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 03:48:41 -0000 Author: pfg Date: Sun Feb 7 03:48:40 2016 New Revision: 295362 URL: https://svnweb.freebsd.org/changeset/base/295362 Log: cd9660: Drop an unnecessary check for NULL. This was unnecessary and also confused Coverity. Confirmed on: NetBSD CID: 978558 Modified: head/sys/fs/cd9660/cd9660_vfsops.c Modified: head/sys/fs/cd9660/cd9660_vfsops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vfsops.c Sun Feb 7 01:45:24 2016 (r295361) +++ head/sys/fs/cd9660/cd9660_vfsops.c Sun Feb 7 03:48:40 2016 (r295362) @@ -741,8 +741,7 @@ cd9660_vget_internal(mp, ino, flags, vpp if (off + isonum_711(isodir->length) > imp->logical_block_size) { vput(vp); - if (bp != 0) - brelse(bp); + brelse(bp); printf("fhtovp: directory crosses block boundary %d[off=%d/len=%d]\n", off +isonum_711(isodir->length), off, isonum_711(isodir->length)); From owner-svn-src-all@freebsd.org Sun Feb 7 04:28:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FED9A9F857; Sun, 7 Feb 2016 04:28:05 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 0A599B0; Sun, 7 Feb 2016 04:28:04 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u174S4VU011822; Sun, 7 Feb 2016 04:28:04 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u174S395011816; Sun, 7 Feb 2016 04:28:03 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201602070428.u174S395011816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 7 Feb 2016 04:28:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295363 - in head/tools/tools/ath: athaggrstats athdebug athradar athratestats athspectral athstats X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 04:28:05 -0000 Author: adrian Date: Sun Feb 7 04:28:03 2016 New Revision: 295363 URL: https://svnweb.freebsd.org/changeset/base/295363 Log: Remove the hard-coded 'ath0' strings and use ATH_DEFAULT. Remove the duplicate ATH_DEFAULT fields. The build bits should be including ../Makefile.inc as appropriate. Modified: head/tools/tools/ath/athaggrstats/main.c head/tools/tools/ath/athdebug/athdebug.c head/tools/tools/ath/athradar/athradar.c head/tools/tools/ath/athratestats/main.c head/tools/tools/ath/athspectral/athspectral.c head/tools/tools/ath/athstats/main.c Modified: head/tools/tools/ath/athaggrstats/main.c ============================================================================== --- head/tools/tools/ath/athaggrstats/main.c Sun Feb 7 03:48:40 2016 (r295362) +++ head/tools/tools/ath/athaggrstats/main.c Sun Feb 7 04:28:03 2016 (r295363) @@ -89,7 +89,7 @@ main(int argc, char *argv[]) ifname = getenv("ATH"); if (ifname == NULL) - ifname = "ath0"; + ifname = ATH_DEFAULT; wf = athaggrstats_new(ifname, getfmt("default")); while ((c = getopt(argc, argv, "bi:lo:z")) != -1) { switch (c) { Modified: head/tools/tools/ath/athdebug/athdebug.c ============================================================================== --- head/tools/tools/ath/athdebug/athdebug.c Sun Feb 7 03:48:40 2016 (r295362) +++ head/tools/tools/ath/athdebug/athdebug.c Sun Feb 7 04:28:03 2016 (r295363) @@ -31,7 +31,7 @@ /* * athdebug [-i interface] flags - * (default interface is ath0). + * (default interface is wlan0). */ #include @@ -156,7 +156,7 @@ main(int argc, char *argv[]) ifname = getenv("ATH"); if (ifname == NULL) - ifname = "ath0"; + ifname = ATH_DEFAULT; progname = argv[0]; if (argc > 1) { if (strcmp(argv[1], "-i") == 0) { Modified: head/tools/tools/ath/athradar/athradar.c ============================================================================== --- head/tools/tools/ath/athradar/athradar.c Sun Feb 7 03:48:40 2016 (r295362) +++ head/tools/tools/ath/athradar/athradar.c Sun Feb 7 04:28:03 2016 (r295363) @@ -30,10 +30,6 @@ #include "ah.h" #include "ah_internal.h" -#ifndef ATH_DEFAULT -#define ATH_DEFAULT "ath0" -#endif - #include #include #include Modified: head/tools/tools/ath/athratestats/main.c ============================================================================== --- head/tools/tools/ath/athratestats/main.c Sun Feb 7 03:48:40 2016 (r295362) +++ head/tools/tools/ath/athratestats/main.c Sun Feb 7 04:28:03 2016 (r295363) @@ -310,7 +310,7 @@ main(int argc, char *argv[]) ifname = getenv("ATH"); if (ifname == NULL) - ifname = "ath0"; + ifname = ATH_DEFAULT; while ((c = getopt(argc, argv, "ahi:m:s:")) != -1) { switch (c) { Modified: head/tools/tools/ath/athspectral/athspectral.c ============================================================================== --- head/tools/tools/ath/athspectral/athspectral.c Sun Feb 7 03:48:40 2016 (r295362) +++ head/tools/tools/ath/athspectral/athspectral.c Sun Feb 7 04:28:03 2016 (r295363) @@ -30,10 +30,6 @@ #include "ah.h" #include "ah_internal.h" -#ifndef ATH_DEFAULT -#define ATH_DEFAULT "ath0" -#endif - #include #include #include Modified: head/tools/tools/ath/athstats/main.c ============================================================================== --- head/tools/tools/ath/athstats/main.c Sun Feb 7 03:48:40 2016 (r295362) +++ head/tools/tools/ath/athstats/main.c Sun Feb 7 04:28:03 2016 (r295363) @@ -94,7 +94,7 @@ main(int argc, char *argv[]) ifname = getenv("ATH"); if (ifname == NULL) - ifname = "ath0"; + ifname = ATH_DEFAULT; wf = athstats_new(ifname, getfmt("default")); while ((c = getopt(argc, argv, "bi:lo:z")) != -1) { switch (c) { From owner-svn-src-all@freebsd.org Sun Feb 7 07:32:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49799A9E716; Sun, 7 Feb 2016 07:32:40 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 11C419AA; Sun, 7 Feb 2016 07:32:39 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id DBF6C4285F2; Sun, 7 Feb 2016 18:32:36 +1100 (AEDT) Date: Sun, 7 Feb 2016 18:32:36 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Pedro F. Giffuni" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295359 - head/sys/fs/fdescfs In-Reply-To: <201602070109.u1719dcr053281@repo.freebsd.org> Message-ID: <20160207182245.J867@besplex.bde.org> References: <201602070109.u1719dcr053281@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=R4L+YolX c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=iZa051W5lHYdGRtyBqQA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 07:32:40 -0000 On Sun, 7 Feb 2016, Pedro F. Giffuni wrote: > Log: > fdesc_setattr: unitialized pointer read > > CID: 1018688 Bug in Coverity. > Modified: head/sys/fs/fdescfs/fdesc_vnops.c > ============================================================================== > --- head/sys/fs/fdescfs/fdesc_vnops.c Sun Feb 7 01:04:47 2016 (r295358) > +++ head/sys/fs/fdescfs/fdesc_vnops.c Sun Feb 7 01:09:38 2016 (r295359) > @@ -465,7 +465,7 @@ fdesc_setattr(ap) > { > struct vattr *vap = ap->a_vap; > struct vnode *vp; > - struct mount *mp; > + struct mount *mp = NULL; > struct file *fp; > struct thread *td = curthread; > cap_rights_t rights; 2 style bugs in the caller to hide the Coverity bug: - initialization in declaration - unused initialization The initialization is done by calling vn_start_write(... &mp, flags). mp is only an output parameter unless (flags & V_MNTREF), and fdesc doesn't put V_MNTREF in flags. This is a common way of returning extra values so it shouldn't cause warning is the source code doesn't have bogus initializations in the caller. Compilers that look at only 1 source file at a time can't see the full API so they have to assume that such parameters are output-only if they are uninitialized in callers. Checkers need to understand the API if they want to do more. Bruce From owner-svn-src-all@freebsd.org Sun Feb 7 07:36:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E031A9E898; Sun, 7 Feb 2016 07:36:35 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 034D6B29; Sun, 7 Feb 2016 07:36:34 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 7AB181A4A63; Sun, 7 Feb 2016 18:13:19 +1100 (AEDT) Date: Sun, 7 Feb 2016 18:13:17 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Pedro F. Giffuni" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295362 - head/sys/fs/cd9660 In-Reply-To: <201602070348.u173meT4000314@repo.freebsd.org> Message-ID: <20160207175356.A867@besplex.bde.org> References: <201602070348.u173meT4000314@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=cK4dyQqN c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=GXk1i5ywecH38PYzJGUA:9 a=mjrdrH4rthIuh85Y:21 a=sZ_X_tx9_h26_S3M:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 07:36:35 -0000 On Sun, 7 Feb 2016, Pedro F. Giffuni wrote: > Log: > cd9660: Drop an unnecessary check for NULL. > > This was unnecessary and also confused Coverity. > > Confirmed on: NetBSD > CID: 978558 This leaves many similar bugs unfixed nearby. One is a null pointer panic, not just an unnecessary check. > Modified: head/sys/fs/cd9660/cd9660_vfsops.c > ============================================================================== > --- head/sys/fs/cd9660/cd9660_vfsops.c Sun Feb 7 01:45:24 2016 (r295361) > +++ head/sys/fs/cd9660/cd9660_vfsops.c Sun Feb 7 03:48:40 2016 (r295362) > @@ -741,8 +741,7 @@ cd9660_vget_internal(mp, ino, flags, vpp > if (off + isonum_711(isodir->length) > > imp->logical_block_size) { > vput(vp); > - if (bp != 0) > - brelse(bp); > + brelse(bp); > printf("fhtovp: directory crosses block boundary %d[off=%d/len=%d]\n", > off +isonum_711(isodir->length), off, > isonum_711(isodir->length)); > - 11 lines later, there is the same bug in an #if 0 block. - 9 lines earlier, bp was brelse()ed without a similar check. bp is always null at that point, so checking for this would be just a style bug. Not checking, but doing the wrong cleanup of calling brelse() after bread() fails, gives a null pointer panic in brelse() whenever bread() fails. That seems to be all the similar bugs. bp is correctly abused as a flag later. Other functions depend more critically on bread() setting bp to NULL when it fails. Typical code is to "goto out" when bread() fails, and brelse() bp there if it is not null. Not-so-similar bugs include spelling NULL as 0 or (empty). bread(9) is undocumented. Someone broke its KPI by changing it to a macro. This annoys me when I try to set a breakpoint at it in kernels with the broken KPI. The unimportant badly designed bread(3) is documented. Bruce From owner-svn-src-all@freebsd.org Sun Feb 7 09:51:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 968C2AA0243; Sun, 7 Feb 2016 09:51:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 502861D9A; Sun, 7 Feb 2016 09:51:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u179pM61007563; Sun, 7 Feb 2016 09:51:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u179pMco007562; Sun, 7 Feb 2016 09:51:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201602070951.u179pMco007562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 7 Feb 2016 09:51: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: r295366 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 09:51:23 -0000 Author: kib Date: Sun Feb 7 09:51:22 2016 New Revision: 295366 URL: https://svnweb.freebsd.org/changeset/base/295366 Log: MFC r295277: When matching brand to the ELF binary by notes, try to find a brand with interpreter name exactly matching one wanted by the binary. Approved by: re (delphij) Modified: stable/10/sys/kern/imgact_elf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/imgact_elf.c ============================================================================== --- stable/10/sys/kern/imgact_elf.c Sun Feb 7 05:15:51 2016 (r295365) +++ stable/10/sys/kern/imgact_elf.c Sun Feb 7 09:51:22 2016 (r295366) @@ -261,7 +261,7 @@ __elfN(get_brandinfo)(struct image_param int interp_name_len, int32_t *osrel) { const Elf_Ehdr *hdr = (const Elf_Ehdr *)imgp->image_header; - Elf_Brandinfo *bi; + Elf_Brandinfo *bi, *bi_m; boolean_t ret; int i; @@ -273,6 +273,7 @@ __elfN(get_brandinfo)(struct image_param */ /* Look for an ".note.ABI-tag" ELF section */ + bi_m = NULL; for (i = 0; i < MAX_BRANDS; i++) { bi = elf_brand_list[i]; if (bi == NULL) @@ -280,10 +281,28 @@ __elfN(get_brandinfo)(struct image_param if (hdr->e_machine == bi->machine && (bi->flags & (BI_BRAND_NOTE|BI_BRAND_NOTE_MANDATORY)) != 0) { ret = __elfN(check_note)(imgp, bi->brand_note, osrel); + /* + * If note checker claimed the binary, but the + * interpreter path in the image does not + * match default one for the brand, try to + * search for other brands with the same + * interpreter. Either there is better brand + * with the right interpreter, or, failing + * this, we return first brand which accepted + * our note and, optionally, header. + */ + if (ret && bi_m == NULL && (strlen(bi->interp_path) + + 1 != interp_name_len || strncmp(interp, + bi->interp_path, interp_name_len) != 0)) { + bi_m = bi; + ret = 0; + } if (ret) return (bi); } } + if (bi_m != NULL) + return (bi_m); /* If the executable has a brand, search for it in the brand list. */ for (i = 0; i < MAX_BRANDS; i++) { From owner-svn-src-all@freebsd.org Sun Feb 7 11:38:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4060AA1E40; Sun, 7 Feb 2016 11:38:56 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 3CC3D136B; Sun, 7 Feb 2016 11:38:56 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u17BctPZ038783; Sun, 7 Feb 2016 11:38:55 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u17Bctwi038780; Sun, 7 Feb 2016 11:38:55 GMT (envelope-from des@FreeBSD.org) Message-Id: <201602071138.u17Bctwi038780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Sun, 7 Feb 2016 11:38: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: r295367 - in stable/10: crypto/openssh crypto/openssh/contrib crypto/openssh/contrib/caldera crypto/openssh/contrib/cygwin crypto/openssh/contrib/redhat crypto/openssh/contrib/suse cryp... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 11:38:56 -0000 Author: des Date: Sun Feb 7 11:38:54 2016 New Revision: 295367 URL: https://svnweb.freebsd.org/changeset/base/295367 Log: MFH (r265214, r294333, r294407, r294467): misc prop fixes MFH (r285975, r287143): register mergeinfo for security fixes MFH (r294497, r294498, r295139): internal documentation MFH (r294328): upgrade to openssh 6.7p1, re-add libwrap MFH (r294332): upgrade to openssh 6.8p1 MFH (r294367): update pam_ssh for api changes MFH (r294909): switch usedns back on MFH (r294336): upgrade to openssh 6.9p1 MFH (r294495): re-enable dsa keys MFH (r294464): upgrade to openssh 7.0p1 MFH (r294496): upgrade to openssh 7.1p2 Approved by: re (gjb) Relnotes: yes Added: stable/10/crypto/openssh/.cvsignore - copied unchanged from r294332, head/crypto/openssh/.cvsignore stable/10/crypto/openssh/bitmap.c (contents, props changed) - copied, changed from r294332, head/crypto/openssh/bitmap.c - copied unchanged from r294332, head/crypto/openssh/bitmap.h stable/10/crypto/openssh/cipher-aesctr.c - copied, changed from r294328, head/crypto/openssh/cipher-aesctr.c stable/10/crypto/openssh/cipher-aesctr.h - copied unchanged from r294328, head/crypto/openssh/cipher-aesctr.h - copied unchanged from r294332, head/crypto/openssh/opacket.c - copied unchanged from r294332, head/crypto/openssh/opacket.h stable/10/crypto/openssh/openbsd-compat/.cvsignore - copied unchanged from r294332, head/crypto/openssh/openbsd-compat/.cvsignore stable/10/crypto/openssh/openbsd-compat/kludge-fd_set.c - copied unchanged from r294328, head/crypto/openssh/openbsd-compat/kludge-fd_set.c - copied unchanged from r294332, head/crypto/openssh/openbsd-compat/md5.c - copied unchanged from r294332, head/crypto/openssh/openbsd-compat/md5.h - copied unchanged from r294332, head/crypto/openssh/openbsd-compat/reallocarray.c stable/10/crypto/openssh/openbsd-compat/regress/.cvsignore - copied unchanged from r294332, head/crypto/openssh/openbsd-compat/regress/.cvsignore stable/10/crypto/openssh/openbsd-compat/regress/opensslvertest.c - copied unchanged from r294328, head/crypto/openssh/openbsd-compat/regress/opensslvertest.c stable/10/crypto/openssh/openbsd-compat/rmd160.c (contents, props changed) - copied, changed from r294332, head/crypto/openssh/openbsd-compat/rmd160.c - copied unchanged from r294332, head/crypto/openssh/openbsd-compat/rmd160.h - copied unchanged from r294332, head/crypto/openssh/openbsd-compat/sha1.c - copied unchanged from r294332, head/crypto/openssh/openbsd-compat/sha1.h stable/10/crypto/openssh/regress/.cvsignore - copied unchanged from r294332, head/crypto/openssh/regress/.cvsignore - copied unchanged from r294336, head/crypto/openssh/regress/cfgparse.sh stable/10/crypto/openssh/regress/hostkey-agent.sh (contents, props changed) - copied, changed from r294332, head/crypto/openssh/regress/hostkey-agent.sh stable/10/crypto/openssh/regress/hostkey-rotate.sh (contents, props changed) - copied, changed from r294332, head/crypto/openssh/regress/hostkey-rotate.sh stable/10/crypto/openssh/regress/keygen-knownhosts.sh (contents, props changed) - copied, changed from r294332, head/crypto/openssh/regress/keygen-knownhosts.sh - copied unchanged from r294332, head/crypto/openssh/regress/limit-keytype.sh - copied unchanged from r294332, head/crypto/openssh/regress/multipubkey.sh stable/10/crypto/openssh/regress/netcat.c (contents, props changed) - copied, changed from r294332, head/crypto/openssh/regress/netcat.c stable/10/crypto/openssh/regress/principals-command.sh (contents, props changed) - copied, changed from r294336, head/crypto/openssh/regress/principals-command.sh stable/10/crypto/openssh/regress/t11.ok - copied unchanged from r294332, head/crypto/openssh/regress/t11.ok stable/10/crypto/openssh/regress/unittests/ - copied from r294328, head/crypto/openssh/regress/unittests/ stable/10/crypto/openssh/regress/unittests/bitmap/ - copied from r294332, head/crypto/openssh/regress/unittests/bitmap/ stable/10/crypto/openssh/regress/unittests/hostkeys/ - copied from r294332, head/crypto/openssh/regress/unittests/hostkeys/ stable/10/crypto/openssh/regress/unittests/kex/ - copied from r294332, head/crypto/openssh/regress/unittests/kex/ - copied unchanged from r294332, head/crypto/openssh/regress/valgrind-unit.sh stable/10/crypto/openssh/scard/.cvsignore - copied unchanged from r294332, head/crypto/openssh/scard/.cvsignore - copied unchanged from r294332, head/crypto/openssh/ssh_api.c - copied unchanged from r294332, head/crypto/openssh/ssh_api.h stable/10/crypto/openssh/sshbuf-getput-basic.c - copied, changed from r294328, head/crypto/openssh/sshbuf-getput-basic.c stable/10/crypto/openssh/sshbuf-getput-crypto.c - copied, changed from r294328, head/crypto/openssh/sshbuf-getput-crypto.c stable/10/crypto/openssh/sshbuf-misc.c - copied, changed from r294328, head/crypto/openssh/sshbuf-misc.c stable/10/crypto/openssh/sshbuf.c - copied, changed from r294328, head/crypto/openssh/sshbuf.c stable/10/crypto/openssh/sshbuf.h - copied, changed from r294328, head/crypto/openssh/sshbuf.h stable/10/crypto/openssh/ssherr.c - copied, changed from r294328, head/crypto/openssh/ssherr.c stable/10/crypto/openssh/ssherr.h - copied, changed from r294328, head/crypto/openssh/ssherr.h stable/10/crypto/openssh/sshkey.c - copied, changed from r294328, head/crypto/openssh/sshkey.c stable/10/crypto/openssh/sshkey.h - copied, changed from r294328, head/crypto/openssh/sshkey.h Directory Properties: stable/10/crypto/openssh/bitmap.h (props changed) stable/10/crypto/openssh/opacket.c (props changed) stable/10/crypto/openssh/opacket.h (props changed) stable/10/crypto/openssh/openbsd-compat/md5.c (props changed) stable/10/crypto/openssh/openbsd-compat/md5.h (props changed) stable/10/crypto/openssh/openbsd-compat/reallocarray.c (props changed) stable/10/crypto/openssh/openbsd-compat/rmd160.h (props changed) stable/10/crypto/openssh/openbsd-compat/sha1.c (props changed) stable/10/crypto/openssh/openbsd-compat/sha1.h (props changed) stable/10/crypto/openssh/regress/cfgparse.sh (props changed) stable/10/crypto/openssh/regress/limit-keytype.sh (props changed) stable/10/crypto/openssh/regress/multipubkey.sh (props changed) stable/10/crypto/openssh/regress/valgrind-unit.sh (props changed) stable/10/crypto/openssh/ssh_api.c (props changed) stable/10/crypto/openssh/ssh_api.h (props changed) Deleted: stable/10/crypto/openssh/compress.c stable/10/crypto/openssh/compress.h stable/10/crypto/openssh/contrib/caldera/ stable/10/crypto/openssh/moduli.0 stable/10/crypto/openssh/scp.0 stable/10/crypto/openssh/sftp-server.0 stable/10/crypto/openssh/sftp.0 stable/10/crypto/openssh/ssh-add.0 stable/10/crypto/openssh/ssh-agent.0 stable/10/crypto/openssh/ssh-keygen.0 stable/10/crypto/openssh/ssh-keyscan.0 stable/10/crypto/openssh/ssh-keysign.0 stable/10/crypto/openssh/ssh-pkcs11-helper.0 stable/10/crypto/openssh/ssh.0 stable/10/crypto/openssh/ssh_config.0 stable/10/crypto/openssh/sshd.0 stable/10/crypto/openssh/sshd_config.0 Modified: stable/10/crypto/openssh/ChangeLog stable/10/crypto/openssh/FREEBSD-upgrade stable/10/crypto/openssh/INSTALL stable/10/crypto/openssh/Makefile.in stable/10/crypto/openssh/OVERVIEW stable/10/crypto/openssh/PROTOCOL stable/10/crypto/openssh/PROTOCOL.agent stable/10/crypto/openssh/PROTOCOL.krl stable/10/crypto/openssh/PROTOCOL.mux stable/10/crypto/openssh/README stable/10/crypto/openssh/addrmatch.c stable/10/crypto/openssh/atomicio.c stable/10/crypto/openssh/auth-bsdauth.c stable/10/crypto/openssh/auth-chall.c stable/10/crypto/openssh/auth-krb5.c (contents, props changed) stable/10/crypto/openssh/auth-options.c stable/10/crypto/openssh/auth-options.h stable/10/crypto/openssh/auth-pam.c stable/10/crypto/openssh/auth-passwd.c stable/10/crypto/openssh/auth-rh-rsa.c stable/10/crypto/openssh/auth-rhosts.c stable/10/crypto/openssh/auth-rsa.c stable/10/crypto/openssh/auth.c stable/10/crypto/openssh/auth.h stable/10/crypto/openssh/auth1.c stable/10/crypto/openssh/auth2-chall.c stable/10/crypto/openssh/auth2-gss.c stable/10/crypto/openssh/auth2-hostbased.c stable/10/crypto/openssh/auth2-kbdint.c stable/10/crypto/openssh/auth2-none.c stable/10/crypto/openssh/auth2-passwd.c stable/10/crypto/openssh/auth2-pubkey.c stable/10/crypto/openssh/auth2.c stable/10/crypto/openssh/authfd.c stable/10/crypto/openssh/authfd.h stable/10/crypto/openssh/authfile.c stable/10/crypto/openssh/authfile.h stable/10/crypto/openssh/bufaux.c stable/10/crypto/openssh/bufbn.c stable/10/crypto/openssh/bufec.c stable/10/crypto/openssh/buffer.c stable/10/crypto/openssh/buffer.h stable/10/crypto/openssh/canohost.c stable/10/crypto/openssh/chacha.h stable/10/crypto/openssh/channels.c stable/10/crypto/openssh/channels.h stable/10/crypto/openssh/cipher-3des1.c stable/10/crypto/openssh/cipher-bf1.c stable/10/crypto/openssh/cipher-chachapoly.c stable/10/crypto/openssh/cipher-chachapoly.h stable/10/crypto/openssh/cipher-ctr.c stable/10/crypto/openssh/cipher.c stable/10/crypto/openssh/cipher.h stable/10/crypto/openssh/clientloop.c stable/10/crypto/openssh/compat.c stable/10/crypto/openssh/compat.h stable/10/crypto/openssh/config.guess stable/10/crypto/openssh/config.h stable/10/crypto/openssh/configure.ac stable/10/crypto/openssh/contrib/Makefile stable/10/crypto/openssh/contrib/README stable/10/crypto/openssh/contrib/cygwin/README stable/10/crypto/openssh/contrib/cygwin/ssh-host-config stable/10/crypto/openssh/contrib/cygwin/ssh-user-config stable/10/crypto/openssh/contrib/redhat/openssh.spec stable/10/crypto/openssh/contrib/suse/openssh.spec stable/10/crypto/openssh/deattack.c stable/10/crypto/openssh/deattack.h stable/10/crypto/openssh/defines.h stable/10/crypto/openssh/dh.c stable/10/crypto/openssh/dh.h stable/10/crypto/openssh/digest-libc.c stable/10/crypto/openssh/digest-openssl.c stable/10/crypto/openssh/digest.h stable/10/crypto/openssh/dispatch.c stable/10/crypto/openssh/dispatch.h stable/10/crypto/openssh/dns.c stable/10/crypto/openssh/dns.h stable/10/crypto/openssh/entropy.c stable/10/crypto/openssh/ge25519.h stable/10/crypto/openssh/groupaccess.c stable/10/crypto/openssh/gss-genr.c stable/10/crypto/openssh/gss-serv-krb5.c stable/10/crypto/openssh/gss-serv.c stable/10/crypto/openssh/hmac.c stable/10/crypto/openssh/hmac.h stable/10/crypto/openssh/hostfile.c stable/10/crypto/openssh/hostfile.h stable/10/crypto/openssh/includes.h stable/10/crypto/openssh/kex.c stable/10/crypto/openssh/kex.h stable/10/crypto/openssh/kexc25519.c stable/10/crypto/openssh/kexc25519c.c stable/10/crypto/openssh/kexc25519s.c stable/10/crypto/openssh/kexdh.c stable/10/crypto/openssh/kexdhc.c stable/10/crypto/openssh/kexdhs.c stable/10/crypto/openssh/kexecdh.c stable/10/crypto/openssh/kexecdhc.c stable/10/crypto/openssh/kexecdhs.c stable/10/crypto/openssh/kexgex.c stable/10/crypto/openssh/kexgexc.c stable/10/crypto/openssh/kexgexs.c stable/10/crypto/openssh/key.c stable/10/crypto/openssh/key.h stable/10/crypto/openssh/krl.c stable/10/crypto/openssh/krl.h stable/10/crypto/openssh/log.c stable/10/crypto/openssh/loginrec.c stable/10/crypto/openssh/mac.c stable/10/crypto/openssh/mac.h stable/10/crypto/openssh/match.c stable/10/crypto/openssh/match.h stable/10/crypto/openssh/misc.c stable/10/crypto/openssh/misc.h stable/10/crypto/openssh/moduli stable/10/crypto/openssh/moduli.c stable/10/crypto/openssh/monitor.c stable/10/crypto/openssh/monitor.h stable/10/crypto/openssh/monitor_fdpass.c stable/10/crypto/openssh/monitor_mm.c stable/10/crypto/openssh/monitor_wrap.c stable/10/crypto/openssh/monitor_wrap.h stable/10/crypto/openssh/msg.c stable/10/crypto/openssh/msg.h stable/10/crypto/openssh/mux.c stable/10/crypto/openssh/myproposal.h stable/10/crypto/openssh/openbsd-compat/Makefile.in stable/10/crypto/openssh/openbsd-compat/arc4random.c stable/10/crypto/openssh/openbsd-compat/bcrypt_pbkdf.c stable/10/crypto/openssh/openbsd-compat/bsd-cygwin_util.c stable/10/crypto/openssh/openbsd-compat/bsd-cygwin_util.h stable/10/crypto/openssh/openbsd-compat/bsd-misc.c stable/10/crypto/openssh/openbsd-compat/bsd-misc.h stable/10/crypto/openssh/openbsd-compat/bsd-snprintf.c stable/10/crypto/openssh/openbsd-compat/explicit_bzero.c stable/10/crypto/openssh/openbsd-compat/fake-rfc2553.h stable/10/crypto/openssh/openbsd-compat/getrrsetbyname-ldns.c stable/10/crypto/openssh/openbsd-compat/openbsd-compat.h stable/10/crypto/openssh/openbsd-compat/openssl-compat.c stable/10/crypto/openssh/openbsd-compat/openssl-compat.h stable/10/crypto/openssh/openbsd-compat/port-linux.c stable/10/crypto/openssh/openbsd-compat/port-tun.c stable/10/crypto/openssh/openbsd-compat/port-uw.c stable/10/crypto/openssh/openbsd-compat/readpassphrase.c stable/10/crypto/openssh/openbsd-compat/realpath.c stable/10/crypto/openssh/openbsd-compat/regress/Makefile.in stable/10/crypto/openssh/openbsd-compat/sha2.c stable/10/crypto/openssh/openbsd-compat/sha2.h stable/10/crypto/openssh/openbsd-compat/xcrypt.c stable/10/crypto/openssh/opensshd.init.in stable/10/crypto/openssh/packet.c stable/10/crypto/openssh/packet.h stable/10/crypto/openssh/platform.c stable/10/crypto/openssh/poly1305.h stable/10/crypto/openssh/progressmeter.c stable/10/crypto/openssh/progressmeter.h stable/10/crypto/openssh/readconf.c stable/10/crypto/openssh/readconf.h stable/10/crypto/openssh/regress/Makefile stable/10/crypto/openssh/regress/README.regress stable/10/crypto/openssh/regress/agent-pkcs11.sh stable/10/crypto/openssh/regress/agent-timeout.sh stable/10/crypto/openssh/regress/agent.sh stable/10/crypto/openssh/regress/broken-pipe.sh stable/10/crypto/openssh/regress/cert-hostkey.sh stable/10/crypto/openssh/regress/cert-userkey.sh stable/10/crypto/openssh/regress/cfgmatch.sh stable/10/crypto/openssh/regress/cipher-speed.sh stable/10/crypto/openssh/regress/connect-privsep.sh stable/10/crypto/openssh/regress/connect.sh stable/10/crypto/openssh/regress/dhgex.sh stable/10/crypto/openssh/regress/dynamic-forward.sh stable/10/crypto/openssh/regress/exit-status.sh stable/10/crypto/openssh/regress/forcecommand.sh stable/10/crypto/openssh/regress/forward-control.sh stable/10/crypto/openssh/regress/forwarding.sh stable/10/crypto/openssh/regress/host-expand.sh stable/10/crypto/openssh/regress/integrity.sh stable/10/crypto/openssh/regress/kextype.sh stable/10/crypto/openssh/regress/key-options.sh stable/10/crypto/openssh/regress/keygen-change.sh stable/10/crypto/openssh/regress/keys-command.sh stable/10/crypto/openssh/regress/keyscan.sh stable/10/crypto/openssh/regress/keytype.sh stable/10/crypto/openssh/regress/krl.sh stable/10/crypto/openssh/regress/localcommand.sh stable/10/crypto/openssh/regress/login-timeout.sh stable/10/crypto/openssh/regress/multiplex.sh stable/10/crypto/openssh/regress/proto-mismatch.sh stable/10/crypto/openssh/regress/proto-version.sh stable/10/crypto/openssh/regress/proxy-connect.sh stable/10/crypto/openssh/regress/reconfigure.sh stable/10/crypto/openssh/regress/reexec.sh stable/10/crypto/openssh/regress/rekey.sh stable/10/crypto/openssh/regress/ssh-com.sh stable/10/crypto/openssh/regress/ssh2putty.sh stable/10/crypto/openssh/regress/sshd-log-wrapper.sh stable/10/crypto/openssh/regress/stderr-data.sh stable/10/crypto/openssh/regress/t4.ok stable/10/crypto/openssh/regress/test-exec.sh stable/10/crypto/openssh/regress/transfer.sh stable/10/crypto/openssh/regress/try-ciphers.sh stable/10/crypto/openssh/regress/unittests/Makefile stable/10/crypto/openssh/regress/unittests/Makefile.inc stable/10/crypto/openssh/regress/unittests/hostkeys/test_iterate.c (contents, props changed) stable/10/crypto/openssh/regress/unittests/kex/test_kex.c (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshbuf/test_sshbuf_getput_crypto.c stable/10/crypto/openssh/regress/unittests/sshbuf/test_sshbuf_getput_fuzz.c stable/10/crypto/openssh/regress/unittests/sshkey/common.c stable/10/crypto/openssh/regress/unittests/sshkey/mktestdata.sh stable/10/crypto/openssh/regress/unittests/sshkey/test_file.c stable/10/crypto/openssh/regress/unittests/sshkey/test_fuzz.c stable/10/crypto/openssh/regress/unittests/sshkey/test_sshkey.c stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_1 stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_1-cert.fp stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_1-cert.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_1.fp stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_1.fp.bb stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_1.param.g stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_1.param.priv stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_1.param.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_1.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_1_pw stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_2 stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_2.fp stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_2.fp.bb stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_2.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_n stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_n_pw stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_1 stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_1-cert.fp stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_1-cert.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_1.fp stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_1.fp.bb stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_1.param.priv stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_1.param.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_1.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_1_pw stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_2 stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_2.fp stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_2.fp.bb stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_2.param.priv stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_2.param.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_2.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_n stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_n_pw stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ed25519_1 stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ed25519_1-cert.fp stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ed25519_1-cert.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ed25519_1.fp stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ed25519_1.fp.bb stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ed25519_1.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ed25519_1_pw stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ed25519_2 stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ed25519_2.fp stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ed25519_2.fp.bb stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ed25519_2.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa1_1 stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa1_1.fp stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa1_1.fp.bb stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa1_1.param.n stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa1_1.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa1_1_pw stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa1_2 stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa1_2.fp stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa1_2.fp.bb stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa1_2.param.n stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa1_2.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_1 stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_1-cert.fp stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_1-cert.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_1.fp stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_1.fp.bb stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_1.param.n stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_1.param.p stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_1.param.q stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_1.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_1_pw stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_2 stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_2.fp stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_2.fp.bb stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_2.param.n stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_2.param.p stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_2.param.q stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_2.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_n stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_n_pw stable/10/crypto/openssh/regress/unittests/test_helper/Makefile stable/10/crypto/openssh/regress/unittests/test_helper/fuzz.c stable/10/crypto/openssh/regress/unittests/test_helper/test_helper.c stable/10/crypto/openssh/regress/unittests/test_helper/test_helper.h stable/10/crypto/openssh/regress/yes-head.sh stable/10/crypto/openssh/rijndael.c stable/10/crypto/openssh/rijndael.h stable/10/crypto/openssh/roaming_client.c stable/10/crypto/openssh/roaming_common.c stable/10/crypto/openssh/roaming_dummy.c stable/10/crypto/openssh/rsa.c stable/10/crypto/openssh/rsa.h stable/10/crypto/openssh/sandbox-seccomp-filter.c stable/10/crypto/openssh/sandbox-systrace.c stable/10/crypto/openssh/scp.1 stable/10/crypto/openssh/scp.c stable/10/crypto/openssh/servconf.c stable/10/crypto/openssh/servconf.h stable/10/crypto/openssh/serverloop.c stable/10/crypto/openssh/session.c stable/10/crypto/openssh/sftp-client.c stable/10/crypto/openssh/sftp-client.h stable/10/crypto/openssh/sftp-common.c stable/10/crypto/openssh/sftp-common.h stable/10/crypto/openssh/sftp-glob.c stable/10/crypto/openssh/sftp-server.8 stable/10/crypto/openssh/sftp-server.c stable/10/crypto/openssh/sftp.1 stable/10/crypto/openssh/sftp.c stable/10/crypto/openssh/ssh-add.1 stable/10/crypto/openssh/ssh-add.c stable/10/crypto/openssh/ssh-agent.1 stable/10/crypto/openssh/ssh-agent.c stable/10/crypto/openssh/ssh-dss.c stable/10/crypto/openssh/ssh-ecdsa.c stable/10/crypto/openssh/ssh-ed25519.c stable/10/crypto/openssh/ssh-keygen.1 stable/10/crypto/openssh/ssh-keygen.c stable/10/crypto/openssh/ssh-keyscan.1 stable/10/crypto/openssh/ssh-keyscan.c stable/10/crypto/openssh/ssh-keysign.c stable/10/crypto/openssh/ssh-pkcs11-client.c stable/10/crypto/openssh/ssh-pkcs11-helper.c stable/10/crypto/openssh/ssh-pkcs11.c stable/10/crypto/openssh/ssh-pkcs11.h stable/10/crypto/openssh/ssh-rsa.c stable/10/crypto/openssh/ssh.1 stable/10/crypto/openssh/ssh.c stable/10/crypto/openssh/ssh.h stable/10/crypto/openssh/ssh_config stable/10/crypto/openssh/ssh_config.5 stable/10/crypto/openssh/ssh_namespace.h stable/10/crypto/openssh/sshconnect.c stable/10/crypto/openssh/sshconnect1.c stable/10/crypto/openssh/sshconnect2.c stable/10/crypto/openssh/sshd.8 stable/10/crypto/openssh/sshd.c stable/10/crypto/openssh/sshd_config stable/10/crypto/openssh/sshd_config.5 stable/10/crypto/openssh/sshlogin.c stable/10/crypto/openssh/sshpty.c stable/10/crypto/openssh/uidswap.c stable/10/crypto/openssh/umac.c stable/10/crypto/openssh/uuencode.c stable/10/crypto/openssh/version.h stable/10/crypto/openssh/xmalloc.c stable/10/crypto/openssh/xmalloc.h stable/10/lib/libpam/modules/pam_ssh/pam_ssh.c stable/10/secure/lib/libssh/Makefile stable/10/secure/usr.sbin/sshd/Makefile Directory Properties: stable/10/ (props changed) stable/10/crypto/openssh/ (props changed) stable/10/crypto/openssh/openbsd-compat/ (props changed) stable/10/crypto/openssh/openbsd-compat/regress/ (props changed) stable/10/crypto/openssh/regress/unittests/bitmap/Makefile (props changed) stable/10/crypto/openssh/regress/unittests/bitmap/tests.c (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/Makefile (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/mktestdata.sh (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/dsa_1.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/dsa_2.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/dsa_3.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/dsa_4.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/dsa_5.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/dsa_6.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/ecdsa_1.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/ecdsa_2.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/ecdsa_3.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/ecdsa_4.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/ecdsa_5.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/ecdsa_6.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/ed25519_1.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/ed25519_2.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/ed25519_3.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/ed25519_4.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/ed25519_5.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/ed25519_6.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/rsa1_1.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/rsa1_2.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/rsa1_3.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/rsa1_4.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/rsa1_5.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/rsa1_6.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/rsa_1.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/rsa_2.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/rsa_3.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/rsa_4.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/rsa_5.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/rsa_6.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/tests.c (props changed) stable/10/crypto/openssh/regress/unittests/kex/Makefile (props changed) stable/10/crypto/openssh/regress/unittests/kex/tests.c (props changed) Copied: stable/10/crypto/openssh/.cvsignore (from r294332, head/crypto/openssh/.cvsignore) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/crypto/openssh/.cvsignore Sun Feb 7 11:38:54 2016 (r295367, copy of r294332, head/crypto/openssh/.cvsignore) @@ -0,0 +1,28 @@ +*.0 +*.out +Makefile +autom4te.cache +buildit.sh +buildpkg.sh +config.cache +config.h +config.h.in +config.log +config.status +configure +openssh.xml +opensshd.init +scp +sftp +sftp-server +ssh +ssh-add +ssh-agent +ssh-keygen +ssh-keyscan +ssh-keysign +ssh-pkcs11-helper +sshd +stamp-h.in +survey +survey.sh Modified: stable/10/crypto/openssh/ChangeLog ============================================================================== --- stable/10/crypto/openssh/ChangeLog Sun Feb 7 09:51:22 2016 (r295366) +++ stable/10/crypto/openssh/ChangeLog Sun Feb 7 11:38:54 2016 (r295367) @@ -1,2887 +1,7615 @@ -20140313 - - (djm) Release OpenSSH 6.6 - -20140304 - - OpenBSD CVS Sync - - djm@cvs.openbsd.org 2014/03/03 22:22:30 - [session.c] - ignore enviornment variables with embedded '=' or '\0' characters; - spotted by Jann Horn; ok deraadt@ - -20140301 - - (djm) [regress/Makefile] Disable dhgex regress test; it breaks when - no moduli file exists at the expected location. - -20140228 - - OpenBSD CVS Sync - - djm@cvs.openbsd.org 2014/02/27 00:41:49 - [bufbn.c] - fix unsigned overflow that could lead to reading a short ssh protocol - 1 bignum value; found by Ben Hawkes; ok deraadt@ - - djm@cvs.openbsd.org 2014/02/27 08:25:09 - [bufbn.c] - off by one in range check - - djm@cvs.openbsd.org 2014/02/27 22:47:07 - [sshd_config.5] - bz#2184 clarify behaviour of a keyword that appears in multiple - matching Match blocks; ok dtucker@ - - djm@cvs.openbsd.org 2014/02/27 22:57:40 - [version.h] - openssh-6.6 - - dtucker@cvs.openbsd.org 2014/01/19 23:43:02 - [regress/sftp-chroot.sh] - Don't use -q on sftp as it suppresses logging, instead redirect the - output to the regress logfile. - - dtucker@cvs.openbsd.org 2014/01/20 00:00:30 - [sregress/ftp-chroot.sh] - append to rather than truncating the log file - - dtucker@cvs.openbsd.org 2014/01/25 04:35:32 - [regress/Makefile regress/dhgex.sh] - Add a test for DH GEX sizes - - djm@cvs.openbsd.org 2014/01/26 10:22:10 - [regress/cert-hostkey.sh] - automatically generate revoked keys from listed keys rather than - manually specifying each type; from portable - (Id sync only) - - djm@cvs.openbsd.org 2014/01/26 10:49:17 - [scp-ssh-wrapper.sh scp.sh] - make sure $SCP is tested on the remote end rather than whichever one - happens to be in $PATH; from portable - (Id sync only) - - djm@cvs.openbsd.org 2014/02/27 20:04:16 - [login-timeout.sh] - remove any existing LoginGraceTime from sshd_config before adding - a specific one for the test back in - - djm@cvs.openbsd.org 2014/02/27 21:21:25 - [agent-ptrace.sh agent.sh] - keep return values that are printed in error messages; - from portable - (Id sync only) - - (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec] - [contrib/suse/openssh.spec] Crank version numbers - - (djm) [regress/host-expand.sh] Add RCS Id - -20140227 - - OpenBSD CVS Sync - - djm@cvs.openbsd.org 2014/02/26 20:18:37 - [ssh.c] - bz#2205: avoid early hostname lookups unless canonicalisation is enabled; - ok dtucker@ markus@ - - djm@cvs.openbsd.org 2014/02/26 20:28:44 - [auth2-gss.c gss-serv.c ssh-gss.h sshd.c] - bz#2107 - cache OIDs of supported GSSAPI mechanisms before privsep - sandboxing, as running this code in the sandbox can cause violations; - ok markus@ - - djm@cvs.openbsd.org 2014/02/26 20:29:29 - [channels.c] - don't assume that the socks4 username is \0 terminated; - spotted by Ben Hawkes; ok markus@ - - markus@cvs.openbsd.org 2014/02/26 21:53:37 - [sshd.c] - ssh_gssapi_prepare_supported_oids needs GSSAPI - -20140224 - - OpenBSD CVS Sync - - djm@cvs.openbsd.org 2014/02/07 06:55:54 - [cipher.c mac.c] - remove some logging that makes ssh debugging output very verbose; - ok markus - - djm@cvs.openbsd.org 2014/02/15 23:05:36 - [channels.c] - avoid spurious "getsockname failed: Bad file descriptor" errors in ssh -W; - bz#2200, debian#738692 via Colin Watson; ok dtucker@ - - djm@cvs.openbsd.org 2014/02/22 01:32:19 - [readconf.c] - when processing Match blocks, skip 'exec' clauses if previous predicates - failed to match; ok markus@ - - djm@cvs.openbsd.org 2014/02/23 20:03:42 - [ssh-ed25519.c] - check for unsigned overflow; not reachable in OpenSSH but others might - copy our code... - - djm@cvs.openbsd.org 2014/02/23 20:11:36 - [readconf.c readconf.h ssh.c ssh_config.5] - reparse ssh_config and ~/.ssh/config if hostname canonicalisation changes - the hostname. This allows users to write configurations that always - refer to canonical hostnames, e.g. - - CanonicalizeHostname yes - CanonicalDomains int.example.org example.org - CanonicalizeFallbackLocal no - - Host *.int.example.org - Compression off - Host *.example.org - User djm - - ok markus@ +commit c88ac102f0eb89f2eaa314cb2e2e0ca3c890c443 +Author: Damien Miller +Date: Thu Jan 14 11:08:19 2016 +1100 + + bump version numbers + +commit 302bc21e6fadacb04b665868cd69b625ef69df90 +Author: Damien Miller +Date: Thu Jan 14 11:04:04 2016 +1100 + + openssh-7.1p2 + +commit 6b33763242c063e4e0593877e835eeb1fd1b60aa +Author: Damien Miller +Date: Thu Jan 14 11:02:58 2016 +1100 + + forcibly disable roaming support in the client + +commit 34d364f0d2e1e30a444009f0e04299bb7c94ba13 +Author: djm@openbsd.org +Date: Mon Oct 5 17:11:21 2015 +0000 + + upstream commit + + some more bzero->explicit_bzero, from Michael McConville + + Upstream-ID: 17f19545685c33327db2efdc357c1c9225ff00d0 + +commit 8f5b93026797b9f7fba90d0c717570421ccebbd3 +Author: guenther@openbsd.org +Date: Fri Sep 11 08:50:04 2015 +0000 + + upstream commit + + Use explicit_bzero() when zeroing before free() + + from Michael McConville (mmcconv1 (at) sccs.swarthmore.edu) + ok millert@ djm@ + + Upstream-ID: 2e3337db046c3fe70c7369ee31515ac73ec00f50 + +commit d77148e3a3ef6c29b26ec74331455394581aa257 +Author: djm@openbsd.org +Date: Sun Nov 8 21:59:11 2015 +0000 + + upstream commit + + fix OOB read in packet code caused by missing return + statement found by Ben Hawkes; ok markus@ deraadt@ + + Upstream-ID: a3e3a85434ebfa0690d4879091959591f30efc62 + +commit 076d849e17ab12603627f87b301e2dca71bae518 +Author: Damien Miller +Date: Sat Nov 14 18:44:49 2015 +1100 + + read back from libcrypto RAND when privdropping + + makes certain libcrypto implementations cache a /dev/urandom fd + in preparation of sandboxing. Based on patch by Greg Hartman. + +commit f72adc0150011a28f177617a8456e1f83733099d +Author: djm@openbsd.org +Date: Sun Dec 13 22:42:23 2015 +0000 + + upstream commit + + unbreak connections with peers that set + first_kex_follows; fix from Matt Johnston va bz#2515 + + Upstream-ID: decc88ec4fc7515594fdb42b04aa03189a44184b + +commit 04bd8d019ccd906cac1a2b362517b8505f3759e6 +Author: djm@openbsd.org +Date: Tue Jan 12 23:42:54 2016 +0000 + + upstream commit + + use explicit_bzero() more liberally in the buffer code; ok + deraadt + + Upstream-ID: 0ece37069fd66bc6e4f55eb1321f93df372b65bf + +commit e91346dc2bbf460246df2ab591b7613908c1b0ad +Author: Damien Miller +Date: Fri Aug 21 14:49:03 2015 +1000 + + we don't use Github for issues/pull-requests + +commit a4f5b507c708cc3dc2c8dd2d02e4416d7514dc23 +Author: Damien Miller +Date: Fri Aug 21 14:43:55 2015 +1000 + + fix URL for connect.c + +commit d026a8d3da0f8186598442997c7d0a28e7275414 +Author: Damien Miller +Date: Fri Aug 21 13:47:10 2015 +1000 + + update version numbers for 7.1 + +commit 78f8f589f0ca1c9f41e5a9bae3cda5ce8a6b42ed +Author: djm@openbsd.org +Date: Fri Aug 21 03:45:26 2015 +0000 + + upstream commit + + openssh-7.1 + + Upstream-ID: ff7b1ef4b06caddfb45e08ba998128c88be3d73f + +commit 32a181980c62fce94f7f9ffaf6a79d90f0c309cf +Author: djm@openbsd.org +Date: Fri Aug 21 03:42:19 2015 +0000 + + upstream commit + + fix inverted logic that broke PermitRootLogin; reported + by Mantas Mikulenas; ok markus@ + + Upstream-ID: 260dd6a904c1bb7e43267e394b1c9cf70bdd5ea5 + +commit ce445b0ed927e45bd5bdce8f836eb353998dd65c +Author: deraadt@openbsd.org +Date: Thu Aug 20 22:32:42 2015 +0000 + + upstream commit + + Do not cast result of malloc/calloc/realloc* if stdlib.h + is in scope ok krw millert + + Upstream-ID: 5e50ded78cadf3841556649a16cc4b1cb6c58667 + +commit 05291e5288704d1a98bacda269eb5a0153599146 +Author: naddy@openbsd.org +Date: Thu Aug 20 19:20:06 2015 +0000 + + upstream commit + + In the certificates section, be consistent about using + "host_key" and "user_key" for the respective key types. ok sthen@ deraadt@ + + Upstream-ID: 9e037ea3b15577b238604c5533e082a3947f13cb + +commit 8543d4ef6f2e9f98c3e6b77c894ceec30c5e4ae4 +Author: djm@openbsd.org +Date: Wed Aug 19 23:21:42 2015 +0000 + + upstream commit + + Better compat matching for WinSCP, add compat matching + for FuTTY (fork of PuTTY); ok markus@ deraadt@ + + Upstream-ID: 24001d1ac115fa3260fbdc329a4b9aeb283c5389 + +commit ec6eda16ebab771aa3dfc90629b41953b999cb1e +Author: djm@openbsd.org +Date: Wed Aug 19 23:19:01 2015 +0000 + + upstream commit + + fix double-free() in error path of DSA key generation + reported by Mateusz Kocielski; ok markus@ + + Upstream-ID: 4735d8f888b10599a935fa1b374787089116713c + +commit 45b0eb752c94954a6de046bfaaf129e518ad4b5b +Author: djm@openbsd.org +Date: Wed Aug 19 23:18:26 2015 +0000 + + upstream commit + + fix free() of uninitialised pointer reported by Mateusz + Kocielski; ok markus@ + + Upstream-ID: 519552b050618501a06b7b023de5cb104e2c5663 + +commit c837643b93509a3ef538cb6624b678c5fe32ff79 +Author: djm@openbsd.org +Date: Wed Aug 19 23:17:51 2015 +0000 + + upstream commit + + fixed unlink([uninitialised memory]) reported by Mateusz + Kocielski; ok markus@ + + Upstream-ID: 14a0c4e7d891f5a8dabc4b89d4f6b7c0d5a20109 + +commit 1f8d3d629cd553031021068eb9c646a5f1e50994 +Author: jmc@openbsd.org +Date: Fri Aug 14 15:32:41 2015 +0000 + + upstream commit + + match myproposal.h order; from brian conway (i snuck in a + tweak while here) + + ok dtucker + + Upstream-ID: 35174a19b5237ea36aa3798f042bf5933b772c67 + +commit 1dc8d93ce69d6565747eb44446ed117187621b26 +Author: deraadt@openbsd.org +Date: Thu Aug 6 14:53:21 2015 +0000 + + upstream commit + + add prohibit-password as a synonymn for without-password, + since the without-password is causing too many questions. Harden it to ban + all but pubkey, hostbased, and GSSAPI auth (when the latter is enabled) from + djm, ok markus + + Upstream-ID: d53317d7b28942153e6236d3fd6e12ceb482db7a + +commit 90a95a4745a531b62b81ce3b025e892bdc434de5 +Author: Damien Miller +Date: Tue Aug 11 13:53:41 2015 +1000 + + update version in README + +commit 318c37743534b58124f1bab37a8a0087a3a9bd2f +Author: Damien Miller +Date: Tue Aug 11 13:53:09 2015 +1000 + + update versions in *.spec + +commit 5e75f5198769056089fb06c4d738ab0e5abc66f7 +Author: Damien Miller +Date: Tue Aug 11 13:34:12 2015 +1000 + + set sshpam_ctxt to NULL after free + + Avoids use-after-free in monitor when privsep child is compromised. + Reported by Moritz Jodeit; ok dtucker@ + +commit d4697fe9a28dab7255c60433e4dd23cf7fce8a8b +Author: Damien Miller +Date: Tue Aug 11 13:33:24 2015 +1000 + + Don't resend username to PAM; it already has it. + + Pointed out by Moritz Jodeit; ok dtucker@ + +commit 88763a6c893bf3dfe951ba9271bf09715e8d91ca +Author: Darren Tucker +Date: Mon Jul 27 12:14:25 2015 +1000 + + Import updated moduli file from OpenBSD. + +commit 55b263fb7cfeacb81aaf1c2036e0394c881637da +Author: Damien Miller +Date: Mon Aug 10 11:13:44 2015 +1000 + + let principals-command.sh work for noexec /var/run + +commit 2651e34cd11b1aac3a0fe23b86d8c2ff35c07897 +Author: Damien Miller +Date: Thu Aug 6 11:43:42 2015 +1000 + + work around echo -n / sed behaviour in tests + +commit d85dad81778c1aa8106acd46930b25fdf0d15b2a +Author: djm@openbsd.org +Date: Wed Aug 5 05:27:33 2015 +0000 + + upstream commit + + adjust for RSA minimum modulus switch; ok deraadt@ + + Upstream-Regress-ID: 5a72c83431b96224d583c573ca281cd3a3ebfdae + +commit 57e8e229bad5fe6056b5f1199665f5f7008192c6 +Author: djm@openbsd.org +Date: Tue Aug 4 05:23:06 2015 +0000 + + upstream commit + + backout SSH_RSA_MINIMUM_MODULUS_SIZE increase for this + release; problems spotted by sthen@ ok deraadt@ markus@ + + Upstream-ID: d0bd60dde9e8c3cd7030007680371894c1499822 + +commit f097d0ea1e0889ca0fa2e53a00214e43ab7fa22a +Author: djm@openbsd.org +Date: Sun Aug 2 09:56:42 2015 +0000 + + upstream commit + + openssh 7.0; ok deraadt@ + + Upstream-ID: c63afdef537f57f28ae84145c5a8e29e9250221f + +commit 3d5728a0f6874ce4efb16913a12963595070f3a9 +Author: chris@openbsd.org +Date: Fri Jul 31 15:38:09 2015 +0000 + + upstream commit + + Allow PermitRootLogin to be overridden by config + + ok markus@ deeradt@ + + Upstream-ID: 5cf3e26ed702888de84e2dc9d0054ccf4d9125b4 + +commit 6f941396b6835ad18018845f515b0c4fe20be21a +Author: djm@openbsd.org +Date: Thu Jul 30 23:09:15 2015 +0000 + + upstream commit + + fix pty permissions; patch from Nikolay Edigaryev; ok + deraadt + + Upstream-ID: 40ff076d2878b916fbfd8e4f45dbe5bec019e550 + +commit f4373ed1e8fbc7c8ce3fc4ea97d0ba2e0c1d7ef0 +Author: deraadt@openbsd.org +Date: Thu Jul 30 19:23:02 2015 +0000 + + upstream commit + + change default: PermitRootLogin without-password matching + install script changes coming as well ok djm markus + + Upstream-ID: 0e2a6c4441daf5498b47a61767382bead5eb8ea6 + +commit 0c30ba91f87fcda7e975e6ff8a057f624e87ea1c +Author: Damien Miller +Date: Thu Jul 30 12:31:39 2015 +1000 + + downgrade OOM adjustment logging: verbose -> debug + +commit f9eca249d4961f28ae4b09186d7dc91de74b5895 +Author: djm@openbsd.org +Date: Thu Jul 30 00:01:34 2015 +0000 + + upstream commit + + Allow ssh_config and sshd_config kex parameters options be + prefixed by a '+' to indicate that the specified items be appended to the + default rather than replacing it. + + approach suggested by dtucker@, feedback dlg@, ok markus@ + + Upstream-ID: 0f901137298fc17095d5756ff1561a7028e8882a + +commit 5cefe769105a2a2e3ca7479d28d9a325d5ef0163 +Author: djm@openbsd.org +Date: Wed Jul 29 08:34:54 2015 +0000 + + upstream commit + + fix bug in previous; was printing incorrect string for + failed host key algorithms negotiation + + Upstream-ID: 22c0dc6bc61930513065d92e11f0753adc4c6e6e + +commit f319912b0d0e1675b8bb051ed8213792c788bcb2 +Author: djm@openbsd.org +Date: Wed Jul 29 04:43:06 2015 +0000 + + upstream commit + + include the peer's offer when logging a failure to + negotiate a mutual set of algorithms (kex, pubkey, ciphers, etc.) ok markus@ + + Upstream-ID: bbb8caabf5c01790bb845f5ce135565248d7c796 + +commit b6ea0e573042eb85d84defb19227c89eb74cf05a +Author: djm@openbsd.org +Date: Tue Jul 28 23:20:42 2015 +0000 + + upstream commit + + add Cisco to the list of clients that choke on the + hostkeys update extension. Pointed out by Howard Kash + + Upstream-ID: c9eadde28ecec056c73d09ee10ba4570dfba7e84 + +commit 3f628c7b537291c1019ce86af90756fb4e66d0fd +Author: guenther@openbsd.org +Date: Mon Jul 27 16:29:23 2015 +0000 + + upstream commit + + Permit kbind(2) use in the sandbox now, to ease testing + of ld.so work using it + + reminded by miod@, ok deraadt@ + + Upstream-ID: 523922e4d1ba7a091e3824e77a8a3c818ee97413 + +commit ebe27ebe520098bbc0fe58945a87ce8490121edb +Author: millert@openbsd.org +Date: Mon Jul 20 18:44:12 2015 +0000 + + upstream commit + + Move .Pp before .Bl, not after to quiet mandoc -Tlint. + Noticed by jmc@ + + Upstream-ID: 59fadbf8407cec4e6931e50c53cfa0214a848e23 + +commit d5d91d0da819611167782c66ab629159169d94d4 +Author: millert@openbsd.org +Date: Mon Jul 20 18:42:35 2015 +0000 + + upstream commit + + Sync usage with SYNOPSIS + + Upstream-ID: 7a321a170181a54f6450deabaccb6ef60cf3f0b7 + +commit 79ec2142fbc68dd2ed9688608da355fc0b1ed743 +Author: millert@openbsd.org +Date: Mon Jul 20 15:39:52 2015 +0000 + + upstream commit + + Better desciption of Unix domain socket forwarding. + bz#2423; ok jmc@ + + Upstream-ID: 85e28874726897e3f26ae50dfa2e8d2de683805d + +commit d56fd1828074a4031b18b8faa0bf949669eb18a0 +Author: Damien Miller +Date: Mon Jul 20 11:19:51 2015 +1000 + + make realpath.c compile -Wsign-compare clean + +commit c63c9a691dca26bb7648827f5a13668832948929 +Author: djm@openbsd.org +Date: Mon Jul 20 00:30:01 2015 +0000 + + upstream commit + + mention that the default of UseDNS=no implies that + hostnames cannot be used for host matching in sshd_config and + authorized_keys; bz#2045, ok dtucker@ + + Upstream-ID: 0812705d5f2dfa59aab01f2764ee800b1741c4e1 + +commit 63ebcd0005e9894fcd6871b7b80aeea1fec0ff76 +Author: djm@openbsd.org +Date: Sat Jul 18 08:02:17 2015 +0000 + + upstream commit + + don't ignore PKCS#11 hosted keys that return empty + CKA_ID; patch by Jakub Jelen via bz#2429; ok markus + + Upstream-ID: 2f7c94744eb0342f8ee8bf97b2351d4e00116485 + +commit b15fd989c8c62074397160147a8d5bc34b3f3c63 +Author: djm@openbsd.org +Date: Sat Jul 18 08:00:21 2015 +0000 + + upstream commit + + skip uninitialised PKCS#11 slots; patch from Jakub Jelen + in bz#2427 ok markus@ + + Upstream-ID: 744c1e7796e237ad32992d0d02148e8a18f27d29 + +commit 5b64f85bb811246c59ebab70aed331f26ba37b18 +Author: djm@openbsd.org +Date: Sat Jul 18 07:57:14 2015 +0000 + + upstream commit + + only query each keyboard-interactive device once per + authentication request regardless of how many times it is listed; ok markus@ + + Upstream-ID: d73fafba6e86030436ff673656ec1f33d9ffeda1 + +commit cd7324d0667794eb5c236d8a4e0f236251babc2d +Author: djm@openbsd.org +Date: Fri Jul 17 03:34:27 2015 +0000 + + upstream commit + + remove -u flag to diff (only used for error output) to make + things easier for -portable + + Upstream-Regress-ID: a5d6777d2909540d87afec3039d9bb2414ade548 + +commit deb8d99ecba70b67f4af7880b11ca8768df9ec3a +Author: djm@openbsd.org +Date: Fri Jul 17 03:09:19 2015 +0000 + + upstream commit + + direct-streamlocal@openssh.com Unix domain foward + messages do not contain a "reserved for future use" field and in fact, + serverloop.c checks that there isn't one. Remove erroneous mention from + PROTOCOL description. bz#2421 from Daniel Black + + Upstream-ID: 3d51a19e64f72f764682f1b08f35a8aa810a43ac + +commit 356b61f365405b5257f5b2ab446e5d7bd33a7b52 +Author: djm@openbsd.org +Date: Fri Jul 17 03:04:27 2015 +0000 + + upstream commit + + describe magic for setting up Unix domain socket fowards + via the mux channel; bz#2422 patch from Daniel Black + + Upstream-ID: 943080fe3864715c423bdeb7c920bb30c4eee861 + +commit d3e2aee41487d55b8d7d40f538b84ff1db7989bc +Author: Darren Tucker +Date: Fri Jul 17 12:52:34 2015 +1000 + + Check if realpath works on nonexistent files. + + On some platforms the native realpath doesn't work with non-existent + files (this is actually specified in some versions of POSIX), however + the sftp spec says its realpath with "canonicalize any given path name". + On those platforms, use realpath from the compat library. + + In addition, when compiling with -DFORTIFY_SOURCE, glibc redefines + the realpath symbol to the checked version, so redefine ours to + something else so we pick up the compat version we want. + + bz#2428, ok djm@ + +commit 25b14610dab655646a109db5ef8cb4c4bf2a48a0 +Author: djm@openbsd.org +Date: Fri Jul 17 02:47:45 2015 +0000 + + upstream commit + + fix incorrect test for SSH1 keys when compiled without SSH1 + support + + Upstream-ID: 6004d720345b8e481c405e8ad05ce2271726e451 + +commit df56a8035d429b2184ee94aaa7e580c1ff67f73a +Author: djm@openbsd.org +Date: Wed Jul 15 08:00:11 2015 +0000 + + upstream commit + + fix NULL-deref when SSH1 reenabled + + Upstream-ID: f22fd805288c92b3e9646782d15b48894b2d5295 + +commit 41e38c4d49dd60908484e6703316651333f16b93 +Author: djm@openbsd.org +Date: Wed Jul 15 07:19:50 2015 +0000 + + upstream commit + + regen RSA1 test keys; the last batch was missing their + private parts + + Upstream-Regress-ID: 7ccf437305dd63ff0b48dd50c5fd0f4d4230c10a + +commit 5bf0933184cb622ca3f96d224bf3299fd2285acc +Author: markus@openbsd.org +Date: Fri Jul 10 06:23:25 2015 +0000 + + upstream commit + + Adapt tests, now that DSA if off by default; use + PubkeyAcceptedKeyTypes and PubkeyAcceptedKeyTypes to test DSA. + + Upstream-Regress-ID: 0ff2a3ff5ac1ce5f92321d27aa07b98656efcc5c + +commit 7a6e3fd7b41dbd3756b6bf9acd67954c0b1564cc +Author: markus@openbsd.org +Date: Tue Jul 7 14:54:16 2015 +0000 + + upstream commit + + regen test data after mktestdata.sh changes + + Upstream-Regress-ID: 3495ecb082b9a7c048a2d7c5c845d3bf181d25a4 + +commit 7c8c174c69f681d4910fa41c37646763692b28e2 +Author: markus@openbsd.org +Date: Tue Jul 7 14:53:30 2015 +0000 + + upstream commit + + adapt tests to new minimum RSA size and default FP format + + Upstream-Regress-ID: a4b30afd174ce82b96df14eb49fb0b81398ffd0e + +commit 6a977a4b68747ade189e43d302f33403fd4a47ac +Author: djm@openbsd.org +Date: Fri Jul 3 04:39:23 2015 +0000 + + upstream commit + + legacy v00 certificates are gone; adapt and don't try to + test them; "sure" markus@ dtucker@ + + Upstream-Regress-ID: c57321e69b3cd4a3b3396dfcc43f0803d047da12 + +commit 0c4123ad5e93fb90fee9c6635b13a6cdabaac385 +Author: djm@openbsd.org +Date: Wed Jul 1 23:11:18 2015 +0000 + + upstream commit + + don't expect SSH v.1 in unittests + + Upstream-Regress-ID: f8812b16668ba78e6a698646b2a652b90b653397 + +commit 3c099845798a817cdde513c39074ec2063781f18 +Author: djm@openbsd.org +Date: Mon Jun 15 06:38:50 2015 +0000 + + upstream commit + + turn SSH1 back on to match src/usr.bin/ssh being tested + + Upstream-Regress-ID: 6c4f763a2f0cc6893bf33983919e9030ae638333 + +commit b1dc2b33689668c75e95f873a42d5aea1f4af1db +Author: dtucker@openbsd.org +Date: Mon Jul 13 04:57:14 2015 +0000 + + upstream commit + + Add "PuTTY_Local:" to the clients to which we do not + offer DH-GEX. This was the string that was used for development versions + prior to September 2014 and they don't do RFC4419 DH-GEX, but unfortunately + there are some extant products based on those versions. bx2424 from Jay + Rouman, ok markus@ djm@ + + Upstream-ID: be34d41e18b966832fe09ca243d275b81882e1d5 + +commit 3a1638dda19bbc73d0ae02b4c251ce08e564b4b9 +Author: markus@openbsd.org +Date: Fri Jul 10 06:21:53 2015 +0000 + + upstream commit + + Turn off DSA by default; add HostKeyAlgorithms to the + server and PubkeyAcceptedKeyTypes to the client side, so it still can be + tested or turned back on; feedback and ok djm@ + + Upstream-ID: 8450a9e6d83f80c9bfed864ff061dfc9323cec21 + +commit 16db0a7ee9a87945cc594d13863cfcb86038db59 +Author: markus@openbsd.org +Date: Thu Jul 9 09:49:46 2015 +0000 + + upstream commit + + re-enable ed25519-certs if compiled w/o openssl; ok djm + + Upstream-ID: e10c90808b001fd2c7a93778418e9b318f5c4c49 + +commit c355bf306ac33de6545ce9dac22b84a194601e2f +Author: markus@openbsd.org +Date: Wed Jul 8 20:24:02 2015 +0000 + + upstream commit + + no need to include the old buffer/key API + + Upstream-ID: fb13c9f7c0bba2545f3eb0a0e69cb0030819f52b + +commit a3cc48cdf9853f1e832d78cb29bedfab7adce1ee +Author: markus@openbsd.org +Date: Wed Jul 8 19:09:25 2015 +0000 + + upstream commit + + typedefs for Cipher&CipherContext are unused + + Upstream-ID: 50e6a18ee92221d23ad173a96d5b6c42207cf9a7 + +commit a635bd06b5c427a57c3ae760d3a2730bb2c863c0 +Author: markus@openbsd.org +Date: Wed Jul 8 19:04:21 2015 +0000 + + upstream commit + + xmalloc.h is unused + + Upstream-ID: afb532355b7fa7135a60d944ca1e644d1d63cb58 + +commit 2521cf0e36c7f3f6b19f206da0af134f535e4a31 +Author: markus@openbsd.org +Date: Wed Jul 8 19:01:15 2015 +0000 + + upstream commit + + compress.c is gone + + Upstream-ID: 174fa7faa9b9643cba06164b5e498591356fbced + +commit c65a7aa6c43aa7a308ee1ab8a96f216169ae9615 +Author: djm@openbsd.org +Date: Fri Jul 3 04:05:54 2015 +0000 + + upstream commit + + another SSH_RSA_MINIMUM_MODULUS_SIZE that needed + cranking + + Upstream-ID: 9d8826cafe96aab4ae8e2f6fd22800874b7ffef1 + +commit b1f383da5cd3cb921fc7776f17a14f44b8a31757 +Author: djm@openbsd.org +Date: Fri Jul 3 03:56:25 2015 +0000 + + upstream commit + + add an XXX reminder for getting correct key paths from + sshd_config + + Upstream-ID: feae52b209d7782ad742df04a4260e9fe41741db + +commit 933935ce8d093996c34d7efa4d59113163080680 +Author: djm@openbsd.org +Date: Fri Jul 3 03:49:45 2015 +0000 + + upstream commit + + refuse to generate or accept RSA keys smaller than 1024 + bits; feedback and ok dtucker@ + + Upstream-ID: 7ea3d31271366ba264f06e34a3539bf1ac30f0ba + +commit bdfd29f60b74f3e678297269dc6247a5699583c1 +Author: djm@openbsd.org +Date: Fri Jul 3 03:47:00 2015 +0000 + + upstream commit + + turn off 1024 bit diffie-hellman-group1-sha1 key + exchange method (already off in server, this turns it off in the client by + default too) ok dtucker@ + + Upstream-ID: f59b88f449210ab7acf7d9d88f20f1daee97a4fa + +commit c28fc62d789d860c75e23a9fa9fb250eb2beca57 +Author: djm@openbsd.org +Date: Fri Jul 3 03:43:18 2015 +0000 + + upstream commit + + delete support for legacy v00 certificates; "sure" + markus@ dtucker@ + + Upstream-ID: b5b9bb5f9202d09e88f912989d74928601b6636f + +commit 564d63e1b4a9637a209d42a9d49646781fc9caef +Author: djm@openbsd.org +Date: Wed Jul 1 23:10:47 2015 +0000 + + upstream commit + + Compile-time disable SSH v.1 again + + Upstream-ID: 1d4b513a3a06232f02650b73bad25100d1b800af + +commit 868109b650504dd9bcccdb1f51d0906f967c20ff +Author: djm@openbsd.org +Date: Wed Jul 1 02:39:06 2015 +0000 + + upstream commit + + twiddle PermitRootLogin back + + Upstream-ID: 2bd23976305d0512e9f84d054e1fc23cd70b89f2 + +commit 7de4b03a6e4071d454b72927ffaf52949fa34545 +Author: djm@openbsd.org +Date: Wed Jul 1 02:32:17 2015 +0000 + + upstream commit + + twiddle; (this commit marks the openssh-6.9 release) + + Upstream-ID: 78500582819f61dd8adee36ec5cc9b9ac9351234 + +commit 1bf477d3cdf1a864646d59820878783d42357a1d +Author: djm@openbsd.org +Date: Wed Jul 1 02:26:31 2015 +0000 + + upstream commit + + better refuse ForwardX11Trusted=no connections attempted + after ForwardX11Timeout expires; reported by Jann Horn + + Upstream-ID: bf0fddadc1b46a0334e26c080038313b4b6dea21 + +commit 47aa7a0f8551b471fcae0447c1d78464f6dba869 +Author: djm@openbsd.org +Date: Wed Jul 1 01:56:13 2015 +0000 + + upstream commit + + put back default PermitRootLogin=no + + Upstream-ID: 7bdedd5cead99c57ed5571f3b6b7840922d5f728 + +commit 984b064fe2a23733733262f88d2e1b2a1a501662 +Author: djm@openbsd.org +Date: Wed Jul 1 01:55:13 2015 +0000 + + upstream commit + + openssh-6.9 + + Upstream-ID: 6cfe8e1904812531080e6ab6e752d7001b5b2d45 + +commit d921082ed670f516652eeba50705e1e9f6325346 +Author: djm@openbsd.org +Date: Wed Jul 1 01:55:00 2015 +0000 + + upstream commit + + reset default PermitRootLogin to 'yes' (momentarily, for + release) + + Upstream-ID: cad8513527066e65dd7a1c16363d6903e8cefa24 + +commit 66295e0e1ba860e527f191b6325d2d77dec4dbce +Author: Damien Miller +Date: Wed Jul 1 11:49:12 2015 +1000 + + crank version numbers for release + +commit 37035c07d4f26bb1fbe000d2acf78efdb008681d +Author: Damien Miller +Date: Wed Jul 1 10:49:37 2015 +1000 + + s/--with-ssh1/--without-ssh1/ + +commit 629df770dbadc2accfbe1c81b3f31f876d0acd84 +Author: djm@openbsd.org +Date: Tue Jun 30 05:25:07 2015 +0000 + + upstream commit + + fatal() when a remote window update causes the window + value to overflow. Reported by Georg Wicherski, ok markus@ + + Upstream-ID: ead397a9aceb3bf74ebfa5fcaf259d72e569f351 + +commit f715afebe735d61df3fd30ad72d9ac1c8bd3b5f2 +Author: djm@openbsd.org *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Feb 7 13:33:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8DCBAA0E33; Sun, 7 Feb 2016 13:33:19 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 86AAA7D6; Sun, 7 Feb 2016 13:33:19 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u17DXIXb076770; Sun, 7 Feb 2016 13:33:18 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u17DXIsA076769; Sun, 7 Feb 2016 13:33:18 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201602071333.u17DXIsA076769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sun, 7 Feb 2016 13:33:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295368 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 13:33:19 -0000 Author: dteske Date: Sun Feb 7 13:33:18 2016 New Revision: 295368 URL: https://svnweb.freebsd.org/changeset/base/295368 Log: Add missing comma Modified: head/share/man/man4/bridge.4 Modified: head/share/man/man4/bridge.4 ============================================================================== --- head/share/man/man4/bridge.4 Sun Feb 7 11:38:54 2016 (r295367) +++ head/share/man/man4/bridge.4 Sun Feb 7 13:33:18 2016 (r295368) @@ -425,8 +425,8 @@ cloned_interfaces="bridge0" ifconfig_bridge0="addm wlan0 addm fxp0 up" .Ed .Pp -For the bridge to forward packets all member interfaces and the bridge need -to be up. +For the bridge to forward packets, +all member interfaces and the bridge need to be up. The above example would also require: .Bd -literal -offset indent create_args_wlan0="wlanmode hostap" From owner-svn-src-all@freebsd.org Sun Feb 7 15:26:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AECEAA1E49; Sun, 7 Feb 2016 15:26:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 E8C391C10; Sun, 7 Feb 2016 15:26:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u17FQLkU009557; Sun, 7 Feb 2016 15:26:21 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u17FQLO7009550; Sun, 7 Feb 2016 15:26:21 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602071526.u17FQLO7009550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 7 Feb 2016 15:26:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295369 - head/lib/libedit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 15:26:23 -0000 Author: pfg Date: Sun Feb 7 15:26:21 2016 New Revision: 295369 URL: https://svnweb.freebsd.org/changeset/base/295369 Log: MFV r295360 Sync our libedit with NetBSD's libedit 2016-01-16 Obtained from: NetBSD Modified: head/lib/libedit/editline.3 head/lib/libedit/el.c head/lib/libedit/hist.h head/lib/libedit/keymacro.h head/lib/libedit/search.c head/lib/libedit/tokenizer.c head/lib/libedit/tty.c Directory Properties: head/lib/libedit/ (props changed) head/lib/libedit/edit/readline/ (props changed) Modified: head/lib/libedit/editline.3 ============================================================================== --- head/lib/libedit/editline.3 Sun Feb 7 13:33:18 2016 (r295368) +++ head/lib/libedit/editline.3 Sun Feb 7 15:26:21 2016 (r295369) @@ -1,4 +1,4 @@ -.\" $NetBSD: editline.3,v 1.84 2014/12/25 13:39:41 wiz Exp $ +.\" $NetBSD: editline.3,v 1.85 2015/11/03 21:36:59 christos Exp $ .\" .\" Copyright (c) 1997-2014 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 25, 2014 +.Dd November 3, 2015 .Dt EDITLINE 3 .Os .Sh NAME @@ -191,7 +191,7 @@ counterparts. The following functions are available: .Bl -tag -width 4n .It Fn el_init -Initialise the line editor, and return a data structure +Initialize the line editor, and return a data structure to be used by all other line editing functions, or .Dv NULL on failure. @@ -521,61 +521,68 @@ are supported, along with actual type of .Fa result : .Bl -tag -width 4n .It Dv EL_PROMPT , Fa "char *(*f)(EditLine *)" , Fa "char *c" -Return a pointer to the function that displays the prompt in +Set .Fa f . +to a pointer to the function that displays the prompt. If .Fa c is not .Dv NULL , -return the start/stop literal prompt character in it. +set it to the start/stop literal prompt character. .It Dv EL_RPROMPT , Fa "char *(*f)(EditLine *)" , Fa "char *c" -Return a pointer to the function that displays the prompt in +Set .Fa f . +to a pointer to the function that displays the prompt. If .Fa c is not .Dv NULL , -return the start/stop literal prompt character in it. -.It Dv EL_EDITOR , Fa "const char **" -Return the name of the editor, which will be one of +set it to the start/stop literal prompt character. +.It Dv EL_EDITOR , Fa "const char **n" +Set the name of the editor in +.Fa n , +which will be one of .Dq emacs or .Dq vi . .It Dv EL_GETTC , Fa "const char *name" , Fa "void *value" -Return non-zero if +If .Fa name is a valid .Xr termcap 5 -capability -and set +capability set .Fa value to the current value of that capability. -.It Dv EL_SIGNAL , Fa "int *" -Return non-zero if +.It Dv EL_SIGNAL , Fa "int *s" +Set +.Fa s +to non zero if .Nm has installed private signal handlers (see .Fn el_get above). -.It Dv EL_EDITMODE , Fa "int *" -Return non-zero if editing is enabled. +.It Dv EL_EDITMODE , Fa "int *c" +Set +.Fa c +to non-zero if editing is enabled. .It Dv EL_GETCFN , Fa "int (**f)(EditLine *, char *)" Return a pointer to the function that read characters, which is equal to .Dq Dv EL_BUILTIN_GETCFN in the case of the default builtin function. .It Dv EL_CLIENTDATA , Fa "void **data" -Retrieve +Set .Fa data -previously registered with the corresponding +to the previously registered client data set by an .Fn el_set call. -.It Dv EL_UNBUFFERED , Fa "int" -Return non-zero if unbuffered mode is enabled. -.It Dv EL_PREP_TERM , Fa "int" -Sets or clears terminal editing mode. +.It Dv EL_UNBUFFERED , Fa "int *c" +Set +.Fa c +to non-zero if unbuffered mode is enabled. .It Dv EL_GETFP , Fa "int fd", Fa "FILE **fp" -Return in +Set .Fa fp -the current +to the current .Nm editline file pointer for .Dq input @@ -593,7 +600,7 @@ or .Dv 2 . .El .It Fn el_source -Initialise +Initialize .Nm by reading the contents of .Fa file . @@ -671,7 +678,7 @@ and freed by The following functions are available: .Bl -tag -width 4n .It Fn history_init -Initialise the history list, and return a data structure +Initialize the history list, and return a data structure to be used by all other history list functions, or .Dv NULL on failure. @@ -810,7 +817,7 @@ and freed by The following functions are available: .Bl -tag -width 4n .It Fn tok_init -Initialise the tokenizer, and return a data structure +Initialize the tokenizer, and return a data structure to be used by all other tokenizer functions. .Fa IFS contains the Input Field Separators, which defaults to Modified: head/lib/libedit/el.c ============================================================================== --- head/lib/libedit/el.c Sun Feb 7 13:33:18 2016 (r295368) +++ head/lib/libedit/el.c Sun Feb 7 15:26:21 2016 (r295369) @@ -1,4 +1,4 @@ -/* $NetBSD: el.c,v 1.73 2014/06/18 18:12:28 christos Exp $ */ +/* $NetBSD: el.c,v 1.74 2015/12/08 12:56:55 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)el.c 8.2 (Berkeley) 1/3/94"; #else -__RCSID("$NetBSD: el.c,v 1.73 2014/06/18 18:12:28 christos Exp $"); +__RCSID("$NetBSD: el.c,v 1.74 2015/12/08 12:56:55 christos Exp $"); #endif #endif /* not lint && not SCCSID */ #include @@ -137,7 +137,8 @@ el_end(EditLine *el) terminal_end(el); keymacro_end(el); map_end(el); - tty_end(el); + if (!(el->el_flags & NO_TTY)) + tty_end(el); ch_end(el); search_end(el); hist_end(el); Modified: head/lib/libedit/hist.h ============================================================================== --- head/lib/libedit/hist.h Sun Feb 7 13:33:18 2016 (r295368) +++ head/lib/libedit/hist.h Sun Feb 7 15:26:21 2016 (r295369) @@ -1,4 +1,4 @@ -/* $NetBSD: hist.h,v 1.14 2014/05/11 01:05:17 christos Exp $ */ +/* $NetBSD: hist.h,v 1.15 2016/01/30 15:05:27 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -47,10 +47,10 @@ typedef int (*hist_fun_t)(void *, TYPE(H typedef struct el_history_t { Char *buf; /* The history buffer */ - size_t sz; /* Size of history buffer */ + size_t sz; /* Size of history buffer */ Char *last; /* The last character */ int eventno; /* Event we are looking for */ - void * ref; /* Argument for history fcns */ + void *ref; /* Argument for history fcns */ hist_fun_t fun; /* Event access */ TYPE(HistEvent) ev; /* Event cookie */ } el_history_t; Modified: head/lib/libedit/keymacro.h ============================================================================== --- head/lib/libedit/keymacro.h Sun Feb 7 13:33:18 2016 (r295368) +++ head/lib/libedit/keymacro.h Sun Feb 7 15:26:21 2016 (r295369) @@ -1,4 +1,4 @@ -/* $NetBSD: keymacro.h,v 1.2 2011/07/28 03:44:36 christos Exp $ */ +/* $NetBSD: keymacro.h,v 1.3 2016/01/29 19:59:11 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -48,7 +48,7 @@ typedef union keymacro_value_t { typedef struct keymacro_node_t keymacro_node_t; -typedef struct el_keymacromacro_t { +typedef struct el_keymacro_t { Char *buf; /* Key print buffer */ keymacro_node_t *map; /* Key map */ keymacro_value_t val; /* Local conversion buffer */ Modified: head/lib/libedit/search.c ============================================================================== --- head/lib/libedit/search.c Sun Feb 7 13:33:18 2016 (r295368) +++ head/lib/libedit/search.c Sun Feb 7 15:26:21 2016 (r295369) @@ -1,4 +1,4 @@ -/* $NetBSD: search.c,v 1.30 2011/10/04 15:27:04 christos Exp $ */ +/* $NetBSD: search.c,v 1.31 2016/01/30 04:02:51 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)search.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: search.c,v 1.30 2011/10/04 15:27:04 christos Exp $"); +__RCSID("$NetBSD: search.c,v 1.31 2016/01/30 04:02:51 christos Exp $"); #endif #endif /* not lint && not SCCSID */ #include @@ -149,7 +149,7 @@ el_match(const Char *str, const Char *pa if (re_comp(ct_encode_string(pat, &conv)) != NULL) return 0; else - return re_exec(ct_encode_string(str, &conv) == 1); + return re_exec(ct_encode_string(str, &conv)) == 1; #endif } Modified: head/lib/libedit/tokenizer.c ============================================================================== --- head/lib/libedit/tokenizer.c Sun Feb 7 13:33:18 2016 (r295368) +++ head/lib/libedit/tokenizer.c Sun Feb 7 15:26:21 2016 (r295369) @@ -1,4 +1,4 @@ -/* $NetBSD: tokenizer.c,v 1.21 2011/08/16 16:25:15 christos Exp $ */ +/* $NetBSD: tokenizer.c,v 1.22 2016/01/30 04:02:51 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)tokenizer.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: tokenizer.c,v 1.21 2011/08/16 16:25:15 christos Exp $"); +__RCSID("$NetBSD: tokenizer.c,v 1.22 2016/01/30 04:02:51 christos Exp $"); #endif #endif /* not lint && not SCCSID */ #include @@ -448,5 +448,5 @@ FUN(tok,str)(TYPE(Tokenizer) *tok, const memset(&li, 0, sizeof(li)); li.buffer = line; li.cursor = li.lastchar = Strchr(line, '\0'); - return FUN(tok,line(tok, &li, argc, argv, NULL, NULL)); + return FUN(tok,line)(tok, &li, argc, argv, NULL, NULL); } Modified: head/lib/libedit/tty.c ============================================================================== --- head/lib/libedit/tty.c Sun Feb 7 13:33:18 2016 (r295368) +++ head/lib/libedit/tty.c Sun Feb 7 15:26:21 2016 (r295369) @@ -1,4 +1,4 @@ -/* $NetBSD: tty.c,v 1.47 2015/05/14 10:44:15 christos Exp $ */ +/* $NetBSD: tty.c,v 1.49 2015/12/08 16:53:27 gson Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)tty.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: tty.c,v 1.47 2015/05/14 10:44:15 christos Exp $"); +__RCSID("$NetBSD: tty.c,v 1.49 2015/12/08 16:53:27 gson Exp $"); #endif #endif /* not lint && not SCCSID */ #include @@ -582,6 +582,9 @@ protected void /*ARGSUSED*/ tty_end(EditLine *el) { + if (el->el_flags & EDIT_DISABLED) + return; + if (tty_setty(el, TCSAFLUSH, &el->el_tty.t_or) == -1) { #ifdef DEBUG_TTY (void) fprintf(el->el_errfile, From owner-svn-src-all@freebsd.org Sun Feb 7 15:36:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02ABAAA02F9; Sun, 7 Feb 2016 15:36:18 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 C4B661AA; Sun, 7 Feb 2016 15:36:17 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u17FaGZ4012489; Sun, 7 Feb 2016 15:36:16 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u17FaGD9012488; Sun, 7 Feb 2016 15:36:16 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602071536.u17FaGD9012488@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 7 Feb 2016 15:36:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295370 - head/sys/fs/msdosfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 15:36:18 -0000 Author: pfg Date: Sun Feb 7 15:36:16 2016 New Revision: 295370 URL: https://svnweb.freebsd.org/changeset/base/295370 Log: msdosfs_rename: yet another unused value. As with r295355, it seems to be left over from a cleanup in r33548. The code is not in NetBSD either. Thanks to bde for checking out the history. Modified: head/sys/fs/msdosfs/msdosfs_vnops.c Modified: head/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vnops.c Sun Feb 7 15:26:21 2016 (r295369) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Sun Feb 7 15:36:16 2016 (r295370) @@ -941,13 +941,10 @@ msdosfs_rename(struct vop_rename_args *a int error; u_long cn, pcl; daddr_t bn; - struct denode *fddep; /* from file's parent directory */ struct msdosfsmount *pmp; struct direntry *dotdotp; struct buf *bp; - fddep = VTODE(ap->a_fdvp); - pmp = VFSTOMSDOSFS(fdvp->v_mount); #ifdef DIAGNOSTIC From owner-svn-src-all@freebsd.org Sun Feb 7 15:40:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21B2CAA04DE; Sun, 7 Feb 2016 15:40:03 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 E3BC963E; Sun, 7 Feb 2016 15:40:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u17Fe1up012669; Sun, 7 Feb 2016 15:40:01 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u17Fe17B012668; Sun, 7 Feb 2016 15:40:01 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602071540.u17Fe17B012668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 7 Feb 2016 15:40:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295371 - head/sys/fs/fdescfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 15:40:03 -0000 Author: pfg Date: Sun Feb 7 15:40:01 2016 New Revision: 295371 URL: https://svnweb.freebsd.org/changeset/base/295371 Log: Revert r295359: CID 1018688 is a false positive. The initialization is done by calling vn_start_write(... &mp, flags). mp is only an output parameter unless (flags & V_MNTREF), and fdesc doesn't put V_MNTREF in flags. Pointed out by: bde Modified: head/sys/fs/fdescfs/fdesc_vnops.c Modified: head/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- head/sys/fs/fdescfs/fdesc_vnops.c Sun Feb 7 15:36:16 2016 (r295370) +++ head/sys/fs/fdescfs/fdesc_vnops.c Sun Feb 7 15:40:01 2016 (r295371) @@ -465,7 +465,7 @@ fdesc_setattr(ap) { struct vattr *vap = ap->a_vap; struct vnode *vp; - struct mount *mp = NULL; + struct mount *mp; struct file *fp; struct thread *td = curthread; cap_rights_t rights; From owner-svn-src-all@freebsd.org Sun Feb 7 16:03:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A20D5AA116F for ; Sun, 7 Feb 2016 16:03:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm46-vm6.bullet.mail.bf1.yahoo.com (nm46-vm6.bullet.mail.bf1.yahoo.com [216.109.115.109]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B0F21358 for ; Sun, 7 Feb 2016 16:03:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1454860978; bh=+U8Gu2t/ISqndmXZNejgwTMyI9Ob/xW82L1dm9pvoa0=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=fi9bchJ3zHu2kNehOP+9FRsx2ne37gLZ+qBeRyIhsIWzXnk+fHDedOyBmbvmk8szzMSAqMbQzdBeo3MSDHPbwXfjxEgbWIqW3Ydwv5UxpIZnAVHjsSnuA1KLZNMO5kbBsA8bJgPgvlB0dgGdWlv1BRXxcbcOpESeD+yyUNw169seN7sTrSOtp8h7zRlLxXv4GkWIcbWkqZQWL1fBVvu+i4ydAb6ouhq+r++B2cqjYg8wdr3ZM1ov7KG3IgCJ07cailZBTX510It/GrsYG6CTBBrKKLzrTmWfckX1peaJixbo/wTnx0KYP1QeE5CCBF4qD8Jlp2OMVXHTo//CXjTYBw== Received: from [98.139.170.179] by nm46.bullet.mail.bf1.yahoo.com with NNFMP; 07 Feb 2016 16:02:58 -0000 Received: from [68.142.230.64] by tm22.bullet.mail.bf1.yahoo.com with NNFMP; 07 Feb 2016 16:02:58 -0000 Received: from [127.0.0.1] by smtp221.mail.bf1.yahoo.com with NNFMP; 07 Feb 2016 16:02:58 -0000 X-Yahoo-Newman-Id: 145091.18808.bm@smtp221.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: g8l0FdIVM1kss5rxfxRctgPxWEebQpWdcq59CWjjFbVuGDC YZztZoLcherYJ6xVZzI9a.mDO3_ZhkgoZ2g6_u2pqoVsXpqyLaO0GybV7pc2 vMSZ7hUDfmmfvzyuUE7Y5XudQOg3isQabNv2IvyOzWq7sWLU3mR7r34WoXRx 2T32zNQrEvX8dWcYMHK8DY_dh9ulmmTomzhXGCebHzASdATG20AojG.zqfWQ gU5GLX464YjG0sQtlfqghxLR6gYaEQuNBA.PsSNBRbqLrQFqdUmrUBIPxves n43QmfsRWbhg9a_psqr2KGvuX.0NeWIfdGWkCBi.PhBL4IoU.nfoelXohrR4 wQQt1lJeRbTwJi1c5NIJSPfH2Ayjtc3fscv0TfzrH4914reqvlPuIWvzTZzq HqihN9gsDAGXB2OqdAKmfmw1_r_NW9rNMcJy9nne12M6Eh5cFGD4EYad3VH2 6NUUwwab87h5XnZenK0EmUBWJ9LYtWBxCoGKiLBdVojzSa1sXxMqv0bluUg5 h0EaMH_ur21TnYQVX2g9drzlSt7ZnWAZx X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r295362 - head/sys/fs/cd9660 To: Bruce Evans References: <201602070348.u173meT4000314@repo.freebsd.org> <20160207175356.A867@besplex.bde.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: <56B76ABA.8000607@FreeBSD.org> Date: Sun, 7 Feb 2016 11:03:06 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160207175356.A867@besplex.bde.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 16:03:06 -0000 On 02/07/16 02:13, Bruce Evans wrote: > On Sun, 7 Feb 2016, Pedro F. Giffuni wrote: > >> Log: >> cd9660: Drop an unnecessary check for NULL. >> >> This was unnecessary and also confused Coverity. >> >> Confirmed on: NetBSD >> CID: 978558 > > This leaves many similar bugs unfixed nearby. One is a null pointer > panic, not just an unnecessary check. > I admittedly oversimplified the commit log here. Not only the value can't be null, our brelse() also ignores NULL values. From sys/kern/vfs_bio.c: ____ /* * Many function erroneously call brelse with a NULL bp under rare * error conditions. Simply return when called with a NULL bp. */ if (bp == NULL) return; ... ____ And yes, NULL was being misspelled 0 here. I will look at doing more cleanups later. Thanks, Pedro. >> Modified: head/sys/fs/cd9660/cd9660_vfsops.c >> ============================================================================== >> >> --- head/sys/fs/cd9660/cd9660_vfsops.c Sun Feb 7 01:45:24 2016 >> (r295361) >> +++ head/sys/fs/cd9660/cd9660_vfsops.c Sun Feb 7 03:48:40 2016 >> (r295362) >> @@ -741,8 +741,7 @@ cd9660_vget_internal(mp, ino, flags, vpp >> if (off + isonum_711(isodir->length) > >> imp->logical_block_size) { >> vput(vp); >> - if (bp != 0) >> - brelse(bp); >> + brelse(bp); >> printf("fhtovp: directory crosses block boundary >> %d[off=%d/len=%d]\n", >> off +isonum_711(isodir->length), off, >> isonum_711(isodir->length)); >> > > - 11 lines later, there is the same bug in an #if 0 block. > - 9 lines earlier, bp was brelse()ed without a similar check. bp is always > null at that point, so checking for this would be just a style bug. Not > checking, but doing the wrong cleanup of calling brelse() after bread() > fails, gives a null pointer panic in brelse() whenever bread() fails. > > That seems to be all the similar bugs. bp is correctly abused as a flag > later. Other functions depend more critically on bread() setting bp to > NULL when it fails. Typical code is to "goto out" when bread() fails, > and brelse() bp there if it is not null. > > Not-so-similar bugs include spelling NULL as 0 or (empty). > > bread(9) is undocumented. Someone broke its KPI by changing it to a > macro. This annoys me when I try to set a breakpoint at it in kernels > with the broken KPI. The unimportant badly designed bread(3) is > documented. > > Bruce From owner-svn-src-all@freebsd.org Sun Feb 7 16:18:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B436AA1716; Sun, 7 Feb 2016 16:18:13 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 37BF41A8C; Sun, 7 Feb 2016 16:18:13 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u17GICSf024459; Sun, 7 Feb 2016 16:18:12 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u17GICWx024458; Sun, 7 Feb 2016 16:18:12 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602071618.u17GICWx024458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 7 Feb 2016 16:18:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295372 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 16:18:13 -0000 Author: pfg Date: Sun Feb 7 16:18:12 2016 New Revision: 295372 URL: https://svnweb.freebsd.org/changeset/base/295372 Log: Minor grammar fix in comment. Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Sun Feb 7 15:40:01 2016 (r295371) +++ head/sys/kern/vfs_bio.c Sun Feb 7 16:18:12 2016 (r295372) @@ -2245,7 +2245,7 @@ brelse(struct buf *bp) int qindex; /* - * Many function erroneously call brelse with a NULL bp under rare + * Many functions erroneously call brelse with a NULL bp under rare * error conditions. Simply return when called with a NULL bp. */ if (bp == NULL) From owner-svn-src-all@freebsd.org Sun Feb 7 16:41:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83331AA02CB; Sun, 7 Feb 2016 16:41:55 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 4C599DE9; Sun, 7 Feb 2016 16:41:55 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u17Gfscw034252; Sun, 7 Feb 2016 16:41:54 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u17GfsO7034250; Sun, 7 Feb 2016 16:41:54 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201602071641.u17GfsO7034250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sun, 7 Feb 2016 16:41:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295373 - head/share/examples/jails X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 16:41:55 -0000 Author: dteske Date: Sun Feb 7 16:41:54 2016 New Revision: 295373 URL: https://svnweb.freebsd.org/changeset/base/295373 Log: Add two scripts for vnet jails One for if_bridge(4) back-end, another for ng_bridge(4) back-end Sponsored by: FIS Global, Inc. Added: head/share/examples/jails/jib (contents, props changed) head/share/examples/jails/jng (contents, props changed) Added: head/share/examples/jails/jib ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/jails/jib Sun Feb 7 16:41:54 2016 (r295373) @@ -0,0 +1,367 @@ +#!/bin/sh +#- +# Copyright (c) 2016 Devin Teske +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +############################################################ IDENT(1) +# +# $Title: if_bridge(4) management script for vnet jails $ +# +############################################################ INFORMATION +# +# Use this tool with jail.conf(5) (or rc.conf(5) ``legacy'' configuration) to +# manage `vnet' interfaces. In jail.conf(5) format: +# +# ### BEGIN EXCERPT ### +# +# xxx { +# host.hostname = "xxx.yyy"; +# path = "/vm/xxx"; +# +# # +# # NB: Below 2-lines required +# # NB: The number of eNb_xxx interfaces should match the number of +# # arguments given to `jib addm xxx' in exec.prestart value. +# # +# vnet; +# vnet.interface = "e0b_xxx e1b_xxx ..."; +# +# exec.clean; +# exec.system_user = "root"; +# exec.jail_user = "root"; +# +# # +# # NB: Below 2-lines required +# # NB: The number of arguments after `jib addm xxx' should match +# # the number of eNb_xxx arguments in vnet.interface value. +# # +# exec.prestart += "jib addm xxx em0 em1 ..."; +# exec.poststop += "jib destroy xxx"; +# +# # Standard recipe +# exec.start += "/bin/sh /etc/rc"; +# exec.stop = "/bin/sh /etc/rc.shutdown"; +# exec.consolelog = "/var/log/jail_xxx_console.log"; +# mount.devfs; +# +# # Optional (default off) +# #allow.mount; +# #allow.set_hostname = 1; +# #allow.sysvipc = 1; +# #devfs_ruleset = "11"; # rule to unhide bpf for DHCP +# } +# +# ### END EXCERPT ### +# +# In rc.conf(5) ``legacy'' format (used when /etc/jail.conf does not exist): +# +# ### BEGIN EXCERPT ### +# +# jail_enable="YES" +# jail_list="xxx" +# +# # +# # Global presets for all jails +# # +# jail_devfs_enable="YES" # mount devfs +# +# # +# # Global options (default off) +# # +# #jail_mount_enable="YES" # mount /etc/fstab.{name} +# #jail_set_hostname_allow="YES" # Allow hostname to change +# #jail_sysvipc_allow="YES" # Allow SysV Interprocess Comm. +# +# # xxx +# jail_xxx_hostname="xxx.shxd.cx" # hostname +# jail_xxx_rootdir="/vm/xxx" # root directory +# jail_xxx_vnet_interfaces="e0b_xxx e1bxxx ..." # vnet interface(s) +# jail_xxx_exec_prestart0="jib addm xxx em0 em1 ..." # bridge interface(s) +# jail_xxx_exec_poststop0="jib destroy xxx" # destroy interface(s) +# #jail_xxx_mount_enable="YES" # mount /etc/fstab.xxx +# #jail_xxx_devfs_ruleset="11" # rule to unhide bpf for DHCP +# +# ### END EXCERPT ### +# +# Note that the legacy rc.conf(5) format is converted to +# /var/run/jail.{name}.conf by /etc/rc.d/jail if jail.conf(5) is missing. +# +# ASIDE: dhclient(8) inside a vnet jail... +# +# To allow dhclient(8) to work inside a vnet jail, make sure the following +# appears in /etc/devfs.rules (which should be created if it doesn't exist): +# +# [devfsrules_jail=11] +# add include $devfsrules_hide_all +# add include $devfsrules_unhide_basic +# add include $devfsrules_unhide_login +# add include $devfsrules_unhide_bpf +# +# And set ether devfs.ruleset="11" (jail.conf(5)) or +# jail_{name}_devfs_ruleset="11" (rc.conf(5)). +# +# NB: While this tool can't create every type of desirable topology, it should +# handle most setups, minus some which considered exotic or purpose-built. +# +############################################################ GLOBALS + +pgm="${0##*/}" # Program basename + +# +# Global exit status +# +SUCCESS=0 +FAILURE=1 + +############################################################ FUNCTIONS + +usage() +{ + local action usage descr + exec >&2 + echo "Usage: $pgm action [arguments]" + echo "Actions:" + for action in \ + addm \ + show \ + show1 \ + destroy \ + ; do + eval usage=\"\$jib_${action}_usage\" + [ "$usage" ] || continue + eval descr=\"\$jib_${action}_descr\" + printf "\t%s\n\t\t%s\n" "$usage" "$descr" + done + exit $FAILURE +} + +action_usage() +{ + local usage action="$1" + eval usage=\"\$jib_${action}_usage\" + echo "Usage: $pgm $usage" >&2 + exit $FAILURE +} + +mustberoot_to_continue() +{ + if [ "$( id -u )" -ne 0 ]; then + echo "Must run as root!" >&2 + exit $FAILURE + fi +} + +jib_addm_usage="addm [-b BRIDGE_NAME] NAME interface0 [interface1 ...]" +jib_addm_descr="Creates e0b_NAME [e1b_NAME ...]" +jib_addm() +{ + local OPTIND=1 OPTARG flag bridge=bridge + while getopts b: flag; do + case "$flag" in + b) bridge="${OPTARG:-bridge}" ;; + *) action_usage addm # NOTREACHED + esac + done + shift $(( $OPTIND - 1 )) + + local name="$1" + [ "${name:-x}" = "${name#*[!0-9a-zA-Z_]}" -a $# -gt 1 ] || + action_usage addm # NOTREACHED + shift 1 # name + + mustberoot_to_continue + + local iface iface_devid eiface_devid_a eiface_devid_b + local new num quad i=0 + for iface in $*; do + + # 1. Make sure the interface doesn't exist already + ifconfig "e${i}a_$name" > /dev/null 2>&1 && continue + + # 2. Bring the interface up + ifconfig $iface up || return + + # 3. Make sure the interface has been bridged + if ! ifconfig "$iface$bridge" > /dev/null 2>&1; then + new=$( ifconfig bridge create ) || return + ifconfig $new addm $iface || return + ifconfig $new name "$iface$bridge" || return + fi + + # 4. Create a new interface to the bridge + new=$( ifconfig epair create ) || return + ifconfig "$iface$bridge" addm $new || return + + # 5. Rename the new interface + ifconfig $new name "e${i}a_$name" || return + ifconfig ${new%a}b name "e${i}b_$name" || return + + # + # 6. Set the MAC address of the new interface using a sensible + # algorithm to prevent conflicts on the network. + # + # The formula I'm using is ``SP:SS:SI:II:II:II'' where: + # + S denotes 16 bits of sum(1) data, split because P (below). + # + P denotes the special nibble whose value, if one of + # 2, 6, A, or E (but usually 2) denotes a privately + # administered MAC address (while remaining routable). + # + I denotes bits that are inherited from parent interface. + # + # The S bits are a CRC-16 checksum of NAME, allowing the jail + # to change the epair(4) generation order without affecting the + # MAC address. Meanwhile, if the jail NAME changes (e.g., it + # was duplicated and given a new name with no other changes), + # the underlying network interface changes, or the jail is + # moved to another host, the MAC address will be recalculated + # to a new, similarly unique value preventing conflict. + # + iface_devid=$( ifconfig $iface ether | awk '/ether/,$0=$2' ) + eiface_devid_a=${iface_devid#??:??:?} + eiface_devid_b=${iface_devid#??:??:?} + num=$( set -- `echo -n $name | sum` && echo $1 ) + quad=$(( $num & 15 )) + case "$quad" in + 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; + 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; + esac + eiface_devid_a=:$quad$eiface_devid_a + eiface_devid_b=:$quad$eiface_devid_b + num=$(( $num >> 4 )) + quad=$(( $num & 15 )) + case "$quad" in + 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; + 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; + esac + eiface_devid_a=$quad$eiface_devid_a + eiface_devid_b=$quad$eiface_devid_b + num=$(( $num >> 4 )) + quad=$(( $num & 15 )) + case "$quad" in + 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; + 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; + esac + eiface_devid_a=2:$quad$eiface_devid_a + eiface_devid_b=6:$quad$eiface_devid_b + num=$(( $num >> 4 )) + quad=$(( $num & 15 )) + case "$quad" in + 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; + 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; + esac + eiface_devid_a=$quad$eiface_devid_a + eiface_devid_b=$quad$eiface_devid_b + ifconfig "e${i}a_$name" ether $eiface_devid_a > /dev/null 2>&1 + ifconfig "e${i}b_$name" ether $eiface_devid_b > /dev/null 2>&1 + + i=$(( $i + 1 )) # on to next ng{i}_name + done # for iface +} + +jib_show_usage="show" +jib_show_descr="List possible NAME values for \`show NAME'" +jib_show1_usage="show NAME" +jib_show1_descr="Lists ng0_NAME [ng1_NAME ...]" +jib_show2_usage="show [NAME]" +jib_show() +{ + local OPTIND=1 OPTARG flag + while getopts "" flag; do + case "$flag" in + *) action_usage show2 # NOTREACHED + esac + done + shift $(( $OPTIND - 1 )) + if [ $# -eq 0 ]; then + ifconfig | awk ' + /^[^:[:space:]]+:/ { + iface = $1 + sub(/:.*/, "", iface) + next + } + $1 == "groups:" { + for (n = split($0, group); n > 1; n--) { + if (group[n] != "bridge") continue + print iface + next + } + }' | + xargs -rn1 ifconfig | + awk '$1 == "member:" && + sub(/^e[[:digit:]]+a_/, "", $2), $0 = $2' | + sort -u + return + fi + ifconfig | awk -v name="$1" ' + match($0, /^e[[:digit:]]+a_/) && sub(/:.*/, "") && + substr($1, RSTART + RLENGTH) == name + ' | sort +} + +jib_destroy_usage="destroy NAME" +jib_destroy_descr="Destroy e0b_NAME [e1b_NAME ...]" +jib_destroy() +{ + local OPTIND=1 OPTARG flag + while getopts "" flag; do + case "$flag" in + *) action_usage destroy # NOTREACHED + esac + done + shift $(( $OPTIND -1 )) + local name="$1" + [ "${name:-x}" = "${name#*[!0-9a-zA-Z_]}" -a $# -eq 1 ] || + action_usage destroy # NOTREACHED + mustberoot_to_continue + jib_show "$name" | xargs -rn1 -I eiface ifconfig eiface destroy +} + +############################################################ MAIN + +# +# Command-line arguments +# +action="$1" +[ "$action" ] || usage # NOTREACHED + +# +# Validate action argument +# +if [ "$BASH_VERSION" ]; then + type="$( type -t "jib_$action" )" || usage # NOTREACHED +else + type="$( type "jib_$action" 2> /dev/null )" || usage # NOTREACHED +fi +case "$type" in +*function) + shift 1 # action + eval "jib_$action" \"\$@\" + ;; +*) usage # NOTREACHED +esac + +################################################################################ +# END +################################################################################ Added: head/share/examples/jails/jng ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/jails/jng Sun Feb 7 16:41:54 2016 (r295373) @@ -0,0 +1,416 @@ +#!/bin/sh +#- +# Copyright (c) 2016 Devin Teske +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +############################################################ IDENT(1) +# +# $Title: netgraph(4) management script for vnet jails $ +# +############################################################ INFORMATION +# +# Use this tool with jail.conf(5) (or rc.conf(5) ``legacy'' configuration) to +# manage `vnet' interfaces. In jail.conf(5) format: +# +# ### BEGIN EXCERPT ### +# +# xxx { +# host.hostname = "xxx.yyy"; +# path = "/vm/xxx"; +# +# # +# # NB: Below 2-lines required +# # NB: The number of ngN_xxx interfaces should match the number of +# # arguments given to `jng bridge xxx' in exec.prestart value. +# # +# vnet; +# vnet.interface = "ng0_xxx ng1_xxx ..."; +# +# exec.clean; +# exec.system_user = "root"; +# exec.jail_user = "root"; +# +# # +# # NB: Below 2-lines required +# # NB: The number of arguments after `jng bridge xxx' should match +# # the number of ngN_xxx arguments in vnet.interface value. +# # +# exec.prestart += "jng bridge xxx em0 em1 ..."; +# exec.poststop += "jng shutdown xxx"; +# +# # Standard recipe +# exec.start += "/bin/sh /etc/rc"; +# exec.stop = "/bin/sh /etc/rc.shutdown"; +# exec.consolelog = "/var/log/jail_xxx_console.log"; +# mount.devfs; +# +# # Optional (default off) +# #allow.mount; +# #allow.set_hostname = 1; +# #allow.sysvipc = 1; +# #devfs_ruleset = "11"; # rule to unhide bpf for DHCP +# } +# +# ### END EXCERPT ### +# +# In rc.conf(5) ``legacy'' format (used when /etc/jail.conf does not exist): +# +# ### BEGIN EXCERPT ### +# +# jail_enable="YES" +# jail_list="xxx" +# +# # +# # Global presets for all jails +# # +# jail_devfs_enable="YES" # mount devfs +# +# # +# # Global options (default off) +# # +# #jail_mount_enable="YES" # mount /etc/fstab.{name} +# #jail_set_hostname_allow="YES" # Allow hostname to change +# #jail_sysvipc_allow="YES" # Allow SysV Interprocess Comm. +# +# # xxx +# jail_xxx_hostname="xxx.shxd.cx" # hostname +# jail_xxx_rootdir="/vm/xxx" # root directory +# jail_xxx_vnet_interfaces="ng0_xxx ng1xxx ..." # vnet interface(s) +# jail_xxx_exec_prestart0="jng bridge xxx em0 em1 ..." # bridge interface(s) +# jail_xxx_exec_poststop0="jng shutdown xxx" # destroy interface(s) +# #jail_xxx_mount_enable="YES" # mount /etc/fstab.xxx +# #jail_xxx_devfs_ruleset="11" # rule to unhide bpf for DHCP +# +# ### END EXCERPT ### +# +# Note that the legacy rc.conf(5) format is converted to +# /var/run/jail.{name}.conf by /etc/rc.d/jail if jail.conf(5) is missing. +# +# ASIDE: dhclient(8) inside a vnet jail... +# +# To allow dhclient(8) to work inside a vnet jail, make sure the following +# appears in /etc/devfs.rules (which should be created if it doesn't exist): +# +# [devfsrules_jail=11] +# add include $devfsrules_hide_all +# add include $devfsrules_unhide_basic +# add include $devfsrules_unhide_login +# add include $devfsrules_unhide_bpf +# +# And set ether devfs.ruleset="11" (jail.conf(5)) or +# jail_{name}_devfs_ruleset="11" (rc.conf(5)). +# +# NB: While this tool can't create every type of desirable topology, it should +# handle most setups, minus some which considered exotic or purpose-built. +# +############################################################ GLOBALS + +pgm="${0##*/}" # Program basename + +# +# Global exit status +# +SUCCESS=0 +FAILURE=1 + +############################################################ FUNCTIONS + +usage() +{ + local action usage descr + exec >&2 + echo "Usage: $pgm action [arguments]" + echo "Actions:" + for action in \ + bridge \ + graph \ + show \ + show1 \ + shutdown \ + ; do + eval usage=\"\$jng_${action}_usage\" + [ "$usage" ] || continue + eval descr=\"\$jng_${action}_descr\" + printf "\t%s\n\t\t%s\n" "$usage" "$descr" + done + exit $FAILURE +} + +action_usage() +{ + local usage action="$1" + eval usage=\"\$jng_${action}_usage\" + echo "Usage: $pgm $usage" >&2 + exit $FAILURE +} + +mustberoot_to_continue() +{ + if [ "$( id -u )" -ne 0 ]; then + echo "Must run as root!" >&2 + exit $FAILURE + fi +} + +jng_bridge_usage="bridge [-b BRIDGE_NAME] NAME interface0 [interface1 ...]" +jng_bridge_descr="Create ng0_NAME [ng1_NAME ...]" +jng_bridge() +{ + local OPTIND=1 OPTARG flag bridge=bridge + while getopts b: flag; do + case "$flag" in + b) bridge="$OPTARG" + [ "$bridge" ] || action_usage bridge ;; # NOTREACHED + *) action_usage bridge # NOTREACHED + esac + done + shift $(( $OPTIND - 1 )) + + local name="$1" + [ "${name:-x}" = "${name#*[!0-9a-zA-Z_]}" -a $# -gt 1 ] || + action_usage bridge # NOTREACHED + shift 1 # name + + mustberoot_to_continue + + local iface iface_devid eiface eiface_devid + local new num quad i=0 + for iface in $*; do + + # 0. Make sure the interface doesn't exist already + eiface=ng${i}_$name + ngctl msg "$eiface:" getifname > /dev/null 2>&1 && continue + + # 1. Bring the interface up + ifconfig $iface up || return + + # 2. Set promiscuous mode and don't overwrite src addr + ngctl msg $iface: setpromisc 1 || return + ngctl msg $iface: setautosrc 0 || return + + # 3. Make sure the interface has been bridged + if ! ngctl info ${iface}bridge: > /dev/null 2>&1; then + ngctl mkpeer $iface: bridge lower link0 || return + ngctl connect $iface: $iface:lower upper link1 || + return + ngctl name $iface:lower ${iface}bridge || return + fi + + # 3.5. Optionally create a secondary bridge + if [ "$bridge" != "bridge" ] && + ! ngctl info "$iface$bridge:" > /dev/null 2>&1 + then + num=2 + while ngctl msg ${iface}bridge: getstats $num \ + > /dev/null 2>&1 + do + num=$(( $num + 1 )) + done + ngctl mkpeer $iface:lower bridge link$num link1 || + return + ngctl name ${iface}bridge:link$num "$iface$bridge" || + return + fi + + # 4. Create a new interface to the bridge + num=2 + while ngctl msg "$iface$bridge:" getstats $num > /dev/null 2>&1 + do + num=$(( $num + 1 )) + done + ngctl mkpeer "$iface$bridge:" eiface link$num ether || return + + # 5. Rename the new interface + while [ ${#eiface} -gt 15 ]; do # OS limitation + eiface=${eiface%?} + done + new=$( set -- `ngctl show -n "$iface$bridge:link$num"` && + echo $2 ) || return + ngctl name "$iface$bridge:link$num" $eiface || return + ifconfig $new name $eiface || return + + # + # 6. Set the MAC address of the new interface using a sensible + # algorithm to prevent conflicts on the network. + # + # The formula I'm using is ``SP:SS:SI:II:II:II'' where: + # + S denotes 16 bits of sum(1) data, split because P (below). + # + P denotes the special nibble whose value, if one of + # 2, 6, A, or E (but usually 2) denotes a privately + # administered MAC address (while remaining routable). + # + I denotes bits that are inherited from parent interface. + # + # The S bits are a CRC-16 checksum of NAME, allowing the jail + # to change link numbers in ng_bridge(4) without affecting the + # MAC address. Meanwhile, if the jail NAME changes (e.g., it + # was duplicated and given a new name with no other changes), + # the underlying network interface changes, or the jail is + # moved to another host, the MAC address will be recalculated + # to a new, similarly unique value preventing conflict. + # + iface_devid=$( ifconfig $iface ether | awk '/ether/,$0=$2' ) + eiface_devid=${iface_devid#??:??:?} + num=$( set -- `echo -n $name | sum` && echo $1 ) + quad=$(( $num & 15 )) + case "$quad" in + 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; + 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; + esac + eiface_devid=:$quad$eiface_devid + num=$(( $num >> 4 )) + quad=$(( $num & 15 )) + case "$quad" in + 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; + 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; + esac + eiface_devid=$quad$eiface_devid + num=$(( $num >> 4 )) + quad=$(( $num & 15 )) + case "$quad" in + 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; + 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; + esac + eiface_devid=2:$quad$eiface_devid + num=$(( $num >> 4 )) + quad=$(( $num & 15 )) + case "$quad" in + 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; + 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; + esac + eiface_devid=$quad$eiface_devid + ifconfig $eiface ether $eiface_devid > /dev/null 2>&1 + + i=$(( $i + 1 )) # on to next ng{i}_name + done # for iface +} + +jng_graph_usage="graph [-f] [-T type] [-o output]" +jng_graph_descr="Generate network graph (default output is \`jng.svg')" +jng_graph() +{ + local OPTIND=1 OPTARG flag + local output=jng.svg output_type= force= + while getopts fo:T: flag; do + case "$flag" in + f) force=1 ;; + o) output="$OPTARG" ;; + T) output_type="$OPTARG" ;; + *) action_usage graph # NOTREACHED + esac + done + shift $(( $OPTIND - 1 )) + [ $# -eq 0 -a "$output" ] || action_usage graph # NOTREACHED + mustberoot_to_continue + if [ -e "$output" -a ! "$force" ]; then + echo "$output: Already exists (use \`-f' to overwrite)" >&2 + return $FAILURE + fi + if [ ! "$output_type" ]; then + local valid suffix + valid=$( dot -Txxx 2>&1 ) + for suffix in ${valid##*:}; do + [ "$output" != "${output%.$suffix}" ] || continue + output_type=$suffix + break + done + fi + ngctl dot | dot ${output_type:+-T "$output_type"} -o "$output" +} + +jng_show_usage="show" +jng_show_descr="List possible NAME values for \`show NAME'" +jng_show1_usage="show NAME" +jng_show1_descr="Lists ng0_NAME [ng1_NAME ...]" +jng_show2_usage="show [NAME]" +jng_show() +{ + local OPTIND=1 OPTARG flag + while getopts "" flag; do + case "$flag" in + *) action_usage show2 # NOTREACHED + esac + done + shift $(( $OPTIND - 1 )) + mustberoot_to_continue + if [ $# -eq 0 ]; then + ngctl ls | awk '$4=="bridge",$0=$2' | + xargs -rn1 -Ibridge ngctl show bridge: | + awk 'sub(/^ng[[:digit:]]+_/, "", $2), $0 = $2' | + sort -u + return + fi + ngctl ls | awk -v name="$1" ' + match($2, /^ng[[:digit:]]+_/) && + substr($2, RSTART + RLENGTH) == name && + $4 == "eiface", $0 = $2 + ' | sort +} + +jng_shutdown_usage="shutdown NAME" +jng_shutdown_descr="Shutdown ng0_NAME [ng1_NAME ...]" +jng_shutdown() +{ + local OPTIND=1 OPTARG flag + while getopts "" flag; do + case "$flag" in + *) action_usage shutdown # NOTREACHED + esac + done + shift $(( $OPTIND -1 )) + local name="$1" + [ "${name:-x}" = "${name#*[!0-9a-zA-Z_]}" -a $# -eq 1 ] || + action_usage shutdown # NOTREACHED + mustberoot_to_continue + jng_show "$name" | xargs -rn1 -I eiface ngctl shutdown eiface: +} + +############################################################ MAIN + +# +# Command-line arguments +# +action="$1" +[ "$action" ] || usage # NOTREACHED + +# +# Validate action argument +# +if [ "$BASH_VERSION" ]; then + type="$( type -t "jng_$action" )" || usage # NOTREACHED +else + type="$( type "jng_$action" 2> /dev/null )" || usage # NOTREACHED +fi +case "$type" in +*function) + shift 1 # action + eval "jng_$action" \"\$@\" + ;; +*) usage # NOTREACHED +esac + +################################################################################ +# END +################################################################################ From owner-svn-src-all@freebsd.org Sun Feb 7 16:43:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4A17AA052A; Sun, 7 Feb 2016 16:43:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 64A491187; Sun, 7 Feb 2016 16:43:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u17GhtXA034480; Sun, 7 Feb 2016 16:43:55 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u17Ghtvb034479; Sun, 7 Feb 2016 16:43:55 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201602071643.u17Ghtvb034479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 7 Feb 2016 16:43:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295374 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 16:43:56 -0000 Author: imp Date: Sun Feb 7 16:43:55 2016 New Revision: 295374 URL: https://svnweb.freebsd.org/changeset/base/295374 Log: Various fixups: o Make sure we create bsd label for MBR scheme (though we don't really need it for the efi case, and boot1 can't read it). Add notes about why we have to do this, at least for BIOS. o Make the BIOS / UEFI with gpt config work. o Remove now-moribund packaging stuff Modified: head/tools/tools/nanobsd/embedded/common Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Sun Feb 7 16:41:54 2016 (r295373) +++ head/tools/tools/nanobsd/embedded/common Sun Feb 7 16:43:55 2016 (r295374) @@ -76,7 +76,7 @@ fi NANO_SLICE_FAT_SIZE=32m NANO_SLICE_CFG_SIZE=32m -NANO_BOOT2CFG="-D -h -S115200 comconsole_port=0x3e8" +NANO_BOOT2CFG="-P -S115200" NANO_RAM_ETCSIZE=8192 NANO_RAM_TMPVARSIZE=8192 @@ -180,105 +180,14 @@ WITHOUT_RCS=true NANO_PACKAGE_ONLY=1 -# install a package from a pre-built binary -do_add_pkg ( ) ( - # Need to create ${NANO_OBJ}/ports in this add_pkg_${port} function - set -x - mkdir -p ${NANO_OBJ}/ports/distfiles - mkdir -p ${NANO_OBJ}/ports/packages - mkdir -p ${NANO_WORLDDIR}/usr/ports/packages - mkdir -p ${NANO_WORLDDIR}/usr/ports/distfiles - mount -t nullfs -o noatime ${NANO_OBJ}/ports/packages \ - ${NANO_WORLDDIR}/usr/ports/packages - mount -t nullfs -o noatime ${NANO_OBJ}/ports/distfiles \ - ${NANO_WORLDDIR}/usr/ports/distfiles - CR env ASSUME_ALWAYS_YES=YES SIGNATURE_TYPE=none /usr/sbin/pkg add /usr/ports/packages/All/$1.txz - umount ${NANO_WORLDDIR}/usr/ports/distfiles - umount ${NANO_WORLDDIR}/usr/ports/packages - rmdir ${NANO_WORLDDIR}/usr/ports/packages - rmdir ${NANO_WORLDDIR}/usr/ports/distfiles - rmdir ${NANO_WORLDDIR}/usr/ports - set +x -) - -# Build a port (with the side effect of creating a package) -do_add_port ( ) ( - local port_path - port_path=$1 - shift - set -x - # Need to create ${NANO_OBJ}/ports in this add_port_${port} function - mkdir -p ${NANO_OBJ}/ports/distfiles - mkdir -p ${NANO_OBJ}/ports/packages - mkdir -p ${NANO_PORTS}/packages - mkdir -p ${NANO_PORTS}/distfiles - mkdir -p ${NANO_WORLDDIR}/usr/src - mkdir -p ${NANO_WORLDDIR}/usr/ports - mount -t nullfs -o noatime ${NANO_SRC} ${NANO_WORLDDIR}/usr/src - mount -t nullfs -o noatime ${NANO_PORTS} ${NANO_WORLDDIR}/usr/ports - mount -t nullfs -o noatime ${NANO_OBJ}/ports/packages \ - ${NANO_WORLDDIR}/usr/ports/packages - mount -t nullfs -o noatime ${NANO_OBJ}/ports/distfiles \ - ${NANO_WORLDDIR}/usr/ports/distfiles - mkdir -p ${NANO_WORLDDIR}/dev - mount -t devfs devfs ${NANO_WORLDDIR}/dev - mkdir -p ${NANO_WORLDDIR}/usr/workdir - cp /etc/resolv.conf ${NANO_WORLDDIR}/etc/resolv.conf - # OK, a little inefficient, but likely not enough to worry about. - CR ldconfig /lib /usr/lib /usr/local/lib - CR ldconfig -R - CR ldconfig -r -# Improvement: Don't know why package-recursive don't works here - CR "env UNAME_p=${NANO_ARCH} TARGET=${NANO_ARCH} \ - TARGET_ARCH=${NANO_ARCH} PORTSDIR=${NANO_PORTS} make \ - __MAKE_CONF=${NANO_MAKE_CONF_BUILD} \ - WRKDIRPREFIX=/usr/workdir -C /usr/ports/$port_path \ - package-recursive BATCH=yes $* clean FORCE_PKG_REGISTER=t" - rm ${NANO_WORLDDIR}/etc/resolv.conf - rm -rf ${NANO_WORLDDIR}/usr/obj - rm -rf ${NANO_WORLDDIR}/usr/workdir - umount ${NANO_WORLDDIR}/dev - umount ${NANO_WORLDDIR}/usr/ports/packages - umount ${NANO_WORLDDIR}/usr/ports/distfiles - umount ${NANO_WORLDDIR}/usr/ports - umount ${NANO_WORLDDIR}/usr/src - set +x -) - -# Need to check if this function works with cross-compiling architecture!!!! -# Recursive complex fonction: Generate one function for each ports -# writes shell functions called later, so don't do in subshell. -add_port ( ) { - local port_path=$1 - local port=`echo $1 | sed -e 's/\//_/'` - shift - # Check if package allready exist - # Need to: - # 1. check ARCH of this package! - # 2. Add a trap - cd ${NANO_PORTS}/${port_path} - PKG_NAME=`env PORTSDIR=${NANO_PORTS} make __MAKE_CONF=${NANO_MAKE_CONF_BUILD} package-name` - if [ -f ${NANO_OBJ}/ports/packages/All/${PKG_NAME}.txz ]; then - # Pkg file found: Generate add_pkg_NAME function - eval " - add_pkg_${port} ( ) { - do_add_pkg ${PKG_NAME} - } - customize_cmd add_pkg_${port} - " - else - # No pkg file: Generate add_port_NAME function - eval " - add_port_${port} ( ) { - do_add_port ${port_path} $* - } - customize_cmd add_port_${port} - " - NANO_PACKAGE_ONLY=0 - fi -} +# Creates images for all the formats that use MBR / GPT +# split later if the #ifdef soup gets too bad. +create_diskimage_gpt ( ) ( + pprint 2 "build diskimage gpt ${NANO_NAME}" + + create_diskimage_mbr $* +) -# Creates images for all the formats that use MBR create_diskimage_mbr ( ) ( pprint 2 "build diskimage ${NANO_NAME}" @@ -319,10 +228,20 @@ create_diskimage_mbr ( ) ( # bsd label [ -z ${NANO_NOPRIV_BUILD} ] || extra="-F ${NANO_METALOG}" sz=${NANO_SLICE_ROOT_SIZE:+-s ${NANO_SLICE_ROOT_SIZE}} - eval "${NANO_MAKEFS_UFS}" ${extra} $sz "${NANO_OBJ}/_.${NANO_SLICE_ROOT}" \ + eval "${NANO_MAKEFS_UFS}" ${extra} $sz "${NANO_OBJ}/_.${NANO_ROOT}" \ "${NANO_WORLDDIR}" -# mkimg -s bsd ${bootbsd} -p freebsd-ufs:=${NANO_OBJ}/_.${NANO_SLICE_ROOT} \ -# -o ${NANO_OBJ}/_.${NANO_SLICE_ROOT} + case ${NANO_DISK_SCHEME} in + mbr) + mkimg -s bsd ${bootbsd} -p freebsd-ufs:=${NANO_OBJ}/_.${NANO_ROOT} \ + -o ${NANO_OBJ}/_.${NANO_SLICE_ROOT} + eval $NANO_SLICE_CFG=freebsd + eval $NANO_SLICE_ROOT=freebsd + ;; + gpt) + eval $NANO_SLICE_CFG=freebsd-ufs + eval $NANO_SLICE_ROOT=freebsd-ufs + ;; + esac # Populate the /cfg partition, empty if none given if [ -z "${NANO_CFGDIR}" ]; then @@ -341,18 +260,7 @@ create_diskimage_mbr ( ) ( if [ -n "$NANO_SLICE_FAT" ]; then eval $NANO_SLICE_FAT=fat16b fi - case ${NANO_SLICE_CFG} in - s*) - echo slice - eval $NANO_SLICE_CFG=freebsd - eval $NANO_SLICE_ROOT=freebsd - ;; - p*) - echo part - eval $NANO_SLICE_CFG=freebsd-ufs - eval $NANO_SLICE_ROOT=freebsd-ufs - ;; - esac + # below depends on https://reviews.freebsd.org/D4403 not yet in the tree # but there's problems: it marks all partitions as active, so you have to # boot off parittion 3 or 2 by hand if you're playing around with this WIP @@ -662,11 +570,21 @@ eval std_${NANO_ARCH} # off the top. We also resize the 'a' partion on first boot # to the size of the partition for the ping/pong upgrade. # This feature needs support in the rc.d bootup script. +# +# Ideally, we'd not put BSD labels on the MBR disks. +# However, we can't boot off raw MBR disks. First, +# boot2 defaults to 'a' partition, and freaks out +# unless you tell it to use 'c'. But even if we +# hack that, then /boot/loader wants to load off +# of 'c' partition. If you fix that, then we'll +# try to mount root, but sanity checks prevent +# slices from working. +# : ${NANO_ENDIAN:=little} # make -V something to figure it out? : ${NANO_LAYOUT:=std-embedded} : ${NANO_MAKEFS_UFS:=makefs -t ffs -B ${NANO_ENDIAN}} -: ${NANO_DISK_SCHEME:=mbr} # No others really supported ATM +: ${NANO_DISK_SCHEME:=mbr} # No others really supported ATM (well, gpt) case ${NANO_LAYOUT} in std-embedded) NANO_SLICE_FAT=s1 @@ -696,11 +614,15 @@ std-uefi) NANO_SLICE_ALTROOT=s4 ;; std-uefi-bios) + NANO_DISK_SCHEME=gpt NANO_SLICE_UEFI=p1 NANO_SLICE_BOOT=p2 NANO_SLICE_CFG=p3 NANO_SLICE_ROOT=p4 NANO_SLICE_ALTROOT=p5 + # override root name + NANO_ROOT=${NANO_SLICE_ROOT} + NANO_ALTROOT=${NANO_SLICE_ALTROOT} ;; *) echo Unknown Layout ${NANO_LAYOUT} @@ -708,10 +630,6 @@ std-uefi-bios) ;; esac -# For this config, no BSD labels so NANO_ROOT and NANO_ALTROOT need to be -# adjusted -NANO_ROOT=${NANO_SLICE_ROOT} -NANO_ALTROOT=${NANO_SLICE_ALTROOT} NANO_SLICE_DATA= # Not included From owner-svn-src-all@freebsd.org Sun Feb 7 16:44:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15983AA0569; Sun, 7 Feb 2016 16:44:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 C162412D4; Sun, 7 Feb 2016 16:44:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u17Gi4jV034547; Sun, 7 Feb 2016 16:44:04 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u17Gi4Qb034546; Sun, 7 Feb 2016 16:44:04 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201602071644.u17Gi4Qb034546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 7 Feb 2016 16:44:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295375 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 16:44:06 -0000 Author: imp Date: Sun Feb 7 16:44:04 2016 New Revision: 295375 URL: https://svnweb.freebsd.org/changeset/base/295375 Log: Add simple config for i386 BIOS boot. Added: head/tools/tools/nanobsd/embedded/i386.cfg (contents, props changed) Added: head/tools/tools/nanobsd/embedded/i386.cfg ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/nanobsd/embedded/i386.cfg Sun Feb 7 16:44:04 2016 (r295375) @@ -0,0 +1,34 @@ +# $FreeBSD$ + +#- +# Copyright (c) 2015 Warner Losh. All Rights Reserved. +# Copyright (c) 2010-2011 iXsystems, Inc., All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL iXsystems, Inc. OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +NANO_ARCH=i386 +NANO_KERNEL=GENERIC +NANO_DRIVE=ada0 +NANO_NAME=i386 + +. common # Pull in common definitions, keep last From owner-svn-src-all@freebsd.org Sun Feb 7 16:44:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 974FBAA0571; Sun, 7 Feb 2016 16:44:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 5430C12D6; Sun, 7 Feb 2016 16:44:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u17Gi6TO034591; Sun, 7 Feb 2016 16:44:06 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u17Gi6qE034590; Sun, 7 Feb 2016 16:44:06 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201602071644.u17Gi6qE034590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 7 Feb 2016 16:44:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295376 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 16:44:07 -0000 Author: imp Date: Sun Feb 7 16:44:06 2016 New Revision: 295376 URL: https://svnweb.freebsd.org/changeset/base/295376 Log: Use NANO_LOG instead of NANO_OBJ for log file locations. Have it default to NANO_OBJ. Modified: head/tools/tools/nanobsd/defaults.sh (contents, props changed) Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Sun Feb 7 16:44:04 2016 (r295375) +++ head/tools/tools/nanobsd/defaults.sh Sun Feb 7 16:44:06 2016 (r295376) @@ -356,7 +356,7 @@ clean_world ( ) ( rm -r ${NANO_OBJ}/ fi mkdir -p "${NANO_OBJ}" "${NANO_WORLDDIR}" - printenv > ${NANO_OBJ}/_.env + printenv > ${NANO_LOG}/_.env else pprint 2 "Clean and create world directory (${NANO_WORLDDIR})" if ! rm -rf "${NANO_WORLDDIR}/" > /dev/null 2>&1 ; then @@ -385,7 +385,7 @@ make_conf_install ( ) ( install_world ( ) ( pprint 2 "installworld" - pprint 3 "log: ${NANO_OBJ}/_.iw" + pprint 3 "log: ${NANO_LOG}/_.iw" ( nano_make_install_env @@ -393,13 +393,13 @@ install_world ( ) ( cd "${NANO_SRC}" ${NANO_MAKE} installworld DESTDIR="${NANO_WORLDDIR}" chflags -R noschg "${NANO_WORLDDIR}" - ) > ${NANO_OBJ}/_.iw 2>&1 + ) > ${NANO_LOG}/_.iw 2>&1 ) install_etc ( ) ( pprint 2 "install /etc" - pprint 3 "log: ${NANO_OBJ}/_.etc" + pprint 3 "log: ${NANO_LOG}/_.etc" ( nano_make_install_env @@ -409,14 +409,14 @@ install_etc ( ) ( # make.conf doesn't get created by default, but some ports need it # so they can spam it. cp /dev/null "${NANO_WORLDDIR}"/etc/make.conf - ) > ${NANO_OBJ}/_.etc 2>&1 + ) > ${NANO_LOG}/_.etc 2>&1 ) install_kernel ( ) ( local extra pprint 2 "install kernel ($NANO_KERNEL)" - pprint 3 "log: ${NANO_OBJ}/_.ik" + pprint 3 "log: ${NANO_LOG}/_.ik" ( @@ -432,12 +432,12 @@ install_kernel ( ) ( cd "${NANO_SRC}" ${NANO_MAKE} installkernel DESTDIR="${NANO_WORLDDIR}" - ) > ${NANO_OBJ}/_.ik 2>&1 + ) > ${NANO_LOG}/_.ik 2>&1 ) native_xtools ( ) ( print 2 "Installing the optimized native build tools for cross env" - pprint 3 "log: ${NANO_OBJ}/_.native_xtools" + pprint 3 "log: ${NANO_LOG}/_.native_xtools" ( @@ -446,7 +446,7 @@ native_xtools ( ) ( cd "${NANO_SRC}" ${NANO_MAKE} native-xtools DESTDIR="${NANO_WORLDDIR}" - ) > ${NANO_OBJ}/_.native_xtools 2>&1 + ) > ${NANO_LOG}/_.native_xtools 2>&1 ) # @@ -460,9 +460,9 @@ run_customize ( ) ( for c in $NANO_CUSTOMIZE do pprint 2 "customize \"$c\"" - pprint 3 "log: ${NANO_OBJ}/_.cust.$c" + pprint 3 "log: ${NANO_LOG}/_.cust.$c" pprint 4 "`type $c`" - ( set -x ; $c ) > ${NANO_OBJ}/_.cust.$c 2>&1 + ( set -x ; $c ) > ${NANO_LOG}/_.cust.$c 2>&1 done ) @@ -476,9 +476,9 @@ run_late_customize ( ) ( for c in $NANO_LATE_CUSTOMIZE do pprint 2 "late customize \"$c\"" - pprint 3 "log: ${NANO_OBJ}/_.late_cust.$c" + pprint 3 "log: ${NANO_LOG}/_.late_cust.$c" pprint 4 "`type $c`" - ( set -x ; $c ) > ${NANO_OBJ}/_.late_cust.$c 2>&1 + ( set -x ; $c ) > ${NANO_LOG}/_.late_cust.$c 2>&1 done ) @@ -510,7 +510,7 @@ fixup_before_diskimage ( ) ( setup_nanobsd ( ) ( pprint 2 "configure nanobsd setup" - pprint 3 "log: ${NANO_OBJ}/_.dl" + pprint 3 "log: ${NANO_LOG}/_.dl" ( cd "${NANO_WORLDDIR}" @@ -547,7 +547,7 @@ setup_nanobsd ( ) ( # Put /tmp on the /var ramdisk (could be symlink already) tgt_dir2symlink tmp var/tmp - ) > ${NANO_OBJ}/_.dl 2>&1 + ) > ${NANO_LOG}/_.dl 2>&1 ) setup_nanobsd_etc ( ) ( @@ -630,7 +630,7 @@ populate_data_slice ( ) ( create_diskimage ( ) ( pprint 2 "build diskimage" - pprint 3 "log: ${NANO_OBJ}/_.di" + pprint 3 "log: ${NANO_LOG}/_.di" ( echo $NANO_MEDIASIZE $NANO_IMAGES \ @@ -699,7 +699,7 @@ create_diskimage ( ) ( # for booting the image from a USB device to work. print "a 1" } - ' > ${NANO_OBJ}/_.fdisk + ' > ${NANO_LOG}/_.fdisk IMG=${NANO_DISKIMGDIR}/${NANO_IMGNAME} MNT=${NANO_OBJ}/_.mnt @@ -718,7 +718,7 @@ create_diskimage ( ) ( trap "echo 'Running exit trap code' ; df -i ${MNT} ; nano_umount ${MNT} || true ; mdconfig -d -u $MD" 1 2 15 EXIT - fdisk -i -f ${NANO_OBJ}/_.fdisk ${MD} + fdisk -i -f ${NANO_LOG}/_.fdisk ${MD} fdisk ${MD} # XXX: params # XXX: pick up cached boot* files, they may not be in image anymore. @@ -736,8 +736,8 @@ create_diskimage ( ) ( populate_slice /dev/${MD}${NANO_ROOT} ${NANO_WORLDDIR} ${MNT} "${NANO_ROOT}" mount /dev/${MD}${NANO_ROOT} ${MNT} echo "Generating mtree..." - ( cd "${MNT}" && mtree -c ) > ${NANO_OBJ}/_.mtree - ( cd "${MNT}" && du -k ) > ${NANO_OBJ}/_.du + ( cd "${MNT}" && mtree -c ) > ${NANO_LOG}/_.mtree + ( cd "${MNT}" && du -k ) > ${NANO_LOG}/_.du nano_umount "${MNT}" if [ $NANO_IMAGES -gt 1 -a $NANO_INIT_IMG2 -gt 0 ] ; then @@ -792,7 +792,7 @@ create_diskimage ( ) ( trap - 1 2 15 trap nano_cleanup EXIT - ) > ${NANO_OBJ}/_.di 2>&1 + ) > ${NANO_LOG}/_.di 2>&1 ) last_orders ( ) ( @@ -1026,7 +1026,8 @@ set_defaults_and_export ( ) { : ${NANO_OBJ:=/usr/obj/nanobsd.${NANO_NAME}} : ${MAKEOBJDIRPREFIX:=${NANO_OBJ}} : ${NANO_DISKIMGDIR:=${NANO_OBJ}} - NANO_WORLDDIR=${NANO_OBJ}/_.w + : ${NANO_WORLDDIR:=${NANO_OBJ}/_.w} + : ${NANO_LOG:=${NANO_OBJ}} NANO_MAKE_CONF_BUILD=${MAKEOBJDIRPREFIX}/make.conf.build NANO_MAKE_CONF_INSTALL=${NANO_OBJ}/make.conf.install @@ -1070,6 +1071,7 @@ set_defaults_and_export ( ) { export_var NANO_MODULES export_var NANO_NOPRIV_BUILD export_var NANO_METALOG + export_var NANO_LOG export_var SRCCONF export_var SRC_ENV_CONF } From owner-svn-src-all@freebsd.org Sun Feb 7 16:44:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E137AA05C3; Sun, 7 Feb 2016 16:44:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 18BB61620; Sun, 7 Feb 2016 16:44:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u17GiEJf034637; Sun, 7 Feb 2016 16:44:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u17GiEgE034636; Sun, 7 Feb 2016 16:44:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201602071644.u17GiEgE034636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 7 Feb 2016 16:44:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295377 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 16:44:15 -0000 Author: imp Date: Sun Feb 7 16:44:13 2016 New Revision: 295377 URL: https://svnweb.freebsd.org/changeset/base/295377 Log: Use new NANO_LOG to put the logs some place reasonable. Also, share the object directory among all builds where it makes sense. When building with NANO_CPUTYPE, separate that out to its own object directory. Put disk files in their own directories. This should make having multiple variants of the same architecture saner. Modified: head/tools/tools/nanobsd/embedded/common Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Sun Feb 7 16:44:06 2016 (r295376) +++ head/tools/tools/nanobsd/embedded/common Sun Feb 7 16:44:13 2016 (r295377) @@ -88,23 +88,30 @@ NANO_CFG_BASE=$(pwd) NANO_CFG_BASE=$(realpath ${NANO_CFG_BASE}/..) NANO_SRC=$(realpath ${NANO_CFG_BASE}/../../..) #### XXX share obj -NANO_OBJ=${NANO_SRC}/../$NANO_NAME/obj -# Where cust_pkg() finds packages to install -#XXX: Is this the right place? -#NANO_PORTS=$(realpath ${NANO_SRC}/../ports) -NANO_PORTS=/usr/ports -NANO_PACKAGE_DIR=${NANO_SRC}/${NANO_TOOLS}/Pkg +if [ -z ${NANO_CPUTYPE} ]; then + NANO_OBJ=${NANO_SRC}/../embedded/obj +else + # Alas, I can't set OBJTREE to ${MACHINE}.${MACHINE_ARCH}.${CPUTYPE} + # so this will have to do until I can. + NANO_OBJ=${NANO_SRC}/../embedded/obj.${NANO_CPUTYPE} +fi +NANO_LOG=${NANO_OBJ}/../${NANO_NAME} +NANO_DISKIMGDIR=${NANO_OBJ}/../images +NANO_WORLDDIR=${NANO_LOG}/_.w NANO_INIT_IMG2=0 NANO_NOPRIV_BUILD=t unset MAKEOBJDIRPREFIX -# this to go into nanobsd.sh -NANO_PORTS=${NANO_PORTS:-/usr/ports} - mkdir -p ${NANO_OBJ} NANO_OBJ=$(realpath ${NANO_OBJ}) +mkdir -p ${NANO_LOG} +NANO_LOG=$(realpath ${NANO_LOG}) +mkdir -p ${NANO_IMAGES} +NANO_IMAGES=$(realpath ${NANO_IMAGES}) +mkdir -p ${NANO_WORLDDIR} +NANO_WORLDDIR=$(realpath ${NANO_WORLDDIR}) -NANO_FAT_DIR=${NANO_OBJ}/_.fat +NANO_FAT_DIR=${NANO_LOG}/_.fat customize_cmd cust_allow_ssh_root @@ -191,7 +198,7 @@ create_diskimage_gpt ( ) ( create_diskimage_mbr ( ) ( pprint 2 "build diskimage ${NANO_NAME}" - pprint 3 "log: ${NANO_OBJ}/_.di" + pprint 3 "log: ${NANO_LOG}/_.di" ( local extra i sz fmt fmtarg bootmbr bootbsd skiparg @@ -204,36 +211,36 @@ create_diskimage_mbr ( ) ( skiparg=${NANO_MBR_FIRST_SKIP:+-S ${NANO_MBR_FIRST_SKIP}} for i in s1 s2 s3 s4 p1 p2 p3 p4 p5 empty; do - rm -fr ${NANO_OBJ}/_.${i}* + rm -fr ${NANO_LOG}/_.${i}* done # Populate the FAT partition, if needed if [ -n "${NANO_SLICE_FAT}" ]; then echo Creating MSDOS partition for kernel newfs_msdos -C ${NANO_SLICE_FAT_SIZE} -F 16 -L ${NANO_NAME} \ - ${NANO_OBJ}/_.${NANO_SLICE_FAT} + ${NANO_LOG}/_.${NANO_SLICE_FAT} if [ -d ${NANO_FAT_DIR} ]; then # Need to copy files from ${NANO_FATDIR} with mtools, or use # makefs -t msdos once that's supported - mcopy -i ${NANO_OBJ}/_.${NANO_SLICE_FAT} ${NANO_FAT_DIR}/* :: + mcopy -i ${NANO_LOG}/_.${NANO_SLICE_FAT} ${NANO_FAT_DIR}/* :: fi fi # Populate the Powerpc boot image, if needed if [ "${NANO_LAYOUT}" = powerpc64-ibm ]; then - dd if=${NANO_WORLDDIR}/boot/boot1.elf of=${NANO_OBJ}/_.s1 bs=800k count=1 conv=sync + dd if=${NANO_WORLDDIR}/boot/boot1.elf of=${NANO_LOG}/_.s1 bs=800k count=1 conv=sync fi # Populate the / partition, and place it into a slice with a # bsd label [ -z ${NANO_NOPRIV_BUILD} ] || extra="-F ${NANO_METALOG}" sz=${NANO_SLICE_ROOT_SIZE:+-s ${NANO_SLICE_ROOT_SIZE}} - eval "${NANO_MAKEFS_UFS}" ${extra} $sz "${NANO_OBJ}/_.${NANO_ROOT}" \ + eval "${NANO_MAKEFS_UFS}" ${extra} $sz "${NANO_LOG}/_.${NANO_ROOT}" \ "${NANO_WORLDDIR}" case ${NANO_DISK_SCHEME} in mbr) - mkimg -s bsd ${bootbsd} -p freebsd-ufs:=${NANO_OBJ}/_.${NANO_ROOT} \ - -o ${NANO_OBJ}/_.${NANO_SLICE_ROOT} + mkimg -s bsd ${bootbsd} -p freebsd-ufs:=${NANO_LOG}/_.${NANO_ROOT} \ + -o ${NANO_LOG}/_.${NANO_SLICE_ROOT} eval $NANO_SLICE_CFG=freebsd eval $NANO_SLICE_ROOT=freebsd ;; @@ -246,12 +253,12 @@ create_diskimage_mbr ( ) ( # Populate the /cfg partition, empty if none given if [ -z "${NANO_CFGDIR}" ]; then echo "Faking cfg dir, it's empty" - NANO_CFGDIR=${NANO_OBJ}/_.empty + NANO_CFGDIR=${NANO_LOG}/_.empty mkdir -p ${NANO_CFGDIR} fi # XXX -F cfg-mtree eval "${NANO_MAKEFS_UFS}" -s ${NANO_SLICE_CFG_SIZE} \ - "${NANO_OBJ}/_.${NANO_SLICE_CFG}" "${NANO_CFGDIR}" + "${NANO_LOG}/_.${NANO_SLICE_CFG}" "${NANO_CFGDIR}" # data slice not supported since we need the part for FAT for # booting @@ -261,31 +268,32 @@ create_diskimage_mbr ( ) ( eval $NANO_SLICE_FAT=fat16b fi + out=${NANO_DISKIMGDIR}/_.disk.image.${NANO_NAME}${fmt} # below depends on https://reviews.freebsd.org/D4403 not yet in the tree # but there's problems: it marks all partitions as active, so you have to # boot off parittion 3 or 2 by hand if you're playing around with this WIP case ${NANO_LAYOUT} in std-embedded) - mkimg -a 3 ${skiparg} ${fmtarg} ${bootmbr} -s mbr -p ${s1}:=${NANO_OBJ}/_.s1 \ - -p ${s2}:=${NANO_OBJ}/_.s2 \ - -p ${s3}:=${NANO_OBJ}/_.s3 \ - -o ${NANO_OBJ}/_.disk.image.${NANO_NAME}${fmt} + mkimg -a 3 ${skiparg} ${fmtarg} ${bootmbr} -s mbr -p ${s1}:=${NANO_LOG}/_.s1 \ + -p ${s2}:=${NANO_LOG}/_.s2 \ + -p ${s3}:=${NANO_LOG}/_.s3 \ + -o ${out} ;; std-x86) # s1 is cfg, s2 is /, not sure how to make that # boot (marked as active) with mkimg yet - mkimg -a 2 ${fmtarg} ${bootmbr} -s mbr -p ${s1}:=${NANO_OBJ}/_.s1 \ - -p ${s2}:=${NANO_OBJ}/_.s2 \ - -o ${NANO_OBJ}/_.disk.image.${NANO_NAME}${fmt} + mkimg -a 2 ${fmtarg} ${bootmbr} -s mbr -p ${s1}:=${NANO_LOG}/_.s1 \ + -p ${s2}:=${NANO_LOG}/_.s2 \ + -o ${out} ;; std-uefi) # s1 is boot, s2 is cfg, s3 is /, not sure how to make that # boot (marked as active) with mkimg yet mkimg -a 2 ${fmtarg} ${bootmbr} -s mbr \ -p efi:=${NANO_WORLDDIR}/boot/boot1.efifat \ - -p ${s2}:=${NANO_OBJ}/_.s2 \ - -p ${s3}:=${NANO_OBJ}/_.s3 \ - -o ${NANO_OBJ}/_.disk.image.${NANO_NAME}${fmt} + -p ${s2}:=${NANO_LOG}/_.s2 \ + -p ${s3}:=${NANO_LOG}/_.s3 \ + -o ${out} ;; std-uefi-bios) # p1 is boot for uefi, p2 is boot for gpt, p3 is cfg, p4 is / @@ -293,9 +301,9 @@ create_diskimage_mbr ( ) ( mkimg -a 2 ${fmtarg} ${bootmbr} -s gpt \ -p efi:=${NANO_WORLDDIR}/boot/boot1.efifat \ -p freebsd-boot:=${NAANO_WORLDDIR}/boot/gptboot \ - -p ${p3}:=${NANO_OBJ}/_.p3 \ - -p ${p4}:=${NANO_OBJ}/_.p4 \ - -o ${NANO_OBJ}/_.disk.image.${NANO_NAME}${fmt} + -p ${p3}:=${NANO_LOG}/_.p3 \ + -p ${p4}:=${NANO_LOG}/_.p4 \ + -o ${out} ;; powerpc64-ibm) # A lie to make the boot loader work, it boots the first BSD partition @@ -304,13 +312,14 @@ create_diskimage_mbr ( ) ( # boot image is on a special partition, ala std-embedded, but that # partition isn't FAT with special files, but a copy of the boot # loader itself. - mkimg -a 1 ${fmtarg} -s mbr -p prepboot:=${NANO_OBJ}/_.s1 \ - -p ${s2}:=${NANO_OBJ}/_.s2 \ - -p ${s3}:=${NANO_OBJ}/_.s3a \ - -o ${NANO_OBJ}/_.disk.image.${NANO_NAME}${fmt} + mkimg -a 1 ${fmtarg} -s mbr -p prepboot:=${NANO_LOG}/_.s1 \ + -p ${s2}:=${NANO_LOG}/_.s2 \ + -p ${s3}:=${NANO_LOG}/_.s3a \ + -o ${out} ;; esac - ) > ${NANO_OBJ}/_.di 2>&1 + xz -9 --keep ${out} + ) > ${NANO_LOG}/_.di 2>&1 ) die( ) { From owner-svn-src-all@freebsd.org Sun Feb 7 16:48:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45232AA07FA; Sun, 7 Feb 2016 16:48:07 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 0DDB51A14; Sun, 7 Feb 2016 16:48:06 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 7C1EED6656B; Mon, 8 Feb 2016 03:47:58 +1100 (AEDT) Date: Mon, 8 Feb 2016 03:47:57 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Pedro Giffuni cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295362 - head/sys/fs/cd9660 In-Reply-To: <56B76ABA.8000607@FreeBSD.org> Message-ID: <20160208034651.X3197@besplex.bde.org> References: <201602070348.u173meT4000314@repo.freebsd.org> <20160207175356.A867@besplex.bde.org> <56B76ABA.8000607@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=R4L+YolX c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=vXAd-1f9--jQ1isoXEQA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 16:48:07 -0000 On Sun, 7 Feb 2016, Pedro Giffuni wrote: > On 02/07/16 02:13, Bruce Evans wrote: >> On Sun, 7 Feb 2016, Pedro F. Giffuni wrote: >> >>> Log: >>> cd9660: Drop an unnecessary check for NULL. >>> >>> This was unnecessary and also confused Coverity. >>> >>> Confirmed on: NetBSD >>> CID: 978558 >> >> This leaves many similar bugs unfixed nearby. One is a null pointer >> panic, not just an unnecessary check. > > I admittedly oversimplified the commit log here. > > Not only the value can't be null, our brelse() also ignores NULL values. > > From sys/kern/vfs_bio.c: > ____ > /* > * Many function erroneously call brelse with a NULL bp under rare > * error conditions. Simply return when called with a NULL bp. > */ > if (bp == NULL) > return; > ... > ____ It has only done that for 11 days. Bruce From owner-svn-src-all@freebsd.org Sun Feb 7 16:51:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7ADC9AA0AFD; Sun, 7 Feb 2016 16:51:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 45A781D43; Sun, 7 Feb 2016 16:51:22 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 9AE111044ACC; Mon, 8 Feb 2016 03:51:21 +1100 (AEDT) Date: Mon, 8 Feb 2016 03:51:21 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Pedro F. Giffuni" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295370 - head/sys/fs/msdosfs In-Reply-To: <201602071536.u17FaGD9012488@repo.freebsd.org> Message-ID: <20160208034854.H3197@besplex.bde.org> References: <201602071536.u17FaGD9012488@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=PfoC/XVd c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=Nrl9UhntDPKYvfRXe7cA:9 a=CjuIK1q_8ugA:10 a=MKNkYfgQ-AAA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 16:51:23 -0000 On Sun, 7 Feb 2016, Pedro F. Giffuni wrote: > Log: > msdosfs_rename: yet another unused value. > > As with r295355, it seems to be left over from a cleanup > in r33548. The code is not in NetBSD either. > > Thanks to bde for checking out the history. r33548 was not a cleanup. It was a major change to add FAT32 support. Bruce From owner-svn-src-all@freebsd.org Sun Feb 7 16:51:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92CB9AA0B5C; Sun, 7 Feb 2016 16:51:51 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 6313E1ECF; Sun, 7 Feb 2016 16:51:51 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u17Gpo2O037591; Sun, 7 Feb 2016 16:51:50 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u17Gpo19037590; Sun, 7 Feb 2016 16:51:50 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201602071651.u17Gpo19037590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Sun, 7 Feb 2016 16:51: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: r295378 - stable/10/share/i18n/esdb/MISC X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 16:51:51 -0000 Author: ume Date: Sun Feb 7 16:51:50 2016 New Revision: 295378 URL: https://svnweb.freebsd.org/changeset/base/295378 Log: MFC r295234: Make sure to enable aliases for SHIFT_JIS. Approved by: re (marius) Modified: stable/10/share/i18n/esdb/MISC/MISC.alias Directory Properties: stable/10/ (props changed) Modified: stable/10/share/i18n/esdb/MISC/MISC.alias ============================================================================== --- stable/10/share/i18n/esdb/MISC/MISC.alias Sun Feb 7 16:44:13 2016 (r295377) +++ stable/10/share/i18n/esdb/MISC/MISC.alias Sun Feb 7 16:51:50 2016 (r295378) @@ -29,10 +29,10 @@ JISX0208:1990 x0208 JOHAB cp1361 -SHIFT_JIS csshiftjis -SHIFT_JIS ms_kanji -SHIFT_JIS sjis +Shift_JIS csshiftjis +Shift_JIS ms_kanji +Shift_JIS sjis -SHIFT_JIS-2004 shift_jisx0213 +Shift_JIS-2004 shift_jisx0213 TDS565 iso-ir-230 From owner-svn-src-all@freebsd.org Sun Feb 7 17:03:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B435AA1183; Sun, 7 Feb 2016 17:03:51 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 CF88E83A; Sun, 7 Feb 2016 17:03:50 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u17H3naH040635; Sun, 7 Feb 2016 17:03:49 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u17H3nHZ040634; Sun, 7 Feb 2016 17:03:49 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201602071703.u17H3nHZ040634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Sun, 7 Feb 2016 17:03: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: r295379 - stable/9/share/i18n/esdb/MISC X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 17:03:51 -0000 Author: ume Date: Sun Feb 7 17:03:49 2016 New Revision: 295379 URL: https://svnweb.freebsd.org/changeset/base/295379 Log: MFC r295234: Make sure to enable aliases for SHIFT_JIS. Modified: stable/9/share/i18n/esdb/MISC/MISC.alias Directory Properties: stable/9/share/i18n/esdb/ (props changed) Modified: stable/9/share/i18n/esdb/MISC/MISC.alias ============================================================================== --- stable/9/share/i18n/esdb/MISC/MISC.alias Sun Feb 7 16:51:50 2016 (r295378) +++ stable/9/share/i18n/esdb/MISC/MISC.alias Sun Feb 7 17:03:49 2016 (r295379) @@ -29,10 +29,10 @@ JISX0208:1990 x0208 JOHAB cp1361 -SHIFT_JIS csshiftjis -SHIFT_JIS ms_kanji -SHIFT_JIS sjis +Shift_JIS csshiftjis +Shift_JIS ms_kanji +Shift_JIS sjis -SHIFT_JIS-2004 shift_jisx0213 +Shift_JIS-2004 shift_jisx0213 TDS565 iso-ir-230 From owner-svn-src-all@freebsd.org Sun Feb 7 18:39:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 433B7AA1AF2 for ; Sun, 7 Feb 2016 18:39:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm19-vm0.bullet.mail.bf1.yahoo.com (nm19-vm0.bullet.mail.bf1.yahoo.com [98.139.213.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBAE51725 for ; Sun, 7 Feb 2016 18:39:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1454870339; bh=g1r8BMnKgrtEIXXgS8c7izyaSN40cwY3Et8fycot00c=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=J00kQ/LGN1RXGOi1Yw+a6OSXxnoVYD6qfHbTwGjLu9CsRsm1q6SGx/yLFfo6YJRqnOsNM20jG5GUfhEh55LK7NSinJ3vcGU/MUovOiu/JENNadlKg1jNliNikhY6FXApoYHOiL3Ft+LhgbYwPloS5UGE813sdaFutg9pjBi2NPwK8fLCE3Wg4PKscpOjswCTOg+TIb2JtSmh3Z6437pCptE7brmyn8g1WQ/P0+i0ruwhNITh+70+VTXxGfliMvnUzVjKkxtd78lN4Zm5uTWGx13uBsnNh8saupTZg0S5D0uv6ULNE0+8gsz8GNIySrI4PwvQO/kT7+KvZnL9LErUZA== Received: from [98.139.170.180] by nm19.bullet.mail.bf1.yahoo.com with NNFMP; 07 Feb 2016 18:38:59 -0000 Received: from [98.139.211.162] by tm23.bullet.mail.bf1.yahoo.com with NNFMP; 07 Feb 2016 18:38:59 -0000 Received: from [127.0.0.1] by smtp219.mail.bf1.yahoo.com with NNFMP; 07 Feb 2016 18:38:59 -0000 X-Yahoo-Newman-Id: 579918.53214.bm@smtp219.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: BgdLMGYVM1kSoMySsxDMmwSFKik8cSte01CwU0519i2WKJ0 kjv4rRo6uAObksuJodUoHk.A3BR5Puifip9YqGA0r5jNiRoDeQJi._bREMnE ARTv6bZAvpjKxqZuw3d7qjuAO_nNJ5RRwN.XpDjeDHXOTwh4TSbhr.SD57A8 vEyE4CWEjzIk7A6ykjHWBPKsleuAXYPMeeDDOqCtL0eVzS8fsWzZGJo3ZQe_ 2s9aZuRgmTru0kdxdFPprwACj5gKmx7TEaE3hm8YPbbYfzGMZWJgQH_UUWhA QL415Vo06zZvyi8L3UfXFytziqMOJD67UtGQbPIYhPPxNdRd4o1PJeMbsr3r UfKCM9gf3CVXQJSp.TCWkXWSTlWuVBERmXuJ0zRmvzSyDmuw8szk6E3Iy7j5 bjTzVTnkzPinwDmr6KjRY46ZPyd9smsO_xD1QRRIObBGQ2cdExUVEO50SPMp PTgGBZ5nVRccKU0f.QkTAIZHmHaQx.lfg7nYGGAmMH2NwsRKRClAuDvYB_wW A.96URrLhaHy3EYMEFn.yk6kYIYWUn8rV X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r295370 - head/sys/fs/msdosfs To: Bruce Evans References: <201602071536.u17FaGD9012488@repo.freebsd.org> <20160208034854.H3197@besplex.bde.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: <56B78F4D.3030103@FreeBSD.org> Date: Sun, 7 Feb 2016 13:39:09 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160208034854.H3197@besplex.bde.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 18:39:02 -0000 El 07/02/2016 a las 11:51, Bruce Evans wrote: > On Sun, 7 Feb 2016, Pedro F. Giffuni wrote: > >> Log: >> msdosfs_rename: yet another unused value. >> >> As with r295355, it seems to be left over from a cleanup >> in r33548. The code is not in NetBSD either. >> >> Thanks to bde for checking out the history. > > r33548 was not a cleanup. It was a major change to add FAT32 support. > Sunday mornings are bad for wording commit logs ... Sorry, I meant the cleanups were missed in r33548 (back in 1998). BTW, this looks useful: "Add support to msdosfs and makefs to generate correct Unicode (UCS-2) directory entries from UTF8 encoded file names." http://freshbsd.org/commit/netbsd/9a7d01023366c9dbef7ae8313b2a850384303b99 I thought I saw something related to that already in the tree but I don't use much UTF8 so I'll just leave the link in case someone else is interested. cheers, Pedro. From owner-svn-src-all@freebsd.org Sun Feb 7 18:40:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B707DAA1B6D; Sun, 7 Feb 2016 18:40:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 8158118B5; Sun, 7 Feb 2016 18:40:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u17Ie5x2068159; Sun, 7 Feb 2016 18:40:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u17Ie4oF068151; Sun, 7 Feb 2016 18:40:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201602071840.u17Ie4oF068151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 7 Feb 2016 18:40:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295380 - in head: . share/man/man7 share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 18:40:06 -0000 Author: ngie Date: Sun Feb 7 18:40:04 2016 New Revision: 295380 URL: https://svnweb.freebsd.org/changeset/base/295380 Log: Simplify running the FreeBSD test suite Replace `make regress` (legacy test make target) and `make test` (incomplete test make target added with the FreeBSD test suite) with make check as it's consistent with other open source projects. `make check` defaults to running tests from `.OBJDIR`, but can be overridden with the `CHECKDIR` variable. Add `make checkworld` target to simplify running the FreeBSD test suite from `TESTSBASE` (i.e. the top-level tests directory), similar to buildworld. Document `make check` and `make checkworld` in build(7). Other minor changes: - Rename intermediate file (`Kyuafile.auto`) to `Kyuafile` to simplify `make check`. - Remove terse warnings attached to `beforetest`/`aftertest`. - Add kyua binary check to check target in suite.test.mk; error out if it's not found The MFC is [partly] contingent on other build related changes being MFCed. Differential Revision: https://reviews.freebsd.org/D4406 MFC after: 2 months X-MFC to: stable/10 Relnotes: yes Reviewed by: bdrewery, Evan Cramer Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile head/Makefile.inc1 head/share/man/man7/build.7 head/share/mk/bsd.README head/share/mk/bsd.subdir.mk head/share/mk/bsd.sys.mk head/share/mk/bsd.test.mk head/share/mk/suite.test.mk Directory Properties: head/ (props changed) Modified: head/Makefile ============================================================================== --- head/Makefile Sun Feb 7 17:03:49 2016 (r295379) +++ head/Makefile Sun Feb 7 18:40:04 2016 (r295380) @@ -21,6 +21,7 @@ # kernel-toolchains - Build kernel-toolchain for all universe targets. # doxygen - Build API documentation of the kernel, needs doxygen. # update - Convenient way to update your source tree(s). +# checkworld - Run test suite on installed world. # check-old - List obsolete directories/files/libraries. # check-old-dirs - List obsolete directories. # check-old-files - List obsolete files. @@ -112,8 +113,8 @@ .else TGTS= all all-man buildenv buildenvvars buildkernel buildworld \ - check-old check-old-dirs check-old-files check-old-libs \ - checkdpadd clean cleandepend cleandir cleanworld \ + check check-old check-old-dirs check-old-files check-old-libs \ + checkdpadd checkworld clean cleandepend cleandir cleanworld \ delete-old delete-old-dirs delete-old-files delete-old-libs \ depend distribute distributekernel distributekernel.debug \ distributeworld distrib-dirs distribution doxygen \ @@ -121,7 +122,7 @@ TGTS= all all-man buildenv buildenvvars installkernel.debug packagekernel packageworld \ reinstallkernel reinstallkernel.debug \ installworld kernel-toolchain libraries lint maninstall \ - obj objlink regress rerelease showconfig tags toolchain update \ + obj objlink rerelease showconfig tags toolchain update \ _worldtmp _legacy _bootstrap-tools _cleanobj _obj \ _build-tools _cross-tools _includes _libraries _depend \ build32 builddtb distribute32 install32 xdev xdev-build xdev-install \ @@ -329,6 +330,10 @@ bmake: .PHONY ${MMAKE} all; \ ${MMAKE} install DESTDIR=${MYMAKE:H} BINDIR= +regress: .PHONY + @echo "'make regress' has been renamed 'make check'" | /usr/bin/fmt + @false + tinderbox toolchains kernel-toolchains kernels worlds: upgrade_checks tinderbox: Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Feb 7 17:03:49 2016 (r295379) +++ head/Makefile.inc1 Sun Feb 7 18:40:04 2016 (r295380) @@ -37,6 +37,7 @@ # The intended user-driven targets are: # buildworld - rebuild *everything*, including glue to help do upgrades # installworld- install everything built by "buildworld" +# checkworld - run test suite on installed world # doxygen - build API documentation of the kernel # update - convenient way to update your source tree (eg: svn/svnup) # @@ -1323,6 +1324,20 @@ packagekernel: .endif # +# +# checkworld +# +# Run test suite on installed world. +# +checkworld: .PHONY + @if [ ! -x ${LOCALBASE}/bin/kyua ]; then \ + echo "You need kyua (devel/kyua) to run the test suite." | /usr/bin/fmt; \ + exit 1; \ + fi + ${_+_}${LOCALBASE}/bin/kyua test -k ${TESTSBASE}/Kyuafile + +# +# # doxygen # # Build the API documentation with doxygen Modified: head/share/man/man7/build.7 ============================================================================== --- head/share/man/man7/build.7 Sun Feb 7 17:03:49 2016 (r295379) +++ head/share/man/man7/build.7 Sun Feb 7 18:40:04 2016 (r295380) @@ -107,6 +107,16 @@ section below, and by the variables docu The following list provides the names and actions for the targets supported by the build system: .Bl -tag -width ".Cm cleandepend" +.It Cm check +Run tests for a given subdirectory. +The default directory used is +.Pa ${.OBJDIR} , +but the check directory can be changed with +.Pa ${CHECKDIR} . +.It Cm checkworld +Run the +.Fx +test suite on installed world. .It Cm clean Remove any files created during the build process. .It Cm cleandepend @@ -653,6 +663,7 @@ make TARGET=sparc64 DESTDIR=/clients/spa .Xr mergemaster 8 , .Xr portsnap 8 , .Xr reboot 8 , -.Xr shutdown 8 +.Xr shutdown 8 , +.Xr tests 7 .Sh AUTHORS .An Mike W. Meyer Aq Mt mwm@mired.org Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Sun Feb 7 17:03:49 2016 (r295379) +++ head/share/mk/bsd.README Sun Feb 7 18:40:04 2016 (r295380) @@ -448,6 +448,17 @@ It has seven targets: all: build the test programs. + check: + runs the test programs from CHECKDIR with kyua test. + + The beforecheck and aftercheck targets will be invoked, if + defined, to execute commands before and after the realcheck + target has been executed, respectively. + + The devel/kyua package must be installed before invoking this + target. + + See CHECKDIR for more details. clean: remove the test programs and any object files. cleandir: @@ -466,12 +477,6 @@ It has seven targets: run lint on the source files. tags: create a tags file for the source files. - test: - runs the test programs from the object directory; if the - Makefile does not itself define the target test, the - targets beforetest and aftertest may also be used to - cause actions immediately before and after the test - target is executed. It sets/uses the following variables, among many others: @@ -485,6 +490,10 @@ TESTSDIR Path to the installed tests. M ${TESTSBASE}/${RELDIR:H} , e.g. /usr/tests/bin/ls when included from bin/ls/tests . +CHECKDIR The directory that 'make check' executes tests from. + + The value of CHECKDIR defaults to .OBJDIR. + KYUAFILE If 'auto' (the default), generate a Kyuafile out of the test programs defined in the Makefile. If 'yes', then a manually-crafted Kyuafile must be supplied with the Modified: head/share/mk/bsd.subdir.mk ============================================================================== --- head/share/mk/bsd.subdir.mk Sun Feb 7 17:03:49 2016 (r295379) +++ head/share/mk/bsd.subdir.mk Sun Feb 7 18:40:04 2016 (r295380) @@ -43,11 +43,11 @@ SUBDIR_TARGETS+= \ checkdpadd clean cleandepend cleandir cleanilinks \ cleanobj depend distribute files includes installconfig \ installfiles installincludes realinstall lint maninstall \ - manlint obj objlink regress tags \ + manlint obj objlink tags \ # Described above. STANDALONE_SUBDIR_TARGETS+= \ - obj checkdpadd clean cleandepend cleandir \ + obj check checkdpadd clean cleandepend cleandir \ cleanilinks cleanobj installconfig \ .include Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Sun Feb 7 17:03:49 2016 (r295379) +++ head/share/mk/bsd.sys.mk Sun Feb 7 18:40:04 2016 (r295380) @@ -178,11 +178,11 @@ CXXFLAGS+= ${CXXFLAGS.${COMPILER_TYPE}} # or expect to ever be up-to-date. PHONY_NOTMAIN = afterdepend afterinstall all beforedepend beforeinstall \ beforelinking build build-tools buildconfig buildfiles \ - buildincludes checkdpadd clean cleandepend cleandir cleanobj \ - configure depend dependall distclean distribute exe \ + buildincludes check checkdpadd clean cleandepend cleandir \ + cleanobj configure depend dependall distclean distribute exe \ files html includes install installconfig installfiles \ installincludes lint obj objlink objs objwarn realall \ - realdepend realinstall regress subdir-all subdir-depend \ + realdepend realinstall subdir-all subdir-depend \ subdir-install tags whereobj # we don't want ${PROG} to be PHONY Modified: head/share/mk/bsd.test.mk ============================================================================== --- head/share/mk/bsd.test.mk Sun Feb 7 17:03:49 2016 (r295379) +++ head/share/mk/bsd.test.mk Sun Feb 7 18:40:04 2016 (r295380) @@ -60,11 +60,15 @@ _TESTS= .include .include +# kyua automatically descends directories; only run make check on the +# top-level directory +.if !make(check) .for ts in ${TESTS_SUBDIRS} .if empty(SUBDIR:M${ts}) SUBDIR+= ${ts} .endif .endfor +.endif # it is rare for test cases to have man pages .if !defined(MAN) @@ -79,19 +83,14 @@ PROGS_TARGETS+= install .include .endif -.if !target(realtest) -realtest: .PHONY +.if !target(realcheck) +realcheck: .PHONY @echo "$@ not defined; skipping" .endif -test: .PHONY -.ORDER: beforetest realtest -test: beforetest realtest - -.if target(aftertest) -.ORDER: realtest aftertest -test: aftertest -.endif +beforecheck realcheck aftercheck check: .PHONY +.ORDER: beforecheck realcheck aftercheck +check: beforecheck realcheck aftercheck .ifdef PROG # we came here via bsd.progs.mk below Modified: head/share/mk/suite.test.mk ============================================================================== --- head/share/mk/suite.test.mk Sun Feb 7 17:03:49 2016 (r295379) +++ head/share/mk/suite.test.mk Sun Feb 7 18:40:04 2016 (r295380) @@ -50,15 +50,12 @@ FILES+= Kyuafile FILESDIR_Kyuafile= ${TESTSDIR} .endif -.if ${KYUAFILE:tl} == "auto" -CLEANFILES+= Kyuafile Kyuafile.tmp -.endif - .for _T in ${_TESTS} _TEST_METADATA.${_T}= ${TEST_METADATA} ${TEST_METADATA.${_T}} .endfor .if ${KYUAFILE:tl} == "auto" +CLEANFILES+= Kyuafile Kyuafile.tmp Kyuafile: Makefile @{ \ echo '-- Automatically generated by bsd.test.mk.'; \ @@ -78,9 +75,11 @@ Kyuafile: Makefile @mv ${.TARGET}.tmp ${.TARGET} .endif +CHECKDIR?= ${DESTDIR}${TESTSDIR} + KYUA= ${LOCALBASE}/bin/kyua -.if exists(${KYUA}) -# Definition of the "make test" target and supporting variables. + +# Definition of the "make check" target and supporting variables. # # This target, by necessity, can only work for native builds (i.e. a FreeBSD # host building a release for the same system). The target runs Kyua, which is @@ -89,35 +88,15 @@ KYUA= ${LOCALBASE}/bin/kyua # Due to the dependencies of the binaries built by the source tree and how they # are used by tests, it is highly possible for a execution of "make test" to # report bogus results unless the new binaries are put in place. -realtest: .PHONY - @echo "*** WARNING: make test is experimental" - @echo "***" - @echo "*** Using this test does not preclude you from running the tests" - @echo "*** installed in ${TESTSBASE}. This test run may raise false" - @echo "*** positives and/or false negatives." - @echo - @${KYUA} test -k ${DESTDIR}${TESTSDIR}/Kyuafile; \ - result=0; \ - echo; \ - echo "*** Once again, note that "make test" is unsupported."; \ - test $${result} -eq 0 -.endif -beforetest: .PHONY -.if defined(TESTSDIR) -.if ${TESTSDIR} == ${TESTSBASE} -# Forbid running from ${TESTSBASE}. It can cause false positives/negatives and -# it does not cover all the tests (e.g. it misses testing software in external). - @echo "*** Sorry, you cannot use make test from src/tests. Install the" - @echo "*** tests into their final location and run them from ${TESTSBASE}" - @false -.else - @echo "*** Using this test does not preclude you from running the tests" - @echo "*** installed in ${TESTSBASE}. This test run may raise false" - @echo "*** positives and/or false negatives." -.endif -.else - @echo "*** No TESTSDIR defined; nothing to do." - @false -.endif - @echo +realcheck: .PHONY + @if [ ! -x ${KYUA} ]; then \ + echo; \ + echo "kyua binary not installed at expected location (${.TARGET})"; \ + echo; \ + echo "Please install via pkg install, or specify the path to the kyua"; \ + echo "package via the \$${LOCALBASE} variable, e.g. "; \ + echo "LOCALBASE=\"${LOCALBASE}\""; \ + false; \ + fi + @${KYUA} test -k ${CHECKDIR}/Kyuafile From owner-svn-src-all@freebsd.org Sun Feb 7 20:15:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC2F4AA068B; Sun, 7 Feb 2016 20:15:45 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id BFB15B1F; Sun, 7 Feb 2016 20:15:45 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp.Home (bcdf01bd.skybroadband.com [188.223.1.189]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 03FC0D7A17; Sun, 7 Feb 2016 20:15:08 +0000 (UTC) Date: Sun, 7 Feb 2016 20:14:48 +0000 From: Andrew Turner To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295377 - head/tools/tools/nanobsd/embedded Message-ID: <20160207201448.75df1eae@zapp.Home> In-Reply-To: <201602071644.u17GiEgE034636@repo.freebsd.org> References: <201602071644.u17GiEgE034636@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 20:15:46 -0000 On Sun, 7 Feb 2016 16:44:14 +0000 (UTC) Warner Losh wrote: > Author: imp > Date: Sun Feb 7 16:44:13 2016 > New Revision: 295377 > URL: https://svnweb.freebsd.org/changeset/base/295377 > > Log: > Use new NANO_LOG to put the logs some place reasonable. Also, share > the object directory among all builds where it makes sense. When > building with NANO_CPUTYPE, separate that out to its own object > directory. Put disk files in their own directories. > > This should make having multiple variants of the same architecture > saner. > > Modified: > head/tools/tools/nanobsd/embedded/common > > Modified: head/tools/tools/nanobsd/embedded/common > ============================================================================== > --- head/tools/tools/nanobsd/embedded/common Sun Feb 7 > 16:44:06 2016 (r295376) +++ > head/tools/tools/nanobsd/embedded/common Sun Feb 7 16:44:13 > 2016 (r295377) @@ -88,23 +88,30 @@ NANO_CFG_BASE=$(pwd) > NANO_CFG_BASE=$(realpath ${NANO_CFG_BASE}/..) NANO_SRC=$(realpath > ${NANO_CFG_BASE}/../../..) #### XXX share obj > -NANO_OBJ=${NANO_SRC}/../$NANO_NAME/obj > -# Where cust_pkg() finds packages to install > -#XXX: Is this the right place? > -#NANO_PORTS=$(realpath ${NANO_SRC}/../ports) > -NANO_PORTS=/usr/ports > -NANO_PACKAGE_DIR=${NANO_SRC}/${NANO_TOOLS}/Pkg > +if [ -z ${NANO_CPUTYPE} ]; then > + NANO_OBJ=${NANO_SRC}/../embedded/obj > +else > + # Alas, I can't set OBJTREE to > ${MACHINE}.${MACHINE_ARCH}.${CPUTYPE} > + # so this will have to do until I can. > + NANO_OBJ=${NANO_SRC}/../embedded/obj.${NANO_CPUTYPE} > +fi > +NANO_LOG=${NANO_OBJ}/../${NANO_NAME} > +NANO_DISKIMGDIR=${NANO_OBJ}/../images NANO_DISKIMGDIR is now set, however the directory doesn't get created. Is this intentional? Andrew From owner-svn-src-all@freebsd.org Sun Feb 7 21:25:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A16AAAA0B1C; Sun, 7 Feb 2016 21:25:09 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 744BF1086; Sun, 7 Feb 2016 21:25:09 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u17LP8Gt018739; Sun, 7 Feb 2016 21:25:08 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u17LP8rw018738; Sun, 7 Feb 2016 21:25:08 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201602072125.u17LP8rw018738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 7 Feb 2016 21:25:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295384 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 21:25:09 -0000 Author: jilles Date: Sun Feb 7 21:25:08 2016 New Revision: 295384 URL: https://svnweb.freebsd.org/changeset/base/295384 Log: semget(2): Add missing [EINVAL] conditions. PR: 206927 Modified: head/lib/libc/sys/semget.2 Modified: head/lib/libc/sys/semget.2 ============================================================================== --- head/lib/libc/sys/semget.2 Sun Feb 7 18:46:53 2016 (r295383) +++ head/lib/libc/sys/semget.2 Sun Feb 7 21:25:08 2016 (r295384) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 12, 1995 +.Dd February 7, 2016 .Dt SEMGET 2 .Os .Sh NAME @@ -132,6 +132,17 @@ already exists. .It Bq Er EINVAL The number of semaphores requested exceeds the system imposed maximum per set. +.It Bq Er EINVAL +A semaphore set corresponding to +.Fa key +already exists and contains fewer semaphores than +.Fa nsems . +.It Bq Er EINVAL +A semaphore set corresponding to +.Fa key +does not exist and +.Fa nsems +is 0 or negative. .It Bq Er ENOSPC Insufficiently many semaphores are available. .It Bq Er ENOSPC From owner-svn-src-all@freebsd.org Sun Feb 7 22:04:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3401AA1DE4 for ; Sun, 7 Feb 2016 22:04:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-x230.google.com (mail-qg0-x230.google.com [IPv6:2607:f8b0:400d:c04::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 70B4179F for ; Sun, 7 Feb 2016 22:04:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qg0-x230.google.com with SMTP id b35so105836872qge.0 for ; Sun, 07 Feb 2016 14:04:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=YN851VGjjdLMUKplNeyYmmk/mMBLpg+2I7wPkdABqlk=; b=NZMCZjIbf3O0EI1r6fhwx/QalBmWhIAy+IpranSvLXwm8NvP5c89uljipYWmqUc8SB 8QTTpT9vYlTj/Ibn7MVypDgS9MbjwTe6Yqq3IjgY422CKVL161FLUDb3UaXDJkt/eBhB 4knS/m2gcrdXt/YgHKiyVVUxRI3fCZRftVmwYA/bni4YReo/uGj7buH60gxmrv7pZYow YKx8wvcpNv6+vI3Ojd0nI2SliL7aVSZIEE22TKW4oaS89GSeboj+/gB6lAzSlvdkt9Vt VK8duEtEBiuWs9TabcYMQeF8tdvqjcyyS+wlHatYenEMtvn+oUrmBi43vKhcP+5kMEp8 p2qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=YN851VGjjdLMUKplNeyYmmk/mMBLpg+2I7wPkdABqlk=; b=Kh7eYLj/Uzs98B2lYA8l6AlUqlp1i8zmxy3Ajx4+TyCrfO3M8eyHAcEhyVEomiyUiC kr7N02MWs9pVS7ojn4gQGmW4uFei63bEW8G01fYeA7E5lGzUf+w+OEHQHUwHQgIJm3du k+t3iYoIEPaJLMvl58BNPOAar20rHD3V0JjNAmthSCaQaN36FRr8dGv4Ct2z9o1+laku rH0A09Q+VvB9ELflt8Y04rYVX8gyNuZ4XAyBmmww4pMp/zwQQJPAdQW7Nh7SAfs58ZbF 4W51ai3ipNSogGRuUFw1MpUAWchmRDjahiN4BYVZYfY7RoPxpSXxHsSI3KqRsclWqW1x RDgA== X-Gm-Message-State: AG10YORqpzyfTcpuwtRyBwlVudk9YdTcWE3qwAlY7CoChw0/0J8EjEG8MqaUuIy4KuOvyHvZGtfbhZhjAZm/Gw== MIME-Version: 1.0 X-Received: by 10.140.135.147 with SMTP id 141mr12326114qhh.74.1454882686415; Sun, 07 Feb 2016 14:04:46 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.30.166 with HTTP; Sun, 7 Feb 2016 14:04:46 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <20160207201448.75df1eae@zapp.Home> References: <201602071644.u17GiEgE034636@repo.freebsd.org> <20160207201448.75df1eae@zapp.Home> Date: Sun, 7 Feb 2016 15:04:46 -0700 X-Google-Sender-Auth: XpDWYYeN_EFv_-ICuOleAhBPLVw Message-ID: Subject: Re: svn commit: r295377 - head/tools/tools/nanobsd/embedded From: Warner Losh To: Andrew Turner Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 22:04:47 -0000 On Sun, Feb 7, 2016 at 1:14 PM, Andrew Turner wrote: > On Sun, 7 Feb 2016 16:44:14 +0000 (UTC) > Warner Losh wrote: > > > Author: imp > > Date: Sun Feb 7 16:44:13 2016 > > New Revision: 295377 > > URL: https://svnweb.freebsd.org/changeset/base/295377 > > > > Log: > > Use new NANO_LOG to put the logs some place reasonable. Also, share > > the object directory among all builds where it makes sense. When > > building with NANO_CPUTYPE, separate that out to its own object > > directory. Put disk files in their own directories. > > > > This should make having multiple variants of the same architecture > > saner. > > > > Modified: > > head/tools/tools/nanobsd/embedded/common > > > > Modified: head/tools/tools/nanobsd/embedded/common > > > ============================================================================== > > --- head/tools/tools/nanobsd/embedded/common Sun Feb 7 > > 16:44:06 2016 (r295376) +++ > > head/tools/tools/nanobsd/embedded/common Sun Feb 7 16:44:13 > > 2016 (r295377) @@ -88,23 +88,30 @@ NANO_CFG_BASE=$(pwd) > > NANO_CFG_BASE=$(realpath ${NANO_CFG_BASE}/..) NANO_SRC=$(realpath > > ${NANO_CFG_BASE}/../../..) #### XXX share obj > > -NANO_OBJ=${NANO_SRC}/../$NANO_NAME/obj > > -# Where cust_pkg() finds packages to install > > -#XXX: Is this the right place? > > -#NANO_PORTS=$(realpath ${NANO_SRC}/../ports) > > -NANO_PORTS=/usr/ports > > -NANO_PACKAGE_DIR=${NANO_SRC}/${NANO_TOOLS}/Pkg > > +if [ -z ${NANO_CPUTYPE} ]; then > > + NANO_OBJ=${NANO_SRC}/../embedded/obj > > +else > > + # Alas, I can't set OBJTREE to > > ${MACHINE}.${MACHINE_ARCH}.${CPUTYPE} > > + # so this will have to do until I can. > > + NANO_OBJ=${NANO_SRC}/../embedded/obj.${NANO_CPUTYPE} > > +fi > > +NANO_LOG=${NANO_OBJ}/../${NANO_NAME} > > +NANO_DISKIMGDIR=${NANO_OBJ}/../images > > NANO_DISKIMGDIR is now set, however the directory doesn't get created. > Is this intentional? > No. I'll track down how my builds worked for me when we're not creating this directory anywhere... Warner From owner-svn-src-all@freebsd.org Sun Feb 7 22:12:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5230AA0207; Sun, 7 Feb 2016 22:12:40 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 6ABC2BB7; Sun, 7 Feb 2016 22:12:40 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u17MCdLP033311; Sun, 7 Feb 2016 22:12:39 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u17MCdQ6033309; Sun, 7 Feb 2016 22:12:39 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201602072212.u17MCdQ6033309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 7 Feb 2016 22:12:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295385 - in head: sys/kern tools/regression/sysvsem X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 22:12:40 -0000 Author: jilles Date: Sun Feb 7 22:12:39 2016 New Revision: 295385 URL: https://svnweb.freebsd.org/changeset/base/295385 Log: semget(): Check for [EEXIST] error first. Although POSIX literally permits failing with [EINVAL] if IPC_CREAT and IPC_EXCL were both passed, the semaphore set already exists and has fewer semaphores than nsems, this does not allow an application to retry safely: if the [EINVAL] is actually because of the semmsl limit, an infinite loop would result. PR: 206927 Modified: head/sys/kern/sysv_sem.c head/tools/regression/sysvsem/semtest.c Modified: head/sys/kern/sysv_sem.c ============================================================================== --- head/sys/kern/sysv_sem.c Sun Feb 7 21:25:08 2016 (r295384) +++ head/sys/kern/sysv_sem.c Sun Feb 7 22:12:39 2016 (r295385) @@ -867,6 +867,11 @@ sys_semget(struct thread *td, struct sem } if (semid < seminfo.semmni) { DPRINTF(("found public key\n")); + if ((semflg & IPC_CREAT) && (semflg & IPC_EXCL)) { + DPRINTF(("not exclusive\n")); + error = EEXIST; + goto done2; + } if ((error = ipcperm(td, &sema[semid].u.sem_perm, semflg & 0700))) { goto done2; @@ -876,11 +881,6 @@ sys_semget(struct thread *td, struct sem error = EINVAL; goto done2; } - if ((semflg & IPC_CREAT) && (semflg & IPC_EXCL)) { - DPRINTF(("not exclusive\n")); - error = EEXIST; - goto done2; - } #ifdef MAC error = mac_sysvsem_check_semget(cred, &sema[semid]); if (error != 0) Modified: head/tools/regression/sysvsem/semtest.c ============================================================================== --- head/tools/regression/sysvsem/semtest.c Sun Feb 7 21:25:08 2016 (r295384) +++ head/tools/regression/sysvsem/semtest.c Sun Feb 7 22:12:39 2016 (r295385) @@ -152,6 +152,15 @@ main(int argc, char *argv[]) print_semid_ds(&s_ds, 0600); + errno = 0; + if (semget(semkey, 1, IPC_CREAT | IPC_EXCL | 0600) != -1 || + errno != EEXIST) + err(1, "semget IPC_EXCL 1 did not fail with [EEXIST]"); + errno = 0; + if (semget(semkey, 2, IPC_CREAT | IPC_EXCL | 0600) != -1 || + errno != EEXIST) + err(1, "semget IPC_EXCL 2 did not fail with [EEXIST]"); + for (child_count = 0; child_count < 5; child_count++) { switch ((child_pid = fork())) { case -1: From owner-svn-src-all@freebsd.org Sun Feb 7 22:53:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F3AEAA1433; Sun, 7 Feb 2016 22:53:05 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 16A8E1AA8; Sun, 7 Feb 2016 22:53:05 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u17Mr4RY045001; Sun, 7 Feb 2016 22:53:04 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u17Mr4da045000; Sun, 7 Feb 2016 22:53:04 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201602072253.u17Mr4da045000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sun, 7 Feb 2016 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: r295386 - stable/10/contrib/bsnmp/snmp_mibII X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 22:53:05 -0000 Author: bz Date: Sun Feb 7 22:53:03 2016 New Revision: 295386 URL: https://svnweb.freebsd.org/changeset/base/295386 Log: MFC r295202: Try to fix a bug introduced in r228623 (head). We started to copy the ifa_msghdr as otherwise platforms with strict alignment would break. It is unclear to me if there's also a problem with access to the address list following the structure. However we never copied the address list after the structure and thus are pointing at random memory. For now just use a pointer to the original memory for accessing the address list making it at least work on platforms with weak memory access. PR: 195445 Reported by: wolfgang lyxys.ka.sub.org Tested by: wolfgang lyxys.ka.sub.org (x86) Approved by: re (marius) Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII.c Sun Feb 7 22:12:39 2016 (r295385) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII.c Sun Feb 7 22:53:03 2016 (r295386) @@ -969,7 +969,7 @@ handle_rtmsg(struct rt_msghdr *rtm) { struct sockaddr *addrs[RTAX_MAX]; struct if_msghdr *ifm; - struct ifa_msghdr ifam; + struct ifa_msghdr ifam, *ifamp; struct ifma_msghdr *ifmam; #ifdef RTM_IFANNOUNCE struct if_announcemsghdr *ifan; @@ -989,8 +989,9 @@ handle_rtmsg(struct rt_msghdr *rtm) switch (rtm->rtm_type) { case RTM_NEWADDR: - memcpy(&ifam, rtm, sizeof(ifam)); - mib_extract_addrs(ifam.ifam_addrs, (u_char *)(&ifam + 1), addrs); + ifamp = (struct ifa_msghdr *)rtm; + memcpy(&ifam, ifamp, sizeof(ifam)); + mib_extract_addrs(ifam.ifam_addrs, (u_char *)(ifamp + 1), addrs); if (addrs[RTAX_IFA] == NULL || addrs[RTAX_NETMASK] == NULL) break; @@ -1016,8 +1017,9 @@ handle_rtmsg(struct rt_msghdr *rtm) break; case RTM_DELADDR: - memcpy(&ifam, rtm, sizeof(ifam)); - mib_extract_addrs(ifam.ifam_addrs, (u_char *)(&ifam + 1), addrs); + ifamp = (struct ifa_msghdr *)rtm; + memcpy(&ifam, ifamp, sizeof(ifam)); + mib_extract_addrs(ifam.ifam_addrs, (u_char *)(ifamp + 1), addrs); if (addrs[RTAX_IFA] == NULL) break; From owner-svn-src-all@freebsd.org Sun Feb 7 23:20:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AC39AA1E49; Sun, 7 Feb 2016 23:20:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 EF40A878; Sun, 7 Feb 2016 23:20:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u17NKjpH051974; Sun, 7 Feb 2016 23:20:45 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u17NKjLX051973; Sun, 7 Feb 2016 23:20:45 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201602072320.u17NKjLX051973@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 7 Feb 2016 23:20:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295387 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 23:20:46 -0000 Author: imp Date: Sun Feb 7 23:20:44 2016 New Revision: 295387 URL: https://svnweb.freebsd.org/changeset/base/295387 Log: Make sure NANO_DISKIMGDIR exists. Modified: head/tools/tools/nanobsd/embedded/common Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Sun Feb 7 22:53:03 2016 (r295386) +++ head/tools/tools/nanobsd/embedded/common Sun Feb 7 23:20:44 2016 (r295387) @@ -110,6 +110,8 @@ mkdir -p ${NANO_IMAGES} NANO_IMAGES=$(realpath ${NANO_IMAGES}) mkdir -p ${NANO_WORLDDIR} NANO_WORLDDIR=$(realpath ${NANO_WORLDDIR}) +mkdir -p ${NANO_DISKIMGDIR} +NANO_DISKIMGDIR=$(realpath ${NANO_DISKIMGDIR}) NANO_FAT_DIR=${NANO_LOG}/_.fat From owner-svn-src-all@freebsd.org Sun Feb 7 23:42:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A96A2AA0860; Sun, 7 Feb 2016 23:42:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 79A5D110C; Sun, 7 Feb 2016 23:42:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u17NgaMZ059669; Sun, 7 Feb 2016 23:42:36 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u17NgaT3059668; Sun, 7 Feb 2016 23:42:36 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201602072342.u17NgaT3059668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sun, 7 Feb 2016 23:42:36 +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: r295388 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 23:42:37 -0000 Author: bz Date: Sun Feb 7 23:42:36 2016 New Revision: 295388 URL: https://svnweb.freebsd.org/changeset/base/295388 Log: MFC r294514: The variable is write once only and not used. Recover the vertical space. Sponsored by: The FreeBSD Foundation Obtained from: p4 CH=180830 Reviewed by: gnn, hiren Differential Revision:https://reviews.freebsd.org/D4898 Approved by: re (marius, gjb) Modified: stable/10/sys/netinet/igmp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/igmp.c ============================================================================== --- stable/10/sys/netinet/igmp.c Sun Feb 7 23:20:44 2016 (r295387) +++ stable/10/sys/netinet/igmp.c Sun Feb 7 23:42:36 2016 (r295388) @@ -654,16 +654,12 @@ igmp_ifdetach(struct ifnet *ifp) void igmp_domifdetach(struct ifnet *ifp) { - struct igmp_ifinfo *igi; CTR3(KTR_IGMPV3, "%s: called for ifp %p(%s)", __func__, ifp, ifp->if_xname); IGMP_LOCK(); - - igi = ((struct in_ifinfo *)ifp->if_afdata[AF_INET])->ii_igmp; igi_delete_locked(ifp); - IGMP_UNLOCK(); } From owner-svn-src-all@freebsd.org Mon Feb 8 00:07:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66B6CAA15A8; Mon, 8 Feb 2016 00:07:03 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 38D111C2D; Mon, 8 Feb 2016 00:07:03 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u18072h8065681; Mon, 8 Feb 2016 00:07:02 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u18072uD065679; Mon, 8 Feb 2016 00:07:02 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201602080007.u18072uD065679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 8 Feb 2016 00:07: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: r295389 - in stable/10/sys: netinet netinet6 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 00:07:03 -0000 Author: bz Date: Mon Feb 8 00:07:01 2016 New Revision: 295389 URL: https://svnweb.freebsd.org/changeset/base/295389 Log: MFC r292601,292654: Since r256624 (head) we have been leaking routing table allocations on vnet enabled jail shutdown. Call the provided cleanup routines for IP versions 4 and 6 to plug these leaks. Sponsored by: The FreeBSD Foundation Reviewed by: gnn Differential Revision:https://reviews.freebsd.org/D4530 Approved by: re (gjb) Modified: stable/10/sys/netinet/in_rmx.c stable/10/sys/netinet6/in6_rmx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/in_rmx.c ============================================================================== --- stable/10/sys/netinet/in_rmx.c Sun Feb 7 23:42:36 2016 (r295388) +++ stable/10/sys/netinet/in_rmx.c Mon Feb 8 00:07:01 2016 (r295389) @@ -373,7 +373,7 @@ in_detachhead(void **head, int off) { callout_drain(&V_rtq_timer); - return (1); + return (rn_detachhead(head)); } #endif Modified: stable/10/sys/netinet6/in6_rmx.c ============================================================================== --- stable/10/sys/netinet6/in6_rmx.c Sun Feb 7 23:42:36 2016 (r295388) +++ stable/10/sys/netinet6/in6_rmx.c Mon Feb 8 00:07:01 2016 (r295389) @@ -290,7 +290,7 @@ in6_detachhead(void **head, int off) { callout_drain(&V_rtq_mtutimer); - return (1); + return (rn_detachhead(head)); } #endif From owner-svn-src-all@freebsd.org Mon Feb 8 02:11:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0086EAA1DCF; Mon, 8 Feb 2016 02:11:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 C4E0DC0E; Mon, 8 Feb 2016 02:11:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u182BYT3000744; Mon, 8 Feb 2016 02:11:34 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u182BYGg000743; Mon, 8 Feb 2016 02:11:34 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201602080211.u182BYGg000743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 8 Feb 2016 02:11:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295390 - head/tools/tools/ath/athregs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 02:11:36 -0000 Author: adrian Date: Mon Feb 8 02:11:34 2016 New Revision: 295390 URL: https://svnweb.freebsd.org/changeset/base/295390 Log: Add a format string to the err() calls. Modified: head/tools/tools/ath/athregs/dumpregs.c Modified: head/tools/tools/ath/athregs/dumpregs.c ============================================================================== --- head/tools/tools/ath/athregs/dumpregs.c Mon Feb 8 00:07:01 2016 (r295389) +++ head/tools/tools/ath/athregs/dumpregs.c Mon Feb 8 02:11:34 2016 (r295390) @@ -155,7 +155,7 @@ main(int argc, char *argv[]) atd.ad_out_data = (caddr_t) &state.revs; atd.ad_out_size = sizeof(state.revs); if (ioctl(s, SIOCGATHDIAG, &atd) < 0) - err(1, atd.ad_name); + err(1, "%s", atd.ad_name); if (ath_hal_setupregs(&atd, what) == 0) errx(-1, "no registers are known for this part " @@ -173,7 +173,7 @@ main(int argc, char *argv[]) } atd.ad_id = HAL_DIAG_REGS | ATH_DIAG_IN | ATH_DIAG_DYN; if (ioctl(s, SIOCGATHDIAG, &atd) < 0) - err(1, atd.ad_name); + err(1, "%s", atd.ad_name); /* * Expand register data into global space that can be From owner-svn-src-all@freebsd.org Mon Feb 8 10:54:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70F47AA192B; Mon, 8 Feb 2016 10:54:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 24BEC108A; Mon, 8 Feb 2016 10:54:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u18AsS1Y053445; Mon, 8 Feb 2016 10:54:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u18AsSpv053444; Mon, 8 Feb 2016 10:54:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201602081054.u18AsSpv053444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 8 Feb 2016 10:54:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295391 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 10:54:29 -0000 Author: kib Date: Mon Feb 8 10:54:27 2016 New Revision: 295391 URL: https://svnweb.freebsd.org/changeset/base/295391 Log: Remove the assert which outlived its usefulness, and, by default, disable compilation of the code which made it possible to call stop_all_proc() from usermode at all. Move the comment to the preamble of stop_all_proc() and reword it to give overview of the function intent. proc0 has P_HADTHREADS flag set due to kthread_add(), but no P_KTHREAD, which triggered the assert, which does not serve a purpose now. Reported by: Oliver Pinter Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Mon Feb 8 02:11:34 2016 (r295390) +++ head/sys/kern/kern_proc.c Mon Feb 8 10:54:27 2016 (r295391) @@ -2983,6 +2983,12 @@ static SYSCTL_NODE(_kern_proc, KERN_PROC int allproc_gen; +/* + * stop_all_proc() purpose is to stop all process which have usermode, + * except current process for obvious reasons. This makes it somewhat + * unreliable when invoked from multithreaded process. The service + * must not be user-callable anyway. + */ void stop_all_proc(void) { @@ -2991,17 +2997,6 @@ stop_all_proc(void) bool restart, seen_stopped, seen_exiting, stopped_some; cp = curproc; - /* - * stop_all_proc() assumes that all process which have - * usermode must be stopped, except current process, for - * obvious reasons. Since other threads in the process - * establishing global stop could unstop something, disable - * calls from multithreaded processes as precaution. The - * service must not be user-callable anyway. - */ - KASSERT((cp->p_flag & P_HADTHREADS) == 0 || - (cp->p_flag & P_KTHREAD) != 0, ("mt stop_all_proc")); - allproc_loop: sx_xlock(&allproc_lock); gen = allproc_gen; @@ -3088,7 +3083,7 @@ resume_all_proc(void) sx_xunlock(&allproc_lock); } -#define TOTAL_STOP_DEBUG 1 +/* #define TOTAL_STOP_DEBUG 1 */ #ifdef TOTAL_STOP_DEBUG volatile static int ap_resume; #include From owner-svn-src-all@freebsd.org Mon Feb 8 11:15:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9172AA9F4E7; Mon, 8 Feb 2016 11:15:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 5DAA31A9A; Mon, 8 Feb 2016 11:15:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u18BFaEL059423; Mon, 8 Feb 2016 11:15:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u18BFat6059422; Mon, 8 Feb 2016 11:15:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201602081115.u18BFat6059422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 8 Feb 2016 11:15:36 +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: r295392 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 11:15:37 -0000 Author: kib Date: Mon Feb 8 11:15:36 2016 New Revision: 295392 URL: https://svnweb.freebsd.org/changeset/base/295392 Log: MFC r294735: Don't allow opening the callout device when the callin device is already open (in disguise as the console device). Approved by: re (gjb) 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 Mon Feb 8 10:54:27 2016 (r295391) +++ stable/10/sys/kern/tty.c Mon Feb 8 11:15:36 2016 (r295392) @@ -266,10 +266,10 @@ ttydev_open(struct cdev *dev, int oflags /* * Make sure the "tty" and "cua" device cannot be opened at the - * same time. + * same time. The console is a "tty" device. */ if (TTY_CALLOUT(tp, dev)) { - if (tp->t_flags & TF_OPENED_IN) { + if (tp->t_flags & (TF_OPENED_CONS | TF_OPENED_IN)) { error = EBUSY; goto done; } @@ -322,6 +322,8 @@ ttydev_open(struct cdev *dev, int oflags tp->t_flags |= TF_OPENED_OUT; else tp->t_flags |= TF_OPENED_IN; + MPASS((tp->t_flags & (TF_OPENED_CONS | TF_OPENED_IN)) == 0 || + (tp->t_flags & TF_OPENED_OUT) == 0); done: tp->t_flags &= ~TF_OPENCLOSE; cv_broadcast(&tp->t_dcdwait); @@ -342,7 +344,8 @@ ttydev_close(struct cdev *dev, int fflag * Don't actually close the device if it is being used as the * console. */ - MPASS((tp->t_flags & TF_OPENED) != TF_OPENED); + MPASS((tp->t_flags & (TF_OPENED_CONS | TF_OPENED_IN)) == 0 || + (tp->t_flags & TF_OPENED_OUT) == 0); if (dev == dev_console) tp->t_flags &= ~TF_OPENED_CONS; else From owner-svn-src-all@freebsd.org Mon Feb 8 11:18:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5F4BA9F7A2; Mon, 8 Feb 2016 11:18:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 A5F518D; Mon, 8 Feb 2016 11:18:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u18BIDFd059947; Mon, 8 Feb 2016 11:18:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u18BIDe2059946; Mon, 8 Feb 2016 11:18:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201602081118.u18BIDe2059946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 8 Feb 2016 11:18: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: r295393 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 11:18:14 -0000 Author: kib Date: Mon Feb 8 11:18:13 2016 New Revision: 295393 URL: https://svnweb.freebsd.org/changeset/base/295393 Log: MFC r294732: Minor fixes for ddb tty-related commands. Approved by: re (gjb) 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 Mon Feb 8 11:15:36 2016 (r295392) +++ stable/10/sys/kern/tty.c Mon Feb 8 11:18:13 2016 (r295393) @@ -2153,9 +2153,11 @@ static const struct { }; #define TTY_FLAG_BITS \ - "\20\1NOPREFIX\2INITLOCK\3CALLOUT\4OPENED_IN\5OPENED_OUT\6GONE" \ - "\7OPENCLOSE\10ASYNC\11LITERAL\12HIWAT_IN\13HIWAT_OUT\14STOPPED" \ - "\15EXCLUDE\16BYPASS\17ZOMBIE\20HOOK" + "\20\1NOPREFIX\2INITLOCK\3CALLOUT\4OPENED_IN" \ + "\5OPENED_OUT\6OPENED_CONS\7GONE\10OPENCLOSE" \ + "\11ASYNC\12LITERAL\13HIWAT_IN\14HIWAT_OUT" \ + "\15STOPPED\16EXCLUDE\17BYPASS\20ZOMBIE" \ + "\21HOOK\22BUSY_IN\23BUSY_OUT" #define DB_PRINTSYM(name, addr) \ db_printf("%s " #name ": ", sep); \ @@ -2221,9 +2223,9 @@ DB_SHOW_COMMAND(tty, db_show_tty) } tp = (struct tty *)addr; - db_printf("0x%p: %s\n", tp, tty_devname(tp)); + db_printf("%p: %s\n", tp, tty_devname(tp)); db_printf("\tmtx: %p\n", tp->t_mtx); - db_printf("\tflags: %b\n", tp->t_flags, TTY_FLAG_BITS); + db_printf("\tflags: 0x%b\n", tp->t_flags, TTY_FLAG_BITS); db_printf("\trevokecnt: %u\n", tp->t_revokecnt); /* Buffering mechanisms. */ From owner-svn-src-all@freebsd.org Mon Feb 8 11:55:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 361BA9D9EA7; Mon, 8 Feb 2016 11:55:50 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pa0-x231.google.com (mail-pa0-x231.google.com [IPv6:2607:f8b0:400e:c03::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FF5F1A10; Mon, 8 Feb 2016 11:55:49 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pa0-x231.google.com with SMTP id cy9so72899055pac.0; Mon, 08 Feb 2016 03:55:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:reply-to:subject:references:to:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=F6mzbVYdUiBhZ7HAnr5d9410hP1isqjN1Ir0FELjFSE=; b=T35Xf8Y+6y3GhoDXPDLOfVgy4gq1ekgT/8xSebdxr/ww7dhRU/DAByasZNB5th1tPb vgQ3oKbrdzru3IjgaOz8omJ6GRsgSLSS7yO7YFgM9MJglFrtRpP82VWdqb5ZFS6H0ZlI yO8V9iKd9a2YtaBCuC5BeMiatxCfBt/M8VTxIMXV9sCIN0wg1eizvMalJSkgs/7R+Y2N c2MgMhqF9T/Kn01/OcR2EhtS8HZZ655AbOUb3haOcL5o+lB14+jB+fllXbTU1e9U+AG8 IGzorxROppLxwi+O4q7iCG1iKDCH9varc/EYiZyrP8i+oJxfxw6gtPpvrkZpNTBnStIy 9FwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:reply-to:subject:references:to:from :message-id:date:user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=F6mzbVYdUiBhZ7HAnr5d9410hP1isqjN1Ir0FELjFSE=; b=cMqzPeldzgfqSiiD5Lsv1eUHVMYbWXOhvFeUQ8ehoZyn6FWETCSUiuw557dO00iCqJ cx3fHVL85Cyx0GMJGTujjQqfmr2P6ugE3oXAdRaqsiziDdE9klCC7e8Xk6mQ+JiIfbYH LYvVakrgPqB0Gsqe1sYeJfztzeagnJMdJU5phMul8C57oh4adc+Pb2OUUcSx1V/w49NO 1A9gQFxSms4aZiY5qalGDIdM63zEsnABW+dL/ARcZywgImJSBHaGExOaeqSGl2F1KHaE cOvLn/BMd4Xyjt+bB9FF8ALUZyu/7tuij7v1YjSKF0YnjQOjBBBPx2Sv+E5RjBP8xRFY e31A== X-Gm-Message-State: AG10YOSULvUaYrdWhstKB5nm63tLhTVAyfz7MCtxGzjY+cVJUkgw5GhGj0f5712nT8+tPQ== X-Received: by 10.66.122.8 with SMTP id lo8mr42282489pab.35.1454932549580; Mon, 08 Feb 2016 03:55:49 -0800 (PST) Received: from ?IPv6:2001:44b8:31ae:7b01:ada3:f1e4:c013:2537? (2001-44b8-31ae-7b01-ada3-f1e4-c013-2537.static.ipv6.internode.on.net. [2001:44b8:31ae:7b01:ada3:f1e4:c013:2537]) by smtp.gmail.com with ESMTPSA id x10sm42960410pas.37.2016.02.08.03.55.47 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 08 Feb 2016 03:55:49 -0800 (PST) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r295385 - in head: sys/kern tools/regression/sysvsem References: <201602072212.u17MCdQ6033309@repo.freebsd.org> To: Jilles Tjoelker , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Kubilay Kocak Message-ID: <56B8823F.2090809@FreeBSD.org> Date: Mon, 8 Feb 2016 22:55:43 +1100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:44.0) Gecko/20100101 Thunderbird/44.0 MIME-Version: 1.0 In-Reply-To: <201602072212.u17MCdQ6033309@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 11:55:50 -0000 On 8/02/2016 9:12 AM, Jilles Tjoelker wrote: > Author: jilles > Date: Sun Feb 7 22:12:39 2016 > New Revision: 295385 > URL: https://svnweb.freebsd.org/changeset/base/295385 > > Log: > semget(): Check for [EEXIST] error first. > > Although POSIX literally permits failing with [EINVAL] if IPC_CREAT and > IPC_EXCL were both passed, the semaphore set already exists and has fewer > semaphores than nsems, this does not allow an application to retry safely: > if the [EINVAL] is actually because of the semmsl limit, an infinite loop > would result. > > PR: 206927 > > Modified: > head/sys/kern/sysv_sem.c > head/tools/regression/sysvsem/semtest.c +infinity for bugfix & issue reference & regression test. Thank you Jilles! > Modified: head/sys/kern/sysv_sem.c > ============================================================================== > --- head/sys/kern/sysv_sem.c Sun Feb 7 21:25:08 2016 (r295384) > +++ head/sys/kern/sysv_sem.c Sun Feb 7 22:12:39 2016 (r295385) > @@ -867,6 +867,11 @@ sys_semget(struct thread *td, struct sem > } > if (semid < seminfo.semmni) { > DPRINTF(("found public key\n")); > + if ((semflg & IPC_CREAT) && (semflg & IPC_EXCL)) { > + DPRINTF(("not exclusive\n")); > + error = EEXIST; > + goto done2; > + } > if ((error = ipcperm(td, &sema[semid].u.sem_perm, > semflg & 0700))) { > goto done2; > @@ -876,11 +881,6 @@ sys_semget(struct thread *td, struct sem > error = EINVAL; > goto done2; > } > - if ((semflg & IPC_CREAT) && (semflg & IPC_EXCL)) { > - DPRINTF(("not exclusive\n")); > - error = EEXIST; > - goto done2; > - } > #ifdef MAC > error = mac_sysvsem_check_semget(cred, &sema[semid]); > if (error != 0) > > Modified: head/tools/regression/sysvsem/semtest.c > ============================================================================== > --- head/tools/regression/sysvsem/semtest.c Sun Feb 7 21:25:08 2016 (r295384) > +++ head/tools/regression/sysvsem/semtest.c Sun Feb 7 22:12:39 2016 (r295385) > @@ -152,6 +152,15 @@ main(int argc, char *argv[]) > > print_semid_ds(&s_ds, 0600); > > + errno = 0; > + if (semget(semkey, 1, IPC_CREAT | IPC_EXCL | 0600) != -1 || > + errno != EEXIST) > + err(1, "semget IPC_EXCL 1 did not fail with [EEXIST]"); > + errno = 0; > + if (semget(semkey, 2, IPC_CREAT | IPC_EXCL | 0600) != -1 || > + errno != EEXIST) > + err(1, "semget IPC_EXCL 2 did not fail with [EEXIST]"); > + > for (child_count = 0; child_count < 5; child_count++) { > switch ((child_pid = fork())) { > case -1: From owner-svn-src-all@freebsd.org Mon Feb 8 12:29:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF220AA1645; Mon, 8 Feb 2016 12:29:19 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 6E7FAF9F; Mon, 8 Feb 2016 12:29:19 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aSkwI-000CbJ-AG; Mon, 08 Feb 2016 15:29:10 +0300 Date: Mon, 8 Feb 2016 15:29:10 +0300 From: Slawa Olhovchenkov To: =?utf-8?Q?Jean-S=C3=A9bastien_P=C3=A9dron?= Cc: Andriy Voskoboinyk , svn-src-stable@freebsd.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , svn-src-stable-10@freebsd.org Subject: Re: svn commit: r293857 - stable/10/sys/dev/drm2/i915 Message-ID: <20160208122910.GZ37895@zxy.spb.ru> References: <201601132156.u0DLunQs020854@repo.freebsd.org> <20160123162617.GL37895@zxy.spb.ru> <56A5E89A.3050106@FreeBSD.org> <20160125104506.GV88527@zxy.spb.ru> <56A619C5.6070109@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <56A619C5.6070109@FreeBSD.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 12:29:19 -0000 On Mon, Jan 25, 2016 at 01:49:09PM +0100, Jean-Sébastien Pédron wrote: > On 25/01/2016 11:50, Andriy Voskoboinyk wrote: > > Try to apply https://svnweb.freebsd.org/base?view=revision&revision=288653 > > (as for me, head/sys/dev/drm2/i915/i915_dma.c change fixes this) > > If this fixes the problem, perfect, I will merge it. BETA builds in actions, do you plan to merge at this time? From owner-svn-src-all@freebsd.org Mon Feb 8 16:59:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3D99AA0DAD; Mon, 8 Feb 2016 16:59:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 B46581CD; Mon, 8 Feb 2016 16:59:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u18Gxqu5058895; Mon, 8 Feb 2016 16:59:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u18Gxq6T058893; Mon, 8 Feb 2016 16:59:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602081659.u18Gxq6T058893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 8 Feb 2016 16:59:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295398 - in head: sys/boot/i386 targets/pseudo/userland/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 16:59:54 -0000 Author: emaste Date: Mon Feb 8 16:59:52 2016 New Revision: 295398 URL: https://svnweb.freebsd.org/changeset/base/295398 Log: Restore kgzldr on i386 only I previously disconnected kgzdr based on a misunderstanding. I'd still like to transition to supporting only the loader(8)-based boot path for handling compressed kernels, but that can follow the standard deprecation procedure. This reverts r291113. Requested by: dteske Modified: head/sys/boot/i386/Makefile head/targets/pseudo/userland/misc/Makefile.depend Modified: head/sys/boot/i386/Makefile ============================================================================== --- head/sys/boot/i386/Makefile Mon Feb 8 16:34:13 2016 (r295397) +++ head/sys/boot/i386/Makefile Mon Feb 8 16:59:52 2016 (r295398) @@ -8,6 +8,10 @@ SUBDIR= mbr pmbr boot0 boot0sio btx boo # special boot programs, 'self-extracting boot2+loader' SUBDIR+= pxeldr +.if ${MACHINE_CPUARCH} == "i386" +SUBDIR+= kgzldr +.endif + .if ${MK_ZFS} != "no" SUBDIR+= zfsboot gptzfsboot zfsloader .endif Modified: head/targets/pseudo/userland/misc/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/misc/Makefile.depend Mon Feb 8 16:34:13 2016 (r295397) +++ head/targets/pseudo/userland/misc/Makefile.depend Mon Feb 8 16:59:52 2016 (r295398) @@ -40,6 +40,7 @@ DIRDEPS.x86sys= \ sys/boot/i386/btx/lib \ sys/boot/i386/cdboot \ sys/boot/i386/gptboot \ + sys/boot/i386/kgzldr \ sys/boot/i386/libfirewire \ sys/boot/i386/libi386 \ sys/boot/i386/loader \ From owner-svn-src-all@freebsd.org Mon Feb 8 17:30:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36C42AA1B44; Mon, 8 Feb 2016 17:30:19 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 07D2811C7; Mon, 8 Feb 2016 17:30:18 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u18HUIF4068022; Mon, 8 Feb 2016 17:30:18 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u18HUIBK068021; Mon, 8 Feb 2016 17:30:18 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201602081730.u18HUIBK068021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Mon, 8 Feb 2016 17:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295399 - head/share/examples/jails X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 17:30:19 -0000 Author: dteske Date: Mon Feb 8 17:30:17 2016 New Revision: 295399 URL: https://svnweb.freebsd.org/changeset/base/295399 Log: Fix copy/paste error; s/ngX/eXb/ Modified: head/share/examples/jails/jib Modified: head/share/examples/jails/jib ============================================================================== --- head/share/examples/jails/jib Mon Feb 8 16:59:52 2016 (r295398) +++ head/share/examples/jails/jib Mon Feb 8 17:30:17 2016 (r295399) @@ -276,14 +276,14 @@ jib_addm() ifconfig "e${i}a_$name" ether $eiface_devid_a > /dev/null 2>&1 ifconfig "e${i}b_$name" ether $eiface_devid_b > /dev/null 2>&1 - i=$(( $i + 1 )) # on to next ng{i}_name + i=$(( $i + 1 )) # on to next e{i}b_name done # for iface } jib_show_usage="show" jib_show_descr="List possible NAME values for \`show NAME'" jib_show1_usage="show NAME" -jib_show1_descr="Lists ng0_NAME [ng1_NAME ...]" +jib_show1_descr="Lists e0b_NAME [e1b_NAME ...]" jib_show2_usage="show [NAME]" jib_show() { From owner-svn-src-all@freebsd.org Mon Feb 8 17:36:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC4BAAA1EEB; Mon, 8 Feb 2016 17:36:47 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 78AC017AD; Mon, 8 Feb 2016 17:36:47 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u18Hak24070916; Mon, 8 Feb 2016 17:36:46 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u18Hakbc070913; Mon, 8 Feb 2016 17:36:46 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201602081736.u18Hakbc070913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Mon, 8 Feb 2016 17:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295400 - head/share/examples/jails X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 17:36:47 -0000 Author: dteske Date: Mon Feb 8 17:36:46 2016 New Revision: 295400 URL: https://svnweb.freebsd.org/changeset/base/295400 Log: Provide additional information on overall purpose Modified: head/share/examples/jails/jib head/share/examples/jails/jng Modified: head/share/examples/jails/jib ============================================================================== --- head/share/examples/jails/jib Mon Feb 8 17:30:17 2016 (r295399) +++ head/share/examples/jails/jib Mon Feb 8 17:36:46 2016 (r295400) @@ -33,7 +33,11 @@ ############################################################ INFORMATION # # Use this tool with jail.conf(5) (or rc.conf(5) ``legacy'' configuration) to -# manage `vnet' interfaces. In jail.conf(5) format: +# manage `vnet' interfaces for jails. Designed to automate the creation of vnet +# interface(s) during jail `prestart' and destroy said interface(s) during jail +# `poststop'. +# +# In jail.conf(5) format: # # ### BEGIN EXCERPT ### # Modified: head/share/examples/jails/jng ============================================================================== --- head/share/examples/jails/jng Mon Feb 8 17:30:17 2016 (r295399) +++ head/share/examples/jails/jng Mon Feb 8 17:36:46 2016 (r295400) @@ -33,7 +33,11 @@ ############################################################ INFORMATION # # Use this tool with jail.conf(5) (or rc.conf(5) ``legacy'' configuration) to -# manage `vnet' interfaces. In jail.conf(5) format: +# manage `vnet' interfaces for jails. Designed to automate the creation of vnet +# interface(s) during jail `prestart' and destroy said interface(s) during jail +# `poststop'. +# +# In jail.conf(5) format: # # ### BEGIN EXCERPT ### # From owner-svn-src-all@freebsd.org Mon Feb 8 17:47:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4705EAA23B0; Mon, 8 Feb 2016 17:47:38 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 13F461E46; Mon, 8 Feb 2016 17:47:38 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u18Hlb1b073799; Mon, 8 Feb 2016 17:47:37 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u18HlaI6073797; Mon, 8 Feb 2016 17:47:36 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201602081747.u18HlaI6073797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Mon, 8 Feb 2016 17:47:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295401 - head/share/examples/jails X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 17:47:38 -0000 Author: dteske Date: Mon Feb 8 17:47:36 2016 New Revision: 295401 URL: https://svnweb.freebsd.org/changeset/base/295401 Log: Adjust MAC allocation algo to support layering Modified: head/share/examples/jails/jib head/share/examples/jails/jng Modified: head/share/examples/jails/jib ============================================================================== --- head/share/examples/jails/jib Mon Feb 8 17:36:46 2016 (r295400) +++ head/share/examples/jails/jib Mon Feb 8 17:47:36 2016 (r295401) @@ -267,8 +267,15 @@ jib_addm() 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; esac - eiface_devid_a=2:$quad$eiface_devid_a - eiface_devid_b=6:$quad$eiface_devid_b + case "$iface_devid" in + ?2:*|?6:*) + eiface_devid_a=a:$quad$eiface_devid_a + eiface_devid_b=e:$quad$eiface_devid_b + ;; + *) + eiface_devid_a=2:$quad$eiface_devid_a + eiface_devid_b=6:$quad$eiface_devid_b + esac num=$(( $num >> 4 )) quad=$(( $num & 15 )) case "$quad" in Modified: head/share/examples/jails/jng ============================================================================== --- head/share/examples/jails/jng Mon Feb 8 17:36:46 2016 (r295400) +++ head/share/examples/jails/jng Mon Feb 8 17:47:36 2016 (r295401) @@ -297,7 +297,10 @@ jng_bridge() 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; esac - eiface_devid=2:$quad$eiface_devid + case "$iface_devid" in + ?2:*) eiface_devid=a:$quad$eiface_devid ;; + *) eiface_devid=2:$quad$eiface_devid + esac num=$(( $num >> 4 )) quad=$(( $num & 15 )) case "$quad" in From owner-svn-src-all@freebsd.org Mon Feb 8 17:47:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92FD3AA242E; Mon, 8 Feb 2016 17:47:59 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 5EFC71FB4; Mon, 8 Feb 2016 17:47:59 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u18HlwIe073866; Mon, 8 Feb 2016 17:47:58 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u18Hlw0G073865; Mon, 8 Feb 2016 17:47:58 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201602081747.u18Hlw0G073865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 8 Feb 2016 17:47: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: r295402 - stable/10/sys/netpfil/pf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 17:47:59 -0000 Author: glebius Date: Mon Feb 8 17:47:58 2016 New Revision: 295402 URL: https://svnweb.freebsd.org/changeset/base/295402 Log: Merge r264915: fix NULL pointer derefernce with special sequence of DIOCADDADDR and DIOCADDRULE. PR: 206933 Approved by: re (marius) Modified: stable/10/sys/netpfil/pf/pf_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/10/sys/netpfil/pf/pf_ioctl.c Mon Feb 8 17:47:36 2016 (r295401) +++ stable/10/sys/netpfil/pf/pf_ioctl.c Mon Feb 8 17:47:58 2016 (r295402) @@ -350,7 +350,9 @@ pf_empty_pool(struct pf_palist *poola) pfi_dynaddr_remove(pa->addr.p.dyn); break; case PF_ADDR_TABLE: - pfr_detach_table(pa->addr.p.tbl); + /* XXX: this could be unfinished pooladdr on pabuf */ + if (pa->addr.p.tbl != NULL) + pfr_detach_table(pa->addr.p.tbl); break; } if (pa->kif) From owner-svn-src-all@freebsd.org Mon Feb 8 19:24:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 867F1AA2EEB; Mon, 8 Feb 2016 19:24:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 43D35B9E; Mon, 8 Feb 2016 19:24:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u18JOEJt006082; Mon, 8 Feb 2016 19:24:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u18JODcb006075; Mon, 8 Feb 2016 19:24:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201602081924.u18JODcb006075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 8 Feb 2016 19:24:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295407 - in head/lib: libc/gen libc/include libc/sys libthr libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 19:24:15 -0000 Author: kib Date: Mon Feb 8 19:24:13 2016 New Revision: 295407 URL: https://svnweb.freebsd.org/changeset/base/295407 Log: If libthr.so is dlopened without RTLD_GLOBAL flag, the libthr symbols do not participate in the global symbols namespace, but rtld locks are still replaced and functions are interposed. In particular, __pthread_map_stacks_exec is resolved to the libc version. If a library is loaded later, which requires adjustment of the stack protection mode, rtld calls into libc __pthread_map_stacks_exec due to the symbols scope. The libc version might recurse into binder and recursively acquire rtld bind lock, causing the hang. Make libc __pthread_map_stacks_exec() interposed, which synchronizes rtld locks and version of the stack exec hook when libthr loaded, regardless of the symbol scope control or symbol resolution order. The __pthread_map_stacks_exec() symbol is removed from the private version in libthr since libc symbol now operates correctly in presence of libthr. Reported and tested by: markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/lib/libc/gen/elf_utils.c head/lib/libc/include/libc_private.h head/lib/libc/sys/interposing_table.c head/lib/libthr/pthread.map head/lib/libthr/thread/thr_private.h head/lib/libthr/thread/thr_stack.c head/lib/libthr/thread/thr_syscalls.c Modified: head/lib/libc/gen/elf_utils.c ============================================================================== --- head/lib/libc/gen/elf_utils.c Mon Feb 8 18:57:06 2016 (r295406) +++ head/lib/libc/gen/elf_utils.c Mon Feb 8 19:24:13 2016 (r295407) @@ -32,6 +32,7 @@ #include #include #include +#include "libc_private.h" int __elf_phdr_match_addr(struct dl_phdr_info *, void *); void __pthread_map_stacks_exec(void); @@ -54,9 +55,8 @@ __elf_phdr_match_addr(struct dl_phdr_inf return (i != phdr_info->dlpi_phnum); } -#pragma weak __pthread_map_stacks_exec void -__pthread_map_stacks_exec(void) +__libc_map_stacks_exec(void) { int mib[2]; struct rlimit rlim; @@ -75,3 +75,10 @@ __pthread_map_stacks_exec(void) rlim.rlim_cur, _rtld_get_stack_prot()); } +#pragma weak __pthread_map_stacks_exec +void +__pthread_map_stacks_exec(void) +{ + + ((void (*)(void))__libc_interposing[INTERPOS_map_stacks_exec])(); +} Modified: head/lib/libc/include/libc_private.h ============================================================================== --- head/lib/libc/include/libc_private.h Mon Feb 8 18:57:06 2016 (r295406) +++ head/lib/libc/include/libc_private.h Mon Feb 8 19:24:13 2016 (r295407) @@ -224,6 +224,7 @@ enum { INTERPOS_kevent, INTERPOS_wait6, INTERPOS_ppoll, + INTERPOS_map_stacks_exec, INTERPOS_MAX }; @@ -381,6 +382,7 @@ int _elf_aux_info(int aux, void *buf, in struct dl_phdr_info; int __elf_phdr_match_addr(struct dl_phdr_info *, void *); void __init_elf_aux_vector(void); +void __libc_map_stacks_exec(); void _pthread_cancel_enter(int); void _pthread_cancel_leave(int); Modified: head/lib/libc/sys/interposing_table.c ============================================================================== --- head/lib/libc/sys/interposing_table.c Mon Feb 8 18:57:06 2016 (r295406) +++ head/lib/libc/sys/interposing_table.c Mon Feb 8 19:24:13 2016 (r295407) @@ -78,6 +78,7 @@ interpos_func_t __libc_interposing[INTER SLOT(kevent, __sys_kevent), SLOT(wait6, __sys_wait6), SLOT(ppoll, __sys_ppoll), + SLOT(map_stacks_exec, __libc_map_stacks_exec), }; #undef SLOT Modified: head/lib/libthr/pthread.map ============================================================================== --- head/lib/libthr/pthread.map Mon Feb 8 18:57:06 2016 (r295406) +++ head/lib/libthr/pthread.map Mon Feb 8 19:24:13 2016 (r295407) @@ -295,8 +295,6 @@ FBSDprivate_1.0 { _thread_size_key; _thread_state_running; _thread_state_zoombie; - - __pthread_map_stacks_exec; }; FBSD_1.1 { Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Mon Feb 8 18:57:06 2016 (r295406) +++ head/lib/libthr/thread/thr_private.h Mon Feb 8 19:24:13 2016 (r295407) @@ -927,6 +927,8 @@ int __thr_sigwait(const sigset_t *set, i int __thr_sigwaitinfo(const sigset_t *set, siginfo_t *info); int __thr_swapcontext(ucontext_t *oucp, const ucontext_t *ucp); +void __thr_map_stacks_exec(void); + struct _spinlock; void __thr_spinunlock(struct _spinlock *lck); void __thr_spinlock(struct _spinlock *lck); Modified: head/lib/libthr/thread/thr_stack.c ============================================================================== --- head/lib/libthr/thread/thr_stack.c Mon Feb 8 18:57:06 2016 (r295406) +++ head/lib/libthr/thread/thr_stack.c Mon Feb 8 19:24:13 2016 (r295407) @@ -161,9 +161,8 @@ singlethread_map_stacks_exec(void) rlim.rlim_cur, _rtld_get_stack_prot()); } -void __pthread_map_stacks_exec(void); void -__pthread_map_stacks_exec(void) +__thr_map_stacks_exec(void) { struct pthread *curthread, *thrd; struct stack *st; Modified: head/lib/libthr/thread/thr_syscalls.c ============================================================================== --- head/lib/libthr/thread/thr_syscalls.c Mon Feb 8 18:57:06 2016 (r295406) +++ head/lib/libthr/thread/thr_syscalls.c Mon Feb 8 19:24:13 2016 (r295407) @@ -652,6 +652,7 @@ __thr_interpose_libc(void) SLOT(kevent); SLOT(wait6); SLOT(ppoll); + SLOT(map_stacks_exec); #undef SLOT *(__libc_interposing_slot( INTERPOS__pthread_mutex_init_calloc_cb)) = From owner-svn-src-all@freebsd.org Mon Feb 8 19:34:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3827BAA0373; Mon, 8 Feb 2016 19:34:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 EFA0E1329; Mon, 8 Feb 2016 19:34:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u18JYIeX009209; Mon, 8 Feb 2016 19:34:18 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u18JYIYC009208; Mon, 8 Feb 2016 19:34:18 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201602081934.u18JYIYC009208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 8 Feb 2016 19:34:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295408 - head/sys/boot/efi/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 19:34:19 -0000 Author: imp Date: Mon Feb 8 19:34:17 2016 New Revision: 295408 URL: https://svnweb.freebsd.org/changeset/base/295408 Log: Implement -P for boot loader. It's a bit easier to implement here than in boot1, like is normally done. When a keyboard appears in the UEFI device tree, assume -D -h, just like on a BIOS boot. # It is unclear if an ACPI keyboard appearing in the tree means there's # a real keyboard or not. A USB keyboard doesn't seem to appear unless # it is really there. Differential Revision: https://reviews.freebsd.org/D5223 Modified: head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Mon Feb 8 19:24:13 2016 (r295407) +++ head/sys/boot/efi/loader/main.c Mon Feb 8 19:34:17 2016 (r295408) @@ -66,6 +66,7 @@ EFI_GUID hoblist = HOB_LIST_TABLE_GUID; EFI_GUID memtype = MEMORY_TYPE_INFORMATION_TABLE_GUID; EFI_GUID debugimg = DEBUG_IMAGE_INFO_TABLE_GUID; EFI_GUID fdtdtb = FDT_TABLE_GUID; +EFI_GUID inputid = SIMPLE_TEXT_INPUT_PROTOCOL; #ifdef EFI_ZFS_BOOT static void efi_zfs_probe(void); @@ -94,6 +95,88 @@ cp16to8(const CHAR16 *src, char *dst, si dst[i] = (char)src[i]; } +static int +has_keyboard(void) +{ + EFI_STATUS status; + EFI_DEVICE_PATH *path; + EFI_HANDLE *hin, *hin_end, *walker; + UINTN sz; + int retval = 0; + + /* + * Find all the handles that support the SIMPLE_TEXT_INPUT_PROTOCOL and + * do the typical dance to get the right sized buffer. + */ + sz = 0; + hin = NULL; + status = BS->LocateHandle(ByProtocol, &inputid, 0, &sz, 0); + if (status == EFI_BUFFER_TOO_SMALL) { + hin = (EFI_HANDLE *)malloc(sz); + status = BS->LocateHandle(ByProtocol, &inputid, 0, &sz, + hin); + if (EFI_ERROR(status)) + free(hin); + } + if (EFI_ERROR(status)) + return retval; + + /* + * Look at each of the handles. If it supports the device path protocol, + * use it to get the device path for this handle. Then see if that + * device path matches either the USB device path for keyboards or the + * legacy device path for keyboards. + */ + hin_end = &hin[sz / sizeof(*hin)]; + for (walker = hin; walker < hin_end; walker++) { + status = BS->HandleProtocol(*walker, &devid, (VOID **)&path); + if (EFI_ERROR(status)) + continue; + + while (!IsDevicePathEnd(path)) { + /* + * Check for the ACPI keyboard node. All PNP3xx nodes + * are keyboards of different flavors. Note: It is + * unclear of there's always a keyboard node when + * there's a keyboard controller, or if there's only one + * when a keyboard is detected at boot. + */ + if (DevicePathType(path) == ACPI_DEVICE_PATH && + (DevicePathSubType(path) == ACPI_DP || + DevicePathSubType(path) == ACPI_EXTENDED_DP)) { + ACPI_HID_DEVICE_PATH *acpi; + + acpi = (ACPI_HID_DEVICE_PATH *)(void *)path; + if ((EISA_ID_TO_NUM(acpi->HID) & 0xff00) == 0x300 && + (acpi->HID & 0xffff) == PNP_EISA_ID_CONST) { + retval = 1; + goto out; + } + /* + * Check for USB keyboard node, if present. Unlike a + * PS/2 keyboard, these definitely only appear when + * connected to the system. + */ + } else if (DevicePathType(path) == MESSAGING_DEVICE_PATH && + DevicePathSubType(path) == MSG_USB_CLASS_DP) { + USB_CLASS_DEVICE_PATH *usb; + + usb = (USB_CLASS_DEVICE_PATH *)(void *)path; + if (usb->DeviceClass == 3 && /* HID */ + usb->DeviceSubClass == 1 && /* Boot devices */ + usb->DeviceProtocol == 1) { /* Boot keyboards */ + retval = 1; + goto out; + } + } + path = NextDevicePathNode(path); + } + } +out: + free(hin); + return retval; +} + EFI_STATUS main(int argc, CHAR16 *argv[]) { @@ -104,6 +187,7 @@ main(int argc, CHAR16 *argv[]) struct devsw *dev; uint64_t pool_guid; UINTN k; + int has_kbd; archsw.arch_autoload = efi_autoload; archsw.arch_getdev = efi_getdev; @@ -115,6 +199,8 @@ main(int argc, CHAR16 *argv[]) archsw.arch_zfs_probe = efi_zfs_probe; #endif + has_kbd = has_keyboard(); + /* * XXX Chicken-and-egg problem; we want to have console output * early, but some console attributes may depend on reading from @@ -150,15 +236,19 @@ main(int argc, CHAR16 *argv[]) case 'D': howto |= RB_MULTIPLE; break; - case 'm': - howto |= RB_MUTE; - break; case 'h': howto |= RB_SERIAL; break; + case 'm': + howto |= RB_MUTE; + break; case 'p': howto |= RB_PAUSE; break; + case 'P': + if (!has_kbd) + howto |= RB_SERIAL | RB_MULTIPLE; + break; case 'r': howto |= RB_DFLTROOT; break; From owner-svn-src-all@freebsd.org Mon Feb 8 19:45:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16DD4AA0AB0; Mon, 8 Feb 2016 19:45:57 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 DCF501CA8; Mon, 8 Feb 2016 19:45:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u18JjtPn012459; Mon, 8 Feb 2016 19:45:55 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u18JjtDg012458; Mon, 8 Feb 2016 19:45:55 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602081945.u18JjtDg012458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 8 Feb 2016 19:45:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295409 - head/sys/boot/ficl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 19:45:57 -0000 Author: pfg Date: Mon Feb 8 19:45:55 2016 New Revision: 295409 URL: https://svnweb.freebsd.org/changeset/base/295409 Log: ficl: Replace rand(3) with random(3). While the later is a better random generator than the former, the main reason of the change is that random() has a better chance to work with libstand(3). At this time we don't include random number generators in bootforth so this has no effect. Modified: head/sys/boot/ficl/words.c Modified: head/sys/boot/ficl/words.c ============================================================================== --- head/sys/boot/ficl/words.c Mon Feb 8 19:34:17 2016 (r295408) +++ head/sys/boot/ficl/words.c Mon Feb 8 19:45:55 2016 (r295409) @@ -4822,7 +4822,7 @@ WORDKIND ficlWordClassify(FICL_WORD *pFW **************************************************************************/ static void ficlRandom(FICL_VM *pVM) { - PUSHINT(rand()); + PUSHINT(random()); } @@ -4832,7 +4832,7 @@ static void ficlRandom(FICL_VM *pVM) **************************************************************************/ static void ficlSeedRandom(FICL_VM *pVM) { - srand(POPINT()); + srandom(POPUNS()); } #endif From owner-svn-src-all@freebsd.org Mon Feb 8 20:03:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE6D1AA131C; Mon, 8 Feb 2016 20:03:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 ACC0C17E3; Mon, 8 Feb 2016 20:03:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u18K3EJk018514; Mon, 8 Feb 2016 20:03:14 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u18K3EKH018513; Mon, 8 Feb 2016 20:03:14 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602082003.u18K3EKH018513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 8 Feb 2016 20:03:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295410 - head/sys/boot/ficl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 20:03:16 -0000 Author: pfg Date: Mon Feb 8 20:03:14 2016 New Revision: 295410 URL: https://svnweb.freebsd.org/changeset/base/295410 Log: ficl: Replace rand(3) with random(3). Be a little more consistent with random(3) and push an unsigned value. Again, this has no effect as this code doesn't get compiled for the boot code. Modified: head/sys/boot/ficl/words.c Modified: head/sys/boot/ficl/words.c ============================================================================== --- head/sys/boot/ficl/words.c Mon Feb 8 19:45:55 2016 (r295409) +++ head/sys/boot/ficl/words.c Mon Feb 8 20:03:14 2016 (r295410) @@ -4822,7 +4822,7 @@ WORDKIND ficlWordClassify(FICL_WORD *pFW **************************************************************************/ static void ficlRandom(FICL_VM *pVM) { - PUSHINT(random()); + PUSHUNS(random()); } From owner-svn-src-all@freebsd.org Mon Feb 8 20:06:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 973A1AA1445; Mon, 8 Feb 2016 20:06:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 5193619FA; Mon, 8 Feb 2016 20:06:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u18K6QIV018682; Mon, 8 Feb 2016 20:06:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u18K6Q5k018681; Mon, 8 Feb 2016 20:06:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602082006.u18K6Q5k018681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 8 Feb 2016 20:06:26 +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: r295411 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 20:06:27 -0000 Author: emaste Date: Mon Feb 8 20:06:26 2016 New Revision: 295411 URL: https://svnweb.freebsd.org/changeset/base/295411 Log: MFC r280950: Move the efi loaders to be under sys/boot/efi In HEAD this was done to support UEFI on arm64. Merging to stable/10 to facilitate the merging of later UEFI changes. This is a commit of mergeinfo only, missed in r293297. Approved by: re (gjb) Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-all@freebsd.org Mon Feb 8 20:57:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B07CAA2CA6; Mon, 8 Feb 2016 20:57:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 3FA721AF7; Mon, 8 Feb 2016 20:57:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u18KvCLf034049; Mon, 8 Feb 2016 20:57:12 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u18KvCP7034048; Mon, 8 Feb 2016 20:57:12 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602082057.u18KvCP7034048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 8 Feb 2016 20:57:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295413 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 20:57:13 -0000 Author: bdrewery Date: Mon Feb 8 20:57:12 2016 New Revision: 295413 URL: https://svnweb.freebsd.org/changeset/base/295413 Log: kmod.mk: Support a beforebuild target such as bsd.prog.mk has. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/conf/kmod.mk Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Mon Feb 8 20:21:07 2016 (r295412) +++ head/sys/conf/kmod.mk Mon Feb 8 20:57:12 2016 (r295413) @@ -249,7 +249,8 @@ _ILINKS+=x86 .endif CLEANFILES+=${_ILINKS} -all: objwarn ${PROG} +all: beforebuild .WAIT ${PROG} +beforebuild: objwarn beforedepend: ${_ILINKS} From owner-svn-src-all@freebsd.org Mon Feb 8 20:58:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B297EAA2D7D; Mon, 8 Feb 2016 20:58:53 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 84CC11C8D; Mon, 8 Feb 2016 20:58:53 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u18KwqXR034144; Mon, 8 Feb 2016 20:58:52 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u18Kwq7t034143; Mon, 8 Feb 2016 20:58:52 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602082058.u18Kwq7t034143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 8 Feb 2016 20:58:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295414 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 20:58:53 -0000 Author: bdrewery Date: Mon Feb 8 20:58:52 2016 New Revision: 295414 URL: https://svnweb.freebsd.org/changeset/base/295414 Log: kmod.mk: Ensure ILINKS are created before building. This allows skipping 'make depend' or running 'make clean all' without getting a flip-flopping dependency due to the exists() just below. Otherwise an error is encountered, such as: fatal error: 'machine/endian.h' file not found. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/conf/kmod.mk Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Mon Feb 8 20:57:12 2016 (r295413) +++ head/sys/conf/kmod.mk Mon Feb 8 20:58:52 2016 (r295414) @@ -253,6 +253,7 @@ all: beforebuild .WAIT ${PROG} beforebuild: objwarn beforedepend: ${_ILINKS} +beforebuild: ${_ILINKS} # Ensure that the links exist without depending on it when it exists which # causes all the modules to be rebuilt when the directory pointed to changes. From owner-svn-src-all@freebsd.org Mon Feb 8 21:42:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C079AA2392; Mon, 8 Feb 2016 21:42:39 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E26CA930; Mon, 8 Feb 2016 21:42:38 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id EC774B958; Mon, 8 Feb 2016 16:42:37 -0500 (EST) From: John Baldwin To: Gleb Smirnoff Cc: Bryan Drewery , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295226 - head/lib/libmemstat Date: Mon, 08 Feb 2016 13:21:18 -0800 Message-ID: <12103176.kVCUAMSdl5@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20160204170603.GF65294@FreeBSD.org> References: <201602040023.u140NL0i052392@repo.freebsd.org> <56B29E36.8000900@FreeBSD.org> <20160204170603.GF65294@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 08 Feb 2016 16:42:38 -0500 (EST) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 21:42:39 -0000 On Thursday, February 04, 2016 09:06:03 AM Gleb Smirnoff wrote: > On Wed, Feb 03, 2016 at 04:41:26PM -0800, Bryan Drewery wrote: > B> On 2/3/2016 4:23 PM, Gleb Smirnoff wrote: > B> > Author: glebius > B> > Date: Thu Feb 4 00:23:21 2016 > B> > New Revision: 295226 > B> > URL: https://svnweb.freebsd.org/changeset/base/295226 > B> > > B> > Log: > B> > Fix build. > B> > > B> > Modified: > B> > head/lib/libmemstat/memstat_uma.c > B> > > B> > Modified: head/lib/libmemstat/memstat_uma.c > B> > ============================================================================== > B> > --- head/lib/libmemstat/memstat_uma.c Wed Feb 3 23:41:58 2016 (r295225) > B> > +++ head/lib/libmemstat/memstat_uma.c Thu Feb 4 00:23:21 2016 (r295226) > B> > @@ -29,6 +29,7 @@ > B> > #include > B> > #include > B> > #include > B> > +#include > B> > > B> > #include > B> > #include > B> > > B> > B> Shouldn't uma_int.h forward declare or include _task.h for struct task? > > Forward declaration won't work, since structure is included, not pointed at. > I'm reluctant with adding includes into includes. The sys/_foo.h headers are specifically designed so they can be used as nested includes while (hopefully) introducing minimal pollution. If you are embedding struct task in a structure, use a nested include of . That is why exists as a separate header from . -- John Baldwin From owner-svn-src-all@freebsd.org Mon Feb 8 22:02:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F066AA2E46; Mon, 8 Feb 2016 22:02:57 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 7217B1334; Mon, 8 Feb 2016 22:02:57 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u18M2u9B054259; Mon, 8 Feb 2016 22:02:56 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u18M2ud9054258; Mon, 8 Feb 2016 22:02:56 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201602082202.u18M2ud9054258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 8 Feb 2016 22:02:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295416 - head/lib/libc/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 22:02:57 -0000 Author: markj Date: Mon Feb 8 22:02:56 2016 New Revision: 295416 URL: https://svnweb.freebsd.org/changeset/base/295416 Log: Fix the gcc build after r295407. X-MFC-With: r295407 Modified: head/lib/libc/include/libc_private.h Modified: head/lib/libc/include/libc_private.h ============================================================================== --- head/lib/libc/include/libc_private.h Mon Feb 8 21:15:07 2016 (r295415) +++ head/lib/libc/include/libc_private.h Mon Feb 8 22:02:56 2016 (r295416) @@ -382,7 +382,7 @@ int _elf_aux_info(int aux, void *buf, in struct dl_phdr_info; int __elf_phdr_match_addr(struct dl_phdr_info *, void *); void __init_elf_aux_vector(void); -void __libc_map_stacks_exec(); +void __libc_map_stacks_exec(void); void _pthread_cancel_enter(int); void _pthread_cancel_leave(int); From owner-svn-src-all@freebsd.org Mon Feb 8 22:13:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCADEAA13B7; Mon, 8 Feb 2016 22:13:09 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 9A8FE1A2F; Mon, 8 Feb 2016 22:13:09 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u18MD8hu057186; Mon, 8 Feb 2016 22:13:08 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u18MD8T4057185; Mon, 8 Feb 2016 22:13:08 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201602082213.u18MD8T4057185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Mon, 8 Feb 2016 22:13:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295417 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 22:13:09 -0000 Author: ken Date: Mon Feb 8 22:13:08 2016 New Revision: 295417 URL: https://svnweb.freebsd.org/changeset/base/295417 Log: Fix the SCSI Extended INQUIRY probe case when an error is returned and a retry is scheduled. Instead of leaving the device queue frozen, unfreeze the device queue so that the retry can happen. Sponsored by: Spectra Logic MFC after: 3 days Modified: head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Mon Feb 8 22:02:56 2016 (r295416) +++ head/sys/cam/scsi/scsi_xpt.c Mon Feb 8 22:13:08 2016 (r295417) @@ -1518,7 +1518,7 @@ out: } else if (cam_periph_error(done_ccb, 0, SF_RETRY_UA, &softc->saved_ccb) == ERESTART) { - return; + goto outr; } else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { /* Don't wedge the queue */ xpt_release_devq(done_ccb->ccb_h.path, /*count*/1, From owner-svn-src-all@freebsd.org Mon Feb 8 22:50:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DECD6AA26CB; Mon, 8 Feb 2016 22:50:46 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CA48F10F1; Mon, 8 Feb 2016 22:50:46 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u18MoeIT093703 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 8 Feb 2016 14:50:40 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u18ModRP093702; Mon, 8 Feb 2016 14:50:39 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 8 Feb 2016 14:50:39 -0800 From: Gleb Smirnoff To: John Baldwin Cc: Bryan Drewery , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295226 - head/lib/libmemstat Message-ID: <20160208225039.GZ72286@FreeBSD.org> References: <201602040023.u140NL0i052392@repo.freebsd.org> <56B29E36.8000900@FreeBSD.org> <20160204170603.GF65294@FreeBSD.org> <12103176.kVCUAMSdl5@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <12103176.kVCUAMSdl5@ralph.baldwin.cx> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 22:50:47 -0000 On Mon, Feb 08, 2016 at 01:21:18PM -0800, John Baldwin wrote: J> On Thursday, February 04, 2016 09:06:03 AM Gleb Smirnoff wrote: J> > On Wed, Feb 03, 2016 at 04:41:26PM -0800, Bryan Drewery wrote: J> > B> On 2/3/2016 4:23 PM, Gleb Smirnoff wrote: J> > B> > Author: glebius J> > B> > Date: Thu Feb 4 00:23:21 2016 J> > B> > New Revision: 295226 J> > B> > URL: https://svnweb.freebsd.org/changeset/base/295226 J> > B> > J> > B> > Log: J> > B> > Fix build. J> > B> > J> > B> > Modified: J> > B> > head/lib/libmemstat/memstat_uma.c J> > B> > J> > B> > Modified: head/lib/libmemstat/memstat_uma.c J> > B> > ============================================================================== J> > B> > --- head/lib/libmemstat/memstat_uma.c Wed Feb 3 23:41:58 2016 (r295225) J> > B> > +++ head/lib/libmemstat/memstat_uma.c Thu Feb 4 00:23:21 2016 (r295226) J> > B> > @@ -29,6 +29,7 @@ J> > B> > #include J> > B> > #include J> > B> > #include J> > B> > +#include J> > B> > J> > B> > #include J> > B> > #include J> > B> > J> > B> J> > B> Shouldn't uma_int.h forward declare or include _task.h for struct task? J> > J> > Forward declaration won't work, since structure is included, not pointed at. J> > I'm reluctant with adding includes into includes. J> J> The sys/_foo.h headers are specifically designed so they can be used as nested J> includes while (hopefully) introducing minimal pollution. If you are embedding J> struct task in a structure, use a nested include of . That is J> why exists as a separate header from . Thanks, John. Will try to fixup that now. -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Mon Feb 8 23:06:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8750CAA2F1D; Mon, 8 Feb 2016 23:06:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 5B5E01CB5; Mon, 8 Feb 2016 23:06:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u18N6Rh4071956; Mon, 8 Feb 2016 23:06:27 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u18N6Rt9071955; Mon, 8 Feb 2016 23:06:27 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201602082306.u18N6Rt9071955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 8 Feb 2016 23:06:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295418 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 23:06:28 -0000 Author: jhb Date: Mon Feb 8 23:06:27 2016 New Revision: 295418 URL: https://svnweb.freebsd.org/changeset/base/295418 Log: Mark proc0 as a kernel process via the P_KTHREAD flag. All other kernel processes have this flag set and all threads in proc0 (including thread0) have the similar TDP_KTHREAD flag set. PR: 204999 Submitted by: Oliver Pinter @ HardenedBSD Reviewed by: kib MFC after: 1 week Modified: head/sys/kern/init_main.c Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Mon Feb 8 22:13:08 2016 (r295417) +++ head/sys/kern/init_main.c Mon Feb 8 23:06:27 2016 (r295418) @@ -479,7 +479,7 @@ proc0_init(void *dummy __unused) session0.s_leader = p; p->p_sysent = &null_sysvec; - p->p_flag = P_SYSTEM | P_INMEM; + p->p_flag = P_SYSTEM | P_INMEM | P_KTHREAD; p->p_flag2 = 0; p->p_state = PRS_NORMAL; knlist_init_mtx(&p->p_klist, &p->p_mtx); From owner-svn-src-all@freebsd.org Mon Feb 8 23:11:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA7CAAA0169; Mon, 8 Feb 2016 23:11:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 B8AE71F68; Mon, 8 Feb 2016 23:11:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u18NBN1Z074130; Mon, 8 Feb 2016 23:11:23 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u18NBNXr074129; Mon, 8 Feb 2016 23:11:23 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201602082311.u18NBNXr074129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 8 Feb 2016 23:11:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295419 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 23:11:25 -0000 Author: jhb Date: Mon Feb 8 23:11:23 2016 New Revision: 295419 URL: https://svnweb.freebsd.org/changeset/base/295419 Log: Call kthread_exit() rather than kproc_exit() for a premature kthread exit. Kernel threads (and processes) are supposed to call kthread_exit() (or kproc_exit()) to terminate. However, the kernel includes a fallback in fork_exit() to force a kthread exit if a kernel thread's "main" routine returns. This fallback was added back when the kernel only had processes and was not updated to call kthread_exit() instead of kproc_exit() when threads were added to the kernel. This mistake was particular exciting when the errant thread belonged to proc0. Due to the missing P_KTHREAD flag the fallback did not kick in and instead tried to return to userland via whatever garbage was in the trapframe. With P_KTHREAD set it tried to terminate proc0 resulting in other amusements. PR: 204999 MFC after: 1 week Modified: head/sys/kern/kern_fork.c Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Mon Feb 8 23:06:27 2016 (r295418) +++ head/sys/kern/kern_fork.c Mon Feb 8 23:11:23 2016 (r295419) @@ -1040,7 +1040,7 @@ fork_exit(void (*callout)(void *, struct if (p->p_flag & P_KTHREAD) { printf("Kernel thread \"%s\" (pid %d) exited prematurely.\n", td->td_name, p->p_pid); - kproc_exit(0); + kthread_exit(); } mtx_assert(&Giant, MA_NOTOWNED); From owner-svn-src-all@freebsd.org Tue Feb 9 00:01:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD429AA1F5D; Tue, 9 Feb 2016 00:01:44 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 7D85D387; Tue, 9 Feb 2016 00:01:44 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1901hVd089018; Tue, 9 Feb 2016 00:01:43 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1901hfw089017; Tue, 9 Feb 2016 00:01:43 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602090001.u1901hfw089017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 9 Feb 2016 00:01:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295420 - head/sys/boot/efi/loader/arch/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 00:01:44 -0000 Author: andrew Date: Tue Feb 9 00:01:43 2016 New Revision: 295420 URL: https://svnweb.freebsd.org/changeset/base/295420 Log: Ensure the bss is aligned to a 4-byte address as we use 4-byte aligned stores to clear it. While here reduce the alignment of the data from 4k to 16 byte aligned. This should be more than enough, without wasting too much space. Sponsored by: ABT Systems Ltd Modified: head/sys/boot/efi/loader/arch/arm/ldscript.arm Modified: head/sys/boot/efi/loader/arch/arm/ldscript.arm ============================================================================== --- head/sys/boot/efi/loader/arch/arm/ldscript.arm Mon Feb 8 23:11:23 2016 (r295419) +++ head/sys/boot/efi/loader/arch/arm/ldscript.arm Tue Feb 9 00:01:43 2016 (r295420) @@ -15,7 +15,7 @@ SECTIONS } =0 _etext = .; PROVIDE (etext = .); - . = ALIGN(4096); + . = ALIGN(16); .data : { *(.data *.data.*) @@ -24,6 +24,7 @@ SECTIONS *(.rodata.*) CONSTRUCTORS + . = ALIGN(4); PROVIDE (__bss_start = .); *(.sbss) *(.scommon) @@ -31,6 +32,7 @@ SECTIONS *(.dynbss) *(.bss) *(COMMON) + . = ALIGN(4); PROVIDE (__bss_end = .); } /* We want the small data sections together, so single-instruction offsets From owner-svn-src-all@freebsd.org Tue Feb 9 00:15:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 220F7A98617; Tue, 9 Feb 2016 00:15:43 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 E715A1183; Tue, 9 Feb 2016 00:15:42 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u190FfYc092633; Tue, 9 Feb 2016 00:15:41 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u190FfnN092632; Tue, 9 Feb 2016 00:15:41 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602090015.u190FfnN092632@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 9 Feb 2016 00:15:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295421 - head/sys/boot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 00:15:43 -0000 Author: andrew Date: Tue Feb 9 00:15:41 2016 New Revision: 295421 URL: https://svnweb.freebsd.org/changeset/base/295421 Log: Stop clang from generating movt/movw sequences. These don't get relocated so will access data from an unrelocated address. This is only needed for self relocating code on ARMv7, however this is true for both ubldr and loader.efi, the only two loaders we support on ARMv7. While here also force the fpu to be none as is done in libstand. Sponsored by: ABT Systems Ltd Modified: head/sys/boot/Makefile.inc Modified: head/sys/boot/Makefile.inc ============================================================================== --- head/sys/boot/Makefile.inc Tue Feb 9 00:01:43 2016 (r295420) +++ head/sys/boot/Makefile.inc Tue Feb 9 00:15:41 2016 (r295421) @@ -1,3 +1,11 @@ # $FreeBSD$ SSP_CFLAGS= + +.if ${MACHINE_CPUARCH} == "arm" +# Do not generate movt/movw, because the relocation fixup for them does not +# translate to the -Bsymbolic -pie format required by self_reloc() in loader(8). +# Also, the fpu is not available in a standalone environment. +CFLAGS.clang+= -mllvm -arm-use-movt=0 +CFLAGS.clang+= -mfpu=none +.endif From owner-svn-src-all@freebsd.org Tue Feb 9 01:41:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94019AA10F7; Tue, 9 Feb 2016 01:41:04 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 695691D54; Tue, 9 Feb 2016 01:41:04 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u191f36A017584; Tue, 9 Feb 2016 01:41:03 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u191f3Hu017582; Tue, 9 Feb 2016 01:41:03 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201602090141.u191f3Hu017582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 9 Feb 2016 01:41:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295422 - head/share/examples/jails X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 01:41:04 -0000 Author: dteske Date: Tue Feb 9 01:41:03 2016 New Revision: 295422 URL: https://svnweb.freebsd.org/changeset/base/295422 Log: Adjust MAC algo to support interface branching Modified: head/share/examples/jails/jib head/share/examples/jails/jng Modified: head/share/examples/jails/jib ============================================================================== --- head/share/examples/jails/jib Tue Feb 9 00:15:41 2016 (r295421) +++ head/share/examples/jails/jib Tue Feb 9 01:41:03 2016 (r295422) @@ -227,32 +227,37 @@ jib_addm() # 6. Set the MAC address of the new interface using a sensible # algorithm to prevent conflicts on the network. # - # The formula I'm using is ``SP:SS:SI:II:II:II'' where: - # + S denotes 16 bits of sum(1) data, split because P (below). + # The formula I'm using is ``NP:SS:SS:II:II:II'' where: + # + N denotes 4 bits used as a counter to support branching + # each parent interface up to 15 times under the same jail + # name (see S below). # + P denotes the special nibble whose value, if one of # 2, 6, A, or E (but usually 2) denotes a privately # administered MAC address (while remaining routable). + # + S denotes 16 bits, the sum(1) value of the jail name. # + I denotes bits that are inherited from parent interface. # # The S bits are a CRC-16 checksum of NAME, allowing the jail # to change the epair(4) generation order without affecting the - # MAC address. Meanwhile, if the jail NAME changes (e.g., it - # was duplicated and given a new name with no other changes), - # the underlying network interface changes, or the jail is - # moved to another host, the MAC address will be recalculated - # to a new, similarly unique value preventing conflict. + # MAC address. Meanwhile, if... + # + the jail NAME changes (e.g., it was duplicated and given + # a new name with no other changes) + # + the underlying network interface changes + # + the jail is moved to another host + # the MAC address will be recalculated to a new, similarly + # unique value preventing conflict. # iface_devid=$( ifconfig $iface ether | awk '/ether/,$0=$2' ) - eiface_devid_a=${iface_devid#??:??:?} - eiface_devid_b=${iface_devid#??:??:?} + eiface_devid_a=${iface_devid#??:??:??} + eiface_devid_b=${iface_devid#??:??:??} num=$( set -- `echo -n $name | sum` && echo $1 ) quad=$(( $num & 15 )) case "$quad" in 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; esac - eiface_devid_a=:$quad$eiface_devid_a - eiface_devid_b=:$quad$eiface_devid_b + eiface_devid_a=$quad$eiface_devid_a + eiface_devid_b=$quad$eiface_devid_b num=$(( $num >> 4 )) quad=$(( $num & 15 )) case "$quad" in @@ -267,6 +272,14 @@ jib_addm() 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; esac + eiface_devid_a=$quad:$eiface_devid_a + eiface_devid_b=$quad:$eiface_devid_b + num=$(( $num >> 4 )) + quad=$(( $num & 15 )) + case "$quad" in + 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; + 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; + esac case "$iface_devid" in ?2:*|?6:*) eiface_devid_a=a:$quad$eiface_devid_a @@ -276,7 +289,14 @@ jib_addm() eiface_devid_a=2:$quad$eiface_devid_a eiface_devid_b=6:$quad$eiface_devid_b esac - num=$(( $num >> 4 )) + eval num=\$_${iface}_num + if [ "$num" ]; then + num=$(( $num + 1 )) + eval _${iface}_num=$num + else + num=0 + local _${iface}_num=$num + fi quad=$(( $num & 15 )) case "$quad" in 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; Modified: head/share/examples/jails/jng ============================================================================== --- head/share/examples/jails/jng Tue Feb 9 00:15:41 2016 (r295421) +++ head/share/examples/jails/jng Tue Feb 9 01:41:03 2016 (r295422) @@ -260,30 +260,35 @@ jng_bridge() # 6. Set the MAC address of the new interface using a sensible # algorithm to prevent conflicts on the network. # - # The formula I'm using is ``SP:SS:SI:II:II:II'' where: - # + S denotes 16 bits of sum(1) data, split because P (below). + # The formula I'm using is ``NP:SS:SS:II:II:II'' where: + # + N denotes 4 bits used as a counter to support branching + # each parent interface up to 15 times under the same jail + # name (see S below). # + P denotes the special nibble whose value, if one of # 2, 6, A, or E (but usually 2) denotes a privately # administered MAC address (while remaining routable). + # + S denotes 16 bits, the sum(1) value of the jail name. # + I denotes bits that are inherited from parent interface. # # The S bits are a CRC-16 checksum of NAME, allowing the jail # to change link numbers in ng_bridge(4) without affecting the - # MAC address. Meanwhile, if the jail NAME changes (e.g., it - # was duplicated and given a new name with no other changes), - # the underlying network interface changes, or the jail is - # moved to another host, the MAC address will be recalculated - # to a new, similarly unique value preventing conflict. + # MAC address. Meanwhile, if... + # + the jail NAME changes (e.g., it was duplicated and given + # a new name with no other changes) + # + the underlying network interface changes + # + the jail is moved to another host + # the MAC address will be recalculated to a new, similarly + # unique value preventing conflict. # iface_devid=$( ifconfig $iface ether | awk '/ether/,$0=$2' ) - eiface_devid=${iface_devid#??:??:?} + eiface_devid=${iface_devid#??:??:??} num=$( set -- `echo -n $name | sum` && echo $1 ) quad=$(( $num & 15 )) case "$quad" in 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; esac - eiface_devid=:$quad$eiface_devid + eiface_devid=$quad$eiface_devid num=$(( $num >> 4 )) quad=$(( $num & 15 )) case "$quad" in @@ -297,11 +302,25 @@ jng_bridge() 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; esac + eiface_devid=$quad:$eiface_devid + num=$(( $num >> 4 )) + quad=$(( $num & 15 )) + case "$quad" in + 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; + 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; + esac case "$iface_devid" in ?2:*) eiface_devid=a:$quad$eiface_devid ;; *) eiface_devid=2:$quad$eiface_devid esac - num=$(( $num >> 4 )) + eval num=\$_${iface}_num + if [ "$num" ]; then + num=$(( $num + 1 )) + eval _${iface}_num=$num + else + num=0 + local _${iface}_num=$num + fi quad=$(( $num & 15 )) case "$quad" in 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; From owner-svn-src-all@freebsd.org Tue Feb 9 03:35:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 561BBAA29C9; Tue, 9 Feb 2016 03:35:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 192FF1A41; Tue, 9 Feb 2016 03:35:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u193Zfef052910; Tue, 9 Feb 2016 03:35:41 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u193Zf05052908; Tue, 9 Feb 2016 03:35:41 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201602090335.u193Zf05052908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 9 Feb 2016 03:35:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295424 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 03:35:42 -0000 Author: adrian Date: Tue Feb 9 03:35:40 2016 New Revision: 295424 URL: https://svnweb.freebsd.org/changeset/base/295424 Log: Teach ofw_bus_parse_xref_list_alloc to be able to return the length of the parsed list. Currently, there is no easy way to know in advance how many entries a list parsed by ofw_bus_parse_xref_list_alloc() in sys/dev/ofw/ofw_bus_subr.c has. This patch: * teaches the existing function about handling idx == -1 and returning how big the set is; then renames it as _internal; * create a new function that asserts idx != -1, so the old API is maintained; * add a new function that returns just the list length. Submitted by: Stanislav Galabov Differential Revision: https://reviews.freebsd.org/D5043 Modified: head/sys/dev/ofw/ofw_bus_subr.c head/sys/dev/ofw/ofw_bus_subr.h Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Tue Feb 9 01:42:51 2016 (r295423) +++ head/sys/dev/ofw/ofw_bus_subr.c Tue Feb 9 03:35:40 2016 (r295424) @@ -629,13 +629,16 @@ ofw_bus_find_child_device_by_phandle(dev * node - consumers device node * list_name - name of parsed list - "clocks" * cells_name - name of size property - "#clock-cells" + * idx - the index of the requested list entry, or, if -1, an indication + * to return the number of entries in the parsed list. * Output arguments: * producer - handle of producer - * ncells - number of cells in result + * ncells - number of cells in result or the number of items in the list when + * idx == -1. * cells - array of decoded cells */ -int -ofw_bus_parse_xref_list_alloc(phandle_t node, const char *list_name, +static int +ofw_bus_parse_xref_list_internal(phandle_t node, const char *list_name, const char *cells_name, int idx, phandle_t *producer, int *ncells, pcell_t **cells) { @@ -649,7 +652,7 @@ ofw_bus_parse_xref_list_alloc(phandle_t (void **)&elems); if (nelems <= 0) return (ENOENT); - rv = ENOENT; + rv = (idx == -1) ? 0 : ENOENT; for (i = 0, cnt = 0; i < nelems; i += pcells, cnt++) { pnode = elems[i++]; if (OF_getencprop(OF_node_from_xref(pnode), @@ -678,10 +681,58 @@ ofw_bus_parse_xref_list_alloc(phandle_t } if (elems != NULL) free(elems, M_OFWPROP); + if (idx == -1 && rv == 0) + *ncells = cnt; return (rv); } /* + * Parse property that contain list of xrefs and values + * (like standard "clocks" and "resets" properties) + * Input arguments: + * node - consumers device node + * list_name - name of parsed list - "clocks" + * cells_name - name of size property - "#clock-cells" + * idx - the index of the requested list entry (>= 0) + * Output arguments: + * producer - handle of producer + * ncells - number of cells in result + * cells - array of decoded cells + */ +int +ofw_bus_parse_xref_list_alloc(phandle_t node, const char *list_name, + const char *cells_name, int idx, phandle_t *producer, int *ncells, + pcell_t **cells) +{ + + KASSERT(idx >= 0, + ("ofw_bus_parse_xref_list_alloc: negative index supplied")); + + return (ofw_bus_parse_xref_list_internal(node, list_name, cells_name, + idx, producer, ncells, cells)); +} + +/* + * Parse property that contain list of xrefs and values + * (like standard "clocks" and "resets" properties) + * and determine the number of items in the list + * Input arguments: + * node - consumers device node + * list_name - name of parsed list - "clocks" + * cells_name - name of size property - "#clock-cells" + * Output arguments: + * count - number of items in list + */ +int +ofw_bus_parse_xref_list_get_length(phandle_t node, const char *list_name, + const char *cells_name, int *count) +{ + + return (ofw_bus_parse_xref_list_internal(node, list_name, cells_name, + -1, NULL, count, NULL)); +} + +/* * Find index of string in string list property (case sensitive). */ int Modified: head/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.h Tue Feb 9 01:42:51 2016 (r295423) +++ head/sys/dev/ofw/ofw_bus_subr.h Tue Feb 9 03:35:40 2016 (r295424) @@ -118,6 +118,8 @@ device_t ofw_bus_find_child_device_by_ph int ofw_bus_parse_xref_list_alloc(phandle_t node, const char *list_name, const char *cells_name, int idx, phandle_t *producer, int *ncells, pcell_t **cells); +int ofw_bus_parse_xref_list_get_length(phandle_t node, const char *list_name, + const char *cells_name, int *count); int ofw_bus_find_string_index(phandle_t node, const char *list_name, const char *name, int *idx); int ofw_bus_string_list_to_array(phandle_t node, const char *list_name, From owner-svn-src-all@freebsd.org Tue Feb 9 06:26:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F4137AA13F6; Tue, 9 Feb 2016 06:26:28 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 C2C9E14A4; Tue, 9 Feb 2016 06:26:28 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u196QR77003000; Tue, 9 Feb 2016 06:26:27 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u196QRbr002999; Tue, 9 Feb 2016 06:26:27 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201602090626.u196QRbr002999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Tue, 9 Feb 2016 06:26:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295425 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 06:26:29 -0000 Author: wma Date: Tue Feb 9 06:26:27 2016 New Revision: 295425 URL: https://svnweb.freebsd.org/changeset/base/295425 Log: Ignore invalid page descriptors in ARM64 pmap_mincore Prevent the function from null-pointer-dereference when unexisting mapping is being processed. Obtained from: Semihalf Sponsored by: Cavium Approved by: cognet (mentor) Reviewed by: zbb, cognet Differential revision: https://reviews.freebsd.org/D5228 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Tue Feb 9 03:35:40 2016 (r295424) +++ head/sys/arm64/arm64/pmap.c Tue Feb 9 06:26:27 2016 (r295425) @@ -3074,7 +3074,11 @@ retry: l1p = pmap_l1(pmap, addr); if (l1p == NULL) /* No l1 */ goto done; + l1 = pmap_load(l1p); + if ((l1 & ATTR_DESCR_MASK) == L1_INVAL) + goto done; + if ((l1 & ATTR_DESCR_MASK) == L1_BLOCK) { pa = (l1 & ~ATTR_MASK) | (addr & L1_OFFSET); managed = (l1 & ATTR_SW_MANAGED) == ATTR_SW_MANAGED; @@ -3089,7 +3093,11 @@ retry: l2p = pmap_l1_to_l2(l1p, addr); if (l2p == NULL) /* No l2 */ goto done; + l2 = pmap_load(l2p); + if ((l2 & ATTR_DESCR_MASK) == L2_INVAL) + goto done; + if ((l2 & ATTR_DESCR_MASK) == L2_BLOCK) { pa = (l2 & ~ATTR_MASK) | (addr & L2_OFFSET); managed = (l2 & ATTR_SW_MANAGED) == ATTR_SW_MANAGED; @@ -3104,7 +3112,11 @@ retry: l3p = pmap_l2_to_l3(l2p, addr); if (l3p == NULL) /* No l3 */ goto done; + l3 = pmap_load(l2p); + if ((l3 & ATTR_DESCR_MASK) == L3_INVAL) + goto done; + if ((l3 & ATTR_DESCR_MASK) == L3_PAGE) { pa = (l3 & ~ATTR_MASK) | (addr & L3_OFFSET); managed = (l3 & ATTR_SW_MANAGED) == ATTR_SW_MANAGED; From owner-svn-src-all@freebsd.org Tue Feb 9 09:32:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29476AA277F; Tue, 9 Feb 2016 09:32:12 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 EA117114C; Tue, 9 Feb 2016 09:32:11 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u199WAYv056040; Tue, 9 Feb 2016 09:32:10 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u199WAXE056039; Tue, 9 Feb 2016 09:32:10 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201602090932.u199WAXE056039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 9 Feb 2016 09:32:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295426 - head/bin/dd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 09:32:12 -0000 Author: trasz Date: Tue Feb 9 09:32:10 2016 New Revision: 295426 URL: https://svnweb.freebsd.org/changeset/base/295426 Log: Use proper functions for parsing the numeric values. Submitted by: bde@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/bin/dd/args.c Modified: head/bin/dd/args.c ============================================================================== --- head/bin/dd/args.c Tue Feb 9 06:26:27 2016 (r295425) +++ head/bin/dd/args.c Tue Feb 9 09:32:10 2016 (r295426) @@ -419,7 +419,7 @@ get_num(const char *val) char *expr; errno = 0; - num = strtouq(val, &expr, 0); + num = strtoumax(val, &expr, 0); if (errno != 0) /* Overflow or underflow. */ err(1, "%s", oper); @@ -469,7 +469,7 @@ get_off_t(const char *val) char *expr; errno = 0; - num = strtoq(val, &expr, 0); + num = strtoimax(val, &expr, 0); if (errno != 0) /* Overflow or underflow. */ err(1, "%s", oper); From owner-svn-src-all@freebsd.org Tue Feb 9 09:37:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DB8EAA29B8; Tue, 9 Feb 2016 09:37:05 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 3DAD1134C; Tue, 9 Feb 2016 09:37:05 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u199b4iE058216; Tue, 9 Feb 2016 09:37:04 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u199b4G8058215; Tue, 9 Feb 2016 09:37:04 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201602090937.u199b4G8058215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 9 Feb 2016 09:37:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295427 - head/bin/dd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 09:37:05 -0000 Author: trasz Date: Tue Feb 9 09:37:04 2016 New Revision: 295427 URL: https://svnweb.freebsd.org/changeset/base/295427 Log: Use a proper type for return value of postfix_to_mult(); the way it's being used wouldn't work if the value returned didn't fit in intmax_t. Submitted by: bde@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/bin/dd/args.c Modified: head/bin/dd/args.c ============================================================================== --- head/bin/dd/args.c Tue Feb 9 09:32:10 2016 (r295426) +++ head/bin/dd/args.c Tue Feb 9 09:37:04 2016 (r295427) @@ -360,10 +360,10 @@ c_conv(const void *a, const void *b) ((const struct conv *)b)->name)); } -static uintmax_t +static intmax_t postfix_to_mult(const char expr) { - uintmax_t mult; + intmax_t mult; mult = 0; switch (expr) { From owner-svn-src-all@freebsd.org Tue Feb 9 09:38:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC60FAA2A52; Tue, 9 Feb 2016 09:38:06 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 AC89F1556; Tue, 9 Feb 2016 09:38:06 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u199c5w2058300; Tue, 9 Feb 2016 09:38:05 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u199c5UE058299; Tue, 9 Feb 2016 09:38:05 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201602090938.u199c5UE058299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 9 Feb 2016 09:38:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295428 - head/bin/dd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 09:38:07 -0000 Author: trasz Date: Tue Feb 9 09:38:05 2016 New Revision: 295428 URL: https://svnweb.freebsd.org/changeset/base/295428 Log: Improve comment to reflect recent changes. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/bin/dd/args.c Modified: head/bin/dd/args.c ============================================================================== --- head/bin/dd/args.c Tue Feb 9 09:37:04 2016 (r295427) +++ head/bin/dd/args.c Tue Feb 9 09:38:05 2016 (r295428) @@ -407,8 +407,10 @@ postfix_to_mult(const char expr) * 3) A positive decimal number followed by a 'k' or 'K' (mult by 1 << 10). * 4) A positive decimal number followed by a 'm' or 'M' (mult by 1 << 20). * 5) A positive decimal number followed by a 'g' or 'G' (mult by 1 << 30). - * 5) A positive decimal number followed by a 'w' or 'W' (mult by sizeof int). - * 6) Two or more positive decimal numbers (with/without [BbKkMmGgWw]) + * 6) A positive decimal number followed by a 't' or 'T' (mult by 1 << 40). + * 7) A positive decimal number followed by a 'p' or 'P' (mult by 1 << 50). + * 8) A positive decimal number followed by a 'w' or 'W' (mult by sizeof int). + * 9) Two or more positive decimal numbers (with/without [BbKkMmGgWw]) * separated by 'x' or 'X' (also '*' for backwards compatibility), * specifying the product of the indicated values. */ From owner-svn-src-all@freebsd.org Tue Feb 9 09:39:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24889AA2B46; Tue, 9 Feb 2016 09:39:32 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 E78B917B5; Tue, 9 Feb 2016 09:39:31 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u199dUhJ058389; Tue, 9 Feb 2016 09:39:30 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u199dUnl058388; Tue, 9 Feb 2016 09:39:30 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602090939.u199dUnl058388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 9 Feb 2016 09:39:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295429 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 09:39:32 -0000 Author: andrew Date: Tue Feb 9 09:39:30 2016 New Revision: 295429 URL: https://svnweb.freebsd.org/changeset/base/295429 Log: Don't set the offset when loading the kernel on the arm loader.efi. The copyin and copyout code handle virtual addresses such that they will take a virtual address and convert it into a valid physical address. It may also mean we fail to boot as the elf files load address could be 0. Sponsored by: ABT Systems Ltd Modified: head/sys/boot/common/load_elf.c Modified: head/sys/boot/common/load_elf.c ============================================================================== --- head/sys/boot/common/load_elf.c Tue Feb 9 09:38:05 2016 (r295428) +++ head/sys/boot/common/load_elf.c Tue Feb 9 09:39:30 2016 (r295429) @@ -353,7 +353,7 @@ __elfN(loadimage)(struct preloaded_file #endif } else off = 0; -#elif defined(__arm__) +#elif defined(__arm__) && !defined(EFI) /* * The elf headers in arm kernels specify virtual addresses in all * header fields, even the ones that should be physical addresses. @@ -364,6 +364,11 @@ __elfN(loadimage)(struct preloaded_file * translates it to a physical address. We do the va->pa conversion on * the entry point address in the header now, so that later we can * launch the kernel by just jumping to that address. + * + * When booting from UEFI the copyin and copyout functions handle + * adjusting the location relative to the first virtual address. + * Because of this there is no need to adjust the offset or entry + * point address as these will both be handled by the efi code. */ off -= ehdr->e_entry & ~PAGE_MASK; ehdr->e_entry += off; From owner-svn-src-all@freebsd.org Tue Feb 9 09:57:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B28AAA33CF; Tue, 9 Feb 2016 09:57:52 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 11536F5; Tue, 9 Feb 2016 09:57:52 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u199vpY0064225; Tue, 9 Feb 2016 09:57:51 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u199vpoN064224; Tue, 9 Feb 2016 09:57:51 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602090957.u199vpoN064224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 9 Feb 2016 09:57:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295430 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 09:57:52 -0000 Author: andrew Date: Tue Feb 9 09:57:50 2016 New Revision: 295430 URL: https://svnweb.freebsd.org/changeset/base/295430 Log: Add an ARMv7 config file to build nanobsd images for the qemu virt platform. Sponsored by: ABT Systems Ltd Added: head/tools/tools/nanobsd/embedded/qemu-armv7.cfg (contents, props changed) Added: head/tools/tools/nanobsd/embedded/qemu-armv7.cfg ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/nanobsd/embedded/qemu-armv7.cfg Tue Feb 9 09:57:50 2016 (r295430) @@ -0,0 +1,48 @@ +# $FreeBSD$ + +#- +# Copyright (c) 2015 Andrew Turner. All Rights Reserved. +# Copyright (c) 2015 Warner Losh. All Rights Reserved. +# Copyright (c) 2010-2011 iXsystems, Inc., All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL iXsystems, Inc. OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +NANO_ARCH=armv6 +NANO_DRIVE=vtbd0 +NANO_KERNEL=VIRT +NANO_NAME=qemu-armv7 +NANO_LAYOUT=std-uefi-bios +NANO_CPUTYPE=cortexa + +. common # Pull in common definitions + +qemu_env + +# +# Run with +# qemu-system-arm -M virt -serial stdio -bios QEMU_EFI.fd \ +# -drive if=none,file=_.disk.image.qemu-armv7.qcow2,id=hd0 \ +# -device virtio-blk-device,drive=hd0 +# QEMU_EFI.fd is from +# http://releases.linaro.org/components/kernel/uefi-linaro/15.12/release/qemu/ +# From owner-svn-src-all@freebsd.org Tue Feb 9 10:06:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24A12AA3A4D; Tue, 9 Feb 2016 10:06:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 E94229AB; Tue, 9 Feb 2016 10:06:07 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u19A66NT067213; Tue, 9 Feb 2016 10:06:06 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u19A662s067212; Tue, 9 Feb 2016 10:06:06 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602091006.u19A662s067212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 9 Feb 2016 10:06:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295431 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 10:06:08 -0000 Author: andrew Date: Tue Feb 9 10:06:06 2016 New Revision: 295431 URL: https://svnweb.freebsd.org/changeset/base/295431 Log: Correct the year, it's 2016. Modified: head/tools/tools/nanobsd/embedded/qemu-armv7.cfg Modified: head/tools/tools/nanobsd/embedded/qemu-armv7.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-armv7.cfg Tue Feb 9 09:57:50 2016 (r295430) +++ head/tools/tools/nanobsd/embedded/qemu-armv7.cfg Tue Feb 9 10:06:06 2016 (r295431) @@ -1,7 +1,7 @@ # $FreeBSD$ #- -# Copyright (c) 2015 Andrew Turner. All Rights Reserved. +# Copyright (c) 2016 Andrew Turner. All Rights Reserved. # Copyright (c) 2015 Warner Losh. All Rights Reserved. # Copyright (c) 2010-2011 iXsystems, Inc., All rights reserved. # From owner-svn-src-all@freebsd.org Tue Feb 9 10:18:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63A3CAA3EDA; Tue, 9 Feb 2016 10:18:23 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 31940F3A; Tue, 9 Feb 2016 10:18:23 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u19AIMNZ070200; Tue, 9 Feb 2016 10:18:22 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u19AIMU0070199; Tue, 9 Feb 2016 10:18:22 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602091018.u19AIMU0070199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 9 Feb 2016 10:18:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295432 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 10:18:23 -0000 Author: andrew Date: Tue Feb 9 10:18:22 2016 New Revision: 295432 URL: https://svnweb.freebsd.org/changeset/base/295432 Log: Use designated initialisers for the db disassembler interface to help with finding the struct when searching for one of its members. Modified: head/sys/arm64/arm64/db_disasm.c Modified: head/sys/arm64/arm64/db_disasm.c ============================================================================== --- head/sys/arm64/arm64/db_disasm.c Tue Feb 9 10:06:06 2016 (r295431) +++ head/sys/arm64/arm64/db_disasm.c Tue Feb 9 10:18:22 2016 (r295432) @@ -41,9 +41,9 @@ static void db_disasm_printaddr(vm_offse /* Glue code to interface db_disasm to the generic ARM disassembler */ static const struct disasm_interface db_disasm_interface = { - db_disasm_read_word, - db_disasm_printaddr, - db_printf + .di_readword = db_disasm_read_word, + .di_printaddr = db_disasm_printaddr, + .di_printf = db_printf, }; static u_int From owner-svn-src-all@freebsd.org Tue Feb 9 14:35:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49F44AA2BC6; Tue, 9 Feb 2016 14:35:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 023439CC; Tue, 9 Feb 2016 14:35:24 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u19EZOuI047326; Tue, 9 Feb 2016 14:35:24 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u19EZO2w047325; Tue, 9 Feb 2016 14:35:24 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602091435.u19EZO2w047325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 9 Feb 2016 14:35: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: r295434 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 14:35:25 -0000 Author: emaste Date: Tue Feb 9 14:35:23 2016 New Revision: 295434 URL: https://svnweb.freebsd.org/changeset/base/295434 Log: MFC r281524 -- add mergeinfo missed in r293347 Approved by: re (gjb, blanket) Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-all@freebsd.org Tue Feb 9 16:30:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FE16AA229B; Tue, 9 Feb 2016 16:30:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 67245ED0; Tue, 9 Feb 2016 16:30:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u19GUI4v079807; Tue, 9 Feb 2016 16:30:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u19GUHJu079795; Tue, 9 Feb 2016 16:30:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201602091630.u19GUHJu079795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 9 Feb 2016 16:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295435 - in head: bin/pkill bin/ps sys/compat/ndis sys/dev/hwpmc sys/kern sys/sys usr.bin/top usr.sbin/bsnmpd/modules/snmp_hostres X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 16:30:19 -0000 Author: kib Date: Tue Feb 9 16:30:16 2016 New Revision: 295435 URL: https://svnweb.freebsd.org/changeset/base/295435 Log: Rename P_KTHREAD struct proc p_flag to P_KPROC. I left as is an apparent bug in ntoskrnl_var.h:AT_PASSIVE_LEVEL() definition. Suggested by: jhb Sponsored by: The FreeBSD Foundation Modified: head/bin/pkill/pkill.c head/bin/ps/ps.1 head/sys/compat/ndis/ntoskrnl_var.h head/sys/dev/hwpmc/hwpmc_mod.c head/sys/kern/init_main.c head/sys/kern/kern_fork.c head/sys/kern/kern_kthread.c head/sys/kern/kern_proc.c head/sys/kern/kern_racct.c head/sys/sys/proc.h head/usr.bin/top/machine.c head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.h Modified: head/bin/pkill/pkill.c ============================================================================== --- head/bin/pkill/pkill.c Tue Feb 9 14:35:23 2016 (r295434) +++ head/bin/pkill/pkill.c Tue Feb 9 16:30:16 2016 (r295435) @@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$"); /* Ignore system-processes (if '-S' flag is not specified) and myself. */ #define PSKIP(kp) ((kp)->ki_pid == mypid || \ - (!kthreads && ((kp)->ki_flag & P_KTHREAD) != 0)) + (!kthreads && ((kp)->ki_flag & P_KPROC) != 0)) enum listtype { LT_GENERIC, Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Tue Feb 9 14:35:23 2016 (r295434) +++ head/bin/ps/ps.1 Tue Feb 9 16:30:16 2016 (r295435) @@ -318,7 +318,7 @@ the include file .Bl -column P_SINGLE_BOUNDARY 0x40000000 .It Dv "P_ADVLOCK" Ta No "0x00001" Ta "Process may hold a POSIX advisory lock" .It Dv "P_CONTROLT" Ta No "0x00002" Ta "Has a controlling terminal" -.It Dv "P_KTHREAD" Ta No "0x00004" Ta "Kernel thread" +.It Dv "P_KPROC" Ta No "0x00004" Ta "Kernel process" .It Dv "P_FOLLOWFORK" Ta No "0x00008" Ta "Attach debugger to new children" .It Dv "P_PPWAIT" Ta No "0x00010" Ta "Parent is waiting for child to exec/exit" .It Dv "P_PROFIL" Ta No "0x00020" Ta "Has started profiling" Modified: head/sys/compat/ndis/ntoskrnl_var.h ============================================================================== --- head/sys/compat/ndis/ntoskrnl_var.h Tue Feb 9 14:35:23 2016 (r295434) +++ head/sys/compat/ndis/ntoskrnl_var.h Tue Feb 9 16:30:16 2016 (r295435) @@ -337,7 +337,7 @@ typedef struct nt_dispatch_header nt_dis #define SYNC_LEVEL_MP (IPI_LEVEL - 1) #define AT_PASSIVE_LEVEL(td) \ - ((td)->td_proc->p_flag & P_KTHREAD == FALSE) + ((td)->td_proc->p_flag & P_KPROC == FALSE) #define AT_DISPATCH_LEVEL(td) \ ((td)->td_base_pri == PI_REALTIME) Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Tue Feb 9 14:35:23 2016 (r295434) +++ head/sys/dev/hwpmc/hwpmc_mod.c Tue Feb 9 16:30:16 2016 (r295435) @@ -1009,7 +1009,7 @@ pmc_attach_one_process(struct proc *p, s /* issue an attach event to a configured log file */ if (pm->pm_owner->po_flags & PMC_PO_OWNS_LOGFILE) { - if (p->p_flag & P_KTHREAD) { + if (p->p_flag & P_KPROC) { fullpath = kernelname; freepath = NULL; } else { Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Tue Feb 9 14:35:23 2016 (r295434) +++ head/sys/kern/init_main.c Tue Feb 9 16:30:16 2016 (r295435) @@ -479,7 +479,7 @@ proc0_init(void *dummy __unused) session0.s_leader = p; p->p_sysent = &null_sysvec; - p->p_flag = P_SYSTEM | P_INMEM | P_KTHREAD; + p->p_flag = P_SYSTEM | P_INMEM | P_KPROC; p->p_flag2 = 0; p->p_state = PRS_NORMAL; knlist_init_mtx(&p->p_klist, &p->p_mtx); Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Tue Feb 9 14:35:23 2016 (r295434) +++ head/sys/kern/kern_fork.c Tue Feb 9 16:30:16 2016 (r295435) @@ -1037,7 +1037,7 @@ fork_exit(void (*callout)(void *, struct * Check if a kernel thread misbehaved and returned from its main * function. */ - if (p->p_flag & P_KTHREAD) { + if (p->p_flag & P_KPROC) { printf("Kernel thread \"%s\" (pid %d) exited prematurely.\n", td->td_name, p->p_pid); kthread_exit(); Modified: head/sys/kern/kern_kthread.c ============================================================================== --- head/sys/kern/kern_kthread.c Tue Feb 9 14:35:23 2016 (r295434) +++ head/sys/kern/kern_kthread.c Tue Feb 9 16:30:16 2016 (r295435) @@ -104,7 +104,7 @@ kproc_create(void (*func)(void *), void /* this is a non-swapped system process */ PROC_LOCK(p2); td = FIRST_THREAD_IN_PROC(p2); - p2->p_flag |= P_SYSTEM | P_KTHREAD; + p2->p_flag |= P_SYSTEM | P_KPROC; td->td_pflags |= TDP_KTHREAD; mtx_lock(&p2->p_sigacts->ps_mtx); p2->p_sigacts->ps_flag |= PS_NOCLDWAIT; @@ -181,7 +181,7 @@ kproc_suspend(struct proc *p, int timo) * use the p_siglist field. */ PROC_LOCK(p); - if ((p->p_flag & P_KTHREAD) == 0) { + if ((p->p_flag & P_KPROC) == 0) { PROC_UNLOCK(p); return (EINVAL); } @@ -198,7 +198,7 @@ kproc_resume(struct proc *p) * use the p_siglist field. */ PROC_LOCK(p); - if ((p->p_flag & P_KTHREAD) == 0) { + if ((p->p_flag & P_KPROC) == 0) { PROC_UNLOCK(p); return (EINVAL); } @@ -411,7 +411,7 @@ kthread_resume(struct thread *td) * and notify the caller that is has happened. */ void -kthread_suspend_check() +kthread_suspend_check(void) { struct proc *p; struct thread *td; Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Tue Feb 9 14:35:23 2016 (r295434) +++ head/sys/kern/kern_proc.c Tue Feb 9 16:30:16 2016 (r295435) @@ -3010,8 +3010,7 @@ allproc_loop: LIST_REMOVE(cp, p_list); LIST_INSERT_AFTER(p, cp, p_list); PROC_LOCK(p); - if ((p->p_flag & (P_KTHREAD | P_SYSTEM | - P_TOTAL_STOP)) != 0) { + if ((p->p_flag & (P_KPROC | P_SYSTEM | P_TOTAL_STOP)) != 0) { PROC_UNLOCK(p); continue; } Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Tue Feb 9 14:35:23 2016 (r295434) +++ head/sys/kern/kern_racct.c Tue Feb 9 16:30:16 2016 (r295435) @@ -1099,7 +1099,7 @@ racct_proc_throttle(struct proc *p) * Do not block kernel processes. Also do not block processes with * low %cpu utilization to improve interactivity. */ - if (((p->p_flag & (P_SYSTEM | P_KTHREAD)) != 0) || + if (((p->p_flag & (P_SYSTEM | P_KPROC)) != 0) || (p->p_racct->r_resources[RACCT_PCTCPU] <= pcpu_threshold)) return; p->p_throttled = 1; Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Tue Feb 9 14:35:23 2016 (r295434) +++ head/sys/sys/proc.h Tue Feb 9 16:30:16 2016 (r295435) @@ -658,7 +658,7 @@ struct proc { /* These flags are kept in p_flag. */ #define P_ADVLOCK 0x00001 /* Process may hold a POSIX advisory lock. */ #define P_CONTROLT 0x00002 /* Has a controlling terminal. */ -#define P_KTHREAD 0x00004 /* Kernel thread (*). */ +#define P_KPROC 0x00004 /* Kernel process. */ #define P_FOLLOWFORK 0x00008 /* Attach parent debugger to children. */ #define P_PPWAIT 0x00010 /* Parent is waiting for child to exec/exit. */ #define P_PROFIL 0x00020 /* Has started profiling. */ Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Tue Feb 9 14:35:23 2016 (r295434) +++ head/usr.bin/top/machine.c Tue Feb 9 16:30:16 2016 (r295435) @@ -1160,7 +1160,7 @@ format_nice(const struct kinfo_proc *pp) static char nicebuf[4 + 1]; fifo = PRI_NEED_RR(pp->ki_pri.pri_class) ? "" : "F"; - kthread = (pp->ki_flag & P_KTHREAD) ? "k" : ""; + kthread = (pp->ki_flag & P_KPROC) ? "k" : ""; switch (PRI_BASE(pp->ki_pri.pri_class)) { case PRI_ITHD: return ("-"); @@ -1185,19 +1185,19 @@ format_nice(const struct kinfo_proc *pp) * values like "kr31F", but such values shouldn't occur, * and if they do then the tailing "F" is not displayed. */ - rtpri = ((pp->ki_flag & P_KTHREAD) ? pp->ki_pri.pri_native : + rtpri = ((pp->ki_flag & P_KPROC) ? pp->ki_pri.pri_native : pp->ki_pri.pri_user) - PRI_MIN_REALTIME; snprintf(nicebuf, sizeof(nicebuf), "%sr%d%s", kthread, rtpri, fifo); break; case PRI_TIMESHARE: - if (pp->ki_flag & P_KTHREAD) + if (pp->ki_flag & P_KPROC) return ("-"); snprintf(nicebuf, sizeof(nicebuf), "%d", pp->ki_nice - NZERO); break; case PRI_IDLE: /* XXX: as above. */ - rtpri = ((pp->ki_flag & P_KTHREAD) ? pp->ki_pri.pri_native : + rtpri = ((pp->ki_flag & P_KPROC) ? pp->ki_pri.pri_native : pp->ki_pri.pri_user) - PRI_MIN_IDLE; snprintf(nicebuf, sizeof(nicebuf), "%si%d%s", kthread, rtpri, fifo); Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.h ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.h Tue Feb 9 14:35:23 2016 (r295434) +++ head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.h Tue Feb 9 16:30:16 2016 (r295435) @@ -85,7 +85,7 @@ struct statfs; /* path to devd(8) output pipe */ #define PATH_DEVD_PIPE "/var/run/devd.pipe" -#define IS_KERNPROC(kp) (((kp)->ki_flag & P_KTHREAD) == P_KTHREAD) +#define IS_KERNPROC(kp) (((kp)->ki_flag & P_KPROC) == P_KPROC) enum snmpTCTruthValue { SNMP_TRUE = 1, From owner-svn-src-all@freebsd.org Tue Feb 9 16:42:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1497AAA2A7C; Tue, 9 Feb 2016 16:42:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 7B35B19A9; Tue, 9 Feb 2016 16:42:34 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u19GgXjT085383; Tue, 9 Feb 2016 16:42:33 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u19GgWtD085374; Tue, 9 Feb 2016 16:42:32 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602091642.u19GgWtD085374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 9 Feb 2016 16:42:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295436 - in head/sys/gnu/dts: arm include/dt-bindings/clk include/dt-bindings/clock include/dt-bindings/dma include/dt-bindings/gpio include/dt-bindings/i2c include/dt-bindings/iio inc... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 16:42:35 -0000 Author: andrew Date: Tue Feb 9 16:42:32 2016 New Revision: 295436 URL: https://svnweb.freebsd.org/changeset/base/295436 Log: Update our copy of the Linux dts files to be in sync with Linux 4.5-rc1. We now uave a full copy of the arm device tree sources to help when adding support for newer boards. Sponsored by: ABT Systems Ltd Added: head/sys/gnu/dts/arm/alphascale-asm9260-devkit.dts - copied unchanged from r295019, vendor/device-tree/dist/src/arm/alphascale-asm9260-devkit.dts head/sys/gnu/dts/arm/alphascale-asm9260.dtsi - copied unchanged from r295019, vendor/device-tree/dist/src/arm/alphascale-asm9260.dtsi head/sys/gnu/dts/arm/alpine-db.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/alpine-db.dts head/sys/gnu/dts/arm/alpine.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/alpine.dtsi head/sys/gnu/dts/arm/am335x-baltos-ir5221.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/am335x-baltos-ir5221.dts head/sys/gnu/dts/arm/am335x-bonegreen.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/am335x-bonegreen.dts head/sys/gnu/dts/arm/am335x-chiliboard.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/am335x-chiliboard.dts head/sys/gnu/dts/arm/am335x-chilisom.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/am335x-chilisom.dtsi head/sys/gnu/dts/arm/am335x-cm-t335.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/am335x-cm-t335.dts head/sys/gnu/dts/arm/am335x-phycore-som.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/am335x-phycore-som.dtsi head/sys/gnu/dts/arm/am335x-sbc-t335.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/am335x-sbc-t335.dts head/sys/gnu/dts/arm/am335x-shc.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/am335x-shc.dts head/sys/gnu/dts/arm/am335x-sl50.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/am335x-sl50.dts head/sys/gnu/dts/arm/am335x-wega-rdk.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/am335x-wega-rdk.dts head/sys/gnu/dts/arm/am335x-wega.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/am335x-wega.dtsi head/sys/gnu/dts/arm/am437x-cm-t43.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/am437x-cm-t43.dts head/sys/gnu/dts/arm/am437x-sbc-t43.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/am437x-sbc-t43.dts head/sys/gnu/dts/arm/am57xx-cl-som-am57x.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/am57xx-cl-som-am57x.dts head/sys/gnu/dts/arm/am57xx-sbc-am57x.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/am57xx-sbc-am57x.dts head/sys/gnu/dts/arm/arm-realview-pb11mp.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/arm-realview-pb11mp.dts head/sys/gnu/dts/arm/armada-370-dlink-dns327l.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/armada-370-dlink-dns327l.dts head/sys/gnu/dts/arm/armada-370-seagate-nas-2bay.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/armada-370-seagate-nas-2bay.dts head/sys/gnu/dts/arm/armada-370-seagate-nas-4bay.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/armada-370-seagate-nas-4bay.dts head/sys/gnu/dts/arm/armada-370-seagate-nas-xbay.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/armada-370-seagate-nas-xbay.dtsi head/sys/gnu/dts/arm/armada-370-seagate-personal-cloud-2bay.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/armada-370-seagate-personal-cloud-2bay.dts head/sys/gnu/dts/arm/armada-370-seagate-personal-cloud.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/armada-370-seagate-personal-cloud.dts head/sys/gnu/dts/arm/armada-370-seagate-personal-cloud.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/armada-370-seagate-personal-cloud.dtsi head/sys/gnu/dts/arm/armada-385-linksys-caiman.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/armada-385-linksys-caiman.dts head/sys/gnu/dts/arm/armada-385-linksys-cobra.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/armada-385-linksys-cobra.dts head/sys/gnu/dts/arm/armada-385-linksys.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/armada-385-linksys.dtsi head/sys/gnu/dts/arm/armada-388-clearfog.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/armada-388-clearfog.dts head/sys/gnu/dts/arm/armada-38x-solidrun-microsom.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/armada-38x-solidrun-microsom.dtsi head/sys/gnu/dts/arm/armada-390.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/armada-390.dtsi head/sys/gnu/dts/arm/armada-398-db.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/armada-398-db.dts head/sys/gnu/dts/arm/armada-398.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/armada-398.dtsi head/sys/gnu/dts/arm/armada-39x.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/armada-39x.dtsi head/sys/gnu/dts/arm/armada-xp-linksys-mamba.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/armada-xp-linksys-mamba.dts head/sys/gnu/dts/arm/at91-ariettag25.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/at91-ariettag25.dts head/sys/gnu/dts/arm/at91-kizbox.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/at91-kizbox.dts head/sys/gnu/dts/arm/at91-kizbox2.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/at91-kizbox2.dts head/sys/gnu/dts/arm/at91-kizboxmini.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/at91-kizboxmini.dts head/sys/gnu/dts/arm/at91-sama5d2_xplained.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/at91-sama5d2_xplained.dts head/sys/gnu/dts/arm/at91-sama5d4_ma5d4.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/at91-sama5d4_ma5d4.dtsi head/sys/gnu/dts/arm/at91-sama5d4_ma5d4evk.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/at91-sama5d4_ma5d4evk.dts head/sys/gnu/dts/arm/at91-sama5d4_xplained.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/at91-sama5d4_xplained.dts head/sys/gnu/dts/arm/at91-vinco.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/at91-vinco.dts head/sys/gnu/dts/arm/at91sam9x5dm.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/at91sam9x5dm.dtsi head/sys/gnu/dts/arm/axm5516-amarillo.dts - copied unchanged from r295019, vendor/device-tree/dist/src/arm/axm5516-amarillo.dts head/sys/gnu/dts/arm/axm55xx.dtsi - copied unchanged from r295019, vendor/device-tree/dist/src/arm/axm55xx.dtsi head/sys/gnu/dts/arm/axp152.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/axp152.dtsi head/sys/gnu/dts/arm/axp22x.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/axp22x.dtsi head/sys/gnu/dts/arm/bcm-nsp.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/bcm-nsp.dtsi head/sys/gnu/dts/arm/bcm2835-rpi-a-plus.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/bcm2835-rpi-a-plus.dts head/sys/gnu/dts/arm/bcm2835-rpi-b-rev2.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/bcm2835-rpi-b-rev2.dts head/sys/gnu/dts/arm/bcm2836-rpi-2-b.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/bcm2836-rpi-2-b.dts head/sys/gnu/dts/arm/bcm2836.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/bcm2836.dtsi head/sys/gnu/dts/arm/bcm283x.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/bcm283x.dtsi head/sys/gnu/dts/arm/bcm4708-asus-rt-ac56u.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/bcm4708-asus-rt-ac56u.dts head/sys/gnu/dts/arm/bcm4708-asus-rt-ac68u.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/bcm4708-asus-rt-ac68u.dts head/sys/gnu/dts/arm/bcm4708-smartrg-sr400ac.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/bcm4708-smartrg-sr400ac.dts head/sys/gnu/dts/arm/bcm4709-asus-rt-ac87u.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/bcm4709-asus-rt-ac87u.dts head/sys/gnu/dts/arm/bcm4709-buffalo-wxr-1900dhp.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/bcm4709-buffalo-wxr-1900dhp.dts head/sys/gnu/dts/arm/bcm4709-netgear-r7000.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/bcm4709-netgear-r7000.dts head/sys/gnu/dts/arm/bcm4709-netgear-r8000.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/bcm4709-netgear-r8000.dts head/sys/gnu/dts/arm/bcm5301x-nand-cs0-bch8.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/bcm5301x-nand-cs0-bch8.dtsi head/sys/gnu/dts/arm/bcm94708.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/bcm94708.dts head/sys/gnu/dts/arm/bcm94709.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/bcm94709.dts head/sys/gnu/dts/arm/bcm953012k.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/bcm953012k.dts head/sys/gnu/dts/arm/bcm958305k.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/bcm958305k.dts head/sys/gnu/dts/arm/bcm958625k.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/bcm958625k.dts head/sys/gnu/dts/arm/bcm9hmidc.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/bcm9hmidc.dtsi head/sys/gnu/dts/arm/compulab-sb-som.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/compulab-sb-som.dtsi head/sys/gnu/dts/arm/cros-ec-sbs.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/cros-ec-sbs.dtsi head/sys/gnu/dts/arm/dm8148-evm.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/dm8148-evm.dts head/sys/gnu/dts/arm/dm8148-t410.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/dm8148-t410.dts head/sys/gnu/dts/arm/dm814x-clocks.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/dm814x-clocks.dtsi head/sys/gnu/dts/arm/dm814x.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/dm814x.dtsi head/sys/gnu/dts/arm/dove-cm-a510.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/dove-cm-a510.dtsi head/sys/gnu/dts/arm/dove-sbc-a510.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/dove-sbc-a510.dts head/sys/gnu/dts/arm/dra62x-clocks.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/dra62x-clocks.dtsi head/sys/gnu/dts/arm/dra62x-j5eco-evm.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/dra62x-j5eco-evm.dts head/sys/gnu/dts/arm/dra62x.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/dra62x.dtsi head/sys/gnu/dts/arm/exynos4-cpu-thermal.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/exynos4-cpu-thermal.dtsi head/sys/gnu/dts/arm/exynos4412-tmu-sensor-conf.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/exynos4412-tmu-sensor-conf.dtsi head/sys/gnu/dts/arm/exynos5250-snow-common.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/exynos5250-snow-common.dtsi head/sys/gnu/dts/arm/exynos5250-snow-rev5.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/exynos5250-snow-rev5.dts head/sys/gnu/dts/arm/exynos5250-snow.dts - copied unchanged from r295019, vendor/device-tree/dist/src/arm/exynos5250-snow.dts head/sys/gnu/dts/arm/exynos5420-peach-pit.dts - copied unchanged from r295019, vendor/device-tree/dist/src/arm/exynos5420-peach-pit.dts head/sys/gnu/dts/arm/exynos5420-trip-points.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/exynos5420-trip-points.dtsi head/sys/gnu/dts/arm/exynos5422-cpu-thermal.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/exynos5422-cpu-thermal.dtsi head/sys/gnu/dts/arm/exynos5422-cpus.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/exynos5422-cpus.dtsi head/sys/gnu/dts/arm/exynos5422-odroidxu3-audio.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/exynos5422-odroidxu3-audio.dtsi head/sys/gnu/dts/arm/exynos5422-odroidxu3-common.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/exynos5422-odroidxu3-common.dtsi head/sys/gnu/dts/arm/exynos5422-odroidxu3-lite.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/exynos5422-odroidxu3-lite.dts head/sys/gnu/dts/arm/exynos5422-odroidxu4.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/exynos5422-odroidxu4.dts head/sys/gnu/dts/arm/exynos5440-tmu-sensor-conf.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/exynos5440-tmu-sensor-conf.dtsi head/sys/gnu/dts/arm/exynos5440-trip-points.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/exynos5440-trip-points.dtsi head/sys/gnu/dts/arm/exynos5800-peach-pi.dts - copied unchanged from r295019, vendor/device-tree/dist/src/arm/exynos5800-peach-pi.dts head/sys/gnu/dts/arm/imx51-ts4800.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/imx51-ts4800.dts head/sys/gnu/dts/arm/imx6dl-apf6dev.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/imx6dl-apf6dev.dts head/sys/gnu/dts/arm/imx6dl-aristainetos2_4.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/imx6dl-aristainetos2_4.dts head/sys/gnu/dts/arm/imx6dl-aristainetos2_7.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/imx6dl-aristainetos2_7.dts head/sys/gnu/dts/arm/imx6dl-gw551x.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/imx6dl-gw551x.dts head/sys/gnu/dts/arm/imx6dl-nit6xlite.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/imx6dl-nit6xlite.dts head/sys/gnu/dts/arm/imx6q-apf6dev.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/imx6q-apf6dev.dts head/sys/gnu/dts/arm/imx6q-gw551x.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/imx6q-gw551x.dts head/sys/gnu/dts/arm/imx6q-nitrogen6_max.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/imx6q-nitrogen6_max.dts head/sys/gnu/dts/arm/imx6q-novena.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/imx6q-novena.dts head/sys/gnu/dts/arm/imx6qdl-apf6.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/imx6qdl-apf6.dtsi head/sys/gnu/dts/arm/imx6qdl-apf6dev.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/imx6qdl-apf6dev.dtsi head/sys/gnu/dts/arm/imx6qdl-aristainetos2.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/imx6qdl-aristainetos2.dtsi head/sys/gnu/dts/arm/imx6qdl-gw551x.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/imx6qdl-gw551x.dtsi head/sys/gnu/dts/arm/imx6qdl-nit6xlite.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/imx6qdl-nit6xlite.dtsi head/sys/gnu/dts/arm/imx6qdl-nitrogen6_max.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/imx6qdl-nitrogen6_max.dtsi head/sys/gnu/dts/arm/imx6sl-warp.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/imx6sl-warp.dts head/sys/gnu/dts/arm/imx6sx-sdb-reva.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/imx6sx-sdb-reva.dts head/sys/gnu/dts/arm/imx6sx-sdb.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/imx6sx-sdb.dtsi head/sys/gnu/dts/arm/imx6ul-14x14-evk.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/imx6ul-14x14-evk.dts head/sys/gnu/dts/arm/imx6ul-pinfunc.h - copied unchanged from r295015, vendor/device-tree/dist/src/arm/imx6ul-pinfunc.h head/sys/gnu/dts/arm/imx6ul.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/imx6ul.dtsi head/sys/gnu/dts/arm/imx7d-cl-som-imx7.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/imx7d-cl-som-imx7.dts head/sys/gnu/dts/arm/imx7d-pinfunc.h - copied unchanged from r295015, vendor/device-tree/dist/src/arm/imx7d-pinfunc.h head/sys/gnu/dts/arm/imx7d-sbc-imx7.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/imx7d-sbc-imx7.dts head/sys/gnu/dts/arm/imx7d-sdb.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/imx7d-sdb.dts head/sys/gnu/dts/arm/imx7d.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/imx7d.dtsi head/sys/gnu/dts/arm/k2e-netcp.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/k2e-netcp.dtsi head/sys/gnu/dts/arm/k2hk-netcp.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/k2hk-netcp.dtsi head/sys/gnu/dts/arm/k2l-netcp.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/k2l-netcp.dtsi head/sys/gnu/dts/arm/kirkwood-lswvl.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/kirkwood-lswvl.dts head/sys/gnu/dts/arm/kirkwood-lswxl.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/kirkwood-lswxl.dts head/sys/gnu/dts/arm/kirkwood-nas2big.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/kirkwood-nas2big.dts head/sys/gnu/dts/arm/kirkwood-nsa325.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/kirkwood-nsa325.dts head/sys/gnu/dts/arm/kirkwood-pogoplug-series-4.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/kirkwood-pogoplug-series-4.dts head/sys/gnu/dts/arm/logicpd-torpedo-37xx-devkit.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/logicpd-torpedo-37xx-devkit.dts head/sys/gnu/dts/arm/logicpd-torpedo-som.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/logicpd-torpedo-som.dtsi head/sys/gnu/dts/arm/lpc18xx.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/lpc18xx.dtsi head/sys/gnu/dts/arm/lpc4337-ciaa.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/lpc4337-ciaa.dts head/sys/gnu/dts/arm/lpc4350-hitex-eval.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/lpc4350-hitex-eval.dts head/sys/gnu/dts/arm/lpc4350.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/lpc4350.dtsi head/sys/gnu/dts/arm/lpc4357-ea4357-devkit.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/lpc4357-ea4357-devkit.dts head/sys/gnu/dts/arm/lpc4357.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/lpc4357.dtsi head/sys/gnu/dts/arm/meson8-minix-neo-x8.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/meson8-minix-neo-x8.dts head/sys/gnu/dts/arm/meson8b-mxq.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/meson8b-mxq.dts head/sys/gnu/dts/arm/meson8b-odroidc1.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/meson8b-odroidc1.dts head/sys/gnu/dts/arm/meson8b.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/meson8b.dtsi head/sys/gnu/dts/arm/mmp2-brownstone.dts - copied unchanged from r295019, vendor/device-tree/dist/src/arm/mmp2-brownstone.dts head/sys/gnu/dts/arm/mmp2.dtsi - copied unchanged from r295019, vendor/device-tree/dist/src/arm/mmp2.dtsi head/sys/gnu/dts/arm/mt2701-evb.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/mt2701-evb.dts head/sys/gnu/dts/arm/mt2701.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/mt2701.dtsi head/sys/gnu/dts/arm/mt6580-evbp1.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/mt6580-evbp1.dts head/sys/gnu/dts/arm/mt6580.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/mt6580.dtsi head/sys/gnu/dts/arm/mt8135-pinfunc.h - copied unchanged from r295015, vendor/device-tree/dist/src/arm/mt8135-pinfunc.h head/sys/gnu/dts/arm/omap3-devkit8000-common.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/omap3-devkit8000-common.dtsi head/sys/gnu/dts/arm/omap3-devkit8000-lcd-common.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/omap3-devkit8000-lcd-common.dtsi head/sys/gnu/dts/arm/omap3-devkit8000-lcd43.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/omap3-devkit8000-lcd43.dts head/sys/gnu/dts/arm/omap3-devkit8000-lcd70.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/omap3-devkit8000-lcd70.dts head/sys/gnu/dts/arm/omap3-overo-palo35-common.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/omap3-overo-palo35-common.dtsi head/sys/gnu/dts/arm/omap3-overo-palo35.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/omap3-overo-palo35.dts head/sys/gnu/dts/arm/omap3-overo-storm-palo35.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/omap3-overo-storm-palo35.dts head/sys/gnu/dts/arm/omap3-overo-storm-tobiduo.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/omap3-overo-storm-tobiduo.dts head/sys/gnu/dts/arm/omap3-overo-tobiduo-common.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/omap3-overo-tobiduo-common.dtsi head/sys/gnu/dts/arm/omap3-overo-tobiduo.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/omap3-overo-tobiduo.dts head/sys/gnu/dts/arm/omap3-pandora-1ghz.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/omap3-pandora-1ghz.dts head/sys/gnu/dts/arm/omap3-pandora-600mhz.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/omap3-pandora-600mhz.dts head/sys/gnu/dts/arm/omap3-pandora-common.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/omap3-pandora-common.dtsi head/sys/gnu/dts/arm/omap5-board-common.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/omap5-board-common.dtsi head/sys/gnu/dts/arm/omap5-igep0050.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/omap5-igep0050.dts head/sys/gnu/dts/arm/orion5x-linkstation-lswtgl.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/orion5x-linkstation-lswtgl.dts head/sys/gnu/dts/arm/orion5x-lswsgl.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/orion5x-lswsgl.dts head/sys/gnu/dts/arm/pxa168-aspenite.dts - copied unchanged from r295019, vendor/device-tree/dist/src/arm/pxa168-aspenite.dts head/sys/gnu/dts/arm/pxa168.dtsi - copied unchanged from r295019, vendor/device-tree/dist/src/arm/pxa168.dtsi head/sys/gnu/dts/arm/pxa910-dkb.dts - copied unchanged from r295019, vendor/device-tree/dist/src/arm/pxa910-dkb.dts head/sys/gnu/dts/arm/pxa910.dtsi - copied unchanged from r295019, vendor/device-tree/dist/src/arm/pxa910.dtsi head/sys/gnu/dts/arm/qcom-apq8064-cm-qs600.dts - copied unchanged from r295019, vendor/device-tree/dist/src/arm/qcom-apq8064-cm-qs600.dts head/sys/gnu/dts/arm/qcom-apq8064-ifc6410.dts - copied unchanged from r295019, vendor/device-tree/dist/src/arm/qcom-apq8064-ifc6410.dts head/sys/gnu/dts/arm/qcom-apq8064-sony-xperia-yuga.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/qcom-apq8064-sony-xperia-yuga.dts head/sys/gnu/dts/arm/qcom-apq8064-v2.0.dtsi - copied unchanged from r295019, vendor/device-tree/dist/src/arm/qcom-apq8064-v2.0.dtsi head/sys/gnu/dts/arm/qcom-apq8064.dtsi - copied unchanged from r295019, vendor/device-tree/dist/src/arm/qcom-apq8064.dtsi head/sys/gnu/dts/arm/qcom-apq8074-dragonboard.dts - copied unchanged from r295019, vendor/device-tree/dist/src/arm/qcom-apq8074-dragonboard.dts head/sys/gnu/dts/arm/qcom-apq8084-ifc6540.dts - copied unchanged from r295019, vendor/device-tree/dist/src/arm/qcom-apq8084-ifc6540.dts head/sys/gnu/dts/arm/qcom-apq8084-mtp.dts - copied unchanged from r295019, vendor/device-tree/dist/src/arm/qcom-apq8084-mtp.dts head/sys/gnu/dts/arm/qcom-apq8084.dtsi - copied unchanged from r295019, vendor/device-tree/dist/src/arm/qcom-apq8084.dtsi head/sys/gnu/dts/arm/qcom-ipq8064-ap148.dts - copied unchanged from r295019, vendor/device-tree/dist/src/arm/qcom-ipq8064-ap148.dts head/sys/gnu/dts/arm/qcom-ipq8064-v1.0.dtsi - copied unchanged from r295019, vendor/device-tree/dist/src/arm/qcom-ipq8064-v1.0.dtsi head/sys/gnu/dts/arm/qcom-ipq8064.dtsi - copied unchanged from r295019, vendor/device-tree/dist/src/arm/qcom-ipq8064.dtsi head/sys/gnu/dts/arm/qcom-msm8660-surf.dts - copied unchanged from r295019, vendor/device-tree/dist/src/arm/qcom-msm8660-surf.dts head/sys/gnu/dts/arm/qcom-msm8660.dtsi - copied unchanged from r295019, vendor/device-tree/dist/src/arm/qcom-msm8660.dtsi head/sys/gnu/dts/arm/qcom-msm8960-cdp.dts - copied unchanged from r295019, vendor/device-tree/dist/src/arm/qcom-msm8960-cdp.dts head/sys/gnu/dts/arm/qcom-msm8960.dtsi - copied unchanged from r295019, vendor/device-tree/dist/src/arm/qcom-msm8960.dtsi head/sys/gnu/dts/arm/qcom-msm8974-sony-xperia-honami.dts - copied unchanged from r295019, vendor/device-tree/dist/src/arm/qcom-msm8974-sony-xperia-honami.dts head/sys/gnu/dts/arm/qcom-msm8974.dtsi - copied unchanged from r295019, vendor/device-tree/dist/src/arm/qcom-msm8974.dtsi head/sys/gnu/dts/arm/qcom-pm8841.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/qcom-pm8841.dtsi head/sys/gnu/dts/arm/qcom-pm8941.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/qcom-pm8941.dtsi head/sys/gnu/dts/arm/qcom-pma8084.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/qcom-pma8084.dtsi head/sys/gnu/dts/arm/r8a7791-porter.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/r8a7791-porter.dts head/sys/gnu/dts/arm/r8a7793-gose.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/r8a7793-gose.dts head/sys/gnu/dts/arm/r8a7793.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/r8a7793.dtsi head/sys/gnu/dts/arm/r8a7794-silk.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/r8a7794-silk.dts head/sys/gnu/dts/arm/r8a77xx-aa121td01-panel.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/r8a77xx-aa121td01-panel.dtsi head/sys/gnu/dts/arm/rk3036-evb.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/rk3036-evb.dts head/sys/gnu/dts/arm/rk3036-kylin.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/rk3036-kylin.dts head/sys/gnu/dts/arm/rk3036.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/rk3036.dtsi head/sys/gnu/dts/arm/rk3228-evb.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/rk3228-evb.dts head/sys/gnu/dts/arm/rk3228.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/rk3228.dtsi head/sys/gnu/dts/arm/rk3288-popmetal.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/rk3288-popmetal.dts head/sys/gnu/dts/arm/rk3288-r89.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/rk3288-r89.dts head/sys/gnu/dts/arm/rk3288-rock2-som.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/rk3288-rock2-som.dtsi head/sys/gnu/dts/arm/rk3288-rock2-square.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/rk3288-rock2-square.dts head/sys/gnu/dts/arm/rk3288-veyron-brain.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/rk3288-veyron-brain.dts head/sys/gnu/dts/arm/rk3288-veyron-chromebook.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/rk3288-veyron-chromebook.dtsi head/sys/gnu/dts/arm/rk3288-veyron-jaq.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/rk3288-veyron-jaq.dts head/sys/gnu/dts/arm/rk3288-veyron-jerry.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/rk3288-veyron-jerry.dts head/sys/gnu/dts/arm/rk3288-veyron-mickey.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/rk3288-veyron-mickey.dts head/sys/gnu/dts/arm/rk3288-veyron-minnie.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/rk3288-veyron-minnie.dts head/sys/gnu/dts/arm/rk3288-veyron-pinky.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/rk3288-veyron-pinky.dts head/sys/gnu/dts/arm/rk3288-veyron-sdmmc.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/rk3288-veyron-sdmmc.dtsi head/sys/gnu/dts/arm/rk3288-veyron-speedy.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/rk3288-veyron-speedy.dts head/sys/gnu/dts/arm/rk3288-veyron.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/rk3288-veyron.dtsi head/sys/gnu/dts/arm/s3c6400.dtsi - copied unchanged from r295019, vendor/device-tree/dist/src/arm/s3c6400.dtsi head/sys/gnu/dts/arm/s3c6410-mini6410.dts - copied unchanged from r295019, vendor/device-tree/dist/src/arm/s3c6410-mini6410.dts head/sys/gnu/dts/arm/s3c6410-smdk6410.dts - copied unchanged from r295019, vendor/device-tree/dist/src/arm/s3c6410-smdk6410.dts head/sys/gnu/dts/arm/s3c6410.dtsi - copied unchanged from r295019, vendor/device-tree/dist/src/arm/s3c6410.dtsi head/sys/gnu/dts/arm/s3c64xx-pinctrl.dtsi - copied unchanged from r295019, vendor/device-tree/dist/src/arm/s3c64xx-pinctrl.dtsi head/sys/gnu/dts/arm/s3c64xx.dtsi - copied unchanged from r295019, vendor/device-tree/dist/src/arm/s3c64xx.dtsi head/sys/gnu/dts/arm/sama5d2-pinfunc.h - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sama5d2-pinfunc.h head/sys/gnu/dts/arm/sama5d2.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sama5d2.dtsi head/sys/gnu/dts/arm/socfpga.dtsi - copied unchanged from r295019, vendor/device-tree/dist/src/arm/socfpga.dtsi head/sys/gnu/dts/arm/socfpga_arria10.dtsi - copied unchanged from r295019, vendor/device-tree/dist/src/arm/socfpga_arria10.dtsi head/sys/gnu/dts/arm/socfpga_arria10_socdk.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/socfpga_arria10_socdk.dtsi head/sys/gnu/dts/arm/socfpga_arria10_socdk_sdmmc.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/socfpga_arria10_socdk_sdmmc.dts head/sys/gnu/dts/arm/socfpga_arria5.dtsi - copied unchanged from r295019, vendor/device-tree/dist/src/arm/socfpga_arria5.dtsi head/sys/gnu/dts/arm/socfpga_arria5_socdk.dts - copied unchanged from r295019, vendor/device-tree/dist/src/arm/socfpga_arria5_socdk.dts head/sys/gnu/dts/arm/socfpga_cyclone5.dtsi - copied unchanged from r295020, vendor/device-tree/dist/src/arm/socfpga_cyclone5.dtsi head/sys/gnu/dts/arm/socfpga_cyclone5_de0_sockit.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/socfpga_cyclone5_de0_sockit.dts head/sys/gnu/dts/arm/socfpga_cyclone5_mcv.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/socfpga_cyclone5_mcv.dtsi head/sys/gnu/dts/arm/socfpga_cyclone5_mcvevk.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/socfpga_cyclone5_mcvevk.dts head/sys/gnu/dts/arm/socfpga_cyclone5_socdk.dts - copied unchanged from r295020, vendor/device-tree/dist/src/arm/socfpga_cyclone5_socdk.dts head/sys/gnu/dts/arm/socfpga_cyclone5_sockit.dts - copied unchanged from r295020, vendor/device-tree/dist/src/arm/socfpga_cyclone5_sockit.dts head/sys/gnu/dts/arm/socfpga_cyclone5_socrates.dts - copied unchanged from r295020, vendor/device-tree/dist/src/arm/socfpga_cyclone5_socrates.dts head/sys/gnu/dts/arm/socfpga_vt.dts - copied unchanged from r295019, vendor/device-tree/dist/src/arm/socfpga_vt.dts head/sys/gnu/dts/arm/stm32429i-eval.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/stm32429i-eval.dts head/sys/gnu/dts/arm/stm32f429-disco.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/stm32f429-disco.dts head/sys/gnu/dts/arm/stm32f429.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/stm32f429.dtsi head/sys/gnu/dts/arm/sun4i-a10-gemei-g9.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun4i-a10-gemei-g9.dts head/sys/gnu/dts/arm/sun4i-a10-inet1.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun4i-a10-inet1.dts head/sys/gnu/dts/arm/sun4i-a10-inet9f-rev03.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun4i-a10-inet9f-rev03.dts head/sys/gnu/dts/arm/sun4i-a10-itead-iteaduino-plus.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun4i-a10-itead-iteaduino-plus.dts head/sys/gnu/dts/arm/sun4i-a10-jesurun-q5.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun4i-a10-jesurun-q5.dts head/sys/gnu/dts/arm/sun4i-a10-pcduino2.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun4i-a10-pcduino2.dts head/sys/gnu/dts/arm/sun4i-a10-pov-protab2-ips9.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun4i-a10-pov-protab2-ips9.dts head/sys/gnu/dts/arm/sun5i-a10s-auxtek-t003.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun5i-a10s-auxtek-t003.dts head/sys/gnu/dts/arm/sun5i-a10s-auxtek-t004.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun5i-a10s-auxtek-t004.dts head/sys/gnu/dts/arm/sun5i-a10s-wobo-i5.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun5i-a10s-wobo-i5.dts head/sys/gnu/dts/arm/sun5i-a13-empire-electronix-d709.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun5i-a13-empire-electronix-d709.dts head/sys/gnu/dts/arm/sun5i-a13-inet-98v-rev2.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun5i-a13-inet-98v-rev2.dts head/sys/gnu/dts/arm/sun5i-a13-q8-tablet.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun5i-a13-q8-tablet.dts head/sys/gnu/dts/arm/sun5i-a13-utoo-p66.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun5i-a13-utoo-p66.dts head/sys/gnu/dts/arm/sun5i-q8-common.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun5i-q8-common.dtsi head/sys/gnu/dts/arm/sun5i-r8-chip.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun5i-r8-chip.dts head/sys/gnu/dts/arm/sun5i-r8.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun5i-r8.dtsi head/sys/gnu/dts/arm/sun5i.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun5i.dtsi head/sys/gnu/dts/arm/sun6i-a31-i7.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun6i-a31-i7.dts head/sys/gnu/dts/arm/sun6i-a31-mele-a1000g-quad.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun6i-a31-mele-a1000g-quad.dts head/sys/gnu/dts/arm/sun6i-a31s-primo81.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun6i-a31s-primo81.dts head/sys/gnu/dts/arm/sun6i-a31s-sina31s-core.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun6i-a31s-sina31s-core.dtsi head/sys/gnu/dts/arm/sun6i-a31s-sina31s.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun6i-a31s-sina31s.dts head/sys/gnu/dts/arm/sun6i-a31s-sinovoip-bpi-m2.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun6i-a31s-sinovoip-bpi-m2.dts head/sys/gnu/dts/arm/sun6i-a31s-yones-toptech-bs1078-v2.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun6i-a31s-yones-toptech-bs1078-v2.dts head/sys/gnu/dts/arm/sun7i-a20-icnova-swac.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun7i-a20-icnova-swac.dts head/sys/gnu/dts/arm/sun7i-a20-mk808c.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun7i-a20-mk808c.dts head/sys/gnu/dts/arm/sun7i-a20-olimex-som-evb.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun7i-a20-olimex-som-evb.dts head/sys/gnu/dts/arm/sun7i-a20-orangepi-mini.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun7i-a20-orangepi-mini.dts head/sys/gnu/dts/arm/sun7i-a20-orangepi.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun7i-a20-orangepi.dts head/sys/gnu/dts/arm/sun7i-a20-pcduino3-nano.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun7i-a20-pcduino3-nano.dts head/sys/gnu/dts/arm/sun7i-a20-wexler-tab7200.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun7i-a20-wexler-tab7200.dts head/sys/gnu/dts/arm/sun7i-a20-wits-pro-a20-dkt.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun7i-a20-wits-pro-a20-dkt.dts head/sys/gnu/dts/arm/sun8i-a23-a33.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun8i-a23-a33.dtsi head/sys/gnu/dts/arm/sun8i-a23-evb.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun8i-a23-evb.dts head/sys/gnu/dts/arm/sun8i-a23-gt90h-v4.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun8i-a23-gt90h-v4.dts head/sys/gnu/dts/arm/sun8i-a23-q8-tablet.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun8i-a23-q8-tablet.dts head/sys/gnu/dts/arm/sun8i-a33-et-q8-v1.6.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun8i-a33-et-q8-v1.6.dts head/sys/gnu/dts/arm/sun8i-a33-ga10h-v1.1.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun8i-a33-ga10h-v1.1.dts head/sys/gnu/dts/arm/sun8i-a33-ippo-q8h-v1.2.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun8i-a33-ippo-q8h-v1.2.dts head/sys/gnu/dts/arm/sun8i-a33-q8-tablet.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun8i-a33-q8-tablet.dts head/sys/gnu/dts/arm/sun8i-a33-sinlinx-sina33.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun8i-a33-sinlinx-sina33.dts head/sys/gnu/dts/arm/sun8i-a33.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun8i-a33.dtsi head/sys/gnu/dts/arm/sun8i-h3-orangepi-plus.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun8i-h3-orangepi-plus.dts head/sys/gnu/dts/arm/sun8i-h3.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun8i-h3.dtsi head/sys/gnu/dts/arm/sun8i-q8-common.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun8i-q8-common.dtsi head/sys/gnu/dts/arm/sun9i-a80-cubieboard4.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sun9i-a80-cubieboard4.dts head/sys/gnu/dts/arm/sunxi-q8-common.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/sunxi-q8-common.dtsi head/sys/gnu/dts/arm/tango4-common.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/tango4-common.dtsi head/sys/gnu/dts/arm/tango4-smp8758.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/tango4-smp8758.dtsi head/sys/gnu/dts/arm/tango4-vantage-1172.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/tango4-vantage-1172.dts head/sys/gnu/dts/arm/tegra124-jetson-tk1-emc.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/tegra124-jetson-tk1-emc.dtsi head/sys/gnu/dts/arm/tegra124-nyan-big-emc.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/tegra124-nyan-big-emc.dtsi head/sys/gnu/dts/arm/tegra124-nyan-blaze-emc.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/tegra124-nyan-blaze-emc.dtsi head/sys/gnu/dts/arm/tegra124-nyan-blaze.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/tegra124-nyan-blaze.dts head/sys/gnu/dts/arm/tegra124-nyan.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/tegra124-nyan.dtsi head/sys/gnu/dts/arm/uniphier-common32.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/uniphier-common32.dtsi head/sys/gnu/dts/arm/uniphier-ph1-ld4-ref.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/uniphier-ph1-ld4-ref.dts head/sys/gnu/dts/arm/uniphier-ph1-ld4.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/uniphier-ph1-ld4.dtsi head/sys/gnu/dts/arm/uniphier-ph1-ld6b-ref.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/uniphier-ph1-ld6b-ref.dts head/sys/gnu/dts/arm/uniphier-ph1-ld6b.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/uniphier-ph1-ld6b.dtsi head/sys/gnu/dts/arm/uniphier-ph1-pro4-ref.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/uniphier-ph1-pro4-ref.dts head/sys/gnu/dts/arm/uniphier-ph1-pro4.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/uniphier-ph1-pro4.dtsi head/sys/gnu/dts/arm/uniphier-ph1-pro5.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/uniphier-ph1-pro5.dtsi head/sys/gnu/dts/arm/uniphier-ph1-sld3-ref.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/uniphier-ph1-sld3-ref.dts head/sys/gnu/dts/arm/uniphier-ph1-sld3.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/uniphier-ph1-sld3.dtsi head/sys/gnu/dts/arm/uniphier-ph1-sld8-ref.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/uniphier-ph1-sld8-ref.dts head/sys/gnu/dts/arm/uniphier-ph1-sld8.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/uniphier-ph1-sld8.dtsi head/sys/gnu/dts/arm/uniphier-pinctrl.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/uniphier-pinctrl.dtsi head/sys/gnu/dts/arm/uniphier-proxstream2-gentil.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/uniphier-proxstream2-gentil.dts head/sys/gnu/dts/arm/uniphier-proxstream2-vodka.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/uniphier-proxstream2-vodka.dts head/sys/gnu/dts/arm/uniphier-proxstream2.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/uniphier-proxstream2.dtsi head/sys/gnu/dts/arm/uniphier-ref-daughter.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/uniphier-ref-daughter.dtsi head/sys/gnu/dts/arm/uniphier-support-card.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/uniphier-support-card.dtsi head/sys/gnu/dts/arm/vf610m4-colibri.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/vf610m4-colibri.dts head/sys/gnu/dts/arm/vf610m4-cosmic.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/vf610m4-cosmic.dts head/sys/gnu/dts/arm/vf610m4.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/vf610m4.dtsi head/sys/gnu/dts/arm/zx296702-ad1.dts - copied unchanged from r295015, vendor/device-tree/dist/src/arm/zx296702-ad1.dts head/sys/gnu/dts/arm/zx296702.dtsi - copied unchanged from r295015, vendor/device-tree/dist/src/arm/zx296702.dtsi head/sys/gnu/dts/include/dt-bindings/clock/alphascale,asm9260.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/alphascale,asm9260.h head/sys/gnu/dts/include/dt-bindings/clock/bcm-cygnus.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/bcm-cygnus.h head/sys/gnu/dts/include/dt-bindings/clock/bcm-ns2.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/bcm-ns2.h head/sys/gnu/dts/include/dt-bindings/clock/bcm-nsp.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/bcm-nsp.h head/sys/gnu/dts/include/dt-bindings/clock/bcm2835-aux.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/bcm2835-aux.h head/sys/gnu/dts/include/dt-bindings/clock/bcm2835.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/bcm2835.h head/sys/gnu/dts/include/dt-bindings/clock/exynos5433.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/exynos5433.h head/sys/gnu/dts/include/dt-bindings/clock/hi6220-clock.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/hi6220-clock.h head/sys/gnu/dts/include/dt-bindings/clock/imx6ul-clock.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/imx6ul-clock.h head/sys/gnu/dts/include/dt-bindings/clock/imx7d-clock.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/imx7d-clock.h head/sys/gnu/dts/include/dt-bindings/clock/jz4740-cgu.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/jz4740-cgu.h head/sys/gnu/dts/include/dt-bindings/clock/jz4780-cgu.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/jz4780-cgu.h head/sys/gnu/dts/include/dt-bindings/clock/lpc18xx-ccu.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/lpc18xx-ccu.h head/sys/gnu/dts/include/dt-bindings/clock/lpc18xx-cgu.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/lpc18xx-cgu.h head/sys/gnu/dts/include/dt-bindings/clock/lpc32xx-clock.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/lpc32xx-clock.h head/sys/gnu/dts/include/dt-bindings/clock/lsi,axm5516-clks.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/lsi,axm5516-clks.h head/sys/gnu/dts/include/dt-bindings/clock/marvell,mmp2.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/marvell,mmp2.h head/sys/gnu/dts/include/dt-bindings/clock/marvell,pxa168.h - copied unchanged from r295021, vendor/device-tree/dist/include/dt-bindings/clock/marvell,pxa168.h head/sys/gnu/dts/include/dt-bindings/clock/marvell,pxa1928.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/marvell,pxa1928.h head/sys/gnu/dts/include/dt-bindings/clock/marvell,pxa910.h - copied unchanged from r295021, vendor/device-tree/dist/include/dt-bindings/clock/marvell,pxa910.h head/sys/gnu/dts/include/dt-bindings/clock/maxim,max77686.h - copied unchanged from r295021, vendor/device-tree/dist/include/dt-bindings/clock/maxim,max77686.h head/sys/gnu/dts/include/dt-bindings/clock/maxim,max77802.h - copied unchanged from r295021, vendor/device-tree/dist/include/dt-bindings/clock/maxim,max77802.h head/sys/gnu/dts/include/dt-bindings/clock/meson8b-clkc.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/meson8b-clkc.h head/sys/gnu/dts/include/dt-bindings/clock/mt8135-clk.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/mt8135-clk.h head/sys/gnu/dts/include/dt-bindings/clock/mt8173-clk.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/mt8173-clk.h head/sys/gnu/dts/include/dt-bindings/clock/pistachio-clk.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/pistachio-clk.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-apq8084.h - copied unchanged from r295021, vendor/device-tree/dist/include/dt-bindings/clock/qcom,gcc-apq8084.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-ipq806x.h - copied unchanged from r295021, vendor/device-tree/dist/include/dt-bindings/clock/qcom,gcc-ipq806x.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8660.h - copied unchanged from r295021, vendor/device-tree/dist/include/dt-bindings/clock/qcom,gcc-msm8660.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8916.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/qcom,gcc-msm8916.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8960.h - copied unchanged from r295021, vendor/device-tree/dist/include/dt-bindings/clock/qcom,gcc-msm8960.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8974.h - copied unchanged from r295021, vendor/device-tree/dist/include/dt-bindings/clock/qcom,gcc-msm8974.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8996.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/qcom,gcc-msm8996.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,lcc-ipq806x.h - copied unchanged from r295021, vendor/device-tree/dist/include/dt-bindings/clock/qcom,lcc-ipq806x.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,lcc-msm8960.h - copied unchanged from r295021, vendor/device-tree/dist/include/dt-bindings/clock/qcom,lcc-msm8960.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-apq8084.h - copied unchanged from r295022, vendor/device-tree/dist/include/dt-bindings/clock/qcom,mmcc-apq8084.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-msm8960.h - copied unchanged from r295022, vendor/device-tree/dist/include/dt-bindings/clock/qcom,mmcc-msm8960.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-msm8974.h - copied unchanged from r295022, vendor/device-tree/dist/include/dt-bindings/clock/qcom,mmcc-msm8974.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-msm8996.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/qcom,mmcc-msm8996.h head/sys/gnu/dts/include/dt-bindings/clock/r8a73a4-clock.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/r8a73a4-clock.h head/sys/gnu/dts/include/dt-bindings/clock/r8a7778-clock.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/r8a7778-clock.h head/sys/gnu/dts/include/dt-bindings/clock/r8a7793-clock.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/r8a7793-clock.h head/sys/gnu/dts/include/dt-bindings/clock/r8a7795-cpg-mssr.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/r8a7795-cpg-mssr.h head/sys/gnu/dts/include/dt-bindings/clock/renesas-cpg-mssr.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/renesas-cpg-mssr.h head/sys/gnu/dts/include/dt-bindings/clock/rk3036-cru.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/rk3036-cru.h head/sys/gnu/dts/include/dt-bindings/clock/rk3228-cru.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/rk3228-cru.h head/sys/gnu/dts/include/dt-bindings/clock/rk3368-cru.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/rk3368-cru.h head/sys/gnu/dts/include/dt-bindings/clock/rockchip,rk808.h - copied unchanged from r295022, vendor/device-tree/dist/include/dt-bindings/clock/rockchip,rk808.h head/sys/gnu/dts/include/dt-bindings/clock/samsung,s2mps11.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/samsung,s2mps11.h head/sys/gnu/dts/include/dt-bindings/clock/samsung,s3c64xx-clock.h - copied unchanged from r295022, vendor/device-tree/dist/include/dt-bindings/clock/samsung,s3c64xx-clock.h head/sys/gnu/dts/include/dt-bindings/clock/sun4i-a10-pll2.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/sun4i-a10-pll2.h head/sys/gnu/dts/include/dt-bindings/clock/tegra210-car.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/tegra210-car.h head/sys/gnu/dts/include/dt-bindings/clock/zx296702-clock.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/clock/zx296702-clock.h head/sys/gnu/dts/include/dt-bindings/dma/axi-dmac.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/dma/axi-dmac.h head/sys/gnu/dts/include/dt-bindings/gpio/meson8b-gpio.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/gpio/meson8b-gpio.h head/sys/gnu/dts/include/dt-bindings/i2c/ - copied from r295020, vendor/device-tree/dist/include/dt-bindings/i2c/ head/sys/gnu/dts/include/dt-bindings/iio/ - copied from r295020, vendor/device-tree/dist/include/dt-bindings/iio/ head/sys/gnu/dts/include/dt-bindings/input/linux-event-codes.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/input/linux-event-codes.h head/sys/gnu/dts/include/dt-bindings/interrupt-controller/irq-st.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/interrupt-controller/irq-st.h head/sys/gnu/dts/include/dt-bindings/leds/ - copied from r295020, vendor/device-tree/dist/include/dt-bindings/leds/ head/sys/gnu/dts/include/dt-bindings/media/ - copied from r295020, vendor/device-tree/dist/include/dt-bindings/media/ head/sys/gnu/dts/include/dt-bindings/memory/tegra210-mc.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/memory/tegra210-mc.h head/sys/gnu/dts/include/dt-bindings/mfd/arizona.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/mfd/arizona.h head/sys/gnu/dts/include/dt-bindings/mfd/atmel-flexcom.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/mfd/atmel-flexcom.h head/sys/gnu/dts/include/dt-bindings/mfd/st-lpc.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/mfd/st-lpc.h head/sys/gnu/dts/include/dt-bindings/net/ - copied from r295020, vendor/device-tree/dist/include/dt-bindings/net/ head/sys/gnu/dts/include/dt-bindings/phy/phy-pistachio-usb.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/phy/phy-pistachio-usb.h head/sys/gnu/dts/include/dt-bindings/pinctrl/bcm2835.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/pinctrl/bcm2835.h head/sys/gnu/dts/include/dt-bindings/pinctrl/dm814x.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/pinctrl/dm814x.h head/sys/gnu/dts/include/dt-bindings/pinctrl/mt6397-pinfunc.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/pinctrl/mt6397-pinfunc.h head/sys/gnu/dts/include/dt-bindings/pinctrl/mt65xx.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/pinctrl/mt65xx.h head/sys/gnu/dts/include/dt-bindings/pinctrl/qcom,pmic-gpio.h - copied unchanged from r295022, vendor/device-tree/dist/include/dt-bindings/pinctrl/qcom,pmic-gpio.h head/sys/gnu/dts/include/dt-bindings/pinctrl/qcom,pmic-mpp.h - copied unchanged from r295022, vendor/device-tree/dist/include/dt-bindings/pinctrl/qcom,pmic-mpp.h head/sys/gnu/dts/include/dt-bindings/power/ - copied from r295020, vendor/device-tree/dist/include/dt-bindings/power/ head/sys/gnu/dts/include/dt-bindings/regulator/ - copied from r295020, vendor/device-tree/dist/include/dt-bindings/regulator/ head/sys/gnu/dts/include/dt-bindings/reset/ - copied from r295020, vendor/device-tree/dist/include/dt-bindings/reset/ head/sys/gnu/dts/include/dt-bindings/soc/ - copied from r295020, vendor/device-tree/dist/include/dt-bindings/soc/ head/sys/gnu/dts/include/dt-bindings/sound/apq8016-lpass.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/sound/apq8016-lpass.h head/sys/gnu/dts/include/dt-bindings/sound/audio-jack-events.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/sound/audio-jack-events.h head/sys/gnu/dts/include/dt-bindings/sound/tas2552.h - copied unchanged from r295020, vendor/device-tree/dist/include/dt-bindings/sound/tas2552.h Deleted: head/sys/gnu/dts/arm/dove-cm-a510.dts head/sys/gnu/dts/arm/imx53-evk.dts head/sys/gnu/dts/arm/kizbox.dts head/sys/gnu/dts/arm/omap34xx-hs.dtsi head/sys/gnu/dts/arm/omap36xx-hs.dtsi head/sys/gnu/dts/arm/r8a73a4-ape6evm-reference.dts head/sys/gnu/dts/arm/r8a7778-bockw-reference.dts head/sys/gnu/dts/arm/r8a7791-henninger.dts head/sys/gnu/dts/arm/sh7372-mackerel.dts head/sys/gnu/dts/arm/sh7372.dtsi head/sys/gnu/dts/arm/sh73a0-kzm9g-reference.dts head/sys/gnu/dts/arm/tps65217.dtsi head/sys/gnu/dts/include/dt-bindings/clk/at91.h head/sys/gnu/dts/include/dt-bindings/clk/exynos-audss-clk.h head/sys/gnu/dts/include/dt-bindings/phy/phy-miphy365x.h head/sys/gnu/dts/include/dt-bindings/reset-controller/ Modified: head/sys/gnu/dts/arm/am335x-base0033.dts head/sys/gnu/dts/arm/am335x-bone-common.dtsi head/sys/gnu/dts/arm/am335x-bone.dts head/sys/gnu/dts/arm/am335x-boneblack.dts head/sys/gnu/dts/arm/am335x-evm.dts head/sys/gnu/dts/arm/am335x-evmsk.dts head/sys/gnu/dts/arm/am335x-igep0033.dtsi head/sys/gnu/dts/arm/am335x-lxm.dts head/sys/gnu/dts/arm/am335x-nano.dts head/sys/gnu/dts/arm/am335x-pepper.dts head/sys/gnu/dts/arm/am33xx-clocks.dtsi head/sys/gnu/dts/arm/am33xx.dtsi head/sys/gnu/dts/arm/am3517-craneboard.dts head/sys/gnu/dts/arm/am3517.dtsi head/sys/gnu/dts/arm/am35xx-clocks.dtsi head/sys/gnu/dts/arm/am4372.dtsi head/sys/gnu/dts/arm/am437x-gp-evm.dts head/sys/gnu/dts/arm/am437x-idk-evm.dts head/sys/gnu/dts/arm/am437x-sk-evm.dts head/sys/gnu/dts/arm/am43x-epos-evm.dts head/sys/gnu/dts/arm/am43xx-clocks.dtsi head/sys/gnu/dts/arm/am57xx-beagle-x15.dts head/sys/gnu/dts/arm/animeo_ip.dts head/sys/gnu/dts/arm/arm-realview-pb1176.dts head/sys/gnu/dts/arm/armada-370-db.dts head/sys/gnu/dts/arm/armada-370-mirabox.dts head/sys/gnu/dts/arm/armada-370-netgear-rn102.dts head/sys/gnu/dts/arm/armada-370-netgear-rn104.dts head/sys/gnu/dts/arm/armada-370-rd.dts head/sys/gnu/dts/arm/armada-370-synology-ds213j.dts head/sys/gnu/dts/arm/armada-370-xp.dtsi head/sys/gnu/dts/arm/armada-370.dtsi head/sys/gnu/dts/arm/armada-375-db.dts head/sys/gnu/dts/arm/armada-375.dtsi head/sys/gnu/dts/arm/armada-385-db-ap.dts head/sys/gnu/dts/arm/armada-388-db.dts head/sys/gnu/dts/arm/armada-388-gp.dts head/sys/gnu/dts/arm/armada-388-rd.dts head/sys/gnu/dts/arm/armada-38x.dtsi head/sys/gnu/dts/arm/armada-xp-axpwifiap.dts head/sys/gnu/dts/arm/armada-xp-db.dts head/sys/gnu/dts/arm/armada-xp-gp.dts head/sys/gnu/dts/arm/armada-xp-lenovo-ix4-300d.dts head/sys/gnu/dts/arm/armada-xp-matrix.dts head/sys/gnu/dts/arm/armada-xp-mv78260.dtsi head/sys/gnu/dts/arm/armada-xp-mv78460.dtsi head/sys/gnu/dts/arm/armada-xp-netgear-rn2120.dts head/sys/gnu/dts/arm/armada-xp-openblocks-ax3-4.dts head/sys/gnu/dts/arm/armada-xp-synology-ds414.dts head/sys/gnu/dts/arm/armada-xp.dtsi head/sys/gnu/dts/arm/armv7-m.dtsi head/sys/gnu/dts/arm/at91-foxg20.dts head/sys/gnu/dts/arm/at91-qil_a9260.dts head/sys/gnu/dts/arm/at91-sama5d3_xplained.dts head/sys/gnu/dts/arm/at91-sama5d4ek.dts head/sys/gnu/dts/arm/at91rm9200.dtsi head/sys/gnu/dts/arm/at91rm9200ek.dts head/sys/gnu/dts/arm/at91sam9260.dtsi head/sys/gnu/dts/arm/at91sam9261.dtsi head/sys/gnu/dts/arm/at91sam9261ek.dts head/sys/gnu/dts/arm/at91sam9263.dtsi head/sys/gnu/dts/arm/at91sam9263ek.dts head/sys/gnu/dts/arm/at91sam9g15.dtsi head/sys/gnu/dts/arm/at91sam9g15ek.dts head/sys/gnu/dts/arm/at91sam9g20ek_common.dtsi head/sys/gnu/dts/arm/at91sam9g25.dtsi head/sys/gnu/dts/arm/at91sam9g25ek.dts head/sys/gnu/dts/arm/at91sam9g35.dtsi head/sys/gnu/dts/arm/at91sam9g35ek.dts head/sys/gnu/dts/arm/at91sam9g45.dtsi head/sys/gnu/dts/arm/at91sam9m10g45ek.dts head/sys/gnu/dts/arm/at91sam9n12.dtsi head/sys/gnu/dts/arm/at91sam9n12ek.dts head/sys/gnu/dts/arm/at91sam9rl.dtsi head/sys/gnu/dts/arm/at91sam9rlek.dts head/sys/gnu/dts/arm/at91sam9x35.dtsi head/sys/gnu/dts/arm/at91sam9x35ek.dts head/sys/gnu/dts/arm/at91sam9x5.dtsi head/sys/gnu/dts/arm/at91sam9x5_isi.dtsi head/sys/gnu/dts/arm/at91sam9x5_lcd.dtsi head/sys/gnu/dts/arm/at91sam9x5_macb0.dtsi head/sys/gnu/dts/arm/at91sam9x5_macb1.dtsi head/sys/gnu/dts/arm/at91sam9x5cm.dtsi head/sys/gnu/dts/arm/at91sam9x5ek.dtsi head/sys/gnu/dts/arm/atlas7-evb.dts head/sys/gnu/dts/arm/atlas7.dtsi head/sys/gnu/dts/arm/axp209.dtsi head/sys/gnu/dts/arm/bcm-cygnus-clock.dtsi head/sys/gnu/dts/arm/bcm-cygnus.dtsi head/sys/gnu/dts/arm/bcm11351.dtsi head/sys/gnu/dts/arm/bcm21664.dtsi head/sys/gnu/dts/arm/bcm2835-rpi-b-plus.dts head/sys/gnu/dts/arm/bcm2835-rpi-b.dts head/sys/gnu/dts/arm/bcm2835-rpi.dtsi head/sys/gnu/dts/arm/bcm2835.dtsi head/sys/gnu/dts/arm/bcm4708-buffalo-wzr-1750dhp.dts head/sys/gnu/dts/arm/bcm4708-luxul-xwc-1000.dts head/sys/gnu/dts/arm/bcm4708-netgear-r6250.dts head/sys/gnu/dts/arm/bcm4708-netgear-r6300-v2.dts head/sys/gnu/dts/arm/bcm4708.dtsi head/sys/gnu/dts/arm/bcm47081-asus-rt-n18u.dts head/sys/gnu/dts/arm/bcm47081-buffalo-wzr-600dhp2.dts head/sys/gnu/dts/arm/bcm47081-buffalo-wzr-900dhp.dts head/sys/gnu/dts/arm/bcm5301x.dtsi head/sys/gnu/dts/arm/bcm63138.dtsi head/sys/gnu/dts/arm/bcm7445-bcm97445svmb.dts head/sys/gnu/dts/arm/bcm7445.dtsi head/sys/gnu/dts/arm/bcm911360_entphn.dts head/sys/gnu/dts/arm/bcm911360k.dts head/sys/gnu/dts/arm/bcm958300k.dts head/sys/gnu/dts/arm/bcm963138dvt.dts head/sys/gnu/dts/arm/berlin2-sony-nsz-gs7.dts head/sys/gnu/dts/arm/berlin2.dtsi head/sys/gnu/dts/arm/berlin2cd-google-chromecast.dts head/sys/gnu/dts/arm/berlin2cd.dtsi head/sys/gnu/dts/arm/berlin2q-marvell-dmp.dts head/sys/gnu/dts/arm/berlin2q.dtsi head/sys/gnu/dts/arm/cros-ec-keyboard.dtsi head/sys/gnu/dts/arm/cx92755.dtsi head/sys/gnu/dts/arm/cx92755_equinox.dts head/sys/gnu/dts/arm/da850-enbw-cmc.dts head/sys/gnu/dts/arm/da850-evm.dts head/sys/gnu/dts/arm/da850.dtsi head/sys/gnu/dts/arm/dm8168-evm.dts head/sys/gnu/dts/arm/dm816x.dtsi head/sys/gnu/dts/arm/dove-cubox.dts head/sys/gnu/dts/arm/dove.dtsi head/sys/gnu/dts/arm/dra7-evm.dts head/sys/gnu/dts/arm/dra7.dtsi head/sys/gnu/dts/arm/dra72-evm.dts head/sys/gnu/dts/arm/dra72x.dtsi head/sys/gnu/dts/arm/dra74x.dtsi head/sys/gnu/dts/arm/dra7xx-clocks.dtsi head/sys/gnu/dts/arm/ea3250.dts head/sys/gnu/dts/arm/efm32gg-dk3750.dts head/sys/gnu/dts/arm/efm32gg.dtsi head/sys/gnu/dts/arm/emev2-kzm9d.dts head/sys/gnu/dts/arm/emev2.dtsi head/sys/gnu/dts/arm/exynos3250-monk.dts head/sys/gnu/dts/arm/exynos3250-rinato.dts head/sys/gnu/dts/arm/exynos3250.dtsi head/sys/gnu/dts/arm/exynos4.dtsi head/sys/gnu/dts/arm/exynos4210-origen.dts head/sys/gnu/dts/arm/exynos4210-smdkv310.dts head/sys/gnu/dts/arm/exynos4210-trats.dts head/sys/gnu/dts/arm/exynos4210-universal_c210.dts head/sys/gnu/dts/arm/exynos4210.dtsi head/sys/gnu/dts/arm/exynos4212.dtsi head/sys/gnu/dts/arm/exynos4412-odroid-common.dtsi head/sys/gnu/dts/arm/exynos4412-odroidu3.dts head/sys/gnu/dts/arm/exynos4412-odroidx.dts head/sys/gnu/dts/arm/exynos4412-origen.dts head/sys/gnu/dts/arm/exynos4412-smdk4412.dts head/sys/gnu/dts/arm/exynos4412-tiny4412.dts head/sys/gnu/dts/arm/exynos4412-trats2.dts head/sys/gnu/dts/arm/exynos4412.dtsi head/sys/gnu/dts/arm/exynos4415.dtsi head/sys/gnu/dts/arm/exynos4x12-pinctrl.dtsi head/sys/gnu/dts/arm/exynos4x12.dtsi head/sys/gnu/dts/arm/exynos5.dtsi head/sys/gnu/dts/arm/exynos5250-arndale.dts head/sys/gnu/dts/arm/exynos5250-pinctrl.dtsi head/sys/gnu/dts/arm/exynos5250-smdk5250.dts head/sys/gnu/dts/arm/exynos5250-spring.dts head/sys/gnu/dts/arm/exynos5250.dtsi head/sys/gnu/dts/arm/exynos5260-xyref5260.dts head/sys/gnu/dts/arm/exynos5410-smdk5410.dts head/sys/gnu/dts/arm/exynos5410.dtsi head/sys/gnu/dts/arm/exynos5420-arndale-octa.dts head/sys/gnu/dts/arm/exynos5420-pinctrl.dtsi head/sys/gnu/dts/arm/exynos5420-smdk5420.dts head/sys/gnu/dts/arm/exynos5420.dtsi head/sys/gnu/dts/arm/exynos5422-odroidxu3.dts head/sys/gnu/dts/arm/exynos5440-sd5v1.dts head/sys/gnu/dts/arm/exynos5440-ssdk5440.dts head/sys/gnu/dts/arm/exynos5440.dtsi head/sys/gnu/dts/arm/hi3620-hi4511.dts head/sys/gnu/dts/arm/hip04.dtsi head/sys/gnu/dts/arm/hisi-x5hd2-dkb.dts head/sys/gnu/dts/arm/imx23-olinuxino.dts head/sys/gnu/dts/arm/imx23.dtsi head/sys/gnu/dts/arm/imx25-pdk.dts head/sys/gnu/dts/arm/imx25-pinfunc.h head/sys/gnu/dts/arm/imx25.dtsi head/sys/gnu/dts/arm/imx27.dtsi head/sys/gnu/dts/arm/imx28-apf28.dts head/sys/gnu/dts/arm/imx28-apf28dev.dts head/sys/gnu/dts/arm/imx28-cfa10036.dts head/sys/gnu/dts/arm/imx28-cfa10057.dts head/sys/gnu/dts/arm/imx28-evk.dts head/sys/gnu/dts/arm/imx28-m28evk.dts head/sys/gnu/dts/arm/imx28-tx28.dts head/sys/gnu/dts/arm/imx28.dtsi head/sys/gnu/dts/arm/imx31.dtsi head/sys/gnu/dts/arm/imx35.dtsi head/sys/gnu/dts/arm/imx50-evk.dts head/sys/gnu/dts/arm/imx50.dtsi head/sys/gnu/dts/arm/imx51-apf51dev.dts head/sys/gnu/dts/arm/imx51.dtsi head/sys/gnu/dts/arm/imx53-ard.dts head/sys/gnu/dts/arm/imx53-m53evk.dts head/sys/gnu/dts/arm/imx53-qsb-common.dtsi head/sys/gnu/dts/arm/imx53-qsrb.dts head/sys/gnu/dts/arm/imx53-smd.dts head/sys/gnu/dts/arm/imx53-tqma53.dtsi head/sys/gnu/dts/arm/imx53-tx53-x03x.dts head/sys/gnu/dts/arm/imx53-tx53.dtsi head/sys/gnu/dts/arm/imx53-voipac-bsb.dts head/sys/gnu/dts/arm/imx53.dtsi head/sys/gnu/dts/arm/imx6dl-aristainetos_4.dts head/sys/gnu/dts/arm/imx6dl-aristainetos_7.dts head/sys/gnu/dts/arm/imx6dl-cubox-i.dts head/sys/gnu/dts/arm/imx6dl-hummingboard.dts head/sys/gnu/dts/arm/imx6dl-nitrogen6x.dts head/sys/gnu/dts/arm/imx6dl-rex-basic.dts head/sys/gnu/dts/arm/imx6dl-riotboard.dts head/sys/gnu/dts/arm/imx6dl-sabrelite.dts head/sys/gnu/dts/arm/imx6dl.dtsi head/sys/gnu/dts/arm/imx6q-arm2.dts head/sys/gnu/dts/arm/imx6q-cubox-i.dts head/sys/gnu/dts/arm/imx6q-dmo-edmqmx6.dts head/sys/gnu/dts/arm/imx6q-gk802.dts head/sys/gnu/dts/arm/imx6q-gw5400-a.dts head/sys/gnu/dts/arm/imx6q-hummingboard.dts head/sys/gnu/dts/arm/imx6q-nitrogen6x.dts head/sys/gnu/dts/arm/imx6q-rex-pro.dts head/sys/gnu/dts/arm/imx6q-sabrelite.dts head/sys/gnu/dts/arm/imx6q-tbs2910.dts head/sys/gnu/dts/arm/imx6q.dtsi head/sys/gnu/dts/arm/imx6qdl-aristainetos.dtsi head/sys/gnu/dts/arm/imx6qdl-cubox-i.dtsi head/sys/gnu/dts/arm/imx6qdl-dfi-fs700-m60.dtsi head/sys/gnu/dts/arm/imx6qdl-gw51xx.dtsi head/sys/gnu/dts/arm/imx6qdl-gw52xx.dtsi head/sys/gnu/dts/arm/imx6qdl-gw53xx.dtsi head/sys/gnu/dts/arm/imx6qdl-gw54xx.dtsi head/sys/gnu/dts/arm/imx6qdl-gw552x.dtsi head/sys/gnu/dts/arm/imx6qdl-hummingboard.dtsi head/sys/gnu/dts/arm/imx6qdl-microsom-ar8035.dtsi head/sys/gnu/dts/arm/imx6qdl-microsom.dtsi head/sys/gnu/dts/arm/imx6qdl-nitrogen6x.dtsi head/sys/gnu/dts/arm/imx6qdl-phytec-pfla02.dtsi head/sys/gnu/dts/arm/imx6qdl-rex.dtsi head/sys/gnu/dts/arm/imx6qdl-sabreauto.dtsi head/sys/gnu/dts/arm/imx6qdl-sabrelite.dtsi head/sys/gnu/dts/arm/imx6qdl-sabresd.dtsi head/sys/gnu/dts/arm/imx6qdl-tx6.dtsi head/sys/gnu/dts/arm/imx6qdl-wandboard.dtsi head/sys/gnu/dts/arm/imx6qdl.dtsi head/sys/gnu/dts/arm/imx6sl-evk.dts head/sys/gnu/dts/arm/imx6sl.dtsi head/sys/gnu/dts/arm/imx6sx-sabreauto.dts head/sys/gnu/dts/arm/imx6sx-sdb.dts head/sys/gnu/dts/arm/imx6sx.dtsi head/sys/gnu/dts/arm/integrator.dtsi head/sys/gnu/dts/arm/k2e-clocks.dtsi head/sys/gnu/dts/arm/k2e-evm.dts head/sys/gnu/dts/arm/k2e.dtsi head/sys/gnu/dts/arm/k2hk-clocks.dtsi head/sys/gnu/dts/arm/k2hk-evm.dts head/sys/gnu/dts/arm/k2hk.dtsi head/sys/gnu/dts/arm/k2l-clocks.dtsi head/sys/gnu/dts/arm/k2l-evm.dts head/sys/gnu/dts/arm/k2l.dtsi head/sys/gnu/dts/arm/keystone.dtsi head/sys/gnu/dts/arm/kirkwood-b3.dts head/sys/gnu/dts/arm/kirkwood-cloudbox.dts head/sys/gnu/dts/arm/kirkwood-d2net.dts head/sys/gnu/dts/arm/kirkwood-dir665.dts head/sys/gnu/dts/arm/kirkwood-dreamplug.dts head/sys/gnu/dts/arm/kirkwood-is2.dts head/sys/gnu/dts/arm/kirkwood-lsxl.dtsi head/sys/gnu/dts/arm/kirkwood-mv88f6281gtw-ge.dts head/sys/gnu/dts/arm/kirkwood-net2big.dts head/sys/gnu/dts/arm/kirkwood-net5big.dts head/sys/gnu/dts/arm/kirkwood-netxbig.dtsi head/sys/gnu/dts/arm/kirkwood-ns2-common.dtsi head/sys/gnu/dts/arm/kirkwood-ns2.dts head/sys/gnu/dts/arm/kirkwood-ns2max.dts head/sys/gnu/dts/arm/kirkwood-ns2mini.dts head/sys/gnu/dts/arm/kirkwood-rd88f6192.dts head/sys/gnu/dts/arm/kirkwood-synology.dtsi head/sys/gnu/dts/arm/kirkwood-t5325.dts head/sys/gnu/dts/arm/kirkwood-ts219.dtsi head/sys/gnu/dts/arm/kirkwood.dtsi head/sys/gnu/dts/arm/lpc32xx.dtsi head/sys/gnu/dts/arm/ls1021a-qds.dts head/sys/gnu/dts/arm/ls1021a-twr.dts head/sys/gnu/dts/arm/ls1021a.dtsi head/sys/gnu/dts/arm/meson.dtsi head/sys/gnu/dts/arm/meson6-atv1200.dts head/sys/gnu/dts/arm/meson8.dtsi head/sys/gnu/dts/arm/mt6589.dtsi head/sys/gnu/dts/arm/mt8127.dtsi head/sys/gnu/dts/arm/mt8135-evbp1.dts head/sys/gnu/dts/arm/mt8135.dtsi head/sys/gnu/dts/arm/nspire-classic.dtsi head/sys/gnu/dts/arm/nspire-cx.dts head/sys/gnu/dts/arm/nspire.dtsi head/sys/gnu/dts/arm/omap2.dtsi head/sys/gnu/dts/arm/omap2420-n8x0-common.dtsi head/sys/gnu/dts/arm/omap2420.dtsi head/sys/gnu/dts/arm/omap2430-clocks.dtsi head/sys/gnu/dts/arm/omap2430.dtsi head/sys/gnu/dts/arm/omap24xx-clocks.dtsi head/sys/gnu/dts/arm/omap3-beagle-xm.dts head/sys/gnu/dts/arm/omap3-beagle.dts head/sys/gnu/dts/arm/omap3-cm-t3517.dts head/sys/gnu/dts/arm/omap3-cm-t3730.dts head/sys/gnu/dts/arm/omap3-cm-t3x.dtsi head/sys/gnu/dts/arm/omap3-cm-t3x30.dtsi head/sys/gnu/dts/arm/omap3-devkit8000.dts head/sys/gnu/dts/arm/omap3-evm-37xx.dts head/sys/gnu/dts/arm/omap3-evm-common.dtsi head/sys/gnu/dts/arm/omap3-gta04.dtsi head/sys/gnu/dts/arm/omap3-gta04a5.dts head/sys/gnu/dts/arm/omap3-igep.dtsi head/sys/gnu/dts/arm/omap3-igep0020-common.dtsi head/sys/gnu/dts/arm/omap3-igep0020-rev-f.dts head/sys/gnu/dts/arm/omap3-igep0020.dts head/sys/gnu/dts/arm/omap3-igep0030-common.dtsi head/sys/gnu/dts/arm/omap3-igep0030-rev-g.dts head/sys/gnu/dts/arm/omap3-igep0030.dts head/sys/gnu/dts/arm/omap3-ldp.dts head/sys/gnu/dts/arm/omap3-lilly-a83x.dtsi head/sys/gnu/dts/arm/omap3-lilly-dbb056.dts head/sys/gnu/dts/arm/omap3-n9.dts head/sys/gnu/dts/arm/omap3-n900.dts head/sys/gnu/dts/arm/omap3-n950-n9.dtsi head/sys/gnu/dts/arm/omap3-n950.dts head/sys/gnu/dts/arm/omap3-overo-alto35-common.dtsi head/sys/gnu/dts/arm/omap3-overo-base.dtsi head/sys/gnu/dts/arm/omap3-overo-chestnut43-common.dtsi head/sys/gnu/dts/arm/omap3-overo-common-lcd35.dtsi head/sys/gnu/dts/arm/omap3-overo-common-lcd43.dtsi head/sys/gnu/dts/arm/omap3-overo-gallop43-common.dtsi head/sys/gnu/dts/arm/omap3-overo-palo43-common.dtsi head/sys/gnu/dts/arm/omap3-overo.dtsi head/sys/gnu/dts/arm/omap3-panel-sharp-ls037v7dw01.dtsi head/sys/gnu/dts/arm/omap3-tao3530.dtsi head/sys/gnu/dts/arm/omap3-zoom3.dts head/sys/gnu/dts/arm/omap3.dtsi head/sys/gnu/dts/arm/omap34xx.dtsi head/sys/gnu/dts/arm/omap36xx.dtsi head/sys/gnu/dts/arm/omap3xxx-clocks.dtsi head/sys/gnu/dts/arm/omap4-cpu-thermal.dtsi head/sys/gnu/dts/arm/omap4-duovero-parlor.dts head/sys/gnu/dts/arm/omap4-duovero.dtsi head/sys/gnu/dts/arm/omap4-panda-a4.dts head/sys/gnu/dts/arm/omap4-panda-common.dtsi head/sys/gnu/dts/arm/omap4-panda-es.dts head/sys/gnu/dts/arm/omap4-sdp-es23plus.dts head/sys/gnu/dts/arm/omap4-sdp.dts head/sys/gnu/dts/arm/omap4-var-om44customboard.dtsi head/sys/gnu/dts/arm/omap4-var-som-om44-wlan.dtsi head/sys/gnu/dts/arm/omap4-var-som-om44.dtsi head/sys/gnu/dts/arm/omap4.dtsi head/sys/gnu/dts/arm/omap4460.dtsi head/sys/gnu/dts/arm/omap5-cm-t54.dts head/sys/gnu/dts/arm/omap5-core-thermal.dtsi head/sys/gnu/dts/arm/omap5-gpu-thermal.dtsi head/sys/gnu/dts/arm/omap5-uevm.dts head/sys/gnu/dts/arm/omap5.dtsi head/sys/gnu/dts/arm/omap54xx-clocks.dtsi head/sys/gnu/dts/arm/orion5x.dtsi head/sys/gnu/dts/arm/phy3250.dts head/sys/gnu/dts/arm/pxa27x.dtsi head/sys/gnu/dts/arm/pxa2xx.dtsi head/sys/gnu/dts/arm/pxa3xx.dtsi head/sys/gnu/dts/arm/r7s72100.dtsi head/sys/gnu/dts/arm/r8a73a4-ape6evm.dts head/sys/gnu/dts/arm/r8a73a4.dtsi head/sys/gnu/dts/arm/r8a7740-armadillo800eva.dts head/sys/gnu/dts/arm/r8a7740.dtsi head/sys/gnu/dts/arm/r8a7778-bockw.dts head/sys/gnu/dts/arm/r8a7778.dtsi head/sys/gnu/dts/arm/r8a7779-marzen.dts head/sys/gnu/dts/arm/r8a7779.dtsi head/sys/gnu/dts/arm/r8a7790-lager.dts head/sys/gnu/dts/arm/r8a7790.dtsi head/sys/gnu/dts/arm/r8a7791-koelsch.dts head/sys/gnu/dts/arm/r8a7791.dtsi head/sys/gnu/dts/arm/r8a7794-alt.dts head/sys/gnu/dts/arm/r8a7794.dtsi head/sys/gnu/dts/arm/rk3066a-bqcurie2.dts head/sys/gnu/dts/arm/rk3066a-marsboard.dts head/sys/gnu/dts/arm/rk3066a-rayeager.dts head/sys/gnu/dts/arm/rk3066a.dtsi head/sys/gnu/dts/arm/rk3188-radxarock.dts head/sys/gnu/dts/arm/rk3188.dtsi head/sys/gnu/dts/arm/rk3288-evb-act8846.dts head/sys/gnu/dts/arm/rk3288-evb-rk808.dts head/sys/gnu/dts/arm/rk3288-evb.dtsi head/sys/gnu/dts/arm/rk3288-firefly.dtsi head/sys/gnu/dts/arm/rk3288-thermal.dtsi head/sys/gnu/dts/arm/rk3288.dtsi head/sys/gnu/dts/arm/rk3xxx.dtsi head/sys/gnu/dts/arm/s3c2416-smdk2416.dts head/sys/gnu/dts/arm/s3c2416.dtsi head/sys/gnu/dts/arm/s5pv210-aquila.dts head/sys/gnu/dts/arm/s5pv210-goni.dts head/sys/gnu/dts/arm/sama5d3.dtsi head/sys/gnu/dts/arm/sama5d35ek.dts head/sys/gnu/dts/arm/sama5d3_can.dtsi head/sys/gnu/dts/arm/sama5d3_emac.dtsi head/sys/gnu/dts/arm/sama5d3_gmac.dtsi head/sys/gnu/dts/arm/sama5d3_lcd.dtsi head/sys/gnu/dts/arm/sama5d3_mci2.dtsi head/sys/gnu/dts/arm/sama5d3_tcb1.dtsi head/sys/gnu/dts/arm/sama5d3_uart.dtsi head/sys/gnu/dts/arm/sama5d3xcm.dtsi head/sys/gnu/dts/arm/sama5d3xmb.dtsi head/sys/gnu/dts/arm/sama5d4.dtsi head/sys/gnu/dts/arm/sh73a0-kzm9g.dts head/sys/gnu/dts/arm/sh73a0.dtsi head/sys/gnu/dts/arm/spear1310-evb.dts head/sys/gnu/dts/arm/spear1310.dtsi head/sys/gnu/dts/arm/spear1340-evb.dts head/sys/gnu/dts/arm/spear1340.dtsi head/sys/gnu/dts/arm/spear13xx.dtsi head/sys/gnu/dts/arm/spear300-evb.dts head/sys/gnu/dts/arm/spear300.dtsi head/sys/gnu/dts/arm/spear310-evb.dts head/sys/gnu/dts/arm/spear310.dtsi head/sys/gnu/dts/arm/spear320-evb.dts head/sys/gnu/dts/arm/spear320.dtsi head/sys/gnu/dts/arm/spear3xx.dtsi head/sys/gnu/dts/arm/ste-ccu8540.dts head/sys/gnu/dts/arm/ste-ccu9540.dts head/sys/gnu/dts/arm/ste-dbx5x0.dtsi head/sys/gnu/dts/arm/ste-href-stuib.dtsi head/sys/gnu/dts/arm/ste-href-tvk1281618.dtsi head/sys/gnu/dts/arm/ste-href.dtsi head/sys/gnu/dts/arm/ste-hrefprev60-stuib.dts head/sys/gnu/dts/arm/ste-hrefprev60-tvk.dts head/sys/gnu/dts/arm/ste-hrefprev60.dtsi head/sys/gnu/dts/arm/ste-hrefv60plus-stuib.dts head/sys/gnu/dts/arm/ste-hrefv60plus-tvk.dts head/sys/gnu/dts/arm/ste-hrefv60plus.dtsi head/sys/gnu/dts/arm/ste-nomadik-nhk15.dts head/sys/gnu/dts/arm/ste-nomadik-s8815.dts head/sys/gnu/dts/arm/ste-nomadik-stn8815.dtsi head/sys/gnu/dts/arm/ste-snowball.dts head/sys/gnu/dts/arm/ste-u300.dts head/sys/gnu/dts/arm/stih407-b2120.dts head/sys/gnu/dts/arm/stih407-clock.dtsi head/sys/gnu/dts/arm/stih407-family.dtsi head/sys/gnu/dts/arm/stih407-pinctrl.dtsi head/sys/gnu/dts/arm/stih407.dtsi head/sys/gnu/dts/arm/stih410-b2120.dts head/sys/gnu/dts/arm/stih410-clock.dtsi head/sys/gnu/dts/arm/stih410.dtsi head/sys/gnu/dts/arm/stih415.dtsi head/sys/gnu/dts/arm/stih416-b2020e.dts head/sys/gnu/dts/arm/stih416-pinctrl.dtsi head/sys/gnu/dts/arm/stih416.dtsi head/sys/gnu/dts/arm/stih418-b2199.dts head/sys/gnu/dts/arm/stih418-clock.dtsi head/sys/gnu/dts/arm/stih418.dtsi head/sys/gnu/dts/arm/stihxxx-b2120.dtsi head/sys/gnu/dts/arm/sun4i-a10-a1000.dts head/sys/gnu/dts/arm/sun4i-a10-ba10-tvbox.dts head/sys/gnu/dts/arm/sun4i-a10-chuwi-v7-cw0825.dts head/sys/gnu/dts/arm/sun4i-a10-cubieboard.dts head/sys/gnu/dts/arm/sun4i-a10-hackberry.dts head/sys/gnu/dts/arm/sun4i-a10-hyundai-a7hd.dts head/sys/gnu/dts/arm/sun4i-a10-inet97fv2.dts head/sys/gnu/dts/arm/sun4i-a10-marsboard.dts head/sys/gnu/dts/arm/sun4i-a10-mini-xplus.dts head/sys/gnu/dts/arm/sun4i-a10-mk802.dts head/sys/gnu/dts/arm/sun4i-a10-mk802ii.dts head/sys/gnu/dts/arm/sun4i-a10-olinuxino-lime.dts head/sys/gnu/dts/arm/sun4i-a10-pcduino.dts head/sys/gnu/dts/arm/sun4i-a10.dtsi head/sys/gnu/dts/arm/sun5i-a10s-mk802.dts head/sys/gnu/dts/arm/sun5i-a10s-olinuxino-micro.dts head/sys/gnu/dts/arm/sun5i-a10s-r7-tv-dongle.dts head/sys/gnu/dts/arm/sun5i-a10s.dtsi head/sys/gnu/dts/arm/sun5i-a13-hsg-h702.dts head/sys/gnu/dts/arm/sun5i-a13-olinuxino-micro.dts head/sys/gnu/dts/arm/sun5i-a13-olinuxino.dts head/sys/gnu/dts/arm/sun5i-a13.dtsi head/sys/gnu/dts/arm/sun6i-a31-app4-evb1.dts head/sys/gnu/dts/arm/sun6i-a31-colombus.dts head/sys/gnu/dts/arm/sun6i-a31-hummingbird.dts head/sys/gnu/dts/arm/sun6i-a31-m9.dts head/sys/gnu/dts/arm/sun6i-a31.dtsi head/sys/gnu/dts/arm/sun6i-a31s-cs908.dts head/sys/gnu/dts/arm/sun6i-a31s.dtsi head/sys/gnu/dts/arm/sun7i-a20-bananapi.dts head/sys/gnu/dts/arm/sun7i-a20-bananapro.dts head/sys/gnu/dts/arm/sun7i-a20-cubieboard2.dts head/sys/gnu/dts/arm/sun7i-a20-cubietruck.dts head/sys/gnu/dts/arm/sun7i-a20-hummingbird.dts head/sys/gnu/dts/arm/sun7i-a20-i12-tvbox.dts head/sys/gnu/dts/arm/sun7i-a20-m3.dts head/sys/gnu/dts/arm/sun7i-a20-olinuxino-lime.dts head/sys/gnu/dts/arm/sun7i-a20-olinuxino-lime2.dts head/sys/gnu/dts/arm/sun7i-a20-olinuxino-micro.dts head/sys/gnu/dts/arm/sun7i-a20-pcduino3.dts head/sys/gnu/dts/arm/sun7i-a20.dtsi head/sys/gnu/dts/arm/sun8i-a23-ippo-q8h-v1.2.dts head/sys/gnu/dts/arm/sun8i-a23-ippo-q8h-v5.dts head/sys/gnu/dts/arm/sun8i-a23.dtsi head/sys/gnu/dts/arm/sun9i-a80-optimus.dts head/sys/gnu/dts/arm/sun9i-a80.dtsi head/sys/gnu/dts/arm/sunxi-common-regulators.dtsi head/sys/gnu/dts/arm/tegra114.dtsi head/sys/gnu/dts/arm/tegra124-jetson-tk1.dts head/sys/gnu/dts/arm/tegra124-nyan-big.dts head/sys/gnu/dts/arm/tegra124-venice2.dts head/sys/gnu/dts/arm/tegra124.dtsi head/sys/gnu/dts/arm/tegra20-seaboard.dts head/sys/gnu/dts/arm/tegra20.dtsi head/sys/gnu/dts/arm/tegra30-apalis-eval.dts head/sys/gnu/dts/arm/tegra30-apalis.dtsi head/sys/gnu/dts/arm/tegra30-beaver.dts head/sys/gnu/dts/arm/tegra30-cardhu.dtsi head/sys/gnu/dts/arm/tegra30-colibri-eval-v3.dts head/sys/gnu/dts/arm/tegra30-colibri.dtsi head/sys/gnu/dts/arm/tegra30.dtsi head/sys/gnu/dts/arm/twl4030_omap3.dtsi head/sys/gnu/dts/arm/twl6030_omap4.dtsi head/sys/gnu/dts/arm/usb_a9260_common.dtsi head/sys/gnu/dts/arm/usb_a9263.dts head/sys/gnu/dts/arm/versatile-ab.dts head/sys/gnu/dts/arm/versatile-pb.dts head/sys/gnu/dts/arm/vexpress-v2m-rs1.dtsi head/sys/gnu/dts/arm/vexpress-v2m.dtsi head/sys/gnu/dts/arm/vexpress-v2p-ca15_a7.dts head/sys/gnu/dts/arm/vexpress-v2p-ca9.dts head/sys/gnu/dts/arm/vf-colibri-eval-v3.dtsi head/sys/gnu/dts/arm/vf-colibri.dtsi head/sys/gnu/dts/arm/vf500-colibri-eval-v3.dts head/sys/gnu/dts/arm/vf500-colibri.dtsi head/sys/gnu/dts/arm/vf500.dtsi head/sys/gnu/dts/arm/vf610-colibri.dtsi head/sys/gnu/dts/arm/vf610-cosmic.dts head/sys/gnu/dts/arm/vf610-pinfunc.h head/sys/gnu/dts/arm/vf610-twr.dts head/sys/gnu/dts/arm/vf610.dtsi head/sys/gnu/dts/arm/vfxxx.dtsi head/sys/gnu/dts/arm/wm8505.dtsi head/sys/gnu/dts/arm/wm8650.dtsi head/sys/gnu/dts/arm/wm8750.dtsi head/sys/gnu/dts/arm/zynq-7000.dtsi head/sys/gnu/dts/arm/zynq-parallella.dts head/sys/gnu/dts/arm/zynq-zc702.dts head/sys/gnu/dts/arm/zynq-zc706.dts head/sys/gnu/dts/arm/zynq-zed.dts head/sys/gnu/dts/arm/zynq-zybo.dts head/sys/gnu/dts/include/dt-bindings/clock/at91.h head/sys/gnu/dts/include/dt-bindings/clock/berlin2q.h head/sys/gnu/dts/include/dt-bindings/clock/exynos3250.h head/sys/gnu/dts/include/dt-bindings/clock/exynos4.h head/sys/gnu/dts/include/dt-bindings/clock/exynos5250.h head/sys/gnu/dts/include/dt-bindings/clock/exynos5420.h head/sys/gnu/dts/include/dt-bindings/clock/exynos7-clk.h head/sys/gnu/dts/include/dt-bindings/clock/imx6qdl-clock.h head/sys/gnu/dts/include/dt-bindings/clock/imx6sl-clock.h head/sys/gnu/dts/include/dt-bindings/clock/imx6sx-clock.h head/sys/gnu/dts/include/dt-bindings/clock/r8a7790-clock.h head/sys/gnu/dts/include/dt-bindings/clock/r8a7791-clock.h head/sys/gnu/dts/include/dt-bindings/clock/r8a7794-clock.h head/sys/gnu/dts/include/dt-bindings/clock/rk3066a-cru.h head/sys/gnu/dts/include/dt-bindings/clock/rk3188-cru-common.h head/sys/gnu/dts/include/dt-bindings/clock/rk3188-cru.h head/sys/gnu/dts/include/dt-bindings/clock/rk3288-cru.h head/sys/gnu/dts/include/dt-bindings/clock/sh73a0-clock.h head/sys/gnu/dts/include/dt-bindings/clock/tegra124-car-common.h head/sys/gnu/dts/include/dt-bindings/clock/vf610-clock.h head/sys/gnu/dts/include/dt-bindings/gpio/gpio.h head/sys/gnu/dts/include/dt-bindings/input/input.h head/sys/gnu/dts/include/dt-bindings/mfd/palmas.h head/sys/gnu/dts/include/dt-bindings/mfd/qcom-rpm.h head/sys/gnu/dts/include/dt-bindings/pinctrl/am33xx.h head/sys/gnu/dts/include/dt-bindings/pinctrl/am43xx.h head/sys/gnu/dts/include/dt-bindings/pinctrl/dra.h head/sys/gnu/dts/include/dt-bindings/pinctrl/omap.h Directory Properties: head/sys/gnu/dts/arm/ (props changed) head/sys/gnu/dts/include/ (props changed) Copied: head/sys/gnu/dts/arm/alphascale-asm9260-devkit.dts (from r295019, vendor/device-tree/dist/src/arm/alphascale-asm9260-devkit.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/arm/alphascale-asm9260-devkit.dts Tue Feb 9 16:42:32 2016 (r295436, copy of r295019, vendor/device-tree/dist/src/arm/alphascale-asm9260-devkit.dts) @@ -0,0 +1,13 @@ +/* + * Copyright 2014 Oleksij Rempel + * + * Licensed under the X11 license or the GPL v2 (or later) + */ + +/dts-v1/; +#include "alphascale-asm9260.dtsi" + +/ { + model = "Alphascale asm9260 Development Kit"; + compatible = "alphascale,asm9260devkit", "alphascale,asm9260"; +}; Copied: head/sys/gnu/dts/arm/alphascale-asm9260.dtsi (from r295019, vendor/device-tree/dist/src/arm/alphascale-asm9260.dtsi) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/arm/alphascale-asm9260.dtsi Tue Feb 9 16:42:32 2016 (r295436, copy of r295019, vendor/device-tree/dist/src/arm/alphascale-asm9260.dtsi) @@ -0,0 +1,63 @@ +/* + * Copyright 2014 Oleksij Rempel + * + * Licensed under the X11 license or the GPL v2 (or later) + */ + +#include "skeleton.dtsi" +#include + +/ { + interrupt-parent = <&icoll>; + + memory { + device_type = "memory"; + reg = <0x20000000 0x2000000>; + }; + + cpus { + #address-cells = <0>; + #size-cells = <0>; + + cpu { + compatible = "arm,arm926ej-s"; + device_type = "cpu"; + clocks = <&acc CLKID_SYS_CPU>; + }; + }; + + osc24m: oscillator { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <24000000>; + clock-accuracy = <30000>; + }; + + soc { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-bus"; + ranges; + + acc: clock-controller@80040000 { + compatible = "alphascale,asm9260-clock-controller"; + #clock-cells = <1>; + clocks = <&osc24m>; + reg = <0x80040000 0x204>; + }; + + icoll: interrupt-controller@80054000 { + compatible = "alphascale,asm9260-icoll"; + interrupt-controller; + #interrupt-cells = <1>; + reg = <0x80054000 0x200>; + }; + + timer0: timer@80088000 { + compatible = "alphascale,asm9260-timer"; + reg = <0x80088000 0x4000>; + clocks = <&acc CLKID_AHB_TIMER0>; + interrupts = <29>; + }; + }; +}; Copied: head/sys/gnu/dts/arm/alpine-db.dts (from r295015, vendor/device-tree/dist/src/arm/alpine-db.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/arm/alpine-db.dts Tue Feb 9 16:42:32 2016 (r295436, copy of r295015, vendor/device-tree/dist/src/arm/alpine-db.dts) @@ -0,0 +1,35 @@ +/* + * Copyright 2015 Annapurna Labs Ltd. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * Alternatively, redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + */ + +/dts-v1/; + +#include "alpine.dtsi" + +/ { + model = "Annapurna Labs Alpine Dev Board"; + /* no need for anything outside SOC */ +}; + Copied: head/sys/gnu/dts/arm/alpine.dtsi (from r295015, vendor/device-tree/dist/src/arm/alpine.dtsi) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/arm/alpine.dtsi Tue Feb 9 16:42:32 2016 (r295436, copy of r295015, vendor/device-tree/dist/src/arm/alpine.dtsi) @@ -0,0 +1,160 @@ +/* + * Copyright 2015 Annapurna Labs Ltd. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * Alternatively, redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + */ + +#include +#include "skeleton64.dtsi" + +/ { + /* SOC compatibility */ + compatible = "al,alpine"; + + /* CPU Configuration */ + cpus { + #address-cells = <1>; + #size-cells = <0>; + enable-method = "al,alpine-smp"; + + cpu@0 { + compatible = "arm,cortex-a15"; + device_type = "cpu"; + reg = <0>; + clock-frequency = <0>; /* Filled by loader */ + }; + + cpu@1 { + compatible = "arm,cortex-a15"; + device_type = "cpu"; + reg = <1>; + clock-frequency = <0>; /* Filled by loader */ + }; + + cpu@2 { + compatible = "arm,cortex-a15"; + device_type = "cpu"; + reg = <2>; + clock-frequency = <0>; /* Filled by loader */ + }; + + cpu@3 { + compatible = "arm,cortex-a15"; + device_type = "cpu"; + reg = <3>; + clock-frequency = <0>; /* Filled by loader */ + }; + }; + + soc { + #address-cells = <2>; + #size-cells = <2>; + compatible = "simple-bus"; + interrupt-parent = <&gic>; + ranges; + + arch-timer { + compatible = "arm,cortex-a15-timer", + "arm,armv7-timer"; + interrupts = + , + , + , + ; + clock-frequency = <0>; /* Filled by loader */ + }; + + /* Interrupt Controller */ + gic: gic@fb001000 { + compatible = "arm,cortex-a15-gic"; + #interrupt-cells = <3>; + #size-cells = <0>; + #address-cells = <0>; + interrupt-controller; + reg = <0x0 0xfb001000 0x0 0x1000>, + <0x0 0xfb002000 0x0 0x2000>, + <0x0 0xfb004000 0x0 0x1000>, + <0x0 0xfb006000 0x0 0x2000>; + interrupts = + ; + }; + + /* CPU Resume registers */ + cpu-resume@fbff5ec0 { + compatible = "al,alpine-cpu-resume"; + reg = <0x0 0xfbff5ec0 0x0 0x30>; + }; + + /* North Bridge Service Registers */ + sysfabric-service@fb070000 { + compatible = "al,alpine-sysfabric-service", "syscon"; + reg = <0x0 0xfb070000 0x0 0x10000>; + }; + + /* Performance Monitor Unit */ + pmu { + compatible = "arm,cortex-a15-pmu"; + interrupts = , + , + , + ; + }; + + uart0:uart@fd883000 { + compatible = "ns16550a"; + reg = <0x0 0xfd883000 0x0 0x1000>; + clock-frequency = <0>; /* Filled by loader */ + interrupts = ; + reg-shift = <2>; + reg-io-width = <4>; + }; + + uart1:uart@0xfd884000 { + compatible = "ns16550a"; + reg = <0x0 0xfd884000 0x0 0x1000>; + clock-frequency = <0>; /* Filled by loader */ + interrupts = ; + reg-shift = <2>; + reg-io-width = <4>; + }; + + /* Internal PCIe Controller */ + pcie-internal@0xfbc00000 { + compatible = "pci-host-ecam-generic"; + device_type = "pci"; + #size-cells = <2>; + #address-cells = <3>; + #interrupt-cells = <1>; + reg = <0x0 0xfbc00000 0x0 0x100000>; + interrupt-map-mask = <0xf800 0 0 7>; + /* Add legacy interrupts for SATA devices only */ + interrupt-map = <0x4000 0 0 1 &gic 0 43 4>, + <0x4800 0 0 1 &gic 0 44 4>; + + /* 32 bit non prefetchable memory space */ + ranges = <0x02000000 0x0 0xfe000000 0x0 0xfe000000 0x0 0x1000000>; + + bus-range = <0x00 0x00>; + }; + }; +}; Copied: head/sys/gnu/dts/arm/am335x-baltos-ir5221.dts (from r295015, vendor/device-tree/dist/src/arm/am335x-baltos-ir5221.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/arm/am335x-baltos-ir5221.dts Tue Feb 9 16:42:32 2016 (r295436, copy of r295015, vendor/device-tree/dist/src/arm/am335x-baltos-ir5221.dts) @@ -0,0 +1,528 @@ +/* + * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +/* + * VScom OnRISC + * http://www.vscom.de + */ + +/dts-v1/; + +#include "am33xx.dtsi" +#include +#include + +/ { + model = "OnRISC Baltos iR 5221"; + compatible = "vscom,onrisc", "ti,am33xx"; + + cpus { + cpu@0 { + cpu0-supply = <&vdd1_reg>; + }; + }; + + memory { + device_type = "memory"; + reg = <0x80000000 0x10000000>; /* 256 MB */ + }; + + vbat: fixedregulator@0 { + compatible = "regulator-fixed"; + regulator-name = "vbat"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-boot-on; + }; + + wl12xx_vmmc: fixedregulator@2 { + pinctrl-names = "default"; + pinctrl-0 = <&wl12xx_gpio>; + compatible = "regulator-fixed"; + regulator-name = "vwl1271"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpio3 8 0>; + startup-delay-us = <70000>; + enable-active-high; + }; +}; + +&am33xx_pinmux { + mmc2_pins: pinmux_mmc2_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x820, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_ad8.mmc1_dat0_mux0 */ + AM33XX_IOPAD(0x824, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_ad9.mmc1_dat1_mux0 */ + AM33XX_IOPAD(0x828, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_ad10.mmc1_dat2_mux0 */ + AM33XX_IOPAD(0x82c, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_ad11.mmc1_dat3_mux0 */ + AM33XX_IOPAD(0x880, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn1.mmc1_clk_mux0 */ + AM33XX_IOPAD(0x884, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn2.mmc1_cmd_mux0 */ + AM33XX_IOPAD(0x9e4, PIN_INPUT_PULLUP | MUX_MODE7) /* emu0.gpio3[7] */ + >; + }; + + wl12xx_gpio: pinmux_wl12xx_gpio { + pinctrl-single,pins = < + AM33XX_IOPAD(0x9e8, PIN_OUTPUT_PULLUP | MUX_MODE7) /* emu1.gpio3[8] */ + >; + }; + + tps65910_pins: pinmux_tps65910_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x878, PIN_INPUT_PULLUP | MUX_MODE7) /* gpmc_ben1.gpio1[28] */ + >; + }; + + tca6416_pins: pinmux_tca6416_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x9b4, PIN_INPUT_PULLUP | MUX_MODE7) /* xdma_event_intr1.gpio0[20] tca6416 stuff */ + >; + }; + + i2c1_pins: pinmux_i2c1_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x958, PIN_INPUT | MUX_MODE2) /* spi0_d1.i2c1_sda_mux3 */ + AM33XX_IOPAD(0x95c, PIN_INPUT | MUX_MODE2) /* spi0_cs0.i2c1_scl_mux3 */ + >; + }; + + dcan1_pins: pinmux_dcan1_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x968, PIN_OUTPUT | MUX_MODE2) /* uart0_ctsn.dcan1_tx_mux0 */ + AM33XX_IOPAD(0x96c, PIN_INPUT | MUX_MODE2) /* uart0_rtsn.dcan1_rx_mux0 */ + >; + }; + + uart0_pins: pinmux_uart0_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0) /* uart0_rxd.uart0_rxd */ + AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart0_txd.uart0_txd */ + >; + }; + + uart1_pins: pinmux_uart1_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x980, PIN_INPUT | MUX_MODE0) /* uart1_rxd */ + AM33XX_IOPAD(0x984, PIN_INPUT | MUX_MODE0) /* uart1_txd */ + AM33XX_IOPAD(0x978, PIN_INPUT_PULLDOWN | MUX_MODE7) /* uart1_ctsn, INPUT | MODE0 */ + AM33XX_IOPAD(0x97c, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* uart1_rtsn, OUTPUT | MODE0 */ + AM33XX_IOPAD(0x8e0, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* lcd_vsync.gpio2[22] DTR */ + AM33XX_IOPAD(0x8e4, PIN_INPUT_PULLDOWN | MUX_MODE7) /* lcd_hsync.gpio2[23] DSR */ + AM33XX_IOPAD(0x8e8, PIN_INPUT_PULLDOWN | MUX_MODE7) /* lcd_pclk.gpio2[24] DCD */ + AM33XX_IOPAD(0x8ec, PIN_INPUT_PULLDOWN | MUX_MODE7) /* lcd_ac_bias_en.gpio2[25] RI */ + >; + }; + + uart2_pins: pinmux_uart2_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x950, PIN_INPUT | MUX_MODE1) /* spi0_sclk.uart2_rxd_mux3 */ + AM33XX_IOPAD(0x954, PIN_OUTPUT | MUX_MODE1) /* spi0_d0.uart2_txd_mux3 */ + AM33XX_IOPAD(0x988, PIN_INPUT_PULLDOWN | MUX_MODE7) /* i2c0_sda.uart2_ctsn_mux0 */ + AM33XX_IOPAD(0x98c, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* i2c0_scl.uart2_rtsn_mux0 */ + AM33XX_IOPAD(0x830, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_ad12.gpio1[12] DTR */ + AM33XX_IOPAD(0x834, PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_ad13.gpio1[13] DSR */ + AM33XX_IOPAD(0x838, PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_ad14.gpio1[14] DCD */ + AM33XX_IOPAD(0x83c, PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_ad15.gpio1[15] RI */ + + AM33XX_IOPAD(0x9a0, PIN_INPUT_PULLUP | MUX_MODE7) /* mcasp0_aclkr.gpio3[18], INPUT_PULLDOWN | MODE7 */ + >; + }; + + cpsw_default: cpsw_default { + pinctrl-single,pins = < + /* Slave 1 */ + AM33XX_IOPAD(0x90c, PIN_INPUT_PULLDOWN | MUX_MODE1) /* mii1_crs.rmii1_crs_dv */ + AM33XX_IOPAD(0x914, PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* mii1_tx_en.rmii1_txen */ + AM33XX_IOPAD(0x924, PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* mii1_txd1.rmii1_txd1 */ + AM33XX_IOPAD(0x928, PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* mii1_txd0.rmii1_txd0 */ + AM33XX_IOPAD(0x93c, PIN_INPUT_PULLDOWN | MUX_MODE1) /* mii1_rxd1.rmii1_rxd1 */ + AM33XX_IOPAD(0x940, PIN_INPUT_PULLDOWN | MUX_MODE1) /* mii1_rxd0.rmii1_rxd0 */ + AM33XX_IOPAD(0x944, PIN_INPUT_PULLDOWN | MUX_MODE0) /* rmii1_ref_clk.rmii1_refclk */ + + + /* Slave 2 */ + AM33XX_IOPAD(0x840, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gpmc_a0.rgmii2_tctl */ + AM33XX_IOPAD(0x844, PIN_INPUT_PULLDOWN | MUX_MODE2) /* gpmc_a1.rgmii2_rctl */ + AM33XX_IOPAD(0x848, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gpmc_a2.rgmii2_td3 */ + AM33XX_IOPAD(0x84c, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gpmc_a3.rgmii2_td2 */ + AM33XX_IOPAD(0x850, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gpmc_a4.rgmii2_td1 */ + AM33XX_IOPAD(0x854, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gpmc_a5.rgmii2_td0 */ + AM33XX_IOPAD(0x858, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gpmc_a6.rgmii2_tclk */ + AM33XX_IOPAD(0x85c, PIN_INPUT_PULLDOWN | MUX_MODE2) /* gpmc_a7.rgmii2_rclk */ + AM33XX_IOPAD(0x860, PIN_INPUT_PULLDOWN | MUX_MODE2) /* gpmc_a8.rgmii2_rd3 */ + AM33XX_IOPAD(0x864, PIN_INPUT_PULLDOWN | MUX_MODE2) /* gpmc_a9.rgmii2_rd2 */ + AM33XX_IOPAD(0x868, PIN_INPUT_PULLDOWN | MUX_MODE2) /* gpmc_a10.rgmii2_rd1 */ + AM33XX_IOPAD(0x86c, PIN_INPUT_PULLDOWN | MUX_MODE2) /* gpmc_a11.rgmii2_rd0 */ + >; + }; + + cpsw_sleep: cpsw_sleep { + pinctrl-single,pins = < + /* Slave 1 reset value */ + AM33XX_IOPAD(0x90c, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x914, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x924, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x928, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x93c, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x940, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x944, PIN_INPUT_PULLDOWN | MUX_MODE7) + + /* Slave 2 reset value*/ + AM33XX_IOPAD(0x840, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x844, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x848, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x84c, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x850, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x854, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x858, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x85c, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x860, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x864, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x868, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x86c, PIN_INPUT_PULLDOWN | MUX_MODE7) + >; + }; + + davinci_mdio_default: davinci_mdio_default { + pinctrl-single,pins = < + /* MDIO */ + AM33XX_IOPAD(0x948, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* mdio_data.mdio_data */ + AM33XX_IOPAD(0x94c, PIN_OUTPUT_PULLUP | MUX_MODE0) /* mdio_clk.mdio_clk */ + >; + }; + + davinci_mdio_sleep: davinci_mdio_sleep { + pinctrl-single,pins = < + /* MDIO reset value */ + AM33XX_IOPAD(0x948, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x94c, PIN_INPUT_PULLDOWN | MUX_MODE7) + >; + }; + + nandflash_pins_s0: nandflash_pins_s0 { + pinctrl-single,pins = < + AM33XX_IOPAD(0x800, PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad0.gpmc_ad0 */ + AM33XX_IOPAD(0x804, PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad1.gpmc_ad1 */ + AM33XX_IOPAD(0x808, PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad2.gpmc_ad2 */ + AM33XX_IOPAD(0x80c, PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad3.gpmc_ad3 */ + AM33XX_IOPAD(0x810, PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad4.gpmc_ad4 */ + AM33XX_IOPAD(0x814, PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad5.gpmc_ad5 */ + AM33XX_IOPAD(0x818, PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad6.gpmc_ad6 */ + AM33XX_IOPAD(0x81c, PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad7.gpmc_ad7 */ + AM33XX_IOPAD(0x870, PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_wait0.gpmc_wait0 */ + AM33XX_IOPAD(0x874, PIN_INPUT_PULLUP | MUX_MODE7) /* gpmc_wpn.gpio0_30 */ + AM33XX_IOPAD(0x87c, PIN_OUTPUT | MUX_MODE0) /* gpmc_csn0.gpmc_csn0 */ + AM33XX_IOPAD(0x890, PIN_OUTPUT | MUX_MODE0) /* gpmc_advn_ale.gpmc_advn_ale */ + AM33XX_IOPAD(0x894, PIN_OUTPUT | MUX_MODE0) /* gpmc_oen_ren.gpmc_oen_ren */ + AM33XX_IOPAD(0x898, PIN_OUTPUT | MUX_MODE0) /* gpmc_wen.gpmc_wen */ + AM33XX_IOPAD(0x89c, PIN_OUTPUT | MUX_MODE0) /* gpmc_be0n_cle.gpmc_be0n_cle */ + >; + }; +}; + +&elm { + status = "okay"; +}; + +&gpmc { + pinctrl-names = "default"; + pinctrl-0 = <&nandflash_pins_s0>; + ranges = <0 0 0x08000000 0x10000000>; /* CS0: NAND */ + status = "okay"; + + nand@0,0 { + reg = <0 0 0>; /* CS0, offset 0 */ + nand-bus-width = <8>; + ti,nand-ecc-opt = "bch8"; + ti,nand-xfer-type = "polled"; + + gpmc,device-nand = "true"; + gpmc,device-width = <1>; + gpmc,sync-clk-ps = <0>; + gpmc,cs-on-ns = <0>; + gpmc,cs-rd-off-ns = <44>; + gpmc,cs-wr-off-ns = <44>; + gpmc,adv-on-ns = <6>; + gpmc,adv-rd-off-ns = <34>; + gpmc,adv-wr-off-ns = <44>; + gpmc,we-on-ns = <0>; + gpmc,we-off-ns = <40>; + gpmc,oe-on-ns = <0>; + gpmc,oe-off-ns = <54>; + gpmc,access-ns = <64>; + gpmc,rd-cycle-ns = <82>; + gpmc,wr-cycle-ns = <82>; + gpmc,wait-on-read = "true"; + gpmc,wait-on-write = "true"; + gpmc,bus-turnaround-ns = <0>; + gpmc,cycle2cycle-delay-ns = <0>; + gpmc,clk-activation-ns = <0>; + gpmc,wait-monitoring-ns = <0>; + gpmc,wr-access-ns = <40>; + gpmc,wr-data-mux-bus-ns = <0>; + + #address-cells = <1>; + #size-cells = <1>; + elm_id = <&elm>; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins>; + + status = "okay"; +}; + +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins>; + dtr-gpios = <&gpio2 22 GPIO_ACTIVE_LOW>; + dsr-gpios = <&gpio2 23 GPIO_ACTIVE_LOW>; + dcd-gpios = <&gpio2 24 GPIO_ACTIVE_LOW>; + rng-gpios = <&gpio2 25 GPIO_ACTIVE_LOW>; + cts-gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; + rts-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + + status = "okay"; +}; + +&uart2 { + pinctrl-names = "default"; + pinctrl-0 = <&uart2_pins>; + dtr-gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; + dsr-gpios = <&gpio1 13 GPIO_ACTIVE_LOW>; + dcd-gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; + rng-gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; + cts-gpios = <&gpio3 5 GPIO_ACTIVE_LOW>; + rts-gpios = <&gpio3 6 GPIO_ACTIVE_LOW>; + + status = "okay"; +}; + +&i2c1 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins>; + + status = "okay"; + clock-frequency = <400000>; + + tps: tps@2d { + reg = <0x2d>; + gpio-controller; + #gpio-cells = <2>; + interrupt-parent = <&gpio1>; + interrupts = <28 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&tps65910_pins>; + }; + + at24@50 { + compatible = "at24,24c02"; + pagesize = <8>; + reg = <0x50>; + }; + + tca6416: gpio@20 { + compatible = "ti,tca6416"; + reg = <0x20>; + gpio-controller; + #gpio-cells = <2>; + interrupt-parent = <&gpio0>; + interrupts = <20 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&tca6416_pins>; + }; +}; + +&usb { + status = "okay"; +}; + +&usb_ctrl_mod { + status = "okay"; +}; + +&usb0_phy { + status = "okay"; +}; + +&usb1_phy { + status = "okay"; +}; + +&usb0 { + status = "okay"; + dr_mode = "host"; +}; + +&usb1 { + status = "okay"; + dr_mode = "otg"; +}; + +&cppi41dma { + status = "okay"; +}; + +#include "tps65910.dtsi" + +&tps { + vcc1-supply = <&vbat>; + vcc2-supply = <&vbat>; + vcc3-supply = <&vbat>; + vcc4-supply = <&vbat>; + vcc5-supply = <&vbat>; + vcc6-supply = <&vbat>; + vcc7-supply = <&vbat>; + vccio-supply = <&vbat>; + + ti,en-ck32k-xtal = <1>; + + regulators { + vrtc_reg: regulator@0 { + regulator-always-on; + }; + + vio_reg: regulator@1 { + regulator-always-on; + }; + + vdd1_reg: regulator@2 { + /* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */ + regulator-name = "vdd_mpu"; + regulator-min-microvolt = <912500>; + regulator-max-microvolt = <1312500>; + regulator-boot-on; + regulator-always-on; + }; + + vdd2_reg: regulator@3 { + /* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */ + regulator-name = "vdd_core"; + regulator-min-microvolt = <912500>; + regulator-max-microvolt = <1150000>; + regulator-boot-on; + regulator-always-on; + }; + + vdd3_reg: regulator@4 { + regulator-always-on; + }; + + vdig1_reg: regulator@5 { + regulator-always-on; + }; + + vdig2_reg: regulator@6 { + regulator-always-on; + }; + + vpll_reg: regulator@7 { + regulator-always-on; + }; + + vdac_reg: regulator@8 { + regulator-always-on; + }; + + vaux1_reg: regulator@9 { + regulator-always-on; + }; + + vaux2_reg: regulator@10 { + regulator-always-on; + }; + + vaux33_reg: regulator@11 { + regulator-always-on; + }; + + vmmc_reg: regulator@12 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + }; +}; + +&mac { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&cpsw_default>; + pinctrl-1 = <&cpsw_sleep>; + dual_emac = <1>; + + status = "okay"; +}; + +&davinci_mdio { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&davinci_mdio_default>; + pinctrl-1 = <&davinci_mdio_sleep>; + + status = "okay"; +}; + +&cpsw_emac0 { + phy_id = <&davinci_mdio>, <0>; + phy-mode = "rmii"; + dual_emac_res_vlan = <1>; +}; + +&cpsw_emac1 { + phy_id = <&davinci_mdio>, <7>; + phy-mode = "rgmii-txid"; + dual_emac_res_vlan = <2>; +}; + +&phy_sel { + rmii-clock-ext = <1>; +}; + +&mmc1 { + vmmc-supply = <&vmmc_reg>; + status = "okay"; +}; + +&mmc2 { + status = "okay"; + vmmc-supply = <&wl12xx_vmmc>; + ti,non-removable; + bus-width = <4>; + cap-power-off-card; + pinctrl-names = "default"; + pinctrl-0 = <&mmc2_pins>; + + #address-cells = <1>; + #size-cells = <0>; + wlcore: wlcore@2 { + compatible = "ti,wl1835"; + reg = <2>; + interrupt-parent = <&gpio3>; + interrupts = <7 IRQ_TYPE_LEVEL_HIGH>; + }; +}; + +&sham { + status = "okay"; +}; + +&aes { + status = "okay"; +}; + +&gpio0 { + ti,no-reset-on-init; +}; + +&dcan1 { + pinctrl-names = "default"; + pinctrl-0 = <&dcan1_pins>; + + status = "okay"; +}; Modified: head/sys/gnu/dts/arm/am335x-base0033.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-base0033.dts Tue Feb 9 16:30:16 2016 (r295435) +++ head/sys/gnu/dts/arm/am335x-base0033.dts Tue Feb 9 16:42:32 2016 (r295436) @@ -46,39 +46,39 @@ &am33xx_pinmux { nxp_hdmi_pins: pinmux_nxp_hdmi_pins { pinctrl-single,pins = < - 0x1b0 (PIN_OUTPUT | MUX_MODE3) /* xdma_event_intr0.clkout1 */ - 0xa0 (PIN_OUTPUT | MUX_MODE0) /* lcd_data0 */ - 0xa4 (PIN_OUTPUT | MUX_MODE0) /* lcd_data1 */ - 0xa8 (PIN_OUTPUT | MUX_MODE0) /* lcd_data2 */ - 0xac (PIN_OUTPUT | MUX_MODE0) /* lcd_data3 */ - 0xb0 (PIN_OUTPUT | MUX_MODE0) /* lcd_data4 */ - 0xb4 (PIN_OUTPUT | MUX_MODE0) /* lcd_data5 */ - 0xb8 (PIN_OUTPUT | MUX_MODE0) /* lcd_data6 */ - 0xbc (PIN_OUTPUT | MUX_MODE0) /* lcd_data7 */ - 0xc0 (PIN_OUTPUT | MUX_MODE0) /* lcd_data8 */ - 0xc4 (PIN_OUTPUT | MUX_MODE0) /* lcd_data9 */ - 0xc8 (PIN_OUTPUT | MUX_MODE0) /* lcd_data10 */ - 0xcc (PIN_OUTPUT | MUX_MODE0) /* lcd_data11 */ - 0xd0 (PIN_OUTPUT | MUX_MODE0) /* lcd_data12 */ - 0xd4 (PIN_OUTPUT | MUX_MODE0) /* lcd_data13 */ - 0xd8 (PIN_OUTPUT | MUX_MODE0) /* lcd_data14 */ - 0xdc (PIN_OUTPUT | MUX_MODE0) /* lcd_data15 */ - 0xe0 (PIN_OUTPUT | MUX_MODE0) /* lcd_vsync */ - 0xe4 (PIN_OUTPUT | MUX_MODE0) /* lcd_hsync */ - 0xe8 (PIN_OUTPUT | MUX_MODE0) /* lcd_pclk */ - 0xec (PIN_OUTPUT | MUX_MODE0) /* lcd_ac_bias_en */ + AM33XX_IOPAD(0x9b0, PIN_OUTPUT | MUX_MODE3) /* xdma_event_intr0.clkout1 */ + AM33XX_IOPAD(0x8a0, PIN_OUTPUT | MUX_MODE0) /* lcd_data0 */ + AM33XX_IOPAD(0x8a4, PIN_OUTPUT | MUX_MODE0) /* lcd_data1 */ + AM33XX_IOPAD(0x8a8, PIN_OUTPUT | MUX_MODE0) /* lcd_data2 */ + AM33XX_IOPAD(0x8ac, PIN_OUTPUT | MUX_MODE0) /* lcd_data3 */ + AM33XX_IOPAD(0x8b0, PIN_OUTPUT | MUX_MODE0) /* lcd_data4 */ + AM33XX_IOPAD(0x8b4, PIN_OUTPUT | MUX_MODE0) /* lcd_data5 */ + AM33XX_IOPAD(0x8b8, PIN_OUTPUT | MUX_MODE0) /* lcd_data6 */ + AM33XX_IOPAD(0x8bc, PIN_OUTPUT | MUX_MODE0) /* lcd_data7 */ + AM33XX_IOPAD(0x8c0, PIN_OUTPUT | MUX_MODE0) /* lcd_data8 */ + AM33XX_IOPAD(0x8c4, PIN_OUTPUT | MUX_MODE0) /* lcd_data9 */ + AM33XX_IOPAD(0x8c8, PIN_OUTPUT | MUX_MODE0) /* lcd_data10 */ + AM33XX_IOPAD(0x8cc, PIN_OUTPUT | MUX_MODE0) /* lcd_data11 */ + AM33XX_IOPAD(0x8d0, PIN_OUTPUT | MUX_MODE0) /* lcd_data12 */ + AM33XX_IOPAD(0x8d4, PIN_OUTPUT | MUX_MODE0) /* lcd_data13 */ + AM33XX_IOPAD(0x8d8, PIN_OUTPUT | MUX_MODE0) /* lcd_data14 */ + AM33XX_IOPAD(0x8dc, PIN_OUTPUT | MUX_MODE0) /* lcd_data15 */ + AM33XX_IOPAD(0x8e0, PIN_OUTPUT | MUX_MODE0) /* lcd_vsync */ + AM33XX_IOPAD(0x8e4, PIN_OUTPUT | MUX_MODE0) /* lcd_hsync */ + AM33XX_IOPAD(0x8e8, PIN_OUTPUT | MUX_MODE0) /* lcd_pclk */ + AM33XX_IOPAD(0x8ec, PIN_OUTPUT | MUX_MODE0) /* lcd_ac_bias_en */ >; }; nxp_hdmi_off_pins: pinmux_nxp_hdmi_off_pins { pinctrl-single,pins = < - 0x1b0 (PIN_OUTPUT | MUX_MODE3) /* xdma_event_intr0.clkout1 */ + AM33XX_IOPAD(0x9b0, PIN_OUTPUT | MUX_MODE3) /* xdma_event_intr0.clkout1 */ >; }; leds_base_pins: pinmux_leds_base_pins { pinctrl-single,pins = < - 0x54 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a5.gpio1_21 */ - 0x88 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_csn3.gpio2_0 */ + AM33XX_IOPAD(0x854, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a5.gpio1_21 */ + AM33XX_IOPAD(0x888, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_csn3.gpio2_0 */ >; }; }; Modified: head/sys/gnu/dts/arm/am335x-bone-common.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am335x-bone-common.dtsi Tue Feb 9 16:30:16 2016 (r295435) +++ head/sys/gnu/dts/arm/am335x-bone-common.dtsi Tue Feb 9 16:42:32 2016 (r295436) @@ -67,105 +67,112 @@ user_leds_s0: user_leds_s0 { pinctrl-single,pins = < - 0x54 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a5.gpio1_21 */ - 0x58 (PIN_OUTPUT_PULLUP | MUX_MODE7) /* gpmc_a6.gpio1_22 */ - 0x5c (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a7.gpio1_23 */ - 0x60 (PIN_OUTPUT_PULLUP | MUX_MODE7) /* gpmc_a8.gpio1_24 */ + AM33XX_IOPAD(0x854, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a5.gpio1_21 */ + AM33XX_IOPAD(0x858, PIN_OUTPUT_PULLUP | MUX_MODE7) /* gpmc_a6.gpio1_22 */ + AM33XX_IOPAD(0x85c, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a7.gpio1_23 */ + AM33XX_IOPAD(0x860, PIN_OUTPUT_PULLUP | MUX_MODE7) /* gpmc_a8.gpio1_24 */ >; }; i2c0_pins: pinmux_i2c0_pins { pinctrl-single,pins = < - 0x188 (PIN_INPUT_PULLUP | MUX_MODE0) /* i2c0_sda.i2c0_sda */ - 0x18c (PIN_INPUT_PULLUP | MUX_MODE0) /* i2c0_scl.i2c0_scl */ + AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c0_sda.i2c0_sda */ + AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c0_scl.i2c0_scl */ + >; + }; + + i2c2_pins: pinmux_i2c2_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x978, PIN_INPUT_PULLUP | MUX_MODE3) /* uart1_ctsn.i2c2_sda */ + AM33XX_IOPAD(0x97c, PIN_INPUT_PULLUP | MUX_MODE3) /* uart1_rtsn.i2c2_scl */ >; }; uart0_pins: pinmux_uart0_pins { pinctrl-single,pins = < - 0x170 (PIN_INPUT_PULLUP | MUX_MODE0) /* uart0_rxd.uart0_rxd */ - 0x174 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart0_txd.uart0_txd */ + AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0) /* uart0_rxd.uart0_rxd */ + AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart0_txd.uart0_txd */ >; }; clkout2_pin: pinmux_clkout2_pin { pinctrl-single,pins = < - 0x1b4 (PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* xdma_event_intr1.clkout2 */ + AM33XX_IOPAD(0x9b4, PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* xdma_event_intr1.clkout2 */ >; }; cpsw_default: cpsw_default { pinctrl-single,pins = < /* Slave 1 */ - 0x110 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxerr.mii1_rxerr */ - 0x114 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txen.mii1_txen */ - 0x118 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxdv.mii1_rxdv */ - 0x11c (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd3.mii1_txd3 */ - 0x120 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd2.mii1_txd2 */ - 0x124 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd1.mii1_txd1 */ - 0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd0.mii1_txd0 */ - 0x12c (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_txclk.mii1_txclk */ - 0x130 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxclk.mii1_rxclk */ - 0x134 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd3.mii1_rxd3 */ - 0x138 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd2.mii1_rxd2 */ - 0x13c (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd1.mii1_rxd1 */ - 0x140 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd0.mii1_rxd0 */ + AM33XX_IOPAD(0x910, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxerr.mii1_rxerr */ + AM33XX_IOPAD(0x914, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txen.mii1_txen */ + AM33XX_IOPAD(0x918, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxdv.mii1_rxdv */ + AM33XX_IOPAD(0x91c, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd3.mii1_txd3 */ + AM33XX_IOPAD(0x920, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd2.mii1_txd2 */ + AM33XX_IOPAD(0x924, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd1.mii1_txd1 */ + AM33XX_IOPAD(0x928, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd0.mii1_txd0 */ + AM33XX_IOPAD(0x92c, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_txclk.mii1_txclk */ + AM33XX_IOPAD(0x930, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxclk.mii1_rxclk */ + AM33XX_IOPAD(0x934, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd3.mii1_rxd3 */ + AM33XX_IOPAD(0x938, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd2.mii1_rxd2 */ + AM33XX_IOPAD(0x93c, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd1.mii1_rxd1 */ + AM33XX_IOPAD(0x940, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd0.mii1_rxd0 */ >; }; cpsw_sleep: cpsw_sleep { pinctrl-single,pins = < /* Slave 1 reset value */ - 0x110 (PIN_INPUT_PULLDOWN | MUX_MODE7) - 0x114 (PIN_INPUT_PULLDOWN | MUX_MODE7) - 0x118 (PIN_INPUT_PULLDOWN | MUX_MODE7) - 0x11c (PIN_INPUT_PULLDOWN | MUX_MODE7) - 0x120 (PIN_INPUT_PULLDOWN | MUX_MODE7) - 0x124 (PIN_INPUT_PULLDOWN | MUX_MODE7) - 0x128 (PIN_INPUT_PULLDOWN | MUX_MODE7) - 0x12c (PIN_INPUT_PULLDOWN | MUX_MODE7) - 0x130 (PIN_INPUT_PULLDOWN | MUX_MODE7) - 0x134 (PIN_INPUT_PULLDOWN | MUX_MODE7) - 0x138 (PIN_INPUT_PULLDOWN | MUX_MODE7) - 0x13c (PIN_INPUT_PULLDOWN | MUX_MODE7) - 0x140 (PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x910, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x914, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x918, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x91c, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x920, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x924, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x928, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x92c, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x930, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x934, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x938, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x93c, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x940, PIN_INPUT_PULLDOWN | MUX_MODE7) >; }; davinci_mdio_default: davinci_mdio_default { pinctrl-single,pins = < /* MDIO */ - 0x148 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* mdio_data.mdio_data */ - 0x14c (PIN_OUTPUT_PULLUP | MUX_MODE0) /* mdio_clk.mdio_clk */ + AM33XX_IOPAD(0x948, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* mdio_data.mdio_data */ + AM33XX_IOPAD(0x94c, PIN_OUTPUT_PULLUP | MUX_MODE0) /* mdio_clk.mdio_clk */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Feb 9 17:09:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0455AAA3948; Tue, 9 Feb 2016 17:09:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 B909111CF; Tue, 9 Feb 2016 17:09:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u19H9EBP092335; Tue, 9 Feb 2016 17:09:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u19H9EVs092332; Tue, 9 Feb 2016 17:09:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201602091709.u19H9EVs092332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 9 Feb 2016 17:09:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295440 - head/sys/dev/sound/pcm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 17:09:16 -0000 Author: hselasky Date: Tue Feb 9 17:09:14 2016 New Revision: 295440 URL: https://svnweb.freebsd.org/changeset/base/295440 Log: To support userspace audio daemons like Virtual OSS, /dev/sndstat is made writeable by the root user. Userspace audio daemons can add or update an entry in /dev/sndstat by doing a single system write call to any /dev/sndstat file descriptor handle. When the audio daemon closes the file handle or is killed the entry disappears. While at it, cleanup the sound status code a bit: - keep the device list sorted to avoid sorting the list every time a /dev/sndstat read request is made. - factor out locking into a pair of locking macros. - use the sound status lock to protect all per file handle states, when generating the output for /dev/sndstat and when removing or adding sound status devices. This way sndstat_acquire() and sndstat_release() become superfluous and can be removed. Reviewed by: mav @ Differential Revision: https://reviews.freebsd.org/D5191 Modified: head/sys/dev/sound/pcm/sndstat.c head/sys/dev/sound/pcm/sound.c head/sys/dev/sound/pcm/sound.h Modified: head/sys/dev/sound/pcm/sndstat.c ============================================================================== --- head/sys/dev/sound/pcm/sndstat.c Tue Feb 9 16:58:50 2016 (r295439) +++ head/sys/dev/sound/pcm/sndstat.c Tue Feb 9 17:09:14 2016 (r295440) @@ -37,77 +37,51 @@ SND_DECLARE_FILE("$FreeBSD$"); #define SS_TYPE_MODULE 0 -#define SS_TYPE_FIRST 1 #define SS_TYPE_PCM 1 #define SS_TYPE_MIDI 2 #define SS_TYPE_SEQUENCER 3 -#define SS_TYPE_LAST 3 static d_open_t sndstat_open; -static d_close_t sndstat_close; +static void sndstat_close(void *); static d_read_t sndstat_read; +static d_write_t sndstat_write; static struct cdevsw sndstat_cdevsw = { .d_version = D_VERSION, .d_open = sndstat_open, - .d_close = sndstat_close, .d_read = sndstat_read, + .d_write = sndstat_write, .d_name = "sndstat", .d_flags = D_TRACKCLOSE, }; struct sndstat_entry { - SLIST_ENTRY(sndstat_entry) link; + TAILQ_ENTRY(sndstat_entry) link; device_t dev; char *str; sndstat_handler handler; int type, unit; }; -static struct sx sndstat_lock; -static struct sbuf sndstat_sbuf; -static struct cdev *sndstat_dev = NULL; -static int sndstat_bufptr = -1; -static int sndstat_maxunit = -1; -static int sndstat_files = 0; - -#define SNDSTAT_PID(x) ((pid_t)((intptr_t)((x)->si_drv1))) -#define SNDSTAT_PID_SET(x, y) (x)->si_drv1 = (void *)((intptr_t)(y)) -#define SNDSTAT_FLUSH() do { \ - if (sndstat_bufptr != -1) { \ - sbuf_delete(&sndstat_sbuf); \ - sndstat_bufptr = -1; \ - } \ -} while (0) +struct sndstat_file { + TAILQ_ENTRY(sndstat_file) entry; + struct sbuf sbuf; + int out_offset; + int in_offset; +}; -static SLIST_HEAD(, sndstat_entry) sndstat_devlist = SLIST_HEAD_INITIALIZER(sndstat_devlist); +static struct sx sndstat_lock; +static struct cdev *sndstat_dev; -int snd_verbose = 0; +#define SNDSTAT_LOCK() sx_xlock(&sndstat_lock) +#define SNDSTAT_UNLOCK() sx_xunlock(&sndstat_lock) -#ifdef SND_DEBUG -static int -sysctl_hw_snd_sndstat_pid(SYSCTL_HANDLER_ARGS) -{ - int err, val; +static TAILQ_HEAD(, sndstat_entry) sndstat_devlist = TAILQ_HEAD_INITIALIZER(sndstat_devlist); +static TAILQ_HEAD(, sndstat_file) sndstat_filelist = TAILQ_HEAD_INITIALIZER(sndstat_filelist); - if (sndstat_dev == NULL) - return (EINVAL); - - sx_xlock(&sndstat_lock); - val = (int)SNDSTAT_PID(sndstat_dev); - err = sysctl_handle_int(oidp, &val, 0, req); - if (err == 0 && req->newptr != NULL && val == 0) { - SNDSTAT_FLUSH(); - SNDSTAT_PID_SET(sndstat_dev, 0); - } - sx_unlock(&sndstat_lock); - return (err); -} -SYSCTL_PROC(_hw_snd, OID_AUTO, sndstat_pid, CTLTYPE_INT | CTLFLAG_RWTUN, - 0, sizeof(int), sysctl_hw_snd_sndstat_pid, "I", "sndstat busy pid"); -#endif +int snd_verbose = 0; -static int sndstat_prepare(struct sbuf *s); +static int sndstat_prepare(struct sndstat_file *); static int sysctl_hw_sndverbose(SYSCTL_HANDLER_ARGS) @@ -122,7 +96,7 @@ sysctl_hw_sndverbose(SYSCTL_HANDLER_ARGS else snd_verbose = verbose; } - return error; + return (error); } SYSCTL_PROC(_hw_snd, OID_AUTO, verbose, CTLTYPE_INT | CTLFLAG_RWTUN, 0, sizeof(int), sysctl_hw_sndverbose, "I", "verbosity level"); @@ -130,128 +104,135 @@ SYSCTL_PROC(_hw_snd, OID_AUTO, verbose, static int sndstat_open(struct cdev *i_dev, int flags, int mode, struct thread *td) { - if (sndstat_dev == NULL || i_dev != sndstat_dev) - return EBADF; + struct sndstat_file *pf; - sx_xlock(&sndstat_lock); - if (SNDSTAT_PID(i_dev) != 0) { - sx_unlock(&sndstat_lock); - return EBUSY; - } - SNDSTAT_PID_SET(i_dev, td->td_proc->p_pid); - if (sbuf_new(&sndstat_sbuf, NULL, 4096, SBUF_AUTOEXTEND) == NULL) { - SNDSTAT_PID_SET(i_dev, 0); - sx_unlock(&sndstat_lock); - return ENXIO; - } - sndstat_bufptr = 0; - sx_unlock(&sndstat_lock); - return 0; -} + pf = malloc(sizeof(*pf), M_DEVBUF, M_WAITOK | M_ZERO); -static int -sndstat_close(struct cdev *i_dev, int flags, int mode, struct thread *td) -{ - if (sndstat_dev == NULL || i_dev != sndstat_dev) - return EBADF; - - sx_xlock(&sndstat_lock); - if (SNDSTAT_PID(i_dev) == 0) { - sx_unlock(&sndstat_lock); - return EBADF; + SNDSTAT_LOCK(); + if (sbuf_new(&pf->sbuf, NULL, 4096, SBUF_AUTOEXTEND) == NULL) { + SNDSTAT_UNLOCK(); + free(pf, M_DEVBUF); + return (ENOMEM); } + TAILQ_INSERT_TAIL(&sndstat_filelist, pf, entry); + SNDSTAT_UNLOCK(); - SNDSTAT_FLUSH(); - SNDSTAT_PID_SET(i_dev, 0); - - sx_unlock(&sndstat_lock); + devfs_set_cdevpriv(pf, &sndstat_close); - return 0; + return (0); } -static int -sndstat_read(struct cdev *i_dev, struct uio *buf, int flag) +static void +sndstat_close(void *sndstat_file) { - int l, err; + struct sndstat_file *pf = (struct sndstat_file *)sndstat_file; - if (sndstat_dev == NULL || i_dev != sndstat_dev) - return EBADF; + SNDSTAT_LOCK(); + sbuf_delete(&pf->sbuf); + TAILQ_REMOVE(&sndstat_filelist, pf, entry); + SNDSTAT_UNLOCK(); - sx_xlock(&sndstat_lock); - if (SNDSTAT_PID(i_dev) != buf->uio_td->td_proc->p_pid || - sndstat_bufptr == -1) { - sx_unlock(&sndstat_lock); - return EBADF; - } - - if (sndstat_bufptr == 0) { - err = (sndstat_prepare(&sndstat_sbuf) > 0) ? 0 : ENOMEM; - if (err) { - SNDSTAT_FLUSH(); - sx_unlock(&sndstat_lock); - return err; - } - } - - l = min(buf->uio_resid, sbuf_len(&sndstat_sbuf) - sndstat_bufptr); - err = (l > 0)? uiomove(sbuf_data(&sndstat_sbuf) + sndstat_bufptr, l, buf) : 0; - sndstat_bufptr += l; - sx_unlock(&sndstat_lock); - - return err; + free(pf, M_DEVBUF); } -/************************************************************************/ - -static struct sndstat_entry * -sndstat_find(int type, int unit) +static int +sndstat_read(struct cdev *i_dev, struct uio *buf, int flag) { - struct sndstat_entry *ent; - - SLIST_FOREACH(ent, &sndstat_devlist, link) { - if (ent->type == type && ent->unit == unit) - return ent; + struct sndstat_file *pf; + int err; + int len; + + err = devfs_get_cdevpriv((void **)&pf); + if (err != 0) + return (err); + + /* skip zero-length reads */ + if (buf->uio_resid == 0) + return (0); + + SNDSTAT_LOCK(); + if (pf->out_offset != 0) { + /* don't allow both reading and writing */ + err = EINVAL; + goto done; + } else if (pf->in_offset == 0) { + err = sndstat_prepare(pf); + if (err <= 0) { + err = ENOMEM; + goto done; + } } - - return NULL; + len = sbuf_len(&pf->sbuf) - pf->in_offset; + if (len > buf->uio_resid) + len = buf->uio_resid; + if (len > 0) + err = uiomove(sbuf_data(&pf->sbuf) + pf->in_offset, len, buf); + pf->in_offset += len; +done: + SNDSTAT_UNLOCK(); + return (err); } -int -sndstat_acquire(struct thread *td) +static int +sndstat_write(struct cdev *i_dev, struct uio *buf, int flag) { - if (sndstat_dev == NULL) - return EBADF; - - sx_xlock(&sndstat_lock); - if (SNDSTAT_PID(sndstat_dev) != 0) { - sx_unlock(&sndstat_lock); - return EBUSY; - } - SNDSTAT_PID_SET(sndstat_dev, td->td_proc->p_pid); - sx_unlock(&sndstat_lock); - return 0; + struct sndstat_file *pf; + uint8_t temp[64]; + int err; + int len; + + err = devfs_get_cdevpriv((void **)&pf); + if (err != 0) + return (err); + + /* skip zero-length writes */ + if (buf->uio_resid == 0) + return (0); + + /* don't allow writing more than 64Kbytes */ + if (buf->uio_resid > 65536) + return (ENOMEM); + + SNDSTAT_LOCK(); + if (pf->in_offset != 0) { + /* don't allow both reading and writing */ + err = EINVAL; + } else { + /* only remember the last write - allows for updates */ + sbuf_clear(&pf->sbuf); + while (1) { + len = sizeof(temp); + if (len > buf->uio_resid) + len = buf->uio_resid; + if (len > 0) { + err = uiomove(temp, len, buf); + if (err) + break; + } else { + break; + } + if (sbuf_bcat(&pf->sbuf, temp, len) < 0) { + err = ENOMEM; + break; + } + } + sbuf_finish(&pf->sbuf); + if (err == 0) + pf->out_offset = sbuf_len(&pf->sbuf); + else + pf->out_offset = 0; + } + SNDSTAT_UNLOCK(); + return (err); } -int -sndstat_release(struct thread *td) -{ - if (sndstat_dev == NULL) - return EBADF; - - sx_xlock(&sndstat_lock); - if (SNDSTAT_PID(sndstat_dev) != td->td_proc->p_pid) { - sx_unlock(&sndstat_lock); - return EBADF; - } - SNDSTAT_PID_SET(sndstat_dev, 0); - sx_unlock(&sndstat_lock); - return 0; -} +/************************************************************************/ int sndstat_register(device_t dev, char *str, sndstat_handler handler) { struct sndstat_entry *ent; + struct sndstat_entry *pre; const char *devtype; int type, unit; @@ -265,7 +246,7 @@ sndstat_register(device_t dev, char *str else if (!strcmp(devtype, "sequencer")) type = SS_TYPE_SEQUENCER; else - return EINVAL; + return (EINVAL); } else { type = SS_TYPE_MODULE; unit = -1; @@ -278,168 +259,167 @@ sndstat_register(device_t dev, char *str ent->unit = unit; ent->handler = handler; - sx_xlock(&sndstat_lock); - SLIST_INSERT_HEAD(&sndstat_devlist, ent, link); - if (type == SS_TYPE_MODULE) - sndstat_files++; - sndstat_maxunit = (unit > sndstat_maxunit)? unit : sndstat_maxunit; - sx_unlock(&sndstat_lock); + SNDSTAT_LOCK(); + /* sorted list insertion */ + TAILQ_FOREACH(pre, &sndstat_devlist, link) { + if (pre->unit > unit) + break; + else if (pre->unit < unit) + continue; + if (pre->type > type) + break; + else if (pre->type < unit) + continue; + } + if (pre == NULL) { + TAILQ_INSERT_TAIL(&sndstat_devlist, ent, link); + } else { + TAILQ_INSERT_BEFORE(pre, ent, link); + } + SNDSTAT_UNLOCK(); - return 0; + return (0); } int sndstat_registerfile(char *str) { - return sndstat_register(NULL, str, NULL); + return (sndstat_register(NULL, str, NULL)); } int sndstat_unregister(device_t dev) { struct sndstat_entry *ent; + int error = ENXIO; - sx_xlock(&sndstat_lock); - SLIST_FOREACH(ent, &sndstat_devlist, link) { + SNDSTAT_LOCK(); + TAILQ_FOREACH(ent, &sndstat_devlist, link) { if (ent->dev == dev) { - SLIST_REMOVE(&sndstat_devlist, ent, sndstat_entry, link); - sx_unlock(&sndstat_lock); + TAILQ_REMOVE(&sndstat_devlist, ent, link); free(ent, M_DEVBUF); - - return 0; + error = 0; + break; } } - sx_unlock(&sndstat_lock); + SNDSTAT_UNLOCK(); - return ENXIO; + return (error); } int sndstat_unregisterfile(char *str) { struct sndstat_entry *ent; + int error = ENXIO; - sx_xlock(&sndstat_lock); - SLIST_FOREACH(ent, &sndstat_devlist, link) { + SNDSTAT_LOCK(); + TAILQ_FOREACH(ent, &sndstat_devlist, link) { if (ent->dev == NULL && ent->str == str) { - SLIST_REMOVE(&sndstat_devlist, ent, sndstat_entry, link); - sndstat_files--; - sx_unlock(&sndstat_lock); + TAILQ_REMOVE(&sndstat_devlist, ent, link); free(ent, M_DEVBUF); - - return 0; + error = 0; + break; } } - sx_unlock(&sndstat_lock); + SNDSTAT_UNLOCK(); - return ENXIO; + return (error); } /************************************************************************/ static int -sndstat_prepare(struct sbuf *s) +sndstat_prepare(struct sndstat_file *pf_self) { + struct sbuf *s = &pf_self->sbuf; struct sndstat_entry *ent; struct snddev_info *d; - int i, j; + struct sndstat_file *pf; + int k; + /* make sure buffer is reset */ + sbuf_clear(s); + if (snd_verbose > 0) { sbuf_printf(s, "FreeBSD Audio Driver (%ubit %d/%s)\n", (u_int)sizeof(intpcm32_t) << 3, SND_DRV_VERSION, MACHINE_ARCH); } - if (SLIST_EMPTY(&sndstat_devlist)) { - sbuf_printf(s, "No devices installed.\n"); - sbuf_finish(s); - return sbuf_len(s); - } - - sbuf_printf(s, "Installed devices:\n"); - - for (i = 0; i <= sndstat_maxunit; i++) { - for (j = SS_TYPE_FIRST; j <= SS_TYPE_LAST; j++) { - ent = sndstat_find(j, i); - if (!ent) - continue; - d = device_get_softc(ent->dev); - if (!PCM_REGISTERED(d)) - continue; + /* generate list of installed devices */ + k = 0; + TAILQ_FOREACH(ent, &sndstat_devlist, link) { + if (ent->dev == NULL) + continue; + d = device_get_softc(ent->dev); + if (!PCM_REGISTERED(d)) + continue; + if (!k++) + sbuf_printf(s, "Installed devices:\n"); + sbuf_printf(s, "%s:", device_get_nameunit(ent->dev)); + sbuf_printf(s, " <%s>", device_get_desc(ent->dev)); + if (snd_verbose > 0) + sbuf_printf(s, " %s", ent->str); + if (ent->handler) { /* XXX Need Giant magic entry ??? */ PCM_ACQUIRE_QUICK(d); - sbuf_printf(s, "%s:", device_get_nameunit(ent->dev)); - sbuf_printf(s, " <%s>", device_get_desc(ent->dev)); - if (snd_verbose > 0) - sbuf_printf(s, " %s", ent->str); - if (ent->handler) - ent->handler(s, ent->dev, snd_verbose); - sbuf_printf(s, "\n"); + ent->handler(s, ent->dev, snd_verbose); PCM_RELEASE_QUICK(d); } - } - - if (snd_verbose >= 3 && sndstat_files > 0) { - sbuf_printf(s, "\nFile Versions:\n"); + sbuf_printf(s, "\n"); + } + if (k == 0) + sbuf_printf(s, "No devices installed.\n"); - SLIST_FOREACH(ent, &sndstat_devlist, link) { - if (ent->dev == NULL && ent->str != NULL) + /* append any input from userspace */ + k = 0; + TAILQ_FOREACH(pf, &sndstat_filelist, entry) { + if (pf == pf_self) + continue; + if (pf->out_offset == 0) + continue; + if (!k++) + sbuf_printf(s, "Installed devices from userspace:\n"); + sbuf_bcat(s, sbuf_data(&pf->sbuf), + sbuf_len(&pf->sbuf)); + } + if (k == 0) + sbuf_printf(s, "No devices installed from userspace.\n"); + + /* append any file versions */ + if (snd_verbose >= 3) { + k = 0; + TAILQ_FOREACH(ent, &sndstat_devlist, link) { + if (ent->dev == NULL && ent->str != NULL) { + if (!k++) + sbuf_printf(s, "\nFile Versions:\n"); sbuf_printf(s, "%s\n", ent->str); + } } + if (k == 0) + sbuf_printf(s, "\nNo file versions.\n"); } - sbuf_finish(s); - return sbuf_len(s); -} - -static int -sndstat_init(void) -{ - if (sndstat_dev != NULL) - return EINVAL; - sx_init(&sndstat_lock, "sndstat lock"); - sndstat_dev = make_dev(&sndstat_cdevsw, SND_DEV_STATUS, - UID_ROOT, GID_WHEEL, 0444, "sndstat"); - return 0; -} - -static int -sndstat_uninit(void) -{ - if (sndstat_dev == NULL) - return EINVAL; - - sx_xlock(&sndstat_lock); - if (SNDSTAT_PID(sndstat_dev) != curthread->td_proc->p_pid) { - sx_unlock(&sndstat_lock); - return EBUSY; - } - - /* XXXPHO: use destroy_dev_sched() */ - destroy_dev(sndstat_dev); - sndstat_dev = NULL; - - SNDSTAT_FLUSH(); - - sx_unlock(&sndstat_lock); - sx_destroy(&sndstat_lock); - return 0; + return (sbuf_len(s)); } static void sndstat_sysinit(void *p) { - sndstat_init(); + sx_init(&sndstat_lock, "sndstat lock"); + sndstat_dev = make_dev(&sndstat_cdevsw, SND_DEV_STATUS, + UID_ROOT, GID_WHEEL, 0644, "sndstat"); } +SYSINIT(sndstat_sysinit, SI_SUB_DRIVERS, SI_ORDER_FIRST, sndstat_sysinit, NULL); static void sndstat_sysuninit(void *p) { - int error; - - error = sndstat_uninit(); - KASSERT(error == 0, ("%s: error = %d", __func__, error)); + if (sndstat_dev != NULL) { + /* destroy_dev() will wait for all references to go away */ + destroy_dev(sndstat_dev); + } + sx_destroy(&sndstat_lock); } - -SYSINIT(sndstat_sysinit, SI_SUB_DRIVERS, SI_ORDER_FIRST, sndstat_sysinit, NULL); SYSUNINIT(sndstat_sysuninit, SI_SUB_DRIVERS, SI_ORDER_FIRST, sndstat_sysuninit, NULL); Modified: head/sys/dev/sound/pcm/sound.c ============================================================================== --- head/sys/dev/sound/pcm/sound.c Tue Feb 9 16:58:50 2016 (r295439) +++ head/sys/dev/sound/pcm/sound.c Tue Feb 9 17:09:14 2016 (r295440) @@ -1153,18 +1153,12 @@ pcm_unregister(device_t dev) return (0); } - if (sndstat_acquire(td) != 0) { - device_printf(dev, "unregister: sndstat busy\n"); - return (EBUSY); - } - PCM_LOCK(d); PCM_WAIT(d); if (d->inprog != 0) { device_printf(dev, "unregister: operation in progress\n"); PCM_UNLOCK(d); - sndstat_release(td); return (EBUSY); } @@ -1179,7 +1173,6 @@ pcm_unregister(device_t dev) ch->name, ch->pid); CHN_UNLOCK(ch); PCM_RELEASE_QUICK(d); - sndstat_release(td); return (EBUSY); } CHN_UNLOCK(ch); @@ -1189,7 +1182,6 @@ pcm_unregister(device_t dev) if (snd_clone_busy(d->clones) != 0) { device_printf(dev, "unregister: clone busy\n"); PCM_RELEASE_QUICK(d); - sndstat_release(td); return (EBUSY); } else { PCM_LOCK(d); @@ -1205,10 +1197,12 @@ pcm_unregister(device_t dev) (void)snd_clone_enable(d->clones); PCM_RELEASE(d); PCM_UNLOCK(d); - sndstat_release(td); return (EBUSY); } + /* remove /dev/sndstat entry first */ + sndstat_unregister(dev); + PCM_LOCK(d); d->flags |= SD_F_DYING; d->flags &= ~SD_F_REGISTERED; @@ -1242,8 +1236,6 @@ pcm_unregister(device_t dev) cv_destroy(&d->cv); PCM_UNLOCK(d); snd_mtxfree(d->lock); - sndstat_unregister(dev); - sndstat_release(td); if (snd_unit == device_get_unit(dev)) { snd_unit = pcm_best_unit(-1); @@ -1415,9 +1407,6 @@ sound_modevent(module_t mod, int type, v pcmsg_unrhdr = new_unrhdr(1, INT_MAX, NULL); break; case MOD_UNLOAD: - ret = sndstat_acquire(curthread); - if (ret != 0) - break; if (pcmsg_unrhdr != NULL) { delete_unrhdr(pcmsg_unrhdr); pcmsg_unrhdr = NULL; Modified: head/sys/dev/sound/pcm/sound.h ============================================================================== --- head/sys/dev/sound/pcm/sound.h Tue Feb 9 16:58:50 2016 (r295439) +++ head/sys/dev/sound/pcm/sound.h Tue Feb 9 17:09:14 2016 (r295440) @@ -350,8 +350,6 @@ void snd_mtxassert(void *m); #define snd_mtxunlock(m) mtx_unlock(m) typedef int (*sndstat_handler)(struct sbuf *s, device_t dev, int verbose); -int sndstat_acquire(struct thread *td); -int sndstat_release(struct thread *td); int sndstat_register(device_t dev, char *str, sndstat_handler handler); int sndstat_registerfile(char *str); int sndstat_unregister(device_t dev); From owner-svn-src-all@freebsd.org Tue Feb 9 18:08:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D90FAA3425; Tue, 9 Feb 2016 18:08:42 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 E289B12EC; Tue, 9 Feb 2016 18:08:41 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u19I8eRb009850; Tue, 9 Feb 2016 18:08:40 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u19I8eMm009848; Tue, 9 Feb 2016 18:08:40 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201602091808.u19I8eMm009848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 9 Feb 2016 18:08:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295441 - head/share/examples/jails X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 18:08:42 -0000 Author: dteske Date: Tue Feb 9 18:08:40 2016 New Revision: 295441 URL: https://svnweb.freebsd.org/changeset/base/295441 Log: Fix bpf unhiding example /etc/devfs.rules Modified: head/share/examples/jails/jib head/share/examples/jails/jng Modified: head/share/examples/jails/jib ============================================================================== --- head/share/examples/jails/jib Tue Feb 9 17:09:14 2016 (r295440) +++ head/share/examples/jails/jib Tue Feb 9 18:08:40 2016 (r295441) @@ -122,7 +122,7 @@ # add include $devfsrules_hide_all # add include $devfsrules_unhide_basic # add include $devfsrules_unhide_login -# add include $devfsrules_unhide_bpf +# add path 'bpf*' unhide # # And set ether devfs.ruleset="11" (jail.conf(5)) or # jail_{name}_devfs_ruleset="11" (rc.conf(5)). Modified: head/share/examples/jails/jng ============================================================================== --- head/share/examples/jails/jng Tue Feb 9 17:09:14 2016 (r295440) +++ head/share/examples/jails/jng Tue Feb 9 18:08:40 2016 (r295441) @@ -122,7 +122,7 @@ # add include $devfsrules_hide_all # add include $devfsrules_unhide_basic # add include $devfsrules_unhide_login -# add include $devfsrules_unhide_bpf +# add path 'bpf*' unhide # # And set ether devfs.ruleset="11" (jail.conf(5)) or # jail_{name}_devfs_ruleset="11" (rc.conf(5)). From owner-svn-src-all@freebsd.org Tue Feb 9 18:10:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F17DAAA34D0; Tue, 9 Feb 2016 18:10:37 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 A435E14D1; Tue, 9 Feb 2016 18:10:37 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u19IAaq5009967; Tue, 9 Feb 2016 18:10:36 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u19IAalK009966; Tue, 9 Feb 2016 18:10:36 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201602091810.u19IAalK009966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 9 Feb 2016 18:10:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295442 - head/share/examples/jails X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 18:10:38 -0000 Author: dteske Date: Tue Feb 9 18:10:36 2016 New Revision: 295442 URL: https://svnweb.freebsd.org/changeset/base/295442 Log: Change MAC algo to support mixing w/jng interfaces Modified: head/share/examples/jails/jib Modified: head/share/examples/jails/jib ============================================================================== --- head/share/examples/jails/jib Tue Feb 9 18:08:40 2016 (r295441) +++ head/share/examples/jails/jib Tue Feb 9 18:10:36 2016 (r295442) @@ -198,7 +198,8 @@ jib_addm() mustberoot_to_continue - local iface iface_devid eiface_devid_a eiface_devid_b + local iface iface_devid eiface_devid + local eiface_devid_a eiface_devid_b local new num quad i=0 for iface in $*; do @@ -248,32 +249,28 @@ jib_addm() # unique value preventing conflict. # iface_devid=$( ifconfig $iface ether | awk '/ether/,$0=$2' ) - eiface_devid_a=${iface_devid#??:??:??} - eiface_devid_b=${iface_devid#??:??:??} + eiface_devid=${iface_devid#??:??:??} num=$( set -- `echo -n $name | sum` && echo $1 ) quad=$(( $num & 15 )) case "$quad" in 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; esac - eiface_devid_a=$quad$eiface_devid_a - eiface_devid_b=$quad$eiface_devid_b + eiface_devid=$quad$eiface_devid num=$(( $num >> 4 )) quad=$(( $num & 15 )) case "$quad" in 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; esac - eiface_devid_a=$quad$eiface_devid_a - eiface_devid_b=$quad$eiface_devid_b + eiface_devid=$quad$eiface_devid num=$(( $num >> 4 )) quad=$(( $num & 15 )) case "$quad" in 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; esac - eiface_devid_a=$quad:$eiface_devid_a - eiface_devid_b=$quad:$eiface_devid_b + eiface_devid=$quad:$eiface_devid num=$(( $num >> 4 )) quad=$(( $num & 15 )) case "$quad" in @@ -281,13 +278,13 @@ jib_addm() 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; esac case "$iface_devid" in - ?2:*|?6:*) - eiface_devid_a=a:$quad$eiface_devid_a - eiface_devid_b=e:$quad$eiface_devid_b + ?[Ee]:*) + eiface_devid_a=2:$quad$eiface_devid + eiface_devid_b=6:$quad$eiface_devid ;; *) - eiface_devid_a=2:$quad$eiface_devid_a - eiface_devid_b=6:$quad$eiface_devid_b + eiface_devid_a=2:$quad$eiface_devid + eiface_devid_b=e:$quad$eiface_devid esac eval num=\$_${iface}_num if [ "$num" ]; then From owner-svn-src-all@freebsd.org Tue Feb 9 18:11:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1F83AA35A4; Tue, 9 Feb 2016 18:11:19 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 8F1D2195F; Tue, 9 Feb 2016 18:11:19 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u19IBIV5010066; Tue, 9 Feb 2016 18:11:18 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u19IBIc3010064; Tue, 9 Feb 2016 18:11:18 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201602091811.u19IBIc3010064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 9 Feb 2016 18:11:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295443 - head/share/examples/jails X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 18:11:19 -0000 Author: dteske Date: Tue Feb 9 18:11:18 2016 New Revision: 295443 URL: https://svnweb.freebsd.org/changeset/base/295443 Log: Bring generated interfaces up always Modified: head/share/examples/jails/jib head/share/examples/jails/jng Modified: head/share/examples/jails/jib ============================================================================== --- head/share/examples/jails/jib Tue Feb 9 18:10:36 2016 (r295442) +++ head/share/examples/jails/jib Tue Feb 9 18:11:18 2016 (r295443) @@ -214,6 +214,7 @@ jib_addm() new=$( ifconfig bridge create ) || return ifconfig $new addm $iface || return ifconfig $new name "$iface$bridge" || return + ifconfig "$iface$bridge" up || return fi # 4. Create a new interface to the bridge @@ -223,6 +224,8 @@ jib_addm() # 5. Rename the new interface ifconfig $new name "e${i}a_$name" || return ifconfig ${new%a}b name "e${i}b_$name" || return + ifconfig "e${i}a_$name" up || return + ifconfig "e${i}b_$name" up || return # # 6. Set the MAC address of the new interface using a sensible Modified: head/share/examples/jails/jng ============================================================================== --- head/share/examples/jails/jng Tue Feb 9 18:10:36 2016 (r295442) +++ head/share/examples/jails/jng Tue Feb 9 18:11:18 2016 (r295443) @@ -255,6 +255,7 @@ jng_bridge() echo $2 ) || return ngctl name "$iface$bridge:link$num" $eiface || return ifconfig $new name $eiface || return + ifconfig $eiface up || return # # 6. Set the MAC address of the new interface using a sensible From owner-svn-src-all@freebsd.org Tue Feb 9 18:19:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71797AA3A4C; Tue, 9 Feb 2016 18:19:25 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 41E701F73; Tue, 9 Feb 2016 18:19:25 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u19IJOSN013244; Tue, 9 Feb 2016 18:19:24 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u19IJO8K013243; Tue, 9 Feb 2016 18:19:24 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602091819.u19IJO8K013243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 9 Feb 2016 18:19:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295444 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 18:19:25 -0000 Author: andrew Date: Tue Feb 9 18:19:24 2016 New Revision: 295444 URL: https://svnweb.freebsd.org/changeset/base/295444 Log: Remove unneeded whitespace, and fix a license for a new file. Extracted from a larger patch. Submitted by: Emmanuel Vadot X-Differential Revision: https://reviews.freebsd.org/D4792 Modified: head/sys/arm/allwinner/allwinner_machdep.h Modified: head/sys/arm/allwinner/allwinner_machdep.h ============================================================================== --- head/sys/arm/allwinner/allwinner_machdep.h Tue Feb 9 18:11:18 2016 (r295443) +++ head/sys/arm/allwinner/allwinner_machdep.h Tue Feb 9 18:19:24 2016 (r295444) @@ -2,8 +2,6 @@ * Copyright (c) 2015 Emmanuel Vadot * All rights reserved. * - * This code is derived from software written for Brini by Mark Brinicombe - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -31,17 +29,17 @@ #ifndef AW_MACHDEP_H #define AW_MACHDEP_H - + #define ALLWINNERSOC_A10 0x10000000 #define ALLWINNERSOC_A13 0x13000000 #define ALLWINNERSOC_A10S 0x10000001 #define ALLWINNERSOC_A20 0x20000000 - + #define ALLWINNERSOC_SUN4I 0x40000000 #define ALLWINNERSOC_SUN5I 0x50000000 #define ALLWINNERSOC_SUN7I 0x70000000 - + u_int allwinner_soc_type(void); u_int allwinner_soc_family(void); - + #endif /* AW_MACHDEP_H */ From owner-svn-src-all@freebsd.org Tue Feb 9 18:35:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23291AA2312; Tue, 9 Feb 2016 18:35:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 E772BCFC; Tue, 9 Feb 2016 18:35:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u19IZb3T019071; Tue, 9 Feb 2016 18:35:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u19IZbbL019070; Tue, 9 Feb 2016 18:35:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201602091835.u19IZbbL019070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 9 Feb 2016 18:35:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295445 - head/usr.bin/top X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 18:35:39 -0000 Author: kib Date: Tue Feb 9 18:35:37 2016 New Revision: 295445 URL: https://svnweb.freebsd.org/changeset/base/295445 Log: Rename variable to reflect the condition. Suggested by: jhb Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Tue Feb 9 18:19:24 2016 (r295444) +++ head/usr.bin/top/machine.c Tue Feb 9 18:35:37 2016 (r295445) @@ -1155,12 +1155,12 @@ getsysctl(const char *name, void *ptr, s static const char * format_nice(const struct kinfo_proc *pp) { - const char *fifo, *kthread; + const char *fifo, *kproc; int rtpri; static char nicebuf[4 + 1]; fifo = PRI_NEED_RR(pp->ki_pri.pri_class) ? "" : "F"; - kthread = (pp->ki_flag & P_KPROC) ? "k" : ""; + kproc = (pp->ki_flag & P_KPROC) ? "k" : ""; switch (PRI_BASE(pp->ki_pri.pri_class)) { case PRI_ITHD: return ("-"); @@ -1188,7 +1188,7 @@ format_nice(const struct kinfo_proc *pp) rtpri = ((pp->ki_flag & P_KPROC) ? pp->ki_pri.pri_native : pp->ki_pri.pri_user) - PRI_MIN_REALTIME; snprintf(nicebuf, sizeof(nicebuf), "%sr%d%s", - kthread, rtpri, fifo); + kproc, rtpri, fifo); break; case PRI_TIMESHARE: if (pp->ki_flag & P_KPROC) @@ -1200,7 +1200,7 @@ format_nice(const struct kinfo_proc *pp) rtpri = ((pp->ki_flag & P_KPROC) ? pp->ki_pri.pri_native : pp->ki_pri.pri_user) - PRI_MIN_IDLE; snprintf(nicebuf, sizeof(nicebuf), "%si%d%s", - kthread, rtpri, fifo); + kproc, rtpri, fifo); break; default: return ("?"); From owner-svn-src-all@freebsd.org Tue Feb 9 18:43:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2B54AA280C; Tue, 9 Feb 2016 18:43:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 58CBF11CB; Tue, 9 Feb 2016 18:43:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u19IhqiX021957; Tue, 9 Feb 2016 18:43:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u19IhqfJ021956; Tue, 9 Feb 2016 18:43:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602091843.u19IhqfJ021956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 9 Feb 2016 18:43:52 +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: r295446 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 18:43:53 -0000 Author: emaste Date: Tue Feb 9 18:43:52 2016 New Revision: 295446 URL: https://svnweb.freebsd.org/changeset/base/295446 Log: Add missing mergeinfo for MFC of r268227 Belatedly record the MFC of r268227, committed in stable/10 r293297. Approved by: re (gjb, blanket) Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-all@freebsd.org Tue Feb 9 20:22:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDF1DAA3419; Tue, 9 Feb 2016 20:22:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 7BFD92B5; Tue, 9 Feb 2016 20:22:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u19KMbSx051653; Tue, 9 Feb 2016 20:22:37 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u19KMZqG051636; Tue, 9 Feb 2016 20:22:35 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201602092022.u19KMZqG051636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 9 Feb 2016 20:22:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295451 - in head: lib/libmemstat sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/kern sys/mips/mips sys/powerpc/powerpc sys/riscv/riscv sys/sparc64/sparc64 sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 20:22:38 -0000 Author: glebius Date: Tue Feb 9 20:22:35 2016 New Revision: 295451 URL: https://svnweb.freebsd.org/changeset/base/295451 Log: Include sys/_task.h into uma_int.h, so that taskqueue.h isn't a requirement for uma_int.h. Suggested by: jhb Modified: head/lib/libmemstat/memstat_uma.c head/sys/amd64/amd64/uma_machdep.c head/sys/arm/arm/vm_machdep.c head/sys/arm64/arm64/uma_machdep.c head/sys/arm64/arm64/vm_machdep.c head/sys/kern/kern_malloc.c head/sys/mips/mips/uma_machdep.c head/sys/mips/mips/vm_machdep.c head/sys/powerpc/powerpc/uma_machdep.c head/sys/riscv/riscv/uma_machdep.c head/sys/riscv/riscv/vm_machdep.c head/sys/sparc64/sparc64/vm_machdep.c head/sys/vm/memguard.c head/sys/vm/uma_dbg.c head/sys/vm/uma_int.h head/sys/vm/vm_page.c Modified: head/lib/libmemstat/memstat_uma.c ============================================================================== --- head/lib/libmemstat/memstat_uma.c Tue Feb 9 20:19:31 2016 (r295450) +++ head/lib/libmemstat/memstat_uma.c Tue Feb 9 20:22:35 2016 (r295451) @@ -29,7 +29,6 @@ #include #include #include -#include #include #include Modified: head/sys/amd64/amd64/uma_machdep.c ============================================================================== --- head/sys/amd64/amd64/uma_machdep.c Tue Feb 9 20:19:31 2016 (r295450) +++ head/sys/amd64/amd64/uma_machdep.c Tue Feb 9 20:22:35 2016 (r295451) @@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Tue Feb 9 20:19:31 2016 (r295450) +++ head/sys/arm/arm/vm_machdep.c Tue Feb 9 20:22:35 2016 (r295451) @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm64/arm64/uma_machdep.c ============================================================================== --- head/sys/arm64/arm64/uma_machdep.c Tue Feb 9 20:19:31 2016 (r295450) +++ head/sys/arm64/arm64/uma_machdep.c Tue Feb 9 20:22:35 2016 (r295451) @@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/arm64/arm64/vm_machdep.c ============================================================================== --- head/sys/arm64/arm64/vm_machdep.c Tue Feb 9 20:19:31 2016 (r295450) +++ head/sys/arm64/arm64/vm_machdep.c Tue Feb 9 20:22:35 2016 (r295451) @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Tue Feb 9 20:19:31 2016 (r295450) +++ head/sys/kern/kern_malloc.c Tue Feb 9 20:22:35 2016 (r295451) @@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/mips/mips/uma_machdep.c ============================================================================== --- head/sys/mips/mips/uma_machdep.c Tue Feb 9 20:19:31 2016 (r295450) +++ head/sys/mips/mips/uma_machdep.c Tue Feb 9 20:22:35 2016 (r295451) @@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Tue Feb 9 20:19:31 2016 (r295450) +++ head/sys/mips/mips/vm_machdep.c Tue Feb 9 20:22:35 2016 (r295451) @@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/powerpc/powerpc/uma_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/uma_machdep.c Tue Feb 9 20:19:31 2016 (r295450) +++ head/sys/powerpc/powerpc/uma_machdep.c Tue Feb 9 20:22:35 2016 (r295451) @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/riscv/riscv/uma_machdep.c ============================================================================== --- head/sys/riscv/riscv/uma_machdep.c Tue Feb 9 20:19:31 2016 (r295450) +++ head/sys/riscv/riscv/uma_machdep.c Tue Feb 9 20:22:35 2016 (r295451) @@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/riscv/riscv/vm_machdep.c ============================================================================== --- head/sys/riscv/riscv/vm_machdep.c Tue Feb 9 20:19:31 2016 (r295450) +++ head/sys/riscv/riscv/vm_machdep.c Tue Feb 9 20:22:35 2016 (r295451) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/sparc64/sparc64/vm_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/vm_machdep.c Tue Feb 9 20:19:31 2016 (r295450) +++ head/sys/sparc64/sparc64/vm_machdep.c Tue Feb 9 20:22:35 2016 (r295451) @@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include Modified: head/sys/vm/memguard.c ============================================================================== --- head/sys/vm/memguard.c Tue Feb 9 20:19:31 2016 (r295450) +++ head/sys/vm/memguard.c Tue Feb 9 20:22:35 2016 (r295451) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/vm/uma_dbg.c ============================================================================== --- head/sys/vm/uma_dbg.c Tue Feb 9 20:19:31 2016 (r295450) +++ head/sys/vm/uma_dbg.c Tue Feb 9 20:22:35 2016 (r295451) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Tue Feb 9 20:19:31 2016 (r295450) +++ head/sys/vm/uma_int.h Tue Feb 9 20:22:35 2016 (r295451) @@ -28,6 +28,8 @@ * */ +#include + /* * This file includes definitions, structures, prototypes, and inlines that * should not be used outside of the actual implementation of UMA. Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Feb 9 20:19:31 2016 (r295450) +++ head/sys/vm/vm_page.c Tue Feb 9 20:22:35 2016 (r295451) @@ -102,7 +102,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include From owner-svn-src-all@freebsd.org Tue Feb 9 21:00:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59A5CAA2817; Tue, 9 Feb 2016 21:00:40 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 284F41A38; Tue, 9 Feb 2016 21:00:40 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u19L0dsT061115; Tue, 9 Feb 2016 21:00:39 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u19L0dBK061114; Tue, 9 Feb 2016 21:00:39 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201602092100.u19L0dBK061114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Tue, 9 Feb 2016 21:00:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295452 - head/etc/periodic/security X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 21:00:40 -0000 Author: lidl Date: Tue Feb 9 21:00:38 2016 New Revision: 295452 URL: https://svnweb.freebsd.org/changeset/base/295452 Log: Zero pf rule counters so daily reports make sense Zero pf rule counters so that each daily report lists an absolute number of rejected packets, not the total since the last time the machine rebooted (or the counters were manually cleared). PR: 206467 Submitted by: Rick Adams Approved by: rpaulo (mentor) Differential Revision: https://reviews.freebsd.org/D5172 Modified: head/etc/periodic/security/520.pfdenied Modified: head/etc/periodic/security/520.pfdenied ============================================================================== --- head/etc/periodic/security/520.pfdenied Tue Feb 9 20:22:35 2016 (r295451) +++ head/etc/periodic/security/520.pfdenied Tue Feb 9 21:00:38 2016 (r295452) @@ -44,7 +44,7 @@ rc=0 if check_yesno_period security_status_pfdenied_enable then TMP=`mktemp -t security` - if pfctl -sr -v 2>/dev/null | nawk '{if (/^block/) {buf=$0; getline; gsub(" +"," ",$0); if ($5 > 0) print buf$0;} }' > ${TMP}; then + if pfctl -sr -v -z 2>/dev/null | nawk '{if (/^block/) {buf=$0; getline; gsub(" +"," ",$0); if ($5 > 0) print buf$0;} }' > ${TMP}; then check_diff new_only pf ${TMP} "${host} pf denied packets:" fi rc=$? From owner-svn-src-all@freebsd.org Tue Feb 9 22:32:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCF5AAA3510; Tue, 9 Feb 2016 22:32:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 83FB1CB2; Tue, 9 Feb 2016 22:32:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u19MWPRY090573; Tue, 9 Feb 2016 22:32:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u19MWO6X089956; Tue, 9 Feb 2016 22:32:24 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602092232.u19MWO6X089956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 9 Feb 2016 22:32: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: r295453 - in stable/10/sys/boot: arm/at91/boot2 arm/ixp425/boot2 common efi/boot1 i386/boot2 i386/common i386/gptboot i386/zfsboot pc98/boot2 powerpc/boot1.chrp sparc64/boot1 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 22:32:26 -0000 Author: emaste Date: Tue Feb 9 22:32:24 2016 New Revision: 295453 URL: https://svnweb.freebsd.org/changeset/base/295453 Log: MFC boot loader path and RBX constant deduplication r294765 (imp) Move all the separate copies of the same strings into paths.h. There's nothing machine specific about these. r294765 (imp) RBX_ defines are in rbx.h, move it there. r294847 (imp) Remove static from these two. They slipped through the cracks. r294925 (imp) Fix mistake when transitioning to the new defines with ZFS loader. I hate adding yet another define, but it is the lessor of the evil choices available. Kill another evil by removing PATH_BOOT3 and replacing it with PATH_LOADER or PATH_LOADER_ZFS as appropriate. Approved by: re (gjb) Added: stable/10/sys/boot/common/paths.h - copied, changed from r294765, head/sys/boot/common/paths.h stable/10/sys/boot/common/rbx.h - copied unchanged from r294766, head/sys/boot/common/rbx.h Deleted: stable/10/sys/boot/i386/common/rbx.h Modified: stable/10/sys/boot/arm/at91/boot2/boot2.c stable/10/sys/boot/arm/ixp425/boot2/boot2.c stable/10/sys/boot/efi/boot1/boot1.c stable/10/sys/boot/i386/boot2/boot2.c stable/10/sys/boot/i386/gptboot/gptboot.c stable/10/sys/boot/i386/zfsboot/zfsboot.c stable/10/sys/boot/pc98/boot2/boot2.c stable/10/sys/boot/powerpc/boot1.chrp/boot1.c stable/10/sys/boot/sparc64/boot1/boot1.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/arm/at91/boot2/boot2.c ============================================================================== --- stable/10/sys/boot/arm/at91/boot2/boot2.c Tue Feb 9 21:00:38 2016 (r295452) +++ stable/10/sys/boot/arm/at91/boot2/boot2.c Tue Feb 9 22:32:24 2016 (r295453) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2008 John Hay - * Copyright (c) 2006 Warner Losh + * Copyright (c) 2006 M Warner Losh * Copyright (c) 1998 Robert Nordier * All rights reserved. * @@ -30,52 +30,16 @@ __FBSDID("$FreeBSD$"); #include "lib.h" #include "board.h" +#include "paths.h" +#include "rbx.h" -#define RBX_ASKNAME 0x0 /* -a */ -#define RBX_SINGLE 0x1 /* -s */ -/* 0x2 is reserved for log2(RB_NOSYNC). */ -/* 0x3 is reserved for log2(RB_HALT). */ -/* 0x4 is reserved for log2(RB_INITNAME). */ -#define RBX_DFLTROOT 0x5 /* -r */ -/* #define RBX_KDB 0x6 -d */ -/* 0x7 is reserved for log2(RB_RDONLY). */ -/* 0x8 is reserved for log2(RB_DUMP). */ -/* 0x9 is reserved for log2(RB_MINIROOT). */ -#define RBX_CONFIG 0xa /* -c */ -#define RBX_VERBOSE 0xb /* -v */ -/* #define RBX_SERIAL 0xc -h */ -/* #define RBX_CDROM 0xd -C */ -/* 0xe is reserved for log2(RB_POWEROFF). */ -#define RBX_GDB 0xf /* -g */ -/* #define RBX_MUTE 0x10 -m */ -/* 0x11 is reserved for log2(RB_SELFTEST). */ -/* 0x12 is reserved for boot programs. */ -/* 0x13 is reserved for boot programs. */ -/* #define RBX_PAUSE 0x14 -p */ -/* #define RBX_QUIET 0x15 -q */ -#define RBX_NOINTR 0x1c /* -n */ -/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ -/* #define RBX_DUAL 0x1d -D */ -/* 0x1f is reserved for log2(RB_BOOTINFO). */ - -/* pass: -a, -s, -r, -v, -g */ -#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ - OPT_SET(RBX_DFLTROOT) | \ - OPT_SET(RBX_VERBOSE) | \ - OPT_SET(RBX_GDB)) - -#define PATH_DOTCONFIG "/boot.config" -#define PATH_CONFIG "/boot/config" -//#define PATH_KERNEL "/boot/kernel/kernel" +#undef PATH_KERNEL #define PATH_KERNEL "/boot/kernel/kernel.gz.tramp" extern uint32_t _end; #define NOPT 6 -#define OPT_SET(opt) (1 << (opt)) -#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) - static const char optstr[NOPT] = "agnrsv"; static const unsigned char flags[NOPT] = { RBX_ASKNAME, Modified: stable/10/sys/boot/arm/ixp425/boot2/boot2.c ============================================================================== --- stable/10/sys/boot/arm/ixp425/boot2/boot2.c Tue Feb 9 21:00:38 2016 (r295452) +++ stable/10/sys/boot/arm/ixp425/boot2/boot2.c Tue Feb 9 22:32:24 2016 (r295453) @@ -28,51 +28,13 @@ __FBSDID("$FreeBSD$"); #include #include "lib.h" - -#define RBX_ASKNAME 0x0 /* -a */ -#define RBX_SINGLE 0x1 /* -s */ -/* 0x2 is reserved for log2(RB_NOSYNC). */ -/* 0x3 is reserved for log2(RB_HALT). */ -/* 0x4 is reserved for log2(RB_INITNAME). */ -#define RBX_DFLTROOT 0x5 /* -r */ -/* #define RBX_KDB 0x6 -d */ -/* 0x7 is reserved for log2(RB_RDONLY). */ -/* 0x8 is reserved for log2(RB_DUMP). */ -/* 0x9 is reserved for log2(RB_MINIROOT). */ -#define RBX_CONFIG 0xa /* -c */ -#define RBX_VERBOSE 0xb /* -v */ -/* #define RBX_SERIAL 0xc -h */ -/* #define RBX_CDROM 0xd -C */ -/* 0xe is reserved for log2(RB_POWEROFF). */ -#define RBX_GDB 0xf /* -g */ -/* #define RBX_MUTE 0x10 -m */ -/* 0x11 is reserved for log2(RB_SELFTEST). */ -/* 0x12 is reserved for boot programs. */ -/* 0x13 is reserved for boot programs. */ -/* #define RBX_PAUSE 0x14 -p */ -/* #define RBX_QUIET 0x15 -q */ -#define RBX_NOINTR 0x1c /* -n */ -/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ -/* #define RBX_DUAL 0x1d -D */ -/* 0x1f is reserved for log2(RB_BOOTINFO). */ - -/* pass: -a, -s, -r, -v, -g */ -#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ - OPT_SET(RBX_DFLTROOT) | \ - OPT_SET(RBX_VERBOSE) | \ - OPT_SET(RBX_GDB)) - -#define PATH_DOTCONFIG "/boot.config" -#define PATH_CONFIG "/boot/config" -#define PATH_KERNEL "/boot/kernel/kernel" +#include "paths.h" +#include "rbx.h" extern uint32_t _end; #define NOPT 6 -#define OPT_SET(opt) (1 << (opt)) -#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) - static const char optstr[NOPT] = "agnrsv"; static const unsigned char flags[NOPT] = { RBX_ASKNAME, Copied and modified: stable/10/sys/boot/common/paths.h (from r294765, head/sys/boot/common/paths.h) ============================================================================== --- head/sys/boot/common/paths.h Tue Jan 26 06:26:19 2016 (r294765, copy source) +++ stable/10/sys/boot/common/paths.h Tue Feb 9 22:32:24 2016 (r295453) @@ -31,9 +31,9 @@ #define PATH_DOTCONFIG "/boot.config" #define PATH_CONFIG "/boot/config" -#define PATH_BOOT3 "/boot/loader" #define PATH_LOADER "/boot/loader" #define PATH_LOADER_EFI "/boot/loader.efi" +#define PATH_LOADER_ZFS "/boot/zfsloader" #define PATH_KERNEL "/boot/kernel/kernel" #endif /* _PATHS_H_ */ Copied: stable/10/sys/boot/common/rbx.h (from r294766, head/sys/boot/common/rbx.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/common/rbx.h Tue Feb 9 22:32:24 2016 (r295453, copy of r294766, head/sys/boot/common/rbx.h) @@ -0,0 +1,61 @@ +/*- + * Copyright (c) 1998 Robert Nordier + * All rights reserved. + * + * Redistribution and use in source and binary forms are freely + * permitted provided that the above copyright notice and this + * paragraph and the following disclaimer are duplicated in all + * such forms. + * + * This software is provided "AS IS" and without any express or + * implied warranties, including, without limitation, the implied + * warranties of merchantability and fitness for a particular + * purpose. + * + * $FreeBSD$ + */ + +#ifndef _RBX_H_ +#define _RBX_H_ + +#define RBX_ASKNAME 0x0 /* -a */ +#define RBX_SINGLE 0x1 /* -s */ +/* 0x2 is reserved for log2(RB_NOSYNC). */ +/* 0x3 is reserved for log2(RB_HALT). */ +/* 0x4 is reserved for log2(RB_INITNAME). */ +#define RBX_DFLTROOT 0x5 /* -r */ +#define RBX_KDB 0x6 /* -d */ +/* 0x7 is reserved for log2(RB_RDONLY). */ +/* 0x8 is reserved for log2(RB_DUMP). */ +/* 0x9 is reserved for log2(RB_MINIROOT). */ +#define RBX_CONFIG 0xa /* -c */ +#define RBX_VERBOSE 0xb /* -v */ +#define RBX_SERIAL 0xc /* -h */ +#define RBX_CDROM 0xd /* -C */ +/* 0xe is reserved for log2(RB_POWEROFF). */ +#define RBX_GDB 0xf /* -g */ +#define RBX_MUTE 0x10 /* -m */ +/* 0x11 is reserved for log2(RB_SELFTEST). */ +/* 0x12 is reserved for boot programs. */ +/* 0x13 is reserved for boot programs. */ +#define RBX_PAUSE 0x14 /* -p */ +#define RBX_QUIET 0x15 /* -q */ +#define RBX_NOINTR 0x1c /* -n */ +/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ +#define RBX_DUAL 0x1d /* -D */ +/* 0x1f is reserved for log2(RB_BOOTINFO). */ + +/* pass: -a, -s, -r, -d, -c, -v, -h, -C, -g, -m, -p, -D */ +#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ + OPT_SET(RBX_DFLTROOT) | OPT_SET(RBX_KDB ) | \ + OPT_SET(RBX_CONFIG) | OPT_SET(RBX_VERBOSE) | \ + OPT_SET(RBX_SERIAL) | OPT_SET(RBX_CDROM) | \ + OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ + OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) + +#define OPT_SET(opt) (1 << (opt)) +#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) + +extern uint32_t opts; + +#endif /* !_RBX_H_ */ Modified: stable/10/sys/boot/efi/boot1/boot1.c ============================================================================== --- stable/10/sys/boot/efi/boot1/boot1.c Tue Feb 9 21:00:38 2016 (r295452) +++ stable/10/sys/boot/efi/boot1/boot1.c Tue Feb 9 22:32:24 2016 (r295453) @@ -31,8 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include "boot_module.h" - -#define _PATH_LOADER "/boot/loader.efi" +#include "paths.h" static const boot_module_t *boot_modules[] = { @@ -99,13 +98,13 @@ try_load(const boot_module_t *mod) EFI_LOADED_IMAGE *loaded_image; EFI_STATUS status; - status = mod->load(_PATH_LOADER, &dev, &buf, &bufsize); + status = mod->load(PATH_LOADER_EFI, &dev, &buf, &bufsize); if (status == EFI_NOT_FOUND) return; if (status != EFI_SUCCESS) { - printf("%s failed to load %s (%lu)\n", mod->name, _PATH_LOADER, - EFI_ERROR_CODE(status)); + printf("%s failed to load %s (%lu)\n", mod->name, + PATH_LOADER_EFI, EFI_ERROR_CODE(status)); return; } @@ -174,7 +173,7 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_T conout->ClearScreen(conout); printf("\n>> FreeBSD EFI boot block\n"); - printf(" Loader path: %s\n\n", _PATH_LOADER); + printf(" Loader path: %s\n\n", PATH_LOADER_EFI); printf(" Initializing modules:"); for (i = 0; i < NUM_BOOT_MODULES; i++) { if (boot_modules[i] == NULL) Modified: stable/10/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/10/sys/boot/i386/boot2/boot2.c Tue Feb 9 21:00:38 2016 (r295452) +++ stable/10/sys/boot/i386/boot2/boot2.c Tue Feb 9 22:32:24 2016 (r295453) @@ -33,6 +33,8 @@ __FBSDID("$FreeBSD$"); #include "boot2.h" #include "lib.h" +#include "paths.h" +#include "rbx.h" /* Define to 0 to omit serial support */ #ifndef SERIAL @@ -52,46 +54,6 @@ __FBSDID("$FreeBSD$"); #define SECOND 18 /* Circa that many ticks in a second. */ -#define RBX_ASKNAME 0x0 /* -a */ -#define RBX_SINGLE 0x1 /* -s */ -/* 0x2 is reserved for log2(RB_NOSYNC). */ -/* 0x3 is reserved for log2(RB_HALT). */ -/* 0x4 is reserved for log2(RB_INITNAME). */ -#define RBX_DFLTROOT 0x5 /* -r */ -#define RBX_KDB 0x6 /* -d */ -/* 0x7 is reserved for log2(RB_RDONLY). */ -/* 0x8 is reserved for log2(RB_DUMP). */ -/* 0x9 is reserved for log2(RB_MINIROOT). */ -#define RBX_CONFIG 0xa /* -c */ -#define RBX_VERBOSE 0xb /* -v */ -#define RBX_SERIAL 0xc /* -h */ -#define RBX_CDROM 0xd /* -C */ -/* 0xe is reserved for log2(RB_POWEROFF). */ -#define RBX_GDB 0xf /* -g */ -#define RBX_MUTE 0x10 /* -m */ -/* 0x11 is reserved for log2(RB_SELFTEST). */ -/* 0x12 is reserved for boot programs. */ -/* 0x13 is reserved for boot programs. */ -#define RBX_PAUSE 0x14 /* -p */ -#define RBX_QUIET 0x15 /* -q */ -#define RBX_NOINTR 0x1c /* -n */ -/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ -#define RBX_DUAL 0x1d /* -D */ -/* 0x1f is reserved for log2(RB_BOOTINFO). */ - -/* pass: -a, -s, -r, -d, -c, -v, -h, -C, -g, -m, -p, -D */ -#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ - OPT_SET(RBX_DFLTROOT) | OPT_SET(RBX_KDB ) | \ - OPT_SET(RBX_CONFIG) | OPT_SET(RBX_VERBOSE) | \ - OPT_SET(RBX_SERIAL) | OPT_SET(RBX_CDROM) | \ - OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ - OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) - -#define PATH_DOTCONFIG "/boot.config" -#define PATH_CONFIG "/boot/config" -#define PATH_BOOT3 "/boot/loader" -#define PATH_KERNEL "/boot/kernel/kernel" - #define ARGS 0x900 #define NOPT 14 #define NDEV 3 @@ -106,9 +68,6 @@ __FBSDID("$FreeBSD$"); #define TYPE_MAXHARD TYPE_DA #define TYPE_FD 2 -#define OPT_SET(opt) (1 << (opt)) -#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) - extern uint32_t _end; static const char optstr[NOPT] = "DhaCcdgmnpqrsv"; /* Also 'P', 'S' */ @@ -143,7 +102,7 @@ static struct dsk { } dsk; static char cmd[512], cmddup[512], knamebuf[1024]; static const char *kname; -static uint32_t opts; +uint32_t opts; static struct bootinfo bootinfo; #if SERIAL static int comspeed = SIOSPD; @@ -275,7 +234,7 @@ main(void) */ if (!kname) { - kname = PATH_BOOT3; + kname = PATH_LOADER; if (autoboot && !keyhit(3*SECOND)) { load(); kname = PATH_KERNEL; Modified: stable/10/sys/boot/i386/gptboot/gptboot.c ============================================================================== --- stable/10/sys/boot/i386/gptboot/gptboot.c Tue Feb 9 21:00:38 2016 (r295452) +++ stable/10/sys/boot/i386/gptboot/gptboot.c Tue Feb 9 22:32:24 2016 (r295453) @@ -37,11 +37,7 @@ __FBSDID("$FreeBSD$"); #include "util.h" #include "cons.h" #include "gpt.h" - -#define PATH_DOTCONFIG "/boot.config" -#define PATH_CONFIG "/boot/config" -#define PATH_BOOT3 "/boot/loader" -#define PATH_KERNEL "/boot/kernel/kernel" +#include "paths.h" #define ARGS 0x900 #define NOPT 14 @@ -180,7 +176,7 @@ main(void) if (autoboot && keyhit(3)) { if (*kname == '\0') - memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); + memcpy(kname, PATH_LOADER, sizeof(PATH_LOADER)); break; } autoboot = 0; @@ -192,7 +188,7 @@ main(void) */ if (*kname != '\0') load(); - memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); + memcpy(kname, PATH_LOADER, sizeof(PATH_LOADER)); load(); memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL)); load(); Modified: stable/10/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/10/sys/boot/i386/zfsboot/zfsboot.c Tue Feb 9 21:00:38 2016 (r295452) +++ stable/10/sys/boot/i386/zfsboot/zfsboot.c Tue Feb 9 22:32:24 2016 (r295453) @@ -42,14 +42,10 @@ __FBSDID("$FreeBSD$"); #include "util.h" #include "cons.h" #include "bootargs.h" +#include "paths.h" #include "libzfs.h" -#define PATH_DOTCONFIG "/boot.config" -#define PATH_CONFIG "/boot/config" -#define PATH_BOOT3 "/boot/zfsloader" -#define PATH_KERNEL "/boot/kernel/kernel" - #define ARGS 0x900 #define NOPT 14 #define NDEV 3 @@ -550,12 +546,12 @@ main(void) } /* - * Try to exec stage 3 boot loader. If interrupted by a keypress, + * Try to exec /boot/loader. If interrupted by a keypress, * or in case of failure, try to load a kernel directly instead. */ if (autoboot && !*kname) { - memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); + memcpy(kname, PATH_LOADER_ZFS, sizeof(PATH_LOADER_ZFS)); if (!keyhit(3)) { load(); memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL)); Modified: stable/10/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/10/sys/boot/pc98/boot2/boot2.c Tue Feb 9 21:00:38 2016 (r295452) +++ stable/10/sys/boot/pc98/boot2/boot2.c Tue Feb 9 22:32:24 2016 (r295453) @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #include "boot2.h" #include "lib.h" +#include "paths.h" +#include "rbx.h" /* Define to 0 to omit serial support */ #ifndef SERIAL @@ -54,46 +56,6 @@ __FBSDID("$FreeBSD$"); #define SECOND 1 /* Circa that many ticks in a second. */ -#define RBX_ASKNAME 0x0 /* -a */ -#define RBX_SINGLE 0x1 /* -s */ -/* 0x2 is reserved for log2(RB_NOSYNC). */ -/* 0x3 is reserved for log2(RB_HALT). */ -/* 0x4 is reserved for log2(RB_INITNAME). */ -#define RBX_DFLTROOT 0x5 /* -r */ -#define RBX_KDB 0x6 /* -d */ -/* 0x7 is reserved for log2(RB_RDONLY). */ -/* 0x8 is reserved for log2(RB_DUMP). */ -/* 0x9 is reserved for log2(RB_MINIROOT). */ -#define RBX_CONFIG 0xa /* -c */ -#define RBX_VERBOSE 0xb /* -v */ -#define RBX_SERIAL 0xc /* -h */ -#define RBX_CDROM 0xd /* -C */ -/* 0xe is reserved for log2(RB_POWEROFF). */ -#define RBX_GDB 0xf /* -g */ -#define RBX_MUTE 0x10 /* -m */ -/* 0x11 is reserved for log2(RB_SELFTEST). */ -/* 0x12 is reserved for boot programs. */ -/* 0x13 is reserved for boot programs. */ -#define RBX_PAUSE 0x14 /* -p */ -#define RBX_QUIET 0x15 /* -q */ -#define RBX_NOINTR 0x1c /* -n */ -/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ -#define RBX_DUAL 0x1d /* -D */ -/* 0x1f is reserved for log2(RB_BOOTINFO). */ - -/* pass: -a, -s, -r, -d, -c, -v, -h, -C, -g, -m, -p, -D */ -#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ - OPT_SET(RBX_DFLTROOT) | OPT_SET(RBX_KDB ) | \ - OPT_SET(RBX_CONFIG) | OPT_SET(RBX_VERBOSE) | \ - OPT_SET(RBX_SERIAL) | OPT_SET(RBX_CDROM) | \ - OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ - OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) - -#define PATH_DOTCONFIG "/boot.config" -#define PATH_CONFIG "/boot/config" -#define PATH_BOOT3 "/boot/loader" -#define PATH_KERNEL "/boot/kernel/kernel" - #define ARGS 0x900 #define NOPT 14 #define NDEV 3 @@ -105,9 +67,6 @@ __FBSDID("$FreeBSD$"); #define TYPE_DA 1 #define TYPE_FD 2 -#define OPT_SET(opt) (1 << (opt)) -#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) - extern uint32_t _end; static const char optstr[NOPT] = "DhaCcdgmnpqrsv"; /* Also 'P', 'S' */ @@ -145,7 +104,7 @@ static struct dsk { } dsk; static char cmd[512], cmddup[512], knamebuf[1024]; static const char *kname; -static uint32_t opts; +uint32_t opts; static struct bootinfo bootinfo; #if SERIAL static int comspeed = SIOSPD; @@ -414,7 +373,7 @@ main(void) */ if (!kname) { - kname = PATH_BOOT3; + kname = PATH_LOADER; if (autoboot && !keyhit(3*SECOND)) { load(); kname = PATH_KERNEL; Modified: stable/10/sys/boot/powerpc/boot1.chrp/boot1.c ============================================================================== --- stable/10/sys/boot/powerpc/boot1.chrp/boot1.c Tue Feb 9 21:00:38 2016 (r295452) +++ stable/10/sys/boot/powerpc/boot1.chrp/boot1.c Tue Feb 9 22:32:24 2016 (r295453) @@ -23,8 +23,7 @@ __FBSDID("$FreeBSD$"); #include #include -#define _PATH_LOADER "/boot/loader" -#define _PATH_KERNEL "/boot/kernel/kernel" +#include "paths.h" #define BSIZEMAX 16384 @@ -396,7 +395,7 @@ main(int ac, char **av) char bootpath_full[255]; int i, len; - path = _PATH_LOADER; + path = PATH_LOADER; for (i = 0; i < ac; i++) { switch (av[i][0]) { case '-': Modified: stable/10/sys/boot/sparc64/boot1/boot1.c ============================================================================== --- stable/10/sys/boot/sparc64/boot1/boot1.c Tue Feb 9 21:00:38 2016 (r295452) +++ stable/10/sys/boot/sparc64/boot1/boot1.c Tue Feb 9 22:32:24 2016 (r295453) @@ -24,8 +24,8 @@ __FBSDID("$FreeBSD$"); #include #include -#define _PATH_LOADER "/boot/loader" -#define _PATH_KERNEL "/boot/kernel/kernel" +#include "paths.h" + #define READ_BUF_SIZE 8192 typedef int putc_func_t(char c, void *arg); @@ -324,7 +324,7 @@ main(int ac, char **av) const char *path; int i; - path = _PATH_LOADER; + path = PATH_LOADER; for (i = 0; i < ac; i++) { switch (av[i][0]) { case '-': From owner-svn-src-all@freebsd.org Wed Feb 10 00:08:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93179AA2830; Wed, 10 Feb 2016 00:08:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 5E55E1E1D; Wed, 10 Feb 2016 00:08:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1A08qYa018253; Wed, 10 Feb 2016 00:08:52 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1A08pnF018243; Wed, 10 Feb 2016 00:08:51 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201602100008.u1A08pnF018243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 10 Feb 2016 00:08:51 +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: r295454 - in stable/10: lib/libprocstat lib/libutil share/man/man5 sys/kern 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 00:08:53 -0000 Author: jhb Date: Wed Feb 10 00:08:51 2016 New Revision: 295454 URL: https://svnweb.freebsd.org/changeset/base/295454 Log: MFC 287442,287537,288944: Fix corruption of coredumps due to procstat notes changing size during coredump generation. The changes in r287442 required some reworking since the 'fo_fill_kinfo' file op does not exist in stable/10. 287442: Detect badly behaved coredump note helpers Coredump notes depend on being able to invoke dump routines twice; once in a dry-run mode to get the size of the note, and another to actually emit the note to the corefile. When a note helper emits a different length section the second time around than the length it requested the first time, the kernel produces a corrupt coredump. NT_PROCSTAT_FILES output length, when packing kinfo structs, is tied to the length of filenames corresponding to vnodes in the process' fd table via vn_fullpath. As vnodes may move around during dump, this is racy. So: - Detect badly behaved notes in putnote() and pad underfilled notes. - Add a fail point, debug.fail_point.fill_kinfo_vnode__random_path to exercise the NT_PROCSTAT_FILES corruption. It simply picks random lengths to expand or truncate paths to in fo_fill_kinfo_vnode(). - Add a sysctl, kern.coredump_pack_fileinfo, to allow users to disable kinfo packing for PROCSTAT_FILES notes. This should avoid both FILES note corruption and truncation, even if filenames change, at the cost of about 1 kiB in padding bloat per open fd. Document the new sysctl in core.5. - Fix note_procstat_files to self-limit in the 2nd pass. Since sometimes this will result in a short write, pad up to our advertised size. This addresses note corruption, at the risk of sometimes truncating the last several fd info entries. - Fix NT_PROCSTAT_FILES consumers libutil and libprocstat to grok the zero padding. 287537: Follow-up to r287442: Move sysctl to compiled-once file Avoid duplicate sysctl nodes. 288944: Fix core corruption caused by race in note_procstat_vmmap This fix is spiritually similar to r287442 and was discovered thanks to the KASSERT added in that revision. NT_PROCSTAT_VMMAP output length, when packing kinfo structs, is tied to the length of filenames corresponding to vnodes in the process' vm map via vn_fullpath. As vnodes may move during coredump, this is racy. We do not remove the race, only prevent it from causing coredump corruption. - Add a sysctl, kern.coredump_pack_vmmapinfo, to allow users to disable kinfo packing for PROCSTAT_VMMAP notes. This avoids VMMAP corruption and truncation, even if names change, at the cost of up to PATH_MAX bytes per mapped object. The new sysctl is documented in core.5. - Fix note_procstat_vmmap to self-limit in the second pass. This addresses corruption, at the cost of sometimes producing a truncated result. - Fix PROCSTAT_VMMAP consumers libutil (and libprocstat, via copy-paste) to grok the new zero padding. Approved by: re (gjb) Modified: stable/10/lib/libprocstat/libprocstat.c stable/10/lib/libutil/kinfo_getfile.c stable/10/lib/libutil/kinfo_getvmmap.c stable/10/share/man/man5/core.5 stable/10/sys/kern/imgact_elf.c stable/10/sys/kern/kern_descrip.c stable/10/sys/kern/kern_exec.c stable/10/sys/kern/kern_proc.c stable/10/sys/sys/exec.h stable/10/sys/sys/user.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libprocstat/libprocstat.c ============================================================================== --- stable/10/lib/libprocstat/libprocstat.c Tue Feb 9 22:32:24 2016 (r295453) +++ stable/10/lib/libprocstat/libprocstat.c Wed Feb 10 00:08:51 2016 (r295454) @@ -767,6 +767,8 @@ kinfo_getfile_core(struct procstat_core eb = buf + len; while (bp < eb) { kf = (struct kinfo_file *)(uintptr_t)bp; + if (kf->kf_structsize == 0) + break; bp += kf->kf_structsize; cnt++; } @@ -782,6 +784,8 @@ kinfo_getfile_core(struct procstat_core /* Pass 2: unpack */ while (bp < eb) { kf = (struct kinfo_file *)(uintptr_t)bp; + if (kf->kf_structsize == 0) + break; /* Copy/expand into pre-zeroed buffer */ memcpy(kp, kf, kf->kf_structsize); /* Advance to next packed record */ @@ -1863,6 +1867,8 @@ kinfo_getvmmap_core(struct procstat_core eb = buf + len; while (bp < eb) { kv = (struct kinfo_vmentry *)(uintptr_t)bp; + if (kv->kve_structsize == 0) + break; bp += kv->kve_structsize; cnt++; } @@ -1878,6 +1884,8 @@ kinfo_getvmmap_core(struct procstat_core /* Pass 2: unpack */ while (bp < eb) { kv = (struct kinfo_vmentry *)(uintptr_t)bp; + if (kv->kve_structsize == 0) + break; /* Copy/expand into pre-zeroed buffer */ memcpy(kp, kv, kv->kve_structsize); /* Advance to next packed record */ Modified: stable/10/lib/libutil/kinfo_getfile.c ============================================================================== --- stable/10/lib/libutil/kinfo_getfile.c Tue Feb 9 22:32:24 2016 (r295453) +++ stable/10/lib/libutil/kinfo_getfile.c Wed Feb 10 00:08:51 2016 (r295454) @@ -44,6 +44,8 @@ kinfo_getfile(pid_t pid, int *cntp) eb = buf + len; while (bp < eb) { kf = (struct kinfo_file *)(uintptr_t)bp; + if (kf->kf_structsize == 0) + break; bp += kf->kf_structsize; cnt++; } @@ -59,6 +61,8 @@ kinfo_getfile(pid_t pid, int *cntp) /* Pass 2: unpack */ while (bp < eb) { kf = (struct kinfo_file *)(uintptr_t)bp; + if (kf->kf_structsize == 0) + break; /* Copy/expand into pre-zeroed buffer */ memcpy(kp, kf, kf->kf_structsize); /* Advance to next packed record */ Modified: stable/10/lib/libutil/kinfo_getvmmap.c ============================================================================== --- stable/10/lib/libutil/kinfo_getvmmap.c Tue Feb 9 22:32:24 2016 (r295453) +++ stable/10/lib/libutil/kinfo_getvmmap.c Wed Feb 10 00:08:51 2016 (r295454) @@ -44,6 +44,8 @@ kinfo_getvmmap(pid_t pid, int *cntp) eb = buf + len; while (bp < eb) { kv = (struct kinfo_vmentry *)(uintptr_t)bp; + if (kv->kve_structsize == 0) + break; bp += kv->kve_structsize; cnt++; } @@ -59,6 +61,8 @@ kinfo_getvmmap(pid_t pid, int *cntp) /* Pass 2: unpack */ while (bp < eb) { kv = (struct kinfo_vmentry *)(uintptr_t)bp; + if (kv->kve_structsize == 0) + break; /* Copy/expand into pre-zeroed buffer */ memcpy(kp, kv, kv->kve_structsize); /* Advance to next packed record */ Modified: stable/10/share/man/man5/core.5 ============================================================================== --- stable/10/share/man/man5/core.5 Tue Feb 9 22:32:24 2016 (r295453) +++ stable/10/share/man/man5/core.5 Wed Feb 10 00:08:51 2016 (r295454) @@ -32,7 +32,7 @@ .\" @(#)core.5 8.3 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd November 22, 2012 +.Dd October 5, 2015 .Dt CORE 5 .Os .Sh NAME @@ -126,6 +126,29 @@ Core files will have the suffix .Em .gz appended to them. .El +.Sh NOTES +Corefiles are written with open file descriptor information as an ELF note. +By default, file paths are packed to only use as much space as needed. +However, file paths can change at any time, including during core dump, +and this can result in truncated file descriptor data. +.Pp +All file descriptor information can be preserved by disabling packing. +This potentially wastes up to PATH_MAX bytes per open fd. +Packing is disabled with +.Dl sysctl kern.coredump_pack_fileinfo=0 . +.Pp +Similarly, corefiles are written with vmmap information as an ELF note, which +contains file paths. +By default, they are packed to only use as much space as +needed. +By the same mechanism as for the open files note, these paths can also +change at any time and result in a truncated note. +.Pp +All vmmap information can be preserved by disabling packing. +Like the file information, this potentially wastes up to PATH_MAX bytes per +mapped object. +Packing is disabled with +.Dl sysctl kern.coredump_pack_vmmapinfo=0 . .Sh EXAMPLES In order to store all core images in per-user private areas under .Pa /var/coredumps , Modified: stable/10/sys/kern/imgact_elf.c ============================================================================== --- stable/10/sys/kern/imgact_elf.c Tue Feb 9 22:32:24 2016 (r295453) +++ stable/10/sys/kern/imgact_elf.c Wed Feb 10 00:08:51 2016 (r295454) @@ -1709,7 +1709,8 @@ static void __elfN(putnote)(struct note_info *ninfo, struct sbuf *sb) { Elf_Note note; - ssize_t old_len; + ssize_t old_len, sect_len; + size_t new_len, descsz, i; if (ninfo->type == -1) { ninfo->outfunc(ninfo->outarg, sb, &ninfo->outsize); @@ -1728,7 +1729,33 @@ __elfN(putnote)(struct note_info *ninfo, return; sbuf_start_section(sb, &old_len); ninfo->outfunc(ninfo->outarg, sb, &ninfo->outsize); - sbuf_end_section(sb, old_len, ELF_NOTE_ROUNDSIZE, 0); + sect_len = sbuf_end_section(sb, old_len, ELF_NOTE_ROUNDSIZE, 0); + if (sect_len < 0) + return; + + new_len = (size_t)sect_len; + descsz = roundup(note.n_descsz, ELF_NOTE_ROUNDSIZE); + if (new_len < descsz) { + /* + * It is expected that individual note emitters will correctly + * predict their expected output size and fill up to that size + * themselves, padding in a format-specific way if needed. + * However, in case they don't, just do it here with zeros. + */ + for (i = 0; i < descsz - new_len; i++) + sbuf_putc(sb, 0); + } else if (new_len > descsz) { + /* + * We can't always truncate sb -- we may have drained some + * of it already. + */ + KASSERT(new_len == descsz, ("%s: Note type %u changed as we " + "read it (%zu > %zu). Since it is longer than " + "expected, this coredump's notes are corrupt. THIS " + "IS A BUG in the note_procstat routine for type %u.\n", + __func__, (unsigned)note.n_type, new_len, descsz, + (unsigned)note.n_type)); + } } /* @@ -1909,25 +1936,47 @@ static void note_procstat_files(void *arg, struct sbuf *sb, size_t *sizep) { struct proc *p; - size_t size; - int structsize; + size_t size, sect_sz, i; + ssize_t start_len, sect_len; + int structsize, filedesc_flags; + + if (coredump_pack_fileinfo) + filedesc_flags = KERN_FILEDESC_PACK_KINFO; + else + filedesc_flags = 0; p = (struct proc *)arg; + structsize = sizeof(struct kinfo_file); if (sb == NULL) { size = 0; sb = sbuf_new(NULL, NULL, 128, SBUF_FIXEDLEN); sbuf_set_drain(sb, sbuf_drain_count, &size); sbuf_bcat(sb, &structsize, sizeof(structsize)); PROC_LOCK(p); - kern_proc_filedesc_out(p, sb, -1); + kern_proc_filedesc_out(p, sb, -1, filedesc_flags); sbuf_finish(sb); sbuf_delete(sb); *sizep = size; } else { - structsize = sizeof(struct kinfo_file); + sbuf_start_section(sb, &start_len); + sbuf_bcat(sb, &structsize, sizeof(structsize)); PROC_LOCK(p); - kern_proc_filedesc_out(p, sb, -1); + kern_proc_filedesc_out(p, sb, *sizep - sizeof(structsize), + filedesc_flags); + + sect_len = sbuf_end_section(sb, start_len, 0, 0); + if (sect_len < 0) + return; + sect_sz = sect_len; + + KASSERT(sect_sz <= *sizep, + ("kern_proc_filedesc_out did not respect maxlen; " + "requested %zu, got %zu", *sizep - sizeof(structsize), + sect_sz - sizeof(structsize))); + + for (i = 0; i < *sizep - sect_sz && sb->s_error == 0; i++) + sbuf_putc(sb, 0); } } @@ -1940,24 +1989,30 @@ note_procstat_vmmap(void *arg, struct sb { struct proc *p; size_t size; - int structsize; + int structsize, vmmap_flags; + + if (coredump_pack_vmmapinfo) + vmmap_flags = KERN_VMMAP_PACK_KINFO; + else + vmmap_flags = 0; p = (struct proc *)arg; + structsize = sizeof(struct kinfo_vmentry); if (sb == NULL) { size = 0; sb = sbuf_new(NULL, NULL, 128, SBUF_FIXEDLEN); sbuf_set_drain(sb, sbuf_drain_count, &size); sbuf_bcat(sb, &structsize, sizeof(structsize)); PROC_LOCK(p); - kern_proc_vmmap_out(p, sb); + kern_proc_vmmap_out(p, sb, -1, vmmap_flags); sbuf_finish(sb); sbuf_delete(sb); *sizep = size; } else { - structsize = sizeof(struct kinfo_vmentry); sbuf_bcat(sb, &structsize, sizeof(structsize)); PROC_LOCK(p); - kern_proc_vmmap_out(p, sb); + kern_proc_vmmap_out(p, sb, *sizep - sizeof(structsize), + vmmap_flags); } } Modified: stable/10/sys/kern/kern_descrip.c ============================================================================== --- stable/10/sys/kern/kern_descrip.c Tue Feb 9 22:32:24 2016 (r295453) +++ stable/10/sys/kern/kern_descrip.c Wed Feb 10 00:08:51 2016 (r295454) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -3299,6 +3300,7 @@ struct export_fd_buf { struct sbuf *sb; ssize_t remainder; struct kinfo_file kif; + int flags; }; static int @@ -3385,9 +3387,12 @@ export_fd_to_sb(void *data, int type, in kif->kf_type = type; kif->kf_ref_count = refcnt; kif->kf_offset = offset; - /* Pack record size down */ - kif->kf_structsize = offsetof(struct kinfo_file, kf_path) + - strlen(kif->kf_path) + 1; + if ((efbuf->flags & KERN_FILEDESC_PACK_KINFO) != 0) + /* Pack record size down */ + kif->kf_structsize = offsetof(struct kinfo_file, kf_path) + + strlen(kif->kf_path) + 1; + else + kif->kf_structsize = sizeof(*kif); kif->kf_structsize = roundup(kif->kf_structsize, sizeof(uint64_t)); if (efbuf->remainder != -1) { if (efbuf->remainder < kif->kf_structsize) { @@ -3413,7 +3418,8 @@ export_fd_to_sb(void *data, int type, in * Takes a locked proc as argument, and returns with the proc unlocked. */ int -kern_proc_filedesc_out(struct proc *p, struct sbuf *sb, ssize_t maxlen) +kern_proc_filedesc_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, + int flags) { struct file *fp; struct filedesc *fdp; @@ -3448,6 +3454,7 @@ kern_proc_filedesc_out(struct proc *p, efbuf->fdp = NULL; efbuf->sb = sb; efbuf->remainder = maxlen; + efbuf->flags = flags; if (tracevp != NULL) export_fd_to_sb(tracevp, KF_TYPE_VNODE, KF_FD_TYPE_TRACE, FREAD | FWRITE, -1, -1, NULL, efbuf); @@ -3597,7 +3604,8 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER return (error); } maxlen = req->oldptr != NULL ? req->oldlen : -1; - error = kern_proc_filedesc_out(p, &sb, maxlen); + error = kern_proc_filedesc_out(p, &sb, maxlen, + KERN_FILEDESC_PACK_KINFO); error2 = sbuf_finish(&sb); sbuf_delete(&sb); return (error != 0 ? error : error2); @@ -3635,6 +3643,24 @@ vntype_to_kinfo(int vtype) return (KF_VTYPE_UNKNOWN); } +static inline void +vn_fill_junk(struct kinfo_file *kif) +{ + size_t len, olen; + + /* + * Simulate vn_fullpath returning changing values for a given + * vp during e.g. coredump. + */ + len = (arc4random() % (sizeof(kif->kf_path) - 2)) + 1; + olen = strlen(kif->kf_path); + if (len < olen) + strcpy(&kif->kf_path[len - 1], "$"); + else + for (; olen < len; olen++) + strcpy(&kif->kf_path[olen], "A"); +} + static int fill_vnode_info(struct vnode *vp, struct kinfo_file *kif) { @@ -3654,6 +3680,10 @@ fill_vnode_info(struct vnode *vp, struct if (freepath != NULL) free(freepath, M_TEMP); + KFAIL_POINT_CODE(DEBUG_FP, fill_kinfo_vnode__random_path, + vn_fill_junk(kif); + ); + /* * Retrieve vnode attributes. */ Modified: stable/10/sys/kern/kern_exec.c ============================================================================== --- stable/10/sys/kern/kern_exec.c Tue Feb 9 22:32:24 2016 (r295453) +++ stable/10/sys/kern/kern_exec.c Wed Feb 10 00:08:51 2016 (r295454) @@ -102,6 +102,16 @@ SDT_PROBE_DEFINE1(proc, kernel, , exec__ MALLOC_DEFINE(M_PARGS, "proc-args", "Process arguments"); +int coredump_pack_fileinfo = 1; +SYSCTL_INT(_kern, OID_AUTO, coredump_pack_fileinfo, CTLFLAG_RWTUN, + &coredump_pack_fileinfo, 0, + "Enable file path packing in 'procstat -f' coredump notes"); + +int coredump_pack_vmmapinfo = 1; +SYSCTL_INT(_kern, OID_AUTO, coredump_pack_vmmapinfo, CTLFLAG_RWTUN, + &coredump_pack_vmmapinfo, 0, + "Enable file path packing in 'procstat -v' coredump notes"); + static int sysctl_kern_ps_strings(SYSCTL_HANDLER_ARGS); static int sysctl_kern_usrstack(SYSCTL_HANDLER_ARGS); static int sysctl_kern_stackprot(SYSCTL_HANDLER_ARGS); Modified: stable/10/sys/kern/kern_proc.c ============================================================================== --- stable/10/sys/kern/kern_proc.c Tue Feb 9 22:32:24 2016 (r295453) +++ stable/10/sys/kern/kern_proc.c Wed Feb 10 00:08:51 2016 (r295454) @@ -2228,7 +2228,7 @@ next:; * Must be called with the process locked and will return unlocked. */ int -kern_proc_vmmap_out(struct proc *p, struct sbuf *sb) +kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags) { vm_map_entry_t entry, tmp_entry; struct vattr va; @@ -2252,7 +2252,7 @@ kern_proc_vmmap_out(struct proc *p, stru PRELE(p); return (ESRCH); } - kve = malloc(sizeof(*kve), M_TEMP, M_WAITOK); + kve = malloc(sizeof(*kve), M_TEMP, M_WAITOK | M_ZERO); error = 0; map = &vm->vm_map; @@ -2387,10 +2387,23 @@ kern_proc_vmmap_out(struct proc *p, stru free(freepath, M_TEMP); /* Pack record size down */ - kve->kve_structsize = offsetof(struct kinfo_vmentry, kve_path) + - strlen(kve->kve_path) + 1; + if ((flags & KERN_VMMAP_PACK_KINFO) != 0) + kve->kve_structsize = + offsetof(struct kinfo_vmentry, kve_path) + + strlen(kve->kve_path) + 1; + else + kve->kve_structsize = sizeof(*kve); kve->kve_structsize = roundup(kve->kve_structsize, sizeof(uint64_t)); + + /* Halt filling and truncate rather than exceeding maxlen */ + if (maxlen != -1 && maxlen < kve->kve_structsize) { + error = 0; + vm_map_lock_read(map); + break; + } else if (maxlen != -1) + maxlen -= kve->kve_structsize; + if (sbuf_bcat(sb, kve, kve->kve_structsize) != 0) error = ENOMEM; vm_map_lock_read(map); @@ -2422,7 +2435,7 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR sbuf_delete(&sb); return (error); } - error = kern_proc_vmmap_out(p, &sb); + error = kern_proc_vmmap_out(p, &sb, -1, KERN_VMMAP_PACK_KINFO); error2 = sbuf_finish(&sb); sbuf_delete(&sb); return (error != 0 ? error : error2); Modified: stable/10/sys/sys/exec.h ============================================================================== --- stable/10/sys/sys/exec.h Tue Feb 9 22:32:24 2016 (r295453) +++ stable/10/sys/sys/exec.h Wed Feb 10 00:08:51 2016 (r295454) @@ -83,6 +83,9 @@ void exec_unmap_first_page(struct image_ int exec_register(const struct execsw *); int exec_unregister(const struct execsw *); +extern int coredump_pack_fileinfo; +extern int coredump_pack_vmmapinfo; + /* * note: name##_mod cannot be const storage because the * linker_file_sysinit() function modifies _file in the Modified: stable/10/sys/sys/user.h ============================================================================== --- stable/10/sys/sys/user.h Tue Feb 9 22:32:24 2016 (r295453) +++ stable/10/sys/sys/user.h Wed Feb 10 00:08:51 2016 (r295454) @@ -536,6 +536,11 @@ struct kinfo_sigtramp { #define KERN_PROC_NOTHREADS 0x1 #define KERN_PROC_MASK32 0x2 +/* Flags for kern_proc_filedesc_out. */ +#define KERN_FILEDESC_PACK_KINFO 0x00000001U + +/* Flags for kern_proc_vmmap_out. */ +#define KERN_VMMAP_PACK_KINFO 0x00000001U struct sbuf; /* @@ -547,9 +552,11 @@ struct sbuf; * to be locked on enter. On return the process is unlocked. */ -int kern_proc_filedesc_out(struct proc *p, struct sbuf *sb, ssize_t maxlen); +int kern_proc_filedesc_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, + int flags); int kern_proc_out(struct proc *p, struct sbuf *sb, int flags); -int kern_proc_vmmap_out(struct proc *p, struct sbuf *sb); +int kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, + int flags); int vntype_to_kinfo(int vtype); #endif /* !_KERNEL */ From owner-svn-src-all@freebsd.org Wed Feb 10 00:26:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81ED5AA126D; Wed, 10 Feb 2016 00:26:02 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 4EFCDCAD; Wed, 10 Feb 2016 00:26:02 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1A0Q1j7024265; Wed, 10 Feb 2016 00:26:01 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1A0Q1RA024264; Wed, 10 Feb 2016 00:26:01 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201602100026.u1A0Q1RA024264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 10 Feb 2016 00:26:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295455 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 00:26:02 -0000 Author: bapt Date: Wed Feb 10 00:26:01 2016 New Revision: 295455 URL: https://svnweb.freebsd.org/changeset/base/295455 Log: Fix make universe when running with non POSIX/C locales using a locale sensitive pattern Reported by: many Submitted by: jilles Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Wed Feb 10 00:08:51 2016 (r295454) +++ head/Makefile Wed Feb 10 00:26:01 2016 (r295455) @@ -466,7 +466,8 @@ _THINNER=cat _THINNER=xargs grep -L "^.NO_UNIVERSE" || true .endif KERNCONFS!= cd ${KERNSRCDIR}/${TARGET}/conf && \ - find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \ + find [[:upper:][:digit:]]*[[:upper:][:digit:]] \ + -type f -maxdepth 0 \ ! -name DEFAULTS ! -name NOTES | \ ${_THINNER} universe_kernconfs: From owner-svn-src-all@freebsd.org Wed Feb 10 04:04:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47149AA2A28; Wed, 10 Feb 2016 04:04:33 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 0998DCDB; Wed, 10 Feb 2016 04:04:32 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1A44WPD088664; Wed, 10 Feb 2016 04:04:32 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1A44VQA088660; Wed, 10 Feb 2016 04:04:31 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201602100404.u1A44VQA088660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 10 Feb 2016 04:04:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295457 - head/share/examples/jails X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 04:04:33 -0000 Author: dteske Date: Wed Feb 10 04:04:31 2016 New Revision: 295457 URL: https://svnweb.freebsd.org/changeset/base/295457 Log: Add vnet jail configuration examples Added: head/share/examples/jails/jail.xxx.conf (contents, props changed) head/share/examples/jails/rc.conf.jails (contents, props changed) head/share/examples/jails/rcjail.xxx.conf (contents, props changed) Modified: head/share/examples/jails/README Modified: head/share/examples/jails/README ============================================================================== --- head/share/examples/jails/README Wed Feb 10 04:00:01 2016 (r295456) +++ head/share/examples/jails/README Wed Feb 10 04:04:31 2016 (r295457) @@ -1,5 +1,49 @@ # $FreeBSD$ -See under share/examples/netgraph for some examples of +Sample 1: jail.conf(5) + + $ cp jib jng /usr/sbin/ + $ cat jail.xxx.conf >> /etc/jail.conf + $ vi /etc/jail.conf + # NB: Customize root directory and bridge interface + $ sysrc jail_enable=YES + # NB: Assumes jail_list="" (meaning ``all jails in jail.conf'') + # NB: Assumes rc_conf_files="" (``below rc.conf(5) samples not used'') + $ service jail start + +Sample 2: rc.conf(5) + + $ cp jib jng /usr/sbin/ + $ cp rc.conf.jails /etc/ + $ vi /etc/rc.conf.jails + # NB: Customize root directory and bridge interface + $ sysrc rc_conf_files+=/etc/rc.conf.jails + # NB: Assumes /etc/jail.conf does not exist and jail_list="" + $ service jail start + +Sample 3: Per-jail jail.conf(5) + + $ cp jib jng /usr/sbin/ + $ cp jail.xxx.conf /etc/ + $ vi /etc/jail.xxx.conf + # NB: Customize root directory and bridge interface + $ sysrc jail_enable=YES + $ sysrc jail_list+=xxx + # NB: Assumes rc_conf_files="" + $ service jail start + +Sample 4: Per-jail rc.conf(5) + + $ cp jib jng /usr/sbin/ + $ cp rcjail.xxx.conf /etc/ + $ vi /etc/rcjail.xxx.conf + # NB: Customize root directory and bridge interface + $ sysrc jail_enable=YES + $ sysrc jail_list+=xxx + $ sysrc rc_conf_files+=/etc/rcjail.xxx.conf + # NB: Assumes neither /etc/jail.conf nor /etc/jail.xxx.conf exist + $ service jail start + +For additional recipes, see share/examples/netgraph for making and hooking together jails using netgraph as the virtual networking fabric. Added: head/share/examples/jails/jail.xxx.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/jails/jail.xxx.conf Wed Feb 10 04:04:31 2016 (r295457) @@ -0,0 +1,35 @@ +# $FreeBSD$ + +xxx { + host.hostname = "xxx.yyy"; # hostname + path = "/vm/xxx"; # root directory + + exec.clean; + exec.system_user = "root"; + exec.jail_user = "root"; + + # + # NB: Below 4-lines required + # + vnet; + # netgraph + vnet.interface = "ng0_xxx"; # vnet interface(s) + exec.prestart += "jng bridge xxx em0"; # bridge interface(s) + exec.poststop += "jng shutdown xxx"; # destroy interface(s) + # if_bridge + #vnet.interface = "e0b_xxx"; # vnet interface(s) + #exec.prestart += "jib addm xxx em0"; # bridge interface(s) + #exec.poststop += "jib destroy xxx"; # destroy interface(s) + + # Standard recipe + exec.start += "/bin/sh /etc/rc"; + exec.stop = "/bin/sh /etc/rc.shutdown"; + exec.consolelog = "/var/log/jail_xxx_console.log"; + mount.devfs; # mount devfs + + # Optional (default off) + #devfs_ruleset = "11"; # rule to unhide bpf for DHCP + #allow.mount; # mount /etc/fstab.xxx + #allow.set_hostname = 1; # Allow hostname to change + #allow.sysvipc = 1; # Allow SysV Interprocess Comm. +} Added: head/share/examples/jails/rc.conf.jails ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/jails/rc.conf.jails Wed Feb 10 04:04:31 2016 (r295457) @@ -0,0 +1,76 @@ +# $FreeBSD$ + +############################################################################### +############################# JAIL CONFIGURATIONS ############################# +############################################################################### + +jail_enable="YES" +jail_list="xxx" + +# +# Global presets for all jails +# +jail_devfs_enable="YES" # mount devfs +# Optional (default off) +#jail_sysvipc_allow="YES" # Allow SysV Interprocess Comm. +#jail_set_hostname_allow="YES" # Allow hostname to change + +# +# To allow dhclient(8) to work inside a jail, make sure the following appears +# in /etc/devfs.rules (which should be created if it doesn't exist): +# +# [devfsrules_jail=11] +# add include $devfsrules_hide_all +# add include $devfsrules_unhide_basic +# add include $devfsrules_unhide_login +# add path 'bpf*' unhide +# + +############################################################ JAILS + +# NETGRAPH TEMPLATE (copy/pate; then replace {name} with short name for jail) +# +# {name} +# +#jail_{name}_hostname="{name}.shxd.cx" # hostname +#jail_{name}_rootdir="/vm/{name}" # root directory +#jail_{name}_vnet_interfaces="ng0_{name}" # vnet interface(s) +#jail_{name}_exec_prestart0="jng bridge {name} em0" # bridge interface(s) +#jail_{name}_exec_poststop0="jng shutdown {name}" # destroy interface(s) +# Optional (default off) +#jail_{name}_devfs_ruleset="11" # rule to unhide bpf for DHCP +#jail_{name}_mount_enable="YES" # mount /etc/fstab.{name} + +# IF_BRIDGE TEMPLATE (copy/pate; then replace {name} with short name for jail) +# +# {name} +# +#jail_{name}_hostname="{name}.shxd.cx" # hostname +#jail_{name}_rootdir="/vm/{name}" # root directory +#jail_{name}_vnet_interfaces="e0b_{name}" # vnet interface(s) +#jail_{name}_exec_prestart0="jib addm {name} em0" # bridge interface(s) +#jail_{name}_exec_poststop0="jib destroy {name}" # destroy interface(s) +# Optional (default off) +#jail_{name}_devfs_ruleset="11" # rule to unhide bpf for DHCP +#jail_{name}_mount_enable="YES" # mount /etc/fstab.{name} + +# +# XXX +# +jail_xxx_hostname="xxx.yyy" # hostname +jail_xxx_rootdir="/vm/xxx" # root directory +# netgraph +jail_xxx_vnet_interface="ng0_xxx" # vnet interface(s) +jail_xxx_exec_prestart0="jng bridge xxx em0" # bridge interface(s) +jail_xxx_exec_poststop0="jng shutdown xxx" # destroy interface(s) +# if_bridge +#jail_xxx_vnet_interface="e0b_xxx" # vnet interface(s) +#jail_xxx_exec_prestart0="jib addm xxx em0" # bridge interface(s) +#jail_xxx_exec_poststop0="jib destroy xxx" # destroy interface(s) +# Optional (default off) +#jail_xxx_devfs_ruleset="11" # rule to unhide bpf for DHCP +#jail_xxx_mount_enable="YES" # mount /etc/fstab.xxx + +################################################################################ +# END +################################################################################ Added: head/share/examples/jails/rcjail.xxx.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/jails/rcjail.xxx.conf Wed Feb 10 04:04:31 2016 (r295457) @@ -0,0 +1,25 @@ +# $FreeBSD$ + +jail_xxx_hostname="xxx.yyy" # hostname +jail_xxx_rootdir="/vm/xxx" # root directory + +# +# NB: Below 3 lines required +# +# netgraph +jail_xxx_vnet_interface="ng0_xxx" # vnet interface(s) +jail_xxx_exec_prestart0="jng bridge xxx em0" # bridge interface(s) +jail_xxx_exec_poststop0="jng shutdown xxx" # destroy interface(s) +# if_bridge +#jail_xxx_vnet_interface="e0b_xxx" # vnet interface(s) +#jail_xxx_exec_prestart0="jib addm xxx em0" # bridge interface(s) +#jail_xxx_exec_poststop0="jib destroy xxx" # destroy interface(s) + +# Standard recipe +jail_xxx_devfs_enable="YES" # mount devfs + +# Optional (default off) +#jail_xxx_devfs_ruleset="11" # rule to unhide bpf for DHCP +#jail_xxx_mount_enable="YES" # mount /etc/fstab.xxx +#jail_xxx_set_hostname_allow="YES" # Allow hostname to change +#jail_xxx_sysvipc_allow="YES" # Allow SysV Interprocess Comm. From owner-svn-src-all@freebsd.org Wed Feb 10 04:43:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 889F4AA3AB7; Wed, 10 Feb 2016 04:43:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 4818C1B93; Wed, 10 Feb 2016 04:43:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1A4h89h000232; Wed, 10 Feb 2016 04:43:08 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1A4h80W000230; Wed, 10 Feb 2016 04:43:08 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201602100443.u1A4h80W000230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 10 Feb 2016 04:43:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295459 - in head/sys: arm/include sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 04:43:09 -0000 Author: adrian Date: Wed Feb 10 04:43:08 2016 New Revision: 295459 URL: https://svnweb.freebsd.org/changeset/base/295459 Log: Break out the shared bits of the arm intrng definitions into sys/intr.h; leave the machine dependent bits in sys/arm/. This is in preparation for MIPS INTRNG work. Submitted by: Stanislav Galabov Added: head/sys/sys/intr.h (contents, props changed) Modified: head/sys/arm/include/intr.h Modified: head/sys/arm/include/intr.h ============================================================================== --- head/sys/arm/include/intr.h Wed Feb 10 04:20:39 2016 (r295458) +++ head/sys/arm/include/intr.h Wed Feb 10 04:43:08 2016 (r295459) @@ -49,93 +49,7 @@ #define NIRQ 1024 /* XXX - It should be an option. */ #endif -#ifdef notyet -#define INTR_SOLO INTR_MD1 -typedef int intr_irq_filter_t(void *arg, struct trapframe *tf); -#else -typedef int intr_irq_filter_t(void *arg); -#endif - -#define INTR_ISRC_NAMELEN (MAXCOMLEN + 1) - -typedef void intr_ipi_filter_t(void *arg); - -enum intr_isrc_type { - INTR_ISRCT_NAMESPACE, - INTR_ISRCT_FDT -}; - -#define INTR_ISRCF_REGISTERED 0x01 /* registered in a controller */ -#define INTR_ISRCF_PERCPU 0x02 /* per CPU interrupt */ -#define INTR_ISRCF_BOUND 0x04 /* bound to a CPU */ - -/* Interrupt source definition. */ -struct intr_irqsrc { - device_t isrc_dev; /* where isrc is mapped */ - intptr_t isrc_xref; /* device reference key */ - uintptr_t isrc_data; /* device data for isrc */ - u_int isrc_irq; /* unique identificator */ - enum intr_isrc_type isrc_type; /* how is isrc decribed */ - u_int isrc_flags; - char isrc_name[INTR_ISRC_NAMELEN]; - uint16_t isrc_nspc_type; - uint16_t isrc_nspc_num; - enum intr_trigger isrc_trig; - enum intr_polarity isrc_pol; - cpuset_t isrc_cpu; /* on which CPUs is enabled */ - u_int isrc_index; - u_long * isrc_count; - u_int isrc_handlers; - struct intr_event * isrc_event; - intr_irq_filter_t * isrc_filter; - intr_ipi_filter_t * isrc_ipifilter; - void * isrc_arg; -#ifdef FDT - u_int isrc_ncells; - pcell_t isrc_cells[]; /* leave it last */ -#endif -}; - -void intr_irq_set_name(struct intr_irqsrc *isrc, const char *fmt, ...) - __printflike(2, 3); - -void intr_irq_dispatch(struct intr_irqsrc *isrc, struct trapframe *tf); - -#define INTR_IRQ_NSPC_NONE 0 -#define INTR_IRQ_NSPC_PLAIN 1 -#define INTR_IRQ_NSPC_IRQ 2 -#define INTR_IRQ_NSPC_IPI 3 - -u_int intr_namespace_map_irq(device_t dev, uint16_t type, uint16_t num); -#ifdef FDT -u_int intr_fdt_map_irq(phandle_t, pcell_t *, u_int); -#endif - -int intr_pic_register(device_t dev, intptr_t xref); -int intr_pic_unregister(device_t dev, intptr_t xref); -int intr_pic_claim_root(device_t dev, intptr_t xref, intr_irq_filter_t *filter, - void *arg, u_int ipicount); - -int intr_irq_add_handler(device_t dev, driver_filter_t, driver_intr_t, void *, - u_int, int, void **); -int intr_irq_remove_handler(device_t dev, u_int, void *); -int intr_irq_config(u_int, enum intr_trigger, enum intr_polarity); -int intr_irq_describe(u_int, void *, const char *); - -u_int intr_irq_next_cpu(u_int current_cpu, cpuset_t *cpumask); - -#ifdef SMP -int intr_irq_bind(u_int, int); - -void intr_ipi_dispatch(struct intr_irqsrc *isrc, struct trapframe *tf); - -#define AISHF_NOALLOC 0x0001 - -int intr_ipi_set_handler(u_int ipi, const char *name, intr_ipi_filter_t *filter, - void *arg, u_int flags); - -void intr_pic_init_secondary(void); -#endif +#include #else /* ARM_INTRNG */ Added: head/sys/sys/intr.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/intr.h Wed Feb 10 04:43:08 2016 (r295459) @@ -0,0 +1,130 @@ +/* $NetBSD: intr.h,v 1.7 2003/06/16 20:01:00 thorpej Exp $ */ + +/*- + * Copyright (c) 1997 Mark Brinicombe. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Mark Brinicombe + * for the NetBSD Project. + * 4. The name of the company nor the name of the author may be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * 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 OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef _SYS_INTR_H_ +#define _SYS_INTR_H_ + +#ifdef notyet +#define INTR_SOLO INTR_MD1 +typedef int intr_irq_filter_t(void *arg, struct trapframe *tf); +#else +typedef int intr_irq_filter_t(void *arg); +#endif + +#define INTR_ISRC_NAMELEN (MAXCOMLEN + 1) + +typedef void intr_ipi_filter_t(void *arg); + +enum intr_isrc_type { + INTR_ISRCT_NAMESPACE, + INTR_ISRCT_FDT +}; + +#define INTR_ISRCF_REGISTERED 0x01 /* registered in a controller */ +#define INTR_ISRCF_PERCPU 0x02 /* per CPU interrupt */ +#define INTR_ISRCF_BOUND 0x04 /* bound to a CPU */ + +/* Interrupt source definition. */ +struct intr_irqsrc { + device_t isrc_dev; /* where isrc is mapped */ + intptr_t isrc_xref; /* device reference key */ + uintptr_t isrc_data; /* device data for isrc */ + u_int isrc_irq; /* unique identificator */ + enum intr_isrc_type isrc_type; /* how is isrc decribed */ + u_int isrc_flags; + char isrc_name[INTR_ISRC_NAMELEN]; + uint16_t isrc_nspc_type; + uint16_t isrc_nspc_num; + enum intr_trigger isrc_trig; + enum intr_polarity isrc_pol; + cpuset_t isrc_cpu; /* on which CPUs is enabled */ + u_int isrc_index; + u_long * isrc_count; + u_int isrc_handlers; + struct intr_event * isrc_event; + intr_irq_filter_t * isrc_filter; + intr_ipi_filter_t * isrc_ipifilter; + void * isrc_arg; +#ifdef FDT + u_int isrc_ncells; + pcell_t isrc_cells[]; /* leave it last */ +#endif +}; + +void intr_irq_set_name(struct intr_irqsrc *isrc, const char *fmt, ...) + __printflike(2, 3); + +void intr_irq_dispatch(struct intr_irqsrc *isrc, struct trapframe *tf); + +#define INTR_IRQ_NSPC_NONE 0 +#define INTR_IRQ_NSPC_PLAIN 1 +#define INTR_IRQ_NSPC_IRQ 2 +#define INTR_IRQ_NSPC_IPI 3 + +u_int intr_namespace_map_irq(device_t dev, uint16_t type, uint16_t num); +#ifdef FDT +u_int intr_fdt_map_irq(phandle_t, pcell_t *, u_int); +#endif + +int intr_pic_register(device_t dev, intptr_t xref); +int intr_pic_unregister(device_t dev, intptr_t xref); +int intr_pic_claim_root(device_t dev, intptr_t xref, intr_irq_filter_t *filter, + void *arg, u_int ipicount); + +int intr_irq_add_handler(device_t dev, driver_filter_t, driver_intr_t, void *, + u_int, int, void **); +int intr_irq_remove_handler(device_t dev, u_int, void *); +int intr_irq_config(u_int, enum intr_trigger, enum intr_polarity); +int intr_irq_describe(u_int, void *, const char *); + +u_int intr_irq_next_cpu(u_int current_cpu, cpuset_t *cpumask); + +#ifdef SMP +int intr_irq_bind(u_int, int); + +void intr_ipi_dispatch(struct intr_irqsrc *isrc, struct trapframe *tf); + +#define AISHF_NOALLOC 0x0001 + +int intr_ipi_set_handler(u_int ipi, const char *name, intr_ipi_filter_t *filter, + void *arg, u_int flags); + +void intr_pic_init_secondary(void); + +#endif +#endif /* _SYS_INTR_H */ From owner-svn-src-all@freebsd.org Wed Feb 10 04:56:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA74BAA3FD0; Wed, 10 Feb 2016 04:56:39 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 BC83E1F8D; Wed, 10 Feb 2016 04:56:39 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1A4ucNg003417; Wed, 10 Feb 2016 04:56:38 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1A4uc9Z003416; Wed, 10 Feb 2016 04:56:38 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201602100456.u1A4uc9Z003416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 10 Feb 2016 04:56:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295460 - head/share/examples/jails X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 04:56:40 -0000 Author: dteske Date: Wed Feb 10 04:56:38 2016 New Revision: 295460 URL: https://svnweb.freebsd.org/changeset/base/295460 Log: Add `stats' command to get ng_bridge(4) stats Modified: head/share/examples/jails/jng Modified: head/share/examples/jails/jng ============================================================================== --- head/share/examples/jails/jng Wed Feb 10 04:43:08 2016 (r295459) +++ head/share/examples/jails/jng Wed Feb 10 04:56:38 2016 (r295460) @@ -154,6 +154,7 @@ usage() show \ show1 \ shutdown \ + stats \ ; do eval usage=\"\$jng_${action}_usage\" [ "$usage" ] || continue @@ -414,6 +415,39 @@ jng_shutdown() jng_show "$name" | xargs -rn1 -I eiface ngctl shutdown eiface: } +jng_stats_usage="stats NAME" +jng_stats_descr="Show ng_bridge link statistics for NAME interfaces" +jng_stats() +{ + local OPTIND=1 OPTARG flag + while getopts "" flag; do + case "$flag" in + *) action_usage stats # NOTREACHED + esac + done + shift $(( $OPTIND -1 )) + local name="$1" + [ "${name:-x}" = "${name#*[!0-9a-zA-Z_]}" -a $# -eq 1 ] || + action_usage stats # NOTREACHED + mustberoot_to_continue + for eiface in $( jng_show "$name" ); do + echo "$eiface:" + ngctl show $eiface: | awk ' + $3 == "bridge" && $5 ~ /^link/ { + bridge = $2 + link = substr($5, 5) + system(sprintf("ngctl msg %s: getstats %u", + bridge, link)) + }' | fmt 2 | awk ' + /=/ && fl = index($0, "=") { + printf "%20s = %s\n", + substr($0, 0, fl-1), + substr($0, 0, fl+1) + } + ' # END-QUOTE + done +} + ############################################################ MAIN # From owner-svn-src-all@freebsd.org Wed Feb 10 07:01:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00CF9AA36F0; Wed, 10 Feb 2016 07:01:09 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x231.google.com (mail-pa0-x231.google.com [IPv6:2607:f8b0:400e:c03::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C9714D3F; Wed, 10 Feb 2016 07:01:08 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x231.google.com with SMTP id cy9so7412710pac.0; Tue, 09 Feb 2016 23:01:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=GnQEtcAxbypoXH5PFZodPi075dflGXLDniOSQ4HQEs8=; b=P/t52CgVb8jG7Duyhk4ZZM/OGOLG3UOan5NSRREITbpVqNgHNskNjFd4itrYE8jnbu c4TuNDe+hbJfDm6x+WdaFI+U4f38U+8OEy6oqcOdxRjiDYUqVBA5NU0wtwuUx+TOwho0 JcTT38BsZ56vRLor58z0vD11l+ZOGyYB7EqJU3hkjQ+f9p7jkVPfO7zLWdV1O1RiOH1P CtkoL6KZw8kqNVQpoU9O0Fl4jKxdWMc/O6I9DS6RaAsxHzvbtnqWH+7WLE+TBAvvzgMv Huq2YZ5ljGE9Mdl7oxdAKKHMY8fGk9QXd1FU/f/Qov43JVlgl9WrdNhAU8If/E5ak4m9 J1+g== 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=GnQEtcAxbypoXH5PFZodPi075dflGXLDniOSQ4HQEs8=; b=KW5e8ovAsTzZImdmbaMlRHNDAHbZ2iBO/IhRVXHPOjWxnxKzb+PxsVHpzKkGqXiSVu iJ9R8TnM36lcBhTxOz+9Slyh71UfISsCJb5d4puTX1eP5C6k4pg0rBb46V5jC3ZSqdJO aoM+qKK2H4kSsoUN+J/H7DA+pYOLf7IHQzsfSLmXyOZyvIA68pbdlBvG1s/tCcZhLDcg zGktTpDHLd8o7TLEsNcWO6gMLYi0QdcJza92lcxWCGJ31luBbhYCijSUFmeU4LhaFT3q cwo7NIWM+QLYXdLcBK0fpFbrtxz2a+4mNU1x43b77MDw5m8IzzzKD1wQ+Np5duTlRmM/ HesQ== X-Gm-Message-State: AG10YOTzer5CmBrobQE+YjtXD6sTxZwL9sm7vBF5Re0OxOoJSzGrDL3bWiMp8C5BO7TJzw== X-Received: by 10.66.100.196 with SMTP id fa4mr37244637pab.37.1455087668514; Tue, 09 Feb 2016 23:01:08 -0800 (PST) Received: from [22.44.143.85] ([172.56.40.209]) by smtp.gmail.com with ESMTPSA id s197sm2395886pfs.62.2016.02.09.23.01.06 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 09 Feb 2016 23:01:06 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r295455 - head From: NGie Cooper X-Mailer: iPhone Mail (13D15) In-Reply-To: <201602100026.u1A0Q1RA024264@repo.freebsd.org> Date: Tue, 9 Feb 2016 23:01:05 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201602100026.u1A0Q1RA024264@repo.freebsd.org> To: Baptiste Daroussin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 07:01:09 -0000 > On Feb 9, 2016, at 16:26, Baptiste Daroussin wrote: >=20 > Author: bapt > Date: Wed Feb 10 00:26:01 2016 > New Revision: 295455 > URL: https://svnweb.freebsd.org/changeset/base/295455 >=20 > Log: > Fix make universe when running with non POSIX/C locales using a locale se= nsitive > pattern >=20 > Reported by: many > Submitted by: jilles Please. Please MFC this. > Modified: > head/Makefile >=20 > Modified: head/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/Makefile Wed Feb 10 00:08:51 2016 (r295454) > +++ head/Makefile Wed Feb 10 00:26:01 2016 (r295455) > @@ -466,7 +466,8 @@ _THINNER=3Dcat > _THINNER=3Dxargs grep -L "^.NO_UNIVERSE" || true > .endif > KERNCONFS!=3D cd ${KERNSRCDIR}/${TARGET}/conf && \ > - find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \ > + find [[:upper:][:digit:]]*[[:upper:][:digit:]] \ > + -type f -maxdepth 0 \ > ! -name DEFAULTS ! -name NOTES | \ > ${_THINNER} > universe_kernconfs: >=20 From owner-svn-src-all@freebsd.org Wed Feb 10 07:06:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C989AA3924; Wed, 10 Feb 2016 07:06:49 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-lb0-x235.google.com (mail-lb0-x235.google.com [IPv6:2a00:1450:4010:c04::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B6B9A106F; Wed, 10 Feb 2016 07:06:48 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-lb0-x235.google.com with SMTP id cw1so5227747lbb.1; Tue, 09 Feb 2016 23:06:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=UUquCYZt/++Jav3u9ND+6Vzxq4YL4ZS7QdNaCBkR5lI=; b=m8LXjwr7RjfRHdaEermd/j4bftzrzsnni9saq5Wa7i28PU7vL6lai0VzKNwYlGMLr9 VwQgFiXJxLgw1HDTFDv4MMm3up84OXKtHAO9gSa+aQFwXbjH+D+OKqFRmoz+jw6YiQbz riuJwcSyTKijAH52e9ncn9zwdiXg/BHvkml+bLs28UZdH7i7mAyRTHdfNpuOUypaJwSQ 2IU+R/svSnuyCYszpynl7D03K61fq8IpYARxRO/9D8suIckvUqulyJzUNO5VcplJ/yeF zOyOWw0gtovGBJs/Qb3VXvEBKjRHCQOZ2BvJ6CkcddOzmx/Fsi5aJFhPRXNiAzOeG71c P/9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=UUquCYZt/++Jav3u9ND+6Vzxq4YL4ZS7QdNaCBkR5lI=; b=P+4DKIVOYNcvXyw7q14VFAxxWHtNQkqpJI/W3yR4iLxv374bXaEdMe56bVuxvD1lUo qWwDJ/TWh9I03SBd7B/PGYbPbeMH5a6O+zSGeKYWKYhXUSWyXKAAqv3lUMiVdf+SOJFx APmCimmXutPZBnFe4hKg1WnqR/PwuJcXIRev5Uc3qL4BPnP84UPZkqZmStxk+Eem+wCA oAZJ52ZfJ+O/tIQ6DT6n2Yz2zVHaRyflg+xZCH07toPbse8wyjW4qbmIbYdohDx5N8Dl /RI4FWe0NHPgjtpn26zfQ1vocwCQiHFtYFkK1Gddywk6YN93z4H0OoWHuoYeWUoZi+dB KHPw== X-Gm-Message-State: AG10YOSzbbbjuXGpQtCjRSzrjoNMU29LTL8M+22tITSUSJWTC+kniIEW/RWb3Mj+fJbNwA== X-Received: by 10.112.148.33 with SMTP id tp1mr15900282lbb.52.1455088006878; Tue, 09 Feb 2016 23:06:46 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id o9sm239432lfe.15.2016.02.09.23.06.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Feb 2016 23:06:46 -0800 (PST) Sender: Baptiste Daroussin Date: Wed, 10 Feb 2016 08:06:43 +0100 From: Baptiste Daroussin To: NGie Cooper Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r295455 - head Message-ID: <20160210070643.GG1141@ivaldir.etoilebsd.net> References: <201602100026.u1A0Q1RA024264@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="XRI2XbIfl/05pQwm" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 07:06:49 -0000 --XRI2XbIfl/05pQwm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 09, 2016 at 11:01:05PM -0800, NGie Cooper wrote: >=20 > > On Feb 9, 2016, at 16:26, Baptiste Daroussin wrote: > >=20 > > Author: bapt > > Date: Wed Feb 10 00:26:01 2016 > > New Revision: 295455 > > URL: https://svnweb.freebsd.org/changeset/base/295455 > >=20 > > Log: > > Fix make universe when running with non POSIX/C locales using a locale= sensitive > > pattern > >=20 > > Reported by: many > > Submitted by: jilles >=20 > Please. Please MFC this. Sure I will I forgot to note it but I will Best regards, Bapt --XRI2XbIfl/05pQwm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWuuGDAAoJEGOJi9zxtz5aI74P/0Rplf9b48P4JC9SboMjyDob JSo9kAsmJpK7g0DXWJ6LO8cOsUaAhb4TqoWwKj52PfxrcmFT7kj2fBqXlcJJiCkD SPtJGXcx7/K4ikRkcmT1a2ChtKxvHaXgQScaQbfCgEasLiR5Fgw9Y+G6cP/hhLcv iZO9SCR3RdUHUlay3J6AmWkYQtxtXt6g1g9m8w2lXSMaA9szzW+l0UTKjzBbJZzT mlLJwaLvfyADYC0PfvICW5pOBWx1kL9RZ8Dewg4MfFfoQtHWNHOaIrHDhT2FYDF1 0yLbFQ6e2/RI7/rU2W0ywpre/1dtvTzR5vjfJ5WISKVta/I6VHSQWKQ45pxMuktI 4sjo3zik5uQAgEaOlcK9HNWDxsttMycxDpu1vBASfaOoNv0vIVFXeITi2bUpiIY8 NQpw9SiK1PuwrT15ieqmHdNVgo4mY0XwZqW44ye8XCPQ1XWc43BaIqC+GBuEaX6/ bo6kzv76lst8G4+tla4f4veOkixcqZByfgQABTzkezLtPflfiU2JcsWoSh0x1OUP E4YuphAkYpOpjLeCP6cUUJ7ZiVw4zJQyrqDaMNxkeAS7tIzEsbv21qtrpDBcVOLk hMJyUbDHEBN9aZ0LiaRWgGrTc+SNggHXEIAg6aTbNgDrYKmuwicwC1PrNYQBuLuL Yp+Y/9lOd3iBKXgHQkiK =Lo71 -----END PGP SIGNATURE----- --XRI2XbIfl/05pQwm-- From owner-svn-src-all@freebsd.org Wed Feb 10 07:16:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59D82AA3DA9; Wed, 10 Feb 2016 07:16:19 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 24F3A1471; Wed, 10 Feb 2016 07:16:19 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1A7GInI044537; Wed, 10 Feb 2016 07:16:18 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1A7GHeg044528; Wed, 10 Feb 2016 07:16:17 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201602100716.u1A7GHeg044528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 10 Feb 2016 07:16: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: r295461 - in stable/10/etc: . defaults mtree ntp periodic/daily 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 07:16:19 -0000 Author: cy Date: Wed Feb 10 07:16:17 2016 New Revision: 295461 URL: https://svnweb.freebsd.org/changeset/base/295461 Log: MFC r289421, r293037, r294773, and r294884. ntp leap-leapseconds support. r289421: Add default leap-seconds file. This should help ntp networks get the leap second date correct Updates to the file can be obtained from ftp://time.nist.gov/pub/ or ftp://tycho.usno.navy.mil/pub/ntp/. r293037: Update leap-seconds to latest. This will satisfy the ntpd leap-second version check. r294773: Add support for automatic leap-second file updates. The working copy of leapfile resides in /var/dbntpd.leap-seconds.list. /etc/ntp/leap-seconds (periodically updated from ftp://time.nist.gov/pub/ or ftp://tycho.usno.navy.mil/pub/ntp/) contains the master copy should automatic leapfile updates be disabled (default). Automatic leapfile updates are fetched from $ntp_leapfile_sources, defaulting to https://www.ietf.org/timezones/data/leap-seconds.list, within $ntp_leapfile_expiry_days (default 30 days) from leap-seconds file expiry. Automatic updates can be enabled by setting $daily_ntpd_leapfile_enable="YES" in periodic.conf. To avoid congesting the ntp leapfile source the automatic update randomized by default but can be disabled through daily_ntpd_avoid_congestion="NO" in periodic.conf. r294884: Allow specification of fetch options for ntp leap-seconds fetch. Approved by: re (gjb) Added: stable/10/etc/ntp/ - copied from r289421, head/etc/ntp/ stable/10/etc/periodic/daily/480.leapfile-ntpd - copied unchanged from r294773, head/etc/periodic/daily/480.leapfile-ntpd Modified: stable/10/etc/Makefile stable/10/etc/defaults/periodic.conf stable/10/etc/defaults/rc.conf stable/10/etc/mtree/BSD.var.dist stable/10/etc/ntp.conf stable/10/etc/ntp/leap-seconds stable/10/etc/periodic/daily/Makefile stable/10/etc/rc.d/ntpd Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/Makefile ============================================================================== --- stable/10/etc/Makefile Wed Feb 10 04:56:38 2016 (r295460) +++ stable/10/etc/Makefile Wed Feb 10 07:16:17 2016 (r295461) @@ -244,6 +244,9 @@ distribution: ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install ${_+_}cd ${.CURDIR}/devd; ${MAKE} install ${_+_}cd ${.CURDIR}/gss; ${MAKE} install +.if ${MK_NTP} != "no" + ${_+_}cd ${.CURDIR}/ntp; ${MAKE} install +.endif ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install .if ${MK_PKGBOOTSTRAP} != "no" ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install Modified: stable/10/etc/defaults/periodic.conf ============================================================================== --- stable/10/etc/defaults/periodic.conf Wed Feb 10 04:56:38 2016 (r295460) +++ stable/10/etc/defaults/periodic.conf Wed Feb 10 07:16:17 2016 (r295461) @@ -138,6 +138,11 @@ daily_status_mail_rejects_enable="YES" daily_status_mail_rejects_logs=3 # How many logs to check daily_status_mail_rejects_shorten="NO" # Shorten output +# 480.leapfile-ntpd +daily_ntpd_leapfile_enable="NO" # Fetch NTP leapfile +daily_ntpd_avoid_congestion="YES" # Avoid congesting + # leapfile sources + # 480.status-ntpd daily_status_ntpd_enable="NO" # Check NTP status Modified: stable/10/etc/defaults/rc.conf ============================================================================== --- stable/10/etc/defaults/rc.conf Wed Feb 10 04:56:38 2016 (r295460) +++ stable/10/etc/defaults/rc.conf Wed Feb 10 07:16:17 2016 (r295461) @@ -366,6 +366,17 @@ ntpd_config="/etc/ntp.conf" # ntpd(8) co ntpd_sync_on_start="NO" # Sync time on ntpd startup, even if offset is high ntpd_flags="-p /var/run/ntpd.pid -f /var/db/ntpd.drift" # Flags to ntpd (if enabled). +ntp_src_leapfile="/etc/ntp/leap-seconds" + # Initial source for ntpd leapfile +ntp_db_leapfile="/var/db/ntpd.leap-seconds.list" + # Working copy (updated weekly) leapfile +ntp_leapfile_sources="https://www.ietf.org/timezones/data/leap-seconds.list" + # Source from which to fetch leapfile +ntp_leapfile_fetch_opts="-mq" # Options to use for ntp leapfile fetch, + # e.g. --no-verify-peer +ntp_leapfile_expiry_days=30 # Check for new leapfile 30 days prior to + # expiry. +ntp_leapfile_fetch_verbose="NO" # Be verbose during NTP leapfile fetch # Network Information Services (NIS) options: All need rpcbind_enable="YES" ### nis_client_enable="NO" # We're an NIS client (or NO). Modified: stable/10/etc/mtree/BSD.var.dist ============================================================================== --- stable/10/etc/mtree/BSD.var.dist Wed Feb 10 04:56:38 2016 (r295460) +++ stable/10/etc/mtree/BSD.var.dist Wed Feb 10 07:16:17 2016 (r295461) @@ -46,6 +46,8 @@ .. ipf mode=0700 .. + ntp mode=0700 + .. pkg .. ports Modified: stable/10/etc/ntp.conf ============================================================================== --- stable/10/etc/ntp.conf Wed Feb 10 04:56:38 2016 (r295460) +++ stable/10/etc/ntp.conf Wed Feb 10 07:16:17 2016 (r295461) @@ -77,3 +77,10 @@ restrict 127.127.1.0 # #server 127.127.1.0 #fudge 127.127.1.0 stratum 10 + +# See http://support.ntp.org/bin/view/Support/ConfiguringNTP#Section_6.14. +# for documentation regarding leapfile. Updates to the file can be obtained +# from ftp://time.nist.gov/pub/ or ftp://tycho.usno.navy.mil/pub/ntp/. +# Use either leapfile in /etc/ntp or weekly updated leapfile in /var/db. +#leapfile "/etc/ntp/leap-seconds" +leapfile "/var/db/ntpd.leap-seconds.list" Modified: stable/10/etc/ntp/leap-seconds ============================================================================== --- head/etc/ntp/leap-seconds Fri Oct 16 14:04:16 2015 (r289421) +++ stable/10/etc/ntp/leap-seconds Wed Feb 10 07:16:17 2016 (r295461) @@ -1,119 +1,221 @@ # # $FreeBSD$ # -# ATOMIC TIME. -# The Coordinated Universal Time (UTC) is the reference time scale derived -# from The "Temps Atomique International" (TAI) calculated by the Bureau -# International des Poids et Mesures (BIPM) using a worldwide network of atomic -# clocks. UTC differs from TAI by an integer number of seconds; it is the basis -# of all activities in the world. -# -# -# ASTRONOMICAL TIME (UT1) is the time scale based on the rate of rotation of the earth. -# It is now mainly derived from Very Long Baseline Interferometry (VLBI). The various -# irregular fluctuations progressively detected in the rotation rate of the Earth lead -# in 1972 to the replacement of UT1 by UTC as the reference time scale. -# -# -# LEAP SECOND -# Atomic clocks are more stable than the rate of the earth rotatiob since the later -# undergoes a full range of geophysical perturbations at various time scales (lunisolar -# and core-mantle torques,atmospheric and oceanic effetcs, ...) -# Leap seconds are needed to keep the two time scales in agreement, i.e. UT1-UTC smaller -# than 0.9 second. So, when necessary a "leap second" is introduced in UTC. -# Since the adoption of this system in 1972 it has been necessary to add 26 seconds to UTC, -# firstly due to the initial choice of the value of the second (1/86400 mean solar day of -# the year 1820) and secondly to the general slowing down of the Earth's rotation. It is -# theorically possible to have a negative leap second (a second removed from UTC), but so far, -# all leap seconds have been positive (a second has been added to UTC). Based on what we know about the earth's rotation, -# it is unlikely that we will ever have a negative leap second. -# -# -# HISTORY -# The first leap second was added on June 30, 1972. Until 2000, it was necessary in average to add a leap second at a rate -# of 1 to 2 years. Since 2000, due to the fact that the earth rate of rotation is accelerating, leap seconds are introduced -# with an average frequency of 3 to 4 years. -# -# -# RESPONSABILITY OF THE DECISION TO INTRODUCE A LEAP SECOND IN UTC -# The decision to introduce a leap second in UTC is the responsibility of the Earth Orientation Center of -# the International Earth Rotation and reference System Service (IERS). This center is located at Paris -# Observatory. According to international agreements, leap second date have to occur at fixed date : -# first preference is given to the end of December and June, and second preference at the end of March -# and September. Since the system was introduced in 1972, only dates in June and December were used. -# -# Questions or comments to: -# Daniel Gambis, daniel.gambis@obspm.fr -# Christian Bizouard: christian.bizouard@obspm.fr -# Earth orientation Center of the IERS -# Paris Observatory, France -# -# -# -# VALIDITY OF THE FILE -# It is important to express the validity of the file. These next two dates are -# given in units of seconds since 1900.0. -# -# 1) Last update of the file. -# -# Updated through IERS Bulletin C (ftp://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat) -# -# The following line shows the last update of this file in NTP timestamp: -# -#$ 3645216000 -# -# 2) Expiration date of the file given on a semi-annual basis: last June or last December -# -# File expires on 28 December 2015 -# -# Expire date in NTP timestamp: -# -#@ 3660249600 -# -# -# LIST OF LEAP SECONDS -# NTP timestamp (X parameter) is the number of seconds since 1900.0 -# -# MJD: The Modified Julian Day number. MJD = X/86400 + 15020 -# -# DTAI: The difference DTAI= TAI-UTC in units of seconds -# It is the quantity to add to UTC to get the time in TAI -# -# Day Month Year : epoch in clear -# -#NTP Time DTAI Day Month Year -# -2272060800 10 # 1 Jan 1972 -2287785600 11 # 1 Jul 1972 -2303683200 12 # 1 Jan 1973 -2335219200 13 # 1 Jan 1974 -2366755200 14 # 1 Jan 1975 -2398291200 15 # 1 Jan 1976 -2429913600 16 # 1 Jan 1977 -2461449600 17 # 1 Jan 1978 -2492985600 18 # 1 Jan 1979 -2524521600 19 # 1 Jan 1980 -2571782400 20 # 1 Jul 1981 -2603318400 21 # 1 Jul 1982 -2634854400 22 # 1 Jul 1983 -2698012800 23 # 1 Jul 1985 -2776982400 24 # 1 Jan 1988 -2840140800 25 # 1 Jan 1990 -2871676800 26 # 1 Jan 1991 -2918937600 27 # 1 Jul 1992 -2950473600 28 # 1 Jul 1993 -2982009600 29 # 1 Jul 1994 -3029443200 30 # 1 Jan 1996 -3076704000 31 # 1 Jul 1997 -3124137600 32 # 1 Jan 1999 -3345062400 33 # 1 Jan 2006 -3439756800 34 # 1 Jan 2009 -3550089600 35 # 1 Jul 2012 -3644697600 36 # 1 Jul 2015 -# -# In order to verify the integrity of this file, a hash code -# has been generated. For more information how to use -# this hash code, please consult the README file under the -# 'sha' repertory. +# In the following text, the symbol '#' introduces +# a comment, which continues from that symbol until +# the end of the line. A plain comment line has a +# whitespace character following the comment indicator. +# There are also special comment lines defined below. +# A special comment will always have a non-whitespace +# character in column 2. +# +# A blank line should be ignored. +# +# The following table shows the corrections that must +# be applied to compute International Atomic Time (TAI) +# from the Coordinated Universal Time (UTC) values that +# are transmitted by almost all time services. +# +# The first column shows an epoch as a number of seconds +# since 1900.0 and the second column shows the number of +# seconds that must be added to UTC to compute TAI for +# any timestamp at or after that epoch. The value on +# each line is valid from the indicated initial instant +# until the epoch given on the next one or indefinitely +# into the future if there is no next line. +# (The comment on each line shows the representation of +# the corresponding initial epoch in the usual +# day-month-year format. The epoch always begins at +# 00:00:00 UTC on the indicated day. See Note 5 below.) +# +# Important notes: +# +# 1. Coordinated Universal Time (UTC) is often referred to +# as Greenwich Mean Time (GMT). The GMT time scale is no +# longer used, and the use of GMT to designate UTC is +# discouraged. +# +# 2. The UTC time scale is realized by many national +# laboratories and timing centers. Each laboratory +# identifies its realization with its name: Thus +# UTC(NIST), UTC(USNO), etc. The differences among +# these different realizations are typically on the +# order of a few nanoseconds (i.e., 0.000 000 00x s) +# and can be ignored for many purposes. These differences +# are tabulated in Circular T, which is published monthly +# by the International Bureau of Weights and Measures +# (BIPM). See www.bipm.fr for more information. +# +# 3. The current defintion of the relationship between UTC +# and TAI dates from 1 January 1972. A number of different +# time scales were in use before than epoch, and it can be +# quite difficult to compute precise timestamps and time +# intervals in those "prehistoric" days. For more information, +# consult: +# +# The Explanatory Supplement to the Astronomical +# Ephemeris. +# or +# Terry Quinn, "The BIPM and the Accurate Measurement +# of Time," Proc. of the IEEE, Vol. 79, pp. 894-905, +# July, 1991. +# +# 4. The insertion of leap seconds into UTC is currently the +# responsibility of the International Earth Rotation Service, +# which is located at the Paris Observatory: +# +# Central Bureau of IERS +# 61, Avenue de l'Observatoire +# 75014 Paris, France. +# +# Leap seconds are announced by the IERS in its Bulletin C +# +# See hpiers.obspm.fr or www.iers.org for more details. +# +# All national laboratories and timing centers use the +# data from the BIPM and the IERS to construct their +# local realizations of UTC. +# +# Although the definition also includes the possibility +# of dropping seconds ("negative" leap seconds), this has +# never been done and is unlikely to be necessary in the +# foreseeable future. +# +# 5. If your system keeps time as the number of seconds since +# some epoch (e.g., NTP timestamps), then the algorithm for +# assigning a UTC time stamp to an event that happens during a positive +# leap second is not well defined. The official name of that leap +# second is 23:59:60, but there is no way of representing that time +# in these systems. +# Many systems of this type effectively stop the system clock for +# one second during the leap second and use a time that is equivalent +# to 23:59:59 UTC twice. For these systems, the corresponding TAI +# timestamp would be obtained by advancing to the next entry in the +# following table when the time equivalent to 23:59:59 UTC +# is used for the second time. Thus the leap second which +# occurred on 30 June 1972 at 23:59:59 UTC would have TAI +# timestamps computed as follows: +# +# ... +# 30 June 1972 23:59:59 (2287785599, first time): TAI= UTC + 10 seconds +# 30 June 1972 23:59:60 (2287785599,second time): TAI= UTC + 11 seconds +# 1 July 1972 00:00:00 (2287785600) TAI= UTC + 11 seconds +# ... +# +# If your system realizes the leap second by repeating 00:00:00 UTC twice +# (this is possible but not usual), then the advance to the next entry +# in the table must occur the second time that a time equivlent to +# 00:00:00 UTC is used. Thus, using the same example as above: +# +# ... +# 30 June 1972 23:59:59 (2287785599): TAI= UTC + 10 seconds +# 30 June 1972 23:59:60 (2287785600, first time): TAI= UTC + 10 seconds +# 1 July 1972 00:00:00 (2287785600,second time): TAI= UTC + 11 seconds +# ... +# +# in both cases the use of timestamps based on TAI produces a smooth +# time scale with no discontinuity in the time interval. +# +# This complexity would not be needed for negative leap seconds (if they +# are ever used). The UTC time would skip 23:59:59 and advance from +# 23:59:58 to 00:00:00 in that case. The TAI offset would decrease by +# 1 second at the same instant. This is a much easier situation to deal +# with, since the difficulty of unambiguously representing the epoch +# during the leap second does not arise. +# +# Questions or comments to: +# Jeff Prillaman +# Time Service Department +# US Naval Observatory +# Washington, DC +# jeffrey.prillaman@usno.navy.mil +# +# Last Update of leap second values: 31 Dec 2015 +# +# The following line shows this last update date in NTP timestamp +# format. This is the date on which the most recent change to +# the leap second data was added to the file. This line can +# be identified by the unique pair of characters in the first two +# columns as shown below. +# +#$ 3660508800 +# +# The data in this file will be updated periodically as new leap +# seconds are announced. In addition to being entered on the line +# above, the update time (in NTP format) will be added to the basic +# file name leap-seconds to form the name leap-seconds.. +# In addition, the generic name leap-seconds.list will always point to +# the most recent version of the file. +# +# This update procedure will be performed only when a new leap second +# is announced. +# +# The following entry specifies the expiration date of the data +# in this file in units of seconds since 1900.0. This expiration date +# will be changed at least twice per year whether or not a new leap +# second is announced. These semi-annual changes will be made no +# later than 1 June and 1 December of each year to indicate what +# action (if any) is to be taken on 30 June and 31 December, +# respectively. (These are the customary effective dates for new +# leap seconds.) This expiration date will be identified by a +# unique pair of characters in columns 1 and 2 as shown below. +# In the unlikely event that a leap second is announced with an +# effective date other than 30 June or 31 December, then this +# file will be edited to include that leap second as soon as it is +# announced or at least one month before the effective date +# (whichever is later). +# If an announcement by the IERS specifies that no leap second is +# scheduled, then only the expiration date of the file will +# be advanced to show that the information in the file is still +# current -- the update time stamp, the data and the name of the file +# will not change. +# +# Updated through IERS Bulletin C 50 +# File expires on: 1 Jun 2016 +# +#@ 3673728000 +# +2272060800 10 # 1 Jan 1972 +2287785600 11 # 1 Jul 1972 +2303683200 12 # 1 Jan 1973 +2335219200 13 # 1 Jan 1974 +2366755200 14 # 1 Jan 1975 +2398291200 15 # 1 Jan 1976 +2429913600 16 # 1 Jan 1977 +2461449600 17 # 1 Jan 1978 +2492985600 18 # 1 Jan 1979 +2524521600 19 # 1 Jan 1980 +2571782400 20 # 1 Jul 1981 +2603318400 21 # 1 Jul 1982 +2634854400 22 # 1 Jul 1983 +2698012800 23 # 1 Jul 1985 +2776982400 24 # 1 Jan 1988 +2840140800 25 # 1 Jan 1990 +2871676800 26 # 1 Jan 1991 +2918937600 27 # 1 Jul 1992 +2950473600 28 # 1 Jul 1993 +2982009600 29 # 1 Jul 1994 +3029443200 30 # 1 Jan 1996 +3076704000 31 # 1 Jul 1997 +3124137600 32 # 1 Jan 1999 +3345062400 33 # 1 Jan 2006 +3439756800 34 # 1 Jan 2009 +3550089600 35 # 1 Jul 2012 +3644697600 36 # 1 Jul 2015 +# +# the following special comment contains the +# hash value of the data in this file computed +# use the secure hash algorithm as specified +# by FIPS 180-1. See the files in ~/sha for +# the details of how this hash value is +# computed. Note that the hash computation +# ignores comments and whitespace characters +# in data lines. It includes the NTP values +# of both the last modification time and the +# expiration time of the file, but not the +# white space on those lines. +# the hash line is also ignored in the +# computation. +# +#h 44a44c49 35b22601 a9c7054c 8c56cf57 9b6f6ed5 # -#h 620ba8af 37900668 95ac09ba d77640f9 6fd75493 Copied: stable/10/etc/periodic/daily/480.leapfile-ntpd (from r294773, head/etc/periodic/daily/480.leapfile-ntpd) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/etc/periodic/daily/480.leapfile-ntpd Wed Feb 10 07:16:17 2016 (r295461, copy of r294773, head/etc/periodic/daily/480.leapfile-ntpd) @@ -0,0 +1,28 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ] +then + . /etc/defaults/periodic.conf + source_periodic_confs +fi + +case "$daily_ntpd_leapfile_enable" in + [Yy][Ee][Ss]) + case "$daily_ntpd_avoid_congestion" in + [Yy][Ee][Ss]) + # Avoid dogpiling + (sleep $(jot -r 1 0 86400); service ntpd fetch) & + ;; + *) + service ntpd fetch + ;; + esac + ;; +esac + +exit $rc Modified: stable/10/etc/periodic/daily/Makefile ============================================================================== --- stable/10/etc/periodic/daily/Makefile Wed Feb 10 04:56:38 2016 (r295460) +++ stable/10/etc/periodic/daily/Makefile Wed Feb 10 07:16:17 2016 (r295461) @@ -34,7 +34,8 @@ FILES+= 130.clean-msgs .endif .if ${MK_NTP} != "no" -FILES+= 480.status-ntpd +FILES+= 480.status-ntpd \ + 480.leapfile-ntpd .endif .if ${MK_PKGTOOLS} != "no" Modified: stable/10/etc/rc.d/ntpd ============================================================================== --- stable/10/etc/rc.d/ntpd Wed Feb 10 04:56:38 2016 (r295460) +++ stable/10/etc/rc.d/ntpd Wed Feb 10 07:16:17 2016 (r295461) @@ -14,6 +14,8 @@ name="ntpd" rcvar="ntpd_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" +extra_commands="fetch" +fetch_cmd="ntpd_fetch_leapfile" start_precmd="ntpd_precmd" load_rc_config $name @@ -30,6 +32,10 @@ ntpd_precmd() return 0; fi + if [ ! -f $ntp_db_leapfile ]; then + ntpd_fetch_leapfile + fi + # If running in a chroot cage, ensure that the appropriate files # exist inside the cage, as well as helper symlinks into the cage # from outside. @@ -44,10 +50,71 @@ ntpd_precmd() ( cd /dev ; /bin/pax -rw -pe clockctl "${ntpd_chrootdir}/dev" ) fi ln -fs "${ntpd_chrootdir}/var/db/ntp.drift" /var/db/ntp.drift + ln -fs "${ntpd_chrootdir}${ntp_tmp_leapfile}" ${ntp_tmp_leapfile} # Change run_rc_commands()'s internal copy of $ntpd_flags # rc_flags="-u ntpd:ntpd -i ${ntpd_chrootdir} $rc_flags" } +current_ntp_ts() { + # Seconds between 1900-01-01 and 1970-01-01 + # echo $(((70*365+17)*86400)) + ntp_to_unix=2208988800 + + echo $(($(date -u +%s)+$ntp_to_unix)) +} + +get_ntp_leapfile_ver() { + expr "$(awk '$1 == "#$" { print $2 }' "$1" 2>/dev/null)" : \ + '^\([1-9][0-9]*\)$' \| 0 +} + +get_ntp_leapfile_expiry() { + expr "$(awk '$1 == "#@" { print $2 }' "$1" 2>/dev/null)" : \ + '^\([1-9][0-9]*\)$' \| 0 +} + +ntpd_fetch_leapfile() { + local ntp_tmp_leapfile rc verbose + + if checkyesno ntp_leapfile_fetch_verbose; then + verbose=echo + else + verbose=: + fi + + ntp_tmp_leapfile="/var/run/ntpd.leap-seconds.list" + + ntp_ver_no_src=$(get_ntp_leapfile_ver $ntp_src_leapfile) + ntp_ver_no_db=$(get_ntp_leapfile_ver $ntp_db_leapfile) + $verbose ntp_src_leapfile version is $ntp_ver_no_src + $verbose ntp_db_leapfile version is $ntp_ver_no_db + + if [ "$ntp_ver_no_src" -gt "$ntp_ver_no_db" ]; then + $verbose replacing $ntp_db_leapfile with $ntp_src_leapfile + cp -p $ntp_src_leapfile $ntp_db_leapfile + ntp_ver_no_db=$ntp_ver_no_src + else + $verbose not replacing $ntp_db_leapfile with $ntp_src_leapfile + fi + ntp_leap_expiry=$(get_ntp_leapfile_expiry $ntp_db_leapfile) + ntp_leapfile_expiry_seconds=$((ntp_leapfile_expiry_days*86400)) + ntp_leap_fetch_date=$((ntp_leap_expiry-ntp_leapfile_expiry_seconds)) + if [ $(current_ntp_ts) -ge $ntp_leap_fetch_date ]; then + $verbose Within ntp leapfile expiry limit, initiating fetch + for url in $ntp_leapfile_sources ; do + $verbose fetching $url + fetch $ntp_leapfile_fetch_opts -o $ntp_tmp_leapfile $url && break + done + ntp_ver_no_tmp=$(get_ntp_leapfile_ver $ntp_tmp_leapfile) + if [ "$ntp_ver_no_tmp" -gt "$ntp_ver_no_db" ]; then + $verbose using $url as $ntp_db_leapfile + mv $ntp_tmp_leapfile $ntp_db_leapfile + else + $verbose using existing $ntp_db_leapfile + fi + fi +} + run_rc_command "$1" From owner-svn-src-all@freebsd.org Wed Feb 10 07:16:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EB4AAA3DD2; Wed, 10 Feb 2016 07:16:24 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 24510147B; Wed, 10 Feb 2016 07:16:24 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1A7GNe6044594; Wed, 10 Feb 2016 07:16:23 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1A7GMIG044585; Wed, 10 Feb 2016 07:16:22 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201602100716.u1A7GMIG044585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 10 Feb 2016 07:16:22 +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: r295462 - in stable/9/etc: . defaults mtree ntp periodic/daily rc.d X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 07:16:24 -0000 Author: cy Date: Wed Feb 10 07:16:22 2016 New Revision: 295462 URL: https://svnweb.freebsd.org/changeset/base/295462 Log: MFC r289421, r293037, r294773, and r294884. ntp leap-leapseconds support. r289421: Add default leap-seconds file. This should help ntp networks get the leap second date correct Updates to the file can be obtained from ftp://time.nist.gov/pub/ or ftp://tycho.usno.navy.mil/pub/ntp/. r293037: Update leap-seconds to latest. This will satisfy the ntpd leap-second version check. r294773: Add support for automatic leap-second file updates. The working copy of leapfile resides in /var/dbntpd.leap-seconds.list. /etc/ntp/leap-seconds (periodically updated from ftp://time.nist.gov/pub/ or ftp://tycho.usno.navy.mil/pub/ntp/) contains the master copy should automatic leapfile updates be disabled (default). Automatic leapfile updates are fetched from $ntp_leapfile_sources, defaulting to https://www.ietf.org/timezones/data/leap-seconds.list, within $ntp_leapfile_expiry_days (default 30 days) from leap-seconds file expiry. Automatic updates can be enabled by setting $daily_ntpd_leapfile_enable="YES" in periodic.conf. To avoid congesting the ntp leapfile source the automatic update randomized by default but can be disabled through daily_ntpd_avoid_congestion="NO" in periodic.conf. r294884: Allow specification of fetch options for ntp leap-seconds fetch. Added: stable/9/etc/ntp/ - copied from r289421, head/etc/ntp/ stable/9/etc/periodic/daily/480.leapfile-ntpd - copied unchanged from r294773, head/etc/periodic/daily/480.leapfile-ntpd Modified: stable/9/etc/Makefile stable/9/etc/defaults/periodic.conf stable/9/etc/defaults/rc.conf stable/9/etc/mtree/BSD.var.dist stable/9/etc/ntp.conf stable/9/etc/ntp/leap-seconds stable/9/etc/periodic/daily/Makefile stable/9/etc/rc.d/ntpd Directory Properties: stable/9/ (props changed) stable/9/etc/ (props changed) stable/9/etc/mtree/ (props changed) stable/9/etc/rc.d/ (props changed) Modified: stable/9/etc/Makefile ============================================================================== --- stable/9/etc/Makefile Wed Feb 10 07:16:17 2016 (r295461) +++ stable/9/etc/Makefile Wed Feb 10 07:16:22 2016 (r295462) @@ -240,6 +240,9 @@ distribution: ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install ${_+_}cd ${.CURDIR}/devd; ${MAKE} install ${_+_}cd ${.CURDIR}/gss; ${MAKE} install +.if ${MK_NTP} != "no" + ${_+_}cd ${.CURDIR}/ntp; ${MAKE} install +.endif ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install .if ${MK_PKGBOOTSTRAP} != "no" ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install Modified: stable/9/etc/defaults/periodic.conf ============================================================================== --- stable/9/etc/defaults/periodic.conf Wed Feb 10 07:16:17 2016 (r295461) +++ stable/9/etc/defaults/periodic.conf Wed Feb 10 07:16:22 2016 (r295462) @@ -142,6 +142,10 @@ daily_status_mail_rejects_shorten="NO" daily_status_named_enable="YES" daily_status_named_usedns="YES" # DNS lookups are ok +# 480.leapfile-ntpd +daily_ntpd_leapfile_enable="NO" # Fetch NTP leapfile +daily_ntpd_avoid_congestion="YES" # Avoid congesting + # 480.status-ntpd daily_status_ntpd_enable="NO" # Check NTP status Modified: stable/9/etc/defaults/rc.conf ============================================================================== --- stable/9/etc/defaults/rc.conf Wed Feb 10 07:16:17 2016 (r295461) +++ stable/9/etc/defaults/rc.conf Wed Feb 10 07:16:22 2016 (r295462) @@ -364,6 +364,17 @@ ntpd_config="/etc/ntp.conf" # ntpd(8) co ntpd_sync_on_start="NO" # Sync time on ntpd startup, even if offset is high ntpd_flags="-p /var/run/ntpd.pid -f /var/db/ntpd.drift" # Flags to ntpd (if enabled). +ntp_src_leapfile="/etc/ntp/leap-seconds" + # Initial source for ntpd leapfile +ntp_db_leapfile="/var/db/ntpd.leap-seconds.list" + # Working copy (updated weekly) leapfile +ntp_leapfile_sources="https://www.ietf.org/timezones/data/leap-seconds.list" + # Source from which to fetch leapfile +ntp_leapfile_fetch_opts="-mq" # Options to use for ntp leapfile fetch, + # e.g. --no-verify-peer +ntp_leapfile_expiry_days=30 # Check for new leapfile 30 days prior to + # expiry. +ntp_leapfile_fetch_verbose="NO" # Be verbose during NTP leapfile fetch # Network Information Services (NIS) options: All need rpcbind_enable="YES" ### nis_client_enable="NO" # We're an NIS client (or NO). Modified: stable/9/etc/mtree/BSD.var.dist ============================================================================== --- stable/9/etc/mtree/BSD.var.dist Wed Feb 10 07:16:17 2016 (r295461) +++ stable/9/etc/mtree/BSD.var.dist Wed Feb 10 07:16:22 2016 (r295462) @@ -44,6 +44,8 @@ .. ipf mode=0700 .. + ntp mode=0700 + .. pkg .. ports Modified: stable/9/etc/ntp.conf ============================================================================== --- stable/9/etc/ntp.conf Wed Feb 10 07:16:17 2016 (r295461) +++ stable/9/etc/ntp.conf Wed Feb 10 07:16:22 2016 (r295462) @@ -77,3 +77,10 @@ restrict 127.127.1.0 # #server 127.127.1.0 #fudge 127.127.1.0 stratum 10 + +# See http://support.ntp.org/bin/view/Support/ConfiguringNTP#Section_6.14. +# for documentation regarding leapfile. Updates to the file can be obtained +# from ftp://time.nist.gov/pub/ or ftp://tycho.usno.navy.mil/pub/ntp/. +# Use either leapfile in /etc/ntp or weekly updated leapfile in /var/db. +#leapfile "/etc/ntp/leap-seconds" +leapfile "/var/db/ntpd.leap-seconds.list" Modified: stable/9/etc/ntp/leap-seconds ============================================================================== --- head/etc/ntp/leap-seconds Fri Oct 16 14:04:16 2015 (r289421) +++ stable/9/etc/ntp/leap-seconds Wed Feb 10 07:16:22 2016 (r295462) @@ -1,119 +1,221 @@ # # $FreeBSD$ # -# ATOMIC TIME. -# The Coordinated Universal Time (UTC) is the reference time scale derived -# from The "Temps Atomique International" (TAI) calculated by the Bureau -# International des Poids et Mesures (BIPM) using a worldwide network of atomic -# clocks. UTC differs from TAI by an integer number of seconds; it is the basis -# of all activities in the world. -# -# -# ASTRONOMICAL TIME (UT1) is the time scale based on the rate of rotation of the earth. -# It is now mainly derived from Very Long Baseline Interferometry (VLBI). The various -# irregular fluctuations progressively detected in the rotation rate of the Earth lead -# in 1972 to the replacement of UT1 by UTC as the reference time scale. -# -# -# LEAP SECOND -# Atomic clocks are more stable than the rate of the earth rotatiob since the later -# undergoes a full range of geophysical perturbations at various time scales (lunisolar -# and core-mantle torques,atmospheric and oceanic effetcs, ...) -# Leap seconds are needed to keep the two time scales in agreement, i.e. UT1-UTC smaller -# than 0.9 second. So, when necessary a "leap second" is introduced in UTC. -# Since the adoption of this system in 1972 it has been necessary to add 26 seconds to UTC, -# firstly due to the initial choice of the value of the second (1/86400 mean solar day of -# the year 1820) and secondly to the general slowing down of the Earth's rotation. It is -# theorically possible to have a negative leap second (a second removed from UTC), but so far, -# all leap seconds have been positive (a second has been added to UTC). Based on what we know about the earth's rotation, -# it is unlikely that we will ever have a negative leap second. -# -# -# HISTORY -# The first leap second was added on June 30, 1972. Until 2000, it was necessary in average to add a leap second at a rate -# of 1 to 2 years. Since 2000, due to the fact that the earth rate of rotation is accelerating, leap seconds are introduced -# with an average frequency of 3 to 4 years. -# -# -# RESPONSABILITY OF THE DECISION TO INTRODUCE A LEAP SECOND IN UTC -# The decision to introduce a leap second in UTC is the responsibility of the Earth Orientation Center of -# the International Earth Rotation and reference System Service (IERS). This center is located at Paris -# Observatory. According to international agreements, leap second date have to occur at fixed date : -# first preference is given to the end of December and June, and second preference at the end of March -# and September. Since the system was introduced in 1972, only dates in June and December were used. -# -# Questions or comments to: -# Daniel Gambis, daniel.gambis@obspm.fr -# Christian Bizouard: christian.bizouard@obspm.fr -# Earth orientation Center of the IERS -# Paris Observatory, France -# -# -# -# VALIDITY OF THE FILE -# It is important to express the validity of the file. These next two dates are -# given in units of seconds since 1900.0. -# -# 1) Last update of the file. -# -# Updated through IERS Bulletin C (ftp://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat) -# -# The following line shows the last update of this file in NTP timestamp: -# -#$ 3645216000 -# -# 2) Expiration date of the file given on a semi-annual basis: last June or last December -# -# File expires on 28 December 2015 -# -# Expire date in NTP timestamp: -# -#@ 3660249600 -# -# -# LIST OF LEAP SECONDS -# NTP timestamp (X parameter) is the number of seconds since 1900.0 -# -# MJD: The Modified Julian Day number. MJD = X/86400 + 15020 -# -# DTAI: The difference DTAI= TAI-UTC in units of seconds -# It is the quantity to add to UTC to get the time in TAI -# -# Day Month Year : epoch in clear -# -#NTP Time DTAI Day Month Year -# -2272060800 10 # 1 Jan 1972 -2287785600 11 # 1 Jul 1972 -2303683200 12 # 1 Jan 1973 -2335219200 13 # 1 Jan 1974 -2366755200 14 # 1 Jan 1975 -2398291200 15 # 1 Jan 1976 -2429913600 16 # 1 Jan 1977 -2461449600 17 # 1 Jan 1978 -2492985600 18 # 1 Jan 1979 -2524521600 19 # 1 Jan 1980 -2571782400 20 # 1 Jul 1981 -2603318400 21 # 1 Jul 1982 -2634854400 22 # 1 Jul 1983 -2698012800 23 # 1 Jul 1985 -2776982400 24 # 1 Jan 1988 -2840140800 25 # 1 Jan 1990 -2871676800 26 # 1 Jan 1991 -2918937600 27 # 1 Jul 1992 -2950473600 28 # 1 Jul 1993 -2982009600 29 # 1 Jul 1994 -3029443200 30 # 1 Jan 1996 -3076704000 31 # 1 Jul 1997 -3124137600 32 # 1 Jan 1999 -3345062400 33 # 1 Jan 2006 -3439756800 34 # 1 Jan 2009 -3550089600 35 # 1 Jul 2012 -3644697600 36 # 1 Jul 2015 -# -# In order to verify the integrity of this file, a hash code -# has been generated. For more information how to use -# this hash code, please consult the README file under the -# 'sha' repertory. +# In the following text, the symbol '#' introduces +# a comment, which continues from that symbol until +# the end of the line. A plain comment line has a +# whitespace character following the comment indicator. +# There are also special comment lines defined below. +# A special comment will always have a non-whitespace +# character in column 2. +# +# A blank line should be ignored. +# +# The following table shows the corrections that must +# be applied to compute International Atomic Time (TAI) +# from the Coordinated Universal Time (UTC) values that +# are transmitted by almost all time services. +# +# The first column shows an epoch as a number of seconds +# since 1900.0 and the second column shows the number of +# seconds that must be added to UTC to compute TAI for +# any timestamp at or after that epoch. The value on +# each line is valid from the indicated initial instant +# until the epoch given on the next one or indefinitely +# into the future if there is no next line. +# (The comment on each line shows the representation of +# the corresponding initial epoch in the usual +# day-month-year format. The epoch always begins at +# 00:00:00 UTC on the indicated day. See Note 5 below.) +# +# Important notes: +# +# 1. Coordinated Universal Time (UTC) is often referred to +# as Greenwich Mean Time (GMT). The GMT time scale is no +# longer used, and the use of GMT to designate UTC is +# discouraged. +# +# 2. The UTC time scale is realized by many national +# laboratories and timing centers. Each laboratory +# identifies its realization with its name: Thus +# UTC(NIST), UTC(USNO), etc. The differences among +# these different realizations are typically on the +# order of a few nanoseconds (i.e., 0.000 000 00x s) +# and can be ignored for many purposes. These differences +# are tabulated in Circular T, which is published monthly +# by the International Bureau of Weights and Measures +# (BIPM). See www.bipm.fr for more information. +# +# 3. The current defintion of the relationship between UTC +# and TAI dates from 1 January 1972. A number of different +# time scales were in use before than epoch, and it can be +# quite difficult to compute precise timestamps and time +# intervals in those "prehistoric" days. For more information, +# consult: +# +# The Explanatory Supplement to the Astronomical +# Ephemeris. +# or +# Terry Quinn, "The BIPM and the Accurate Measurement +# of Time," Proc. of the IEEE, Vol. 79, pp. 894-905, +# July, 1991. +# +# 4. The insertion of leap seconds into UTC is currently the +# responsibility of the International Earth Rotation Service, +# which is located at the Paris Observatory: +# +# Central Bureau of IERS +# 61, Avenue de l'Observatoire +# 75014 Paris, France. +# +# Leap seconds are announced by the IERS in its Bulletin C +# +# See hpiers.obspm.fr or www.iers.org for more details. +# +# All national laboratories and timing centers use the +# data from the BIPM and the IERS to construct their +# local realizations of UTC. +# +# Although the definition also includes the possibility +# of dropping seconds ("negative" leap seconds), this has +# never been done and is unlikely to be necessary in the +# foreseeable future. +# +# 5. If your system keeps time as the number of seconds since +# some epoch (e.g., NTP timestamps), then the algorithm for +# assigning a UTC time stamp to an event that happens during a positive +# leap second is not well defined. The official name of that leap +# second is 23:59:60, but there is no way of representing that time +# in these systems. +# Many systems of this type effectively stop the system clock for +# one second during the leap second and use a time that is equivalent +# to 23:59:59 UTC twice. For these systems, the corresponding TAI +# timestamp would be obtained by advancing to the next entry in the +# following table when the time equivalent to 23:59:59 UTC +# is used for the second time. Thus the leap second which +# occurred on 30 June 1972 at 23:59:59 UTC would have TAI +# timestamps computed as follows: +# +# ... +# 30 June 1972 23:59:59 (2287785599, first time): TAI= UTC + 10 seconds +# 30 June 1972 23:59:60 (2287785599,second time): TAI= UTC + 11 seconds +# 1 July 1972 00:00:00 (2287785600) TAI= UTC + 11 seconds +# ... +# +# If your system realizes the leap second by repeating 00:00:00 UTC twice +# (this is possible but not usual), then the advance to the next entry +# in the table must occur the second time that a time equivlent to +# 00:00:00 UTC is used. Thus, using the same example as above: +# +# ... +# 30 June 1972 23:59:59 (2287785599): TAI= UTC + 10 seconds +# 30 June 1972 23:59:60 (2287785600, first time): TAI= UTC + 10 seconds +# 1 July 1972 00:00:00 (2287785600,second time): TAI= UTC + 11 seconds +# ... +# +# in both cases the use of timestamps based on TAI produces a smooth +# time scale with no discontinuity in the time interval. +# +# This complexity would not be needed for negative leap seconds (if they +# are ever used). The UTC time would skip 23:59:59 and advance from +# 23:59:58 to 00:00:00 in that case. The TAI offset would decrease by +# 1 second at the same instant. This is a much easier situation to deal +# with, since the difficulty of unambiguously representing the epoch +# during the leap second does not arise. +# +# Questions or comments to: +# Jeff Prillaman +# Time Service Department +# US Naval Observatory +# Washington, DC +# jeffrey.prillaman@usno.navy.mil +# +# Last Update of leap second values: 31 Dec 2015 +# +# The following line shows this last update date in NTP timestamp +# format. This is the date on which the most recent change to +# the leap second data was added to the file. This line can +# be identified by the unique pair of characters in the first two +# columns as shown below. +# +#$ 3660508800 +# +# The data in this file will be updated periodically as new leap +# seconds are announced. In addition to being entered on the line +# above, the update time (in NTP format) will be added to the basic +# file name leap-seconds to form the name leap-seconds.. +# In addition, the generic name leap-seconds.list will always point to +# the most recent version of the file. +# +# This update procedure will be performed only when a new leap second +# is announced. +# +# The following entry specifies the expiration date of the data +# in this file in units of seconds since 1900.0. This expiration date +# will be changed at least twice per year whether or not a new leap +# second is announced. These semi-annual changes will be made no +# later than 1 June and 1 December of each year to indicate what +# action (if any) is to be taken on 30 June and 31 December, +# respectively. (These are the customary effective dates for new +# leap seconds.) This expiration date will be identified by a +# unique pair of characters in columns 1 and 2 as shown below. +# In the unlikely event that a leap second is announced with an +# effective date other than 30 June or 31 December, then this +# file will be edited to include that leap second as soon as it is +# announced or at least one month before the effective date +# (whichever is later). +# If an announcement by the IERS specifies that no leap second is +# scheduled, then only the expiration date of the file will +# be advanced to show that the information in the file is still +# current -- the update time stamp, the data and the name of the file +# will not change. +# +# Updated through IERS Bulletin C 50 +# File expires on: 1 Jun 2016 +# +#@ 3673728000 +# +2272060800 10 # 1 Jan 1972 +2287785600 11 # 1 Jul 1972 +2303683200 12 # 1 Jan 1973 +2335219200 13 # 1 Jan 1974 +2366755200 14 # 1 Jan 1975 +2398291200 15 # 1 Jan 1976 +2429913600 16 # 1 Jan 1977 +2461449600 17 # 1 Jan 1978 +2492985600 18 # 1 Jan 1979 +2524521600 19 # 1 Jan 1980 +2571782400 20 # 1 Jul 1981 +2603318400 21 # 1 Jul 1982 +2634854400 22 # 1 Jul 1983 +2698012800 23 # 1 Jul 1985 +2776982400 24 # 1 Jan 1988 +2840140800 25 # 1 Jan 1990 +2871676800 26 # 1 Jan 1991 +2918937600 27 # 1 Jul 1992 +2950473600 28 # 1 Jul 1993 +2982009600 29 # 1 Jul 1994 +3029443200 30 # 1 Jan 1996 +3076704000 31 # 1 Jul 1997 +3124137600 32 # 1 Jan 1999 +3345062400 33 # 1 Jan 2006 +3439756800 34 # 1 Jan 2009 +3550089600 35 # 1 Jul 2012 +3644697600 36 # 1 Jul 2015 +# +# the following special comment contains the +# hash value of the data in this file computed +# use the secure hash algorithm as specified +# by FIPS 180-1. See the files in ~/sha for +# the details of how this hash value is +# computed. Note that the hash computation +# ignores comments and whitespace characters +# in data lines. It includes the NTP values +# of both the last modification time and the +# expiration time of the file, but not the +# white space on those lines. +# the hash line is also ignored in the +# computation. +# +#h 44a44c49 35b22601 a9c7054c 8c56cf57 9b6f6ed5 # -#h 620ba8af 37900668 95ac09ba d77640f9 6fd75493 Copied: stable/9/etc/periodic/daily/480.leapfile-ntpd (from r294773, head/etc/periodic/daily/480.leapfile-ntpd) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/etc/periodic/daily/480.leapfile-ntpd Wed Feb 10 07:16:22 2016 (r295462, copy of r294773, head/etc/periodic/daily/480.leapfile-ntpd) @@ -0,0 +1,28 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ] +then + . /etc/defaults/periodic.conf + source_periodic_confs +fi + +case "$daily_ntpd_leapfile_enable" in + [Yy][Ee][Ss]) + case "$daily_ntpd_avoid_congestion" in + [Yy][Ee][Ss]) + # Avoid dogpiling + (sleep $(jot -r 1 0 86400); service ntpd fetch) & + ;; + *) + service ntpd fetch + ;; + esac + ;; +esac + +exit $rc Modified: stable/9/etc/periodic/daily/Makefile ============================================================================== --- stable/9/etc/periodic/daily/Makefile Wed Feb 10 07:16:17 2016 (r295461) +++ stable/9/etc/periodic/daily/Makefile Wed Feb 10 07:16:22 2016 (r295462) @@ -40,7 +40,8 @@ FILES+= 130.clean-msgs .endif .if ${MK_NTP} != "no" -FILES+= 480.status-ntpd +FILES+= 480.status-ntpd \ + 480.leapfile-ntpd .endif .if ${MK_PKGTOOLS} != "no" Modified: stable/9/etc/rc.d/ntpd ============================================================================== --- stable/9/etc/rc.d/ntpd Wed Feb 10 07:16:17 2016 (r295461) +++ stable/9/etc/rc.d/ntpd Wed Feb 10 07:16:22 2016 (r295462) @@ -14,6 +14,8 @@ name="ntpd" rcvar="ntpd_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" +extra_commands="fetch" +fetch_cmd="ntpd_fetch_leapfile" start_precmd="ntpd_precmd" load_rc_config $name @@ -30,6 +32,10 @@ ntpd_precmd() return 0; fi + if [ ! -f $ntp_db_leapfile ]; then + ntpd_fetch_leapfile + fi + # If running in a chroot cage, ensure that the appropriate files # exist inside the cage, as well as helper symlinks into the cage # from outside. @@ -44,10 +50,71 @@ ntpd_precmd() ( cd /dev ; /bin/pax -rw -pe clockctl "${ntpd_chrootdir}/dev" ) fi ln -fs "${ntpd_chrootdir}/var/db/ntp.drift" /var/db/ntp.drift + ln -fs "${ntpd_chrootdir}${ntp_tmp_leapfile}" ${ntp_tmp_leapfile} # Change run_rc_commands()'s internal copy of $ntpd_flags # rc_flags="-u ntpd:ntpd -i ${ntpd_chrootdir} $rc_flags" } +current_ntp_ts() { + # Seconds between 1900-01-01 and 1970-01-01 + # echo $(((70*365+17)*86400)) + ntp_to_unix=2208988800 + + echo $(($(date -u +%s)+$ntp_to_unix)) +} + +get_ntp_leapfile_ver() { + expr "$(awk '$1 == "#$" { print $2 }' "$1" 2>/dev/null)" : \ + '^\([1-9][0-9]*\)$' \| 0 +} + +get_ntp_leapfile_expiry() { + expr "$(awk '$1 == "#@" { print $2 }' "$1" 2>/dev/null)" : \ + '^\([1-9][0-9]*\)$' \| 0 +} + +ntpd_fetch_leapfile() { + local ntp_tmp_leapfile rc verbose + + if checkyesno ntp_leapfile_fetch_verbose; then + verbose=echo + else + verbose=: + fi + + ntp_tmp_leapfile="/var/run/ntpd.leap-seconds.list" + + ntp_ver_no_src=$(get_ntp_leapfile_ver $ntp_src_leapfile) + ntp_ver_no_db=$(get_ntp_leapfile_ver $ntp_db_leapfile) + $verbose ntp_src_leapfile version is $ntp_ver_no_src + $verbose ntp_db_leapfile version is $ntp_ver_no_db + + if [ "$ntp_ver_no_src" -gt "$ntp_ver_no_db" ]; then + $verbose replacing $ntp_db_leapfile with $ntp_src_leapfile + cp -p $ntp_src_leapfile $ntp_db_leapfile + ntp_ver_no_db=$ntp_ver_no_src + else + $verbose not replacing $ntp_db_leapfile with $ntp_src_leapfile + fi + ntp_leap_expiry=$(get_ntp_leapfile_expiry $ntp_db_leapfile) + ntp_leapfile_expiry_seconds=$((ntp_leapfile_expiry_days*86400)) + ntp_leap_fetch_date=$((ntp_leap_expiry-ntp_leapfile_expiry_seconds)) + if [ $(current_ntp_ts) -ge $ntp_leap_fetch_date ]; then + $verbose Within ntp leapfile expiry limit, initiating fetch + for url in $ntp_leapfile_sources ; do + $verbose fetching $url + fetch $ntp_leapfile_fetch_opts -o $ntp_tmp_leapfile $url && break + done + ntp_ver_no_tmp=$(get_ntp_leapfile_ver $ntp_tmp_leapfile) + if [ "$ntp_ver_no_tmp" -gt "$ntp_ver_no_db" ]; then + $verbose using $url as $ntp_db_leapfile + mv $ntp_tmp_leapfile $ntp_db_leapfile + else + $verbose using existing $ntp_db_leapfile + fi + fi +} + run_rc_command "$1" From owner-svn-src-all@freebsd.org Wed Feb 10 07:18:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26B03AA3F23; Wed, 10 Feb 2016 07:18:11 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (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 E741E189D; Wed, 10 Feb 2016 07:18:10 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 1F9D51FE023; Wed, 10 Feb 2016 08:18:07 +0100 (CET) Subject: Re: svn commit: r294327 - in head/sys: dev/cxgb dev/cxgbe dev/e1000 dev/hyperv/netvsc dev/ixgbe dev/mxge netinet sys To: Ryan Stone References: <201601191533.u0JFXSxf037804@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Hans Petter Selasky Message-ID: <56BAE4BC.9000105@selasky.org> Date: Wed, 10 Feb 2016 08:20:28 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 07:18:11 -0000 On 01/19/16 17:09, Ryan Stone wrote: > On Tue, Jan 19, 2016 at 10:33 AM, Hans Petter Selasky > wrote: > >> >> + qsort(lc->lro_mbuf_data, lc->lro_mbuf_count, sizeof(struct mbuf *), >> + &tcp_lro_mbuf_compare_header); >> > > In the worst case, qsort() can take O(n**2) time and consume O(n) stack > space. Is there a DOS concern here? > Hi, Our FreeBSD qsort() routine has been specifically modified to not exhibit the so-called QuickSort worst case behaviour of O(N**2) sorting time. This is not documented in our source code, but here: http://cs.fit.edu/~pkc/classes/writing/samples/bentley93engineering.pdf So I think DOS w.r.t O(N**2) is not a valid consern. Thank you for your input Ryan. BTW: Drew Gallatin has tested our qsort() v.s. my mergesort() and found that: "It looks like mergesort is nearly 2x as expensive. (4.7% vs 2.5%)" See: https://reviews.freebsd.org/D5200 And: https://reviews.freebsd.org/D4994 --HPS From owner-svn-src-all@freebsd.org Wed Feb 10 08:03:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD2C3AA37C3; Wed, 10 Feb 2016 08:03:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 AC6C7B3F; Wed, 10 Feb 2016 08:03:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1A83AxZ059188; Wed, 10 Feb 2016 08:03:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1A83AC4059187; Wed, 10 Feb 2016 08:03:10 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201602100803.u1A83AC4059187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 10 Feb 2016 08:03:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295463 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 08:03:12 -0000 Author: hselasky Date: Wed Feb 10 08:03:10 2016 New Revision: 295463 URL: https://svnweb.freebsd.org/changeset/base/295463 Log: Correct PCI device description. Submitted by: Dmitry Luhtionov Modified: head/sys/dev/usb/controller/ehci_pci.c Modified: head/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ehci_pci.c Wed Feb 10 07:16:22 2016 (r295462) +++ head/sys/dev/usb/controller/ehci_pci.c Wed Feb 10 08:03:10 2016 (r295463) @@ -172,7 +172,7 @@ ehci_pci_match(device_t self) return ("Intel Lynx Point LP USB 2.0 controller USB"); case 0x00e01033: - return ("NEC uPD 720100 USB 2.0 controller"); + return ("NEC uPD 72010x USB 2.0 controller"); case 0x006810de: return "NVIDIA nForce2 USB 2.0 controller"; From owner-svn-src-all@freebsd.org Wed Feb 10 08:12:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7E7BAA3BE5 for ; Wed, 10 Feb 2016 08:12:55 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2ACF0EDC for ; Wed, 10 Feb 2016 08:12:55 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-wm0-x233.google.com with SMTP id p63so15347907wmp.1 for ; Wed, 10 Feb 2016 00:12:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=ora/8vUQ3CsAzzN0m9IOed/Csmohjm+bpcw80JVkucE=; b=LAMtnGy53txbwKtIi11hol+M4nKOmcJ6pAMS32TKwcUrna+8m1Uzlia0InJZulCC8B 3aHHWelCO5IdCuWGr7nDtCG9U1j5Fabq3gVuZIntUZi+o34Va9nzhhtnHvHpwZYdn43D ZNeUm3bfu2OsAnHuaQvHtA7fG6gZ+HkFXl7tBw6Nxp96r8Hu8Sa7kF5wSxvzdFCMAlKI kS9CKE1LI1fLcAa9ZwUmtbNOi8ziKqOuxpvx0ZIWb1BAXEEFOGhtVnGs2PARu5bRuElS Yxwa23K0XIQBnoXy+v7yk8l9IkZxdjPEWpUcBbYK73H7ZTHr1IB5OAKZoTQgE7fXZd7H w+HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=ora/8vUQ3CsAzzN0m9IOed/Csmohjm+bpcw80JVkucE=; b=TaSIdqPrudnrZ53IBBLRspNbTho2d0Nx6loNnKqqBYUDPviF0NMvhM7icaPSYBfsaG Of+cJO0Se6a3j9Y+ETbELBSNJyL1ZuH0WLQC81qtjtqaEy+11WEacfl3GuYWGC3UhUTn XV4XMVbi5ZGwVuwkbDzZ8D7qs7DFCjz3Pxk+RSGZ23jb19SPf38RbqNZgpeRK/m0yiaX 1e/NStzXtvf4ejkAxY37J2uDxLuMeevtEBlahKILLyMVPn2VzQhPXMeDC1vqV7wYYrdl W7eoK44mjHwSMc9Cx8nxatTzx/Ia/ifX+BooYZ7HFM+RFU/5ynQMArsMQTihf85yNzaz bPkg== X-Gm-Message-State: AG10YOQISkOdoLtKks14qlSMkSWDKoC23KhHgwu6TG6CU1yByBYS7KvoebePrmVw0dbbfimaIZEooyGg3tbP3dk8 MIME-Version: 1.0 X-Received: by 10.28.92.195 with SMTP id q186mr9040241wmb.37.1455091972787; Wed, 10 Feb 2016 00:12:52 -0800 (PST) Sender: sobomax@sippysoft.com Received: by 10.27.172.16 with HTTP; Wed, 10 Feb 2016 00:12:52 -0800 (PST) In-Reply-To: <201405071933.s47JXUx0046697@svn.freebsd.org> References: <201405071933.s47JXUx0046697@svn.freebsd.org> Date: Wed, 10 Feb 2016 00:12:52 -0800 X-Google-Sender-Auth: pmXUo0nltEjtJyiPVCzi9C5mNG0 Message-ID: Subject: Re: svn: head/bin/dd From: Maxim Sobolev To: Thomas Quinot , kib@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 08:12:55 -0000 Something is seriously broken about this change. The last block is never written at least for the case of output being regular file: $ dd if=/dev/zero of=/tmp/foo.bar bs=1m count=10 10+0 records in 10+0 records out 10485760 bytes transferred in 0.003244 secs (3232431656 bytes/sec) $ ktrace dd if=/tmp/foo.bar of=/tmp/foo.bar1 bs=1m conv=sparse 10+0 records in 10+0 records out $ ls -l /tmp/foo.bar /tmp/foo.bar1 -rw-r--r-- 1 sobomax wheel 10485760 Feb 9 23:59 /tmp/foo.bar -rw-r--r-- 1 sobomax wheel 0 Feb 9 23:59 /tmp/foo.bar1 $ uname -a FreeBSD abc.sippysoft.com 10.3-PRERELEASE FreeBSD 10.3-PRERELEASE #1 80de3e2(master)-dirty: Tue Feb 2 12:19:57 PST 2016 sobomax@abc.sippysoft.com:/usr/obj/usr/home/sobomax/projects/freebsd103/sys/VAN01 amd64 ktrace ends with: 3150 dd RET read 1048576/0x100000 3150 dd CALL read(0x3,0x801009000,0x100000) 3150 dd GIO fd 3 read 0 bytes "" 3150 dd RET read 0 3150 dd CALL lseek(0x4,0x900000,SEEK_CUR) 3150 dd RET lseek 9437184/0x900000 3150 dd CALL close(0x4) 3150 dd RET close 0 3150 dd CALL write(0x2,0x7fffffffe2c0,0x21) 3150 dd GIO fd 2 wrote 33 bytes "10+0 records in 10+0 records out " 3150 dd RET write 33/0x21 3150 dd CALL write(0x2,0x7fffffffe2c0,0x43) 3150 dd GIO fd 2 wrote 67 bytes "10485760 bytes transferred in 0.008217 secs (1276090675 bytes/sec) " 3150 dd RET write 67/0x43 3150 dd CALL sigprocmask(SIG_BLOCK,0x800822a38,0x7fffffffe780) 3150 dd RET sigprocmask 0 3150 dd CALL sigprocmask(SIG_SETMASK,0x800822a4c,0) 3150 dd RET sigprocmask 0 3150 dd CALL sigprocmask(SIG_BLOCK,0x800822a38,0x7fffffffe310) 3150 dd RET sigprocmask 0 3150 dd CALL sigprocmask(SIG_SETMASK,0x800822a4c,0) 3150 dd RET sigprocmask 0 3150 dd CALL sigprocmask(SIG_BLOCK,0x800822a38,0x7fffffffe310) 3150 dd RET sigprocmask 0 3150 dd CALL sigprocmask(SIG_SETMASK,0x800822a4c,0) 3150 dd RET sigprocmask 0 3150 dd CALL exit(0) Looking at the code in question I don't see how could it have worked. Look at the following piece of code in your diff for example: + if (force && cnt == 0) { + pending -= last_sp; + assert(outp == out.db); + memset(outp, 0, cnt); + } When the branch is taken, cnt is 0, so at the very least memset(x, y, 0) is NOP. Later on, write(2) is conditional on cnt != 0, so that it's never taken. As a result, lseek is the last operation the file sees. Also, for what it's worth, you can use ftruncate(2) instead of write() for regular sparse files to ensure correct size. That would write just as much data as needed to the end. I've made a quick and dirty patch, that seems to be working better than current code at least: http://sobomax.sippysoft.com/dd.diff Please fix. On Wed, May 7, 2014 at 12:33 PM, Thomas Quinot wrote: > Author: thomas > Date: Wed May 7 19:33:29 2014 > New Revision: 265593 > URL: http://svnweb.freebsd.org/changeset/base/265593 > > Log: > (dd_out): Fix handling of all-zeroes block at end of input with > conv=sparse. > > This change fixes two separate issues observed when the last output > block is all zeroes, and conv=sparse is in use. In this case, care > must be taken to roll back the last seek and write the entire last zero > block at the original offset where it should have occurred: when the > destination file is a block device, it is not possible to roll back > by just one character as the write would then not be properly aligned. > > Furthermore, the buffer used to write this last all-zeroes block > needs to be properly zeroed-out. This was not the case previously, > resulting in a junk data byte appearing instead of a zero in the > output stream. > > PR: bin/189174 > PR: bin/189284 > Reviewed by: kib > MFC after: 2 weeks > > Modified: > head/bin/dd/dd.c > > Modified: head/bin/dd/dd.c > > ============================================================================== > --- head/bin/dd/dd.c Wed May 7 19:30:28 2014 (r265592) > +++ head/bin/dd/dd.c Wed May 7 19:33:29 2014 (r265593) > @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +#include > #include > #include > #include > @@ -77,6 +78,7 @@ STAT st; /* statistics */ > void (*cfunc)(void); /* conversion function */ > uintmax_t cpy_cnt; /* # of blocks to copy */ > static off_t pending = 0; /* pending seek if sparse */ > +static off_t last_sp = 0; /* size of last added sparse block */ > u_int ddflags = 0; /* conversion options */ > size_t cbsz; /* conversion block size */ > uintmax_t files_cnt = 1; /* # of files to copy */ > @@ -174,6 +176,8 @@ setup(void) > } else if ((in.db = malloc(MAX(in.dbsz, cbsz) + cbsz)) == NULL || > (out.db = malloc(out.dbsz + cbsz)) == NULL) > err(1, "output buffer"); > + > + /* dbp is the first free position in each buffer. */ > in.dbp = in.db; > out.dbp = out.db; > > @@ -436,8 +440,15 @@ dd_out(int force) > * we play games with the buffer size, and it's usually a partial > write. > */ > outp = out.db; > + > + /* > + * If force, first try to write all pending data, else try to write > + * just one block. Subsequently always write data one full block at > + * a time at most. > + */ > for (n = force ? out.dbcnt : out.dbsz;; n = out.dbsz) { > - for (cnt = n;; cnt -= nw) { > + cnt = n; > + do { > sparse = 0; > if (ddflags & C_SPARSE) { > sparse = 1; /* Is buffer sparse? */ > @@ -449,18 +460,24 @@ dd_out(int force) > } > if (sparse && !force) { > pending += cnt; > + last_sp = cnt; > nw = cnt; > } else { > if (pending != 0) { > - if (force) > - pending--; > + /* If forced to write, and we have > no > + * data left, we need to write the > last > + * sparse block explicitly. > + */ > + if (force && cnt == 0) { > + pending -= last_sp; > + assert(outp == out.db); > + memset(outp, 0, cnt); > + } > if (lseek(out.fd, pending, > SEEK_CUR) == > -1) > err(2, "%s: seek error > creating sparse file", > out.name); > - if (force) > - write(out.fd, outp, 1); > - pending = 0; > + pending = last_sp = 0; > } > if (cnt) > nw = write(out.fd, outp, cnt); > @@ -475,27 +492,29 @@ dd_out(int force) > err(1, "%s", out.name); > nw = 0; > } > + > outp += nw; > st.bytes += nw; > - if ((size_t)nw == n) { > - if (n != out.dbsz) > - ++st.out_part; > - else > - ++st.out_full; > - break; > - } > - ++st.out_part; > - if ((size_t)nw == cnt) > - break; > - if (out.flags & ISTAPE) > - errx(1, "%s: short write on tape device", > - out.name); > - if (out.flags & ISCHR && !warned) { > - warned = 1; > - warnx("%s: short write on character > device", > - out.name); > + > + if ((size_t)nw == n && n == out.dbsz) > + ++st.out_full; > + else > + ++st.out_part; > + > + if ((size_t) nw != cnt) { > + if (out.flags & ISTAPE) > + errx(1, "%s: short write on tape > device", > + out.name); > + if (out.flags & ISCHR && !warned) { > + warned = 1; > + warnx("%s: short write on > character device", > + out.name); > + } > } > - } > + > + cnt -= nw; > + } while (cnt != 0); > + > if ((out.dbcnt -= n) < out.dbsz) > break; > } > > From owner-svn-src-all@freebsd.org Wed Feb 10 09:19:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D57FAA4021; Wed, 10 Feb 2016 09:19:32 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 4F8F1F2C; Wed, 10 Feb 2016 09:19:32 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1A9JVuK080165; Wed, 10 Feb 2016 09:19:31 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1A9JTWf080141; Wed, 10 Feb 2016 09:19:29 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602100919.u1A9JTWf080141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 10 Feb 2016 09:19:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295464 - in head/sys: arm/allwinner arm/allwinner/a20 arm/conf arm64/arm64 boot/fdt/dts/arm modules/dtb/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 09:19:32 -0000 Author: andrew Date: Wed Feb 10 09:19:29 2016 New Revision: 295464 URL: https://svnweb.freebsd.org/changeset/base/295464 Log: Update of the Allwinner drivers to: * Use the Linux compat string * Use EARLY_DRIVER_MODULE to attach at the right time * Add a generic A10 kernel config file * A20 now use generic_timer * Add two new dts files for Olimex boards * Update our custom DTS file for A10 and A20 to use the same compatible property names as the vendor ones. Submitted by: Emmanuel Vadot Differential Revision: https://reviews.freebsd.org/D4792 Added: head/sys/arm/conf/A10 - copied, changed from r295446, head/sys/arm/conf/A20 head/sys/boot/fdt/dts/arm/olimex-a20-som-evb.dts - copied, changed from r295446, head/sys/boot/fdt/dts/arm/bananapi.dts head/sys/boot/fdt/dts/arm/olinuxino-lime.dts - copied, changed from r295446, head/sys/boot/fdt/dts/arm/bananapi.dts Modified: head/sys/arm/allwinner/a10_clk.c head/sys/arm/allwinner/a10_common.c head/sys/arm/allwinner/a10_ehci.c head/sys/arm/allwinner/a10_gpio.c head/sys/arm/allwinner/a10_mmc.c head/sys/arm/allwinner/a10_wdog.c head/sys/arm/allwinner/a20/a20_cpu_cfg.c head/sys/arm/allwinner/aintc.c head/sys/arm/allwinner/files.a10 head/sys/arm/allwinner/files.allwinner head/sys/arm/allwinner/if_emac.c head/sys/arm/allwinner/timer.c head/sys/arm/conf/A20 head/sys/arm64/arm64/swtch.S head/sys/boot/fdt/dts/arm/bananapi.dts head/sys/boot/fdt/dts/arm/cubieboard2.dts head/sys/boot/fdt/dts/arm/sun4i-a10.dtsi head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi head/sys/modules/dtb/allwinner/Makefile Modified: head/sys/arm/allwinner/a10_clk.c ============================================================================== --- head/sys/arm/allwinner/a10_clk.c Wed Feb 10 08:03:10 2016 (r295463) +++ head/sys/arm/allwinner/a10_clk.c Wed Feb 10 09:19:29 2016 (r295464) @@ -109,7 +109,8 @@ static driver_t a10_ccm_driver = { static devclass_t a10_ccm_devclass; -DRIVER_MODULE(a10_ccm, simplebus, a10_ccm_driver, a10_ccm_devclass, 0, 0); +EARLY_DRIVER_MODULE(a10_ccm, simplebus, a10_ccm_driver, a10_ccm_devclass, 0, 0, + BUS_PASS_TIMER + BUS_PASS_ORDER_MIDDLE); int a10_clk_usb_activate(void) @@ -200,7 +201,7 @@ a10_clk_gmac_activate(phandle_t node) /* Set GMAC mode. */ reg_value = CCM_GMAC_CLK_MII; - if (OF_getprop_alloc(node, "phy-type", 1, (void **)&phy_type) > 0) { + if (OF_getprop_alloc(node, "phy-mode", 1, (void **)&phy_type) > 0) { if (strcasecmp(phy_type, "rgmii") == 0) reg_value = CCM_GMAC_CLK_RGMII | CCM_GMAC_MODE_RGMII; else if (strcasecmp(phy_type, "rgmii-bpi") == 0) { Modified: head/sys/arm/allwinner/a10_common.c ============================================================================== --- head/sys/arm/allwinner/a10_common.c Wed Feb 10 08:03:10 2016 (r295463) +++ head/sys/arm/allwinner/a10_common.c Wed Feb 10 09:19:29 2016 (r295464) @@ -50,7 +50,7 @@ fdt_aintc_decode_ic(phandle_t node, pcel { int offset; - if (fdt_is_compatible(node, "allwinner,sun4i-ic")) + if (fdt_is_compatible(node, "allwinner,sun4i-a10-ic")) offset = 0; else if (fdt_is_compatible(node, "arm,gic")) offset = 32; Modified: head/sys/arm/allwinner/a10_ehci.c ============================================================================== --- head/sys/arm/allwinner/a10_ehci.c Wed Feb 10 08:03:10 2016 (r295463) +++ head/sys/arm/allwinner/a10_ehci.c Wed Feb 10 09:19:29 2016 (r295464) @@ -43,10 +43,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include -#include +#include #include #include @@ -90,6 +90,12 @@ static device_detach_t a10_ehci_detach; bs_r_1_proto(reversed); bs_w_1_proto(reversed); +static struct ofw_compat_data compat_data[] = { + {"allwinner,sun4i-a10-ehci", 1}, + {"allwinner,sun7i-a20-ehci", 1}, + {NULL, 0} +}; + static int a10_ehci_probe(device_t self) { @@ -97,7 +103,7 @@ a10_ehci_probe(device_t self) if (!ofw_bus_status_okay(self)) return (ENXIO); - if (!ofw_bus_is_compatible(self, "allwinner,usb-ehci")) + if (ofw_bus_search_compatible(self, compat_data)->ocd_data == 0) return (ENXIO); device_set_desc(self, EHCI_HC_DEVSTR); Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Wed Feb 10 08:03:10 2016 (r295463) +++ head/sys/arm/allwinner/a10_gpio.c Wed Feb 10 09:19:29 2016 (r295464) @@ -73,6 +73,12 @@ __FBSDID("$FreeBSD$"); #define A10_GPIO_INPUT 0 #define A10_GPIO_OUTPUT 1 +static struct ofw_compat_data compat_data[] = { + {"allwinner,sun4i-a10-pinctrl", 1}, + {"allwinner,sun7i-a20-pinctrl", 1}, + {NULL, 0} +}; + struct a10_gpio_softc { device_t sc_dev; device_t sc_busdev; @@ -373,7 +379,7 @@ a10_gpio_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "allwinner,sun4i-gpio")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); device_set_desc(dev, "Allwinner GPIO controller"); @@ -493,7 +499,9 @@ static driver_t a10_gpio_driver = { sizeof(struct a10_gpio_softc), }; -DRIVER_MODULE(a10_gpio, simplebus, a10_gpio_driver, a10_gpio_devclass, 0, 0); +EARLY_DRIVER_MODULE(a10_gpio, simplebus, a10_gpio_driver, a10_gpio_devclass, 0, 0, + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); + int a10_gpio_ethernet_activate(uint32_t func) Modified: head/sys/arm/allwinner/a10_mmc.c ============================================================================== --- head/sys/arm/allwinner/a10_mmc.c Wed Feb 10 08:03:10 2016 (r295463) +++ head/sys/arm/allwinner/a10_mmc.c Wed Feb 10 09:19:29 2016 (r295464) @@ -62,6 +62,12 @@ static int a10_mmc_pio_mode = 0; TUNABLE_INT("hw.a10.mmc.pio_mode", &a10_mmc_pio_mode); +static struct ofw_compat_data compat_data[] = { + {"allwinner,sun4i-a10-mmc", 1}, + {"allwinner,sun5i-a13-mmc", 1}, + {NULL, 0} +}; + struct a10_mmc_softc { bus_space_handle_t a10_bsh; bus_space_tag_t a10_bst; @@ -123,8 +129,9 @@ a10_mmc_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "allwinner,sun4i-a10-mmc")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); + device_set_desc(dev, "Allwinner Integrated MMC/SD controller"); return (BUS_PROBE_DEFAULT); Modified: head/sys/arm/allwinner/a10_wdog.c ============================================================================== --- head/sys/arm/allwinner/a10_wdog.c Wed Feb 10 08:03:10 2016 (r295463) +++ head/sys/arm/allwinner/a10_wdog.c Wed Feb 10 09:19:29 2016 (r295464) @@ -95,7 +95,7 @@ a10wd_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (ofw_bus_is_compatible(dev, "allwinner,sun4i-wdt")) { + if (ofw_bus_is_compatible(dev, "allwinner,sun4i-a10-wdt")) { device_set_desc(dev, "Allwinner A10 Watchdog"); return (BUS_PROBE_DEFAULT); } Modified: head/sys/arm/allwinner/a20/a20_cpu_cfg.c ============================================================================== --- head/sys/arm/allwinner/a20/a20_cpu_cfg.c Wed Feb 10 08:03:10 2016 (r295463) +++ head/sys/arm/allwinner/a20/a20_cpu_cfg.c Wed Feb 10 09:19:29 2016 (r295464) @@ -117,7 +117,8 @@ static driver_t a20_cpu_cfg_driver = { static devclass_t a20_cpu_cfg_devclass; -DRIVER_MODULE(a20_cpu_cfg, simplebus, a20_cpu_cfg_driver, a20_cpu_cfg_devclass, 0, 0); +EARLY_DRIVER_MODULE(a20_cpu_cfg, simplebus, a20_cpu_cfg_driver, a20_cpu_cfg_devclass, 0, 0, + BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); uint64_t a20_read_counter64(void) Modified: head/sys/arm/allwinner/aintc.c ============================================================================== --- head/sys/arm/allwinner/aintc.c Wed Feb 10 08:03:10 2016 (r295463) +++ head/sys/arm/allwinner/aintc.c Wed Feb 10 09:19:29 2016 (r295464) @@ -79,6 +79,12 @@ __FBSDID("$FreeBSD$"); #define SW_INT_ENABLE_REG(_b) (0x40 + ((_b) * 4)) #define SW_INT_MASK_REG(_b) (0x50 + ((_b) * 4)) +static struct ofw_compat_data compat_data[] = { + {"allwinner,sun4i-a10-ic", 1}, + {"allwinner,sun7i-a20-sc-nmi", 1}, + {NULL, 0} +}; + struct a10_aintc_softc { device_t sc_dev; struct resource * aintc_res; @@ -101,7 +107,7 @@ a10_aintc_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "allwinner,sun4i-ic")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); device_set_desc(dev, "A10 AINTC Interrupt Controller"); return (BUS_PROBE_DEFAULT); @@ -158,7 +164,8 @@ static driver_t a10_aintc_driver = { static devclass_t a10_aintc_devclass; -DRIVER_MODULE(aintc, simplebus, a10_aintc_driver, a10_aintc_devclass, 0, 0); +EARLY_DRIVER_MODULE(aintc, simplebus, a10_aintc_driver, a10_aintc_devclass, 0, 0, + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_FIRST); int arm_get_next_irq(int last_irq) Modified: head/sys/arm/allwinner/files.a10 ============================================================================== --- head/sys/arm/allwinner/files.a10 Wed Feb 10 08:03:10 2016 (r295463) +++ head/sys/arm/allwinner/files.a10 Wed Feb 10 09:19:29 2016 (r295464) @@ -1,3 +1,4 @@ # $FreeBSD$ arm/allwinner/aintc.c standard +arm/allwinner/timer.c standard Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Wed Feb 10 08:03:10 2016 (r295463) +++ head/sys/arm/allwinner/files.allwinner Wed Feb 10 09:19:29 2016 (r295464) @@ -12,5 +12,4 @@ arm/allwinner/a10_wdog.c standard arm/allwinner/a20/a20_cpu_cfg.c standard arm/allwinner/allwinner_machdep.c standard arm/allwinner/if_emac.c optional emac -arm/allwinner/timer.c standard #arm/allwinner/console.c standard Modified: head/sys/arm/allwinner/if_emac.c ============================================================================== --- head/sys/arm/allwinner/if_emac.c Wed Feb 10 08:03:10 2016 (r295463) +++ head/sys/arm/allwinner/if_emac.c Wed Feb 10 09:19:29 2016 (r295464) @@ -756,7 +756,7 @@ static int emac_probe(device_t dev) { - if (!ofw_bus_is_compatible(dev, "allwinner,sun4i-emac")) + if (!ofw_bus_is_compatible(dev, "allwinner,sun4i-a10-emac")) return (ENXIO); device_set_desc(dev, "A10/A20 EMAC ethernet controller"); Modified: head/sys/arm/allwinner/timer.c ============================================================================== --- head/sys/arm/allwinner/timer.c Wed Feb 10 08:03:10 2016 (r295463) +++ head/sys/arm/allwinner/timer.c Wed Feb 10 09:19:29 2016 (r295464) @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); #include -#include "a20/a20_cpu_cfg.h" +#include /** * Timer registers addr @@ -84,7 +84,6 @@ struct a10_timer_softc { uint32_t sc_period; uint32_t timer0_freq; struct eventtimer et; - uint8_t sc_timer_type; /* 0 for A10, 1 for A20 */ }; int a10_timer_get_timerfreq(struct a10_timer_softc *); @@ -127,10 +126,6 @@ timer_read_counter64(void) { uint32_t lo, hi; - /* In case of A20 get appropriate counter info */ - if (a10_timer_sc->sc_timer_type) - return (a20_read_counter64()); - /* Latch counter, wait for it to be ready to read. */ timer_write_4(a10_timer_sc, CNT64_CTRL_REG, CNT64_RL_EN); while (timer_read_4(a10_timer_sc, CNT64_CTRL_REG) & CNT64_RL_EN) @@ -146,14 +141,16 @@ static int a10_timer_probe(device_t dev) { struct a10_timer_softc *sc; + u_int soc_family; sc = device_get_softc(dev); - if (ofw_bus_is_compatible(dev, "allwinner,sun4i-timer")) - sc->sc_timer_type = 0; - else if (ofw_bus_is_compatible(dev, "allwinner,sun7i-timer")) - sc->sc_timer_type = 1; - else + if (!ofw_bus_is_compatible(dev, "allwinner,sun4i-a10-timer")) + return (ENXIO); + + soc_family = allwinner_soc_family(); + if (soc_family != ALLWINNERSOC_SUN4I && + soc_family != ALLWINNERSOC_SUN5I) return (ENXIO); device_set_desc(dev, "Allwinner A10/A20 timer"); @@ -352,7 +349,8 @@ static driver_t a10_timer_driver = { static devclass_t a10_timer_devclass; -DRIVER_MODULE(a10_timer, simplebus, a10_timer_driver, a10_timer_devclass, 0, 0); +EARLY_DRIVER_MODULE(a10_timer, simplebus, a10_timer_driver, a10_timer_devclass, 0, 0, + BUS_PASS_TIMER + BUS_PASS_ORDER_MIDDLE); void DELAY(int usec) Copied and modified: head/sys/arm/conf/A10 (from r295446, head/sys/arm/conf/A20) ============================================================================== --- head/sys/arm/conf/A20 Tue Feb 9 18:43:52 2016 (r295446, copy source) +++ head/sys/arm/conf/A10 Wed Feb 10 09:19:29 2016 (r295464) @@ -1,5 +1,5 @@ # -# A20 -- Custom configuration for the Allwinner A20 ARM SoC +# A10 -- Custom configuration for the AllWinner A10 SoC # # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: @@ -18,16 +18,13 @@ # # $FreeBSD$ -ident A20 +ident A10 include "std.armv6" -include "../allwinner/a20/std.a20" - -options ARM_INTRNG +include "../allwinner/std.a10" options HZ=100 -options SCHED_ULE # ULE scheduler -options SMP # Enable multiple cores +options SCHED_4BSD # 4BSD scheduler options PLATFORM # Debugging for use in -current @@ -50,13 +47,7 @@ options WITNESS_SKIPSPIN # Don't run wi #options BOOTP_NFSROOT #options BOOTP_COMPAT #options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=dwc0 - -# Boot device is 2nd slice on MMC/SD card -options ROOTDEVNAME=\"ufs:/dev/da0s2\" - -# Interrupt controller -device gic +#options BOOTP_WIRED_TO=emac0 # MMC/SD/SDIO Card slot support device mmc # mmc/sd bus @@ -104,8 +95,7 @@ device ether device mii device bpf -#device emac # 10/100 integrated EMAC controller -device dwc # 10/100/1000 integrated GMAC controller +device emac # USB ethernet support, requires miibus device miibus Modified: head/sys/arm/conf/A20 ============================================================================== --- head/sys/arm/conf/A20 Wed Feb 10 08:03:10 2016 (r295463) +++ head/sys/arm/conf/A20 Wed Feb 10 09:19:29 2016 (r295464) @@ -52,12 +52,12 @@ options WITNESS_SKIPSPIN # Don't run wi #options BOOTP_NFSV3 #options BOOTP_WIRED_TO=dwc0 -# Boot device is 2nd slice on MMC/SD card -options ROOTDEVNAME=\"ufs:/dev/da0s2\" - # Interrupt controller device gic +# ARM Generic Timer +device generic_timer + # MMC/SD/SDIO Card slot support device mmc # mmc/sd bus device mmcsd # mmc/sd flash cards Modified: head/sys/arm64/arm64/swtch.S ============================================================================== --- head/sys/arm64/arm64/swtch.S Wed Feb 10 08:03:10 2016 (r295463) +++ head/sys/arm64/arm64/swtch.S Wed Feb 10 09:19:29 2016 (r295464) @@ -129,12 +129,6 @@ END(cpu_throw) * x3 to x7, x16 and x17 are caller saved */ ENTRY(cpu_switch) - /* Store the new curthread */ - str x1, [x18, #PC_CURTHREAD] - /* And the new pcb */ - ldr x4, [x1, #TD_PCB] - str x4, [x18, #PC_CURPCB] - /* * Save the old context. */ @@ -174,10 +168,15 @@ ENTRY(cpu_switch) mov x0, x19 #endif + /* Store the new curthread */ + str x1, [x18, #PC_CURTHREAD] + /* - * Restore the saved context. + * Restore the saved context and save it as the curpcb. */ ldr x4, [x1, #TD_PCB] + str x4, [x18, #PC_CURPCB] + /* * TODO: We may need to flush the cache here if switching Modified: head/sys/boot/fdt/dts/arm/bananapi.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/bananapi.dts Wed Feb 10 08:03:10 2016 (r295463) +++ head/sys/boot/fdt/dts/arm/bananapi.dts Wed Feb 10 09:19:29 2016 (r295464) @@ -28,7 +28,8 @@ /dts-v1/; -/include/ "sun7i-a20.dtsi" +#include "sun7i-a20.dtsi" + #include @@ -65,7 +66,7 @@ }; gmac@01c50000 { - phy-type = "rgmii-bpi"; + phy-mode = "rgmii-bpi"; status = "okay"; }; Modified: head/sys/boot/fdt/dts/arm/cubieboard2.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/cubieboard2.dts Wed Feb 10 08:03:10 2016 (r295463) +++ head/sys/boot/fdt/dts/arm/cubieboard2.dts Wed Feb 10 09:19:29 2016 (r295464) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2016 Emmanuel Vadot * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,78 +23,19 @@ * 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$ */ -/dts-v1/; - -/include/ "sun7i-a20.dtsi" - -#include +#include "sun7i-a20-cubieboard2.dts" / { - model = "Cubietech Cubieboard2"; - - memory { - device_type = "memory"; - reg = < 0x40000000 0x40000000 >; /* 1GB RAM */ - }; - - aliases { - soc = &SOC; - UART0 = &UART0; - }; - - SOC: a20 { - - usb1: usb@01c14000 { - status = "okay"; - }; - - usb2: usb@01c1c000 { - status = "okay"; - }; - - UART0: serial@01c28000 { - status = "okay"; - }; - - mmc0: mmc@01c0f000 { - status = "okay"; - }; - - emac@01c0b000 { - status = "okay"; - }; - - gmac@01c50000 { - status = "okay"; - }; - - ahci: sata@01c18000 { - status = "okay"; + soc@01c00000 { + ccm@01c20000 { + compatible = "allwinner,sun4i-ccm"; + #address-cells = <1>; + #size-cells = <1>; + reg = < 0x01c20000 0x400 >; }; }; - - leds { - compatible = "gpio-leds"; - - blue { - label = "cubieboard2:blue:usr"; - gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>; - }; - - green { - label = "cubieboard2:green:usr"; - gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>; - }; - }; - - chosen { - bootargs = "-v"; - stdin = "UART0"; - stdout = "UART0"; - }; }; - Copied and modified: head/sys/boot/fdt/dts/arm/olimex-a20-som-evb.dts (from r295446, head/sys/boot/fdt/dts/arm/bananapi.dts) ============================================================================== --- head/sys/boot/fdt/dts/arm/bananapi.dts Tue Feb 9 18:43:52 2016 (r295446, copy source) +++ head/sys/boot/fdt/dts/arm/olimex-a20-som-evb.dts Wed Feb 10 09:19:29 2016 (r295464) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2015 Emmanuel Vadot * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,70 +22,19 @@ * 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$ */ -/dts-v1/; - -/include/ "sun7i-a20.dtsi" - -#include +#include "sun7i-a20-olimex-som-evb.dts" / { - model = "LeMaker Banana Pi"; - compatible = "lemaker,bananapi", "allwinner,sun7i-a20"; - - memory { - device_type = "memory"; - reg = < 0x40000000 0x40000000 >; /* 1GB RAM */ - }; - - aliases { - soc = &SOC; - UART0 = &UART0; - }; - - SOC: a20 { - - usb1: usb@01c14000 { - status = "okay"; - }; - - usb2: usb@01c1c000 { - status = "okay"; - }; - - UART0: serial@01c28000 { - status = "okay"; + soc@01c00000 { + ccm@01c20000 { + compatible = "allwinner,sun4i-ccm"; + #address-cells = <1>; + #size-cells = <1>; + reg = < 0x01c20000 0x400 >; }; - - mmc0: mmc@01c0f000 { - status = "okay"; - }; - - gmac@01c50000 { - phy-type = "rgmii-bpi"; - status = "okay"; - }; - - ahci: sata@01c18000 { - status = "okay"; - }; - }; - - leds { - compatible = "gpio-leds"; - - green { - label = "bananapi:green:usr"; - gpios = <&pio 7 24 GPIO_ACTIVE_HIGH>; - }; - }; - - chosen { - bootargs = "-v"; - stdin = "UART0"; - stdout = "UART0"; }; }; Copied and modified: head/sys/boot/fdt/dts/arm/olinuxino-lime.dts (from r295446, head/sys/boot/fdt/dts/arm/bananapi.dts) ============================================================================== --- head/sys/boot/fdt/dts/arm/bananapi.dts Tue Feb 9 18:43:52 2016 (r295446, copy source) +++ head/sys/boot/fdt/dts/arm/olinuxino-lime.dts Wed Feb 10 09:19:29 2016 (r295464) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2015 Emmanuel Vadot * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,66 +26,15 @@ * $FreeBSD$ */ -/dts-v1/; - -/include/ "sun7i-a20.dtsi" - -#include +#include "sun4i-a10-olinuxino-lime.dts" / { - model = "LeMaker Banana Pi"; - compatible = "lemaker,bananapi", "allwinner,sun7i-a20"; - - memory { - device_type = "memory"; - reg = < 0x40000000 0x40000000 >; /* 1GB RAM */ - }; - - aliases { - soc = &SOC; - UART0 = &UART0; - }; - - SOC: a20 { - - usb1: usb@01c14000 { - status = "okay"; - }; - - usb2: usb@01c1c000 { - status = "okay"; - }; - - UART0: serial@01c28000 { - status = "okay"; + soc@01c00000 { + ccm@01c20000 { + compatible = "allwinner,sun4i-ccm"; + #address-cells = <1>; + #size-cells = <1>; + reg = < 0x01c20000 0x400 >; }; - - mmc0: mmc@01c0f000 { - status = "okay"; - }; - - gmac@01c50000 { - phy-type = "rgmii-bpi"; - status = "okay"; - }; - - ahci: sata@01c18000 { - status = "okay"; - }; - }; - - leds { - compatible = "gpio-leds"; - - green { - label = "bananapi:green:usr"; - gpios = <&pio 7 24 GPIO_ACTIVE_HIGH>; - }; - }; - - chosen { - bootargs = "-v"; - stdin = "UART0"; - stdout = "UART0"; }; }; Modified: head/sys/boot/fdt/dts/arm/sun4i-a10.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/sun4i-a10.dtsi Wed Feb 10 08:03:10 2016 (r295463) +++ head/sys/boot/fdt/dts/arm/sun4i-a10.dtsi Wed Feb 10 09:19:29 2016 (r295464) @@ -45,7 +45,7 @@ bus-frequency = <0>; AINTC: interrupt-controller@01c20400 { - compatible = "allwinner,sun4i-ic"; + compatible = "allwinner,sun4i-a10-ic"; interrupt-controller; #address-cells = <0>; #interrupt-cells = <1>; @@ -67,7 +67,7 @@ }; timer@01c20c00 { - compatible = "allwinner,sun4i-timer"; + compatible = "allwinner,sun4i-a10-timer"; reg = <0x01c20c00 0x90>; interrupts = < 22 >; interrupt-parent = <&AINTC>; @@ -82,7 +82,7 @@ GPIO: gpio@01c20800 { #gpio-cells = <3>; - compatible = "allwinner,sun4i-gpio"; + compatible = "allwinner,sun4i-a10-pinctrl"; gpio-controller; reg =< 0x01c20800 0x400 >; interrupts = < 28 >; @@ -90,14 +90,14 @@ }; usb1: usb@01c14000 { - compatible = "allwinner,usb-ehci", "usb-ehci"; + compatible = "allwinner,sun4i-a10-ehci", "generic-ehci"; reg = <0x01c14000 0x1000>; interrupts = < 39 >; interrupt-parent = <&AINTC>; }; usb2: usb@01c1c000 { - compatible = "allwinner,usb-ehci", "usb-ehci"; + compatible = "allwinner,sun4i-a10-ehci", "generic-ehci"; reg = <0x01c1c000 0x1000>; interrupts = < 40 >; interrupt-parent = <&AINTC>; @@ -130,7 +130,7 @@ }; emac@01c0b000 { - compatible = "allwinner,sun4i-emac"; + compatible = "allwinner,sun4i-a10-emac"; reg = <0x01c0b000 0x1000>; interrupts = <55>; interrupt-parent = <&AINTC>; Modified: head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi Wed Feb 10 08:03:10 2016 (r295463) +++ head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi Wed Feb 10 09:19:29 2016 (r295464) @@ -26,6 +26,8 @@ * $FreeBSD$ */ +#include + / { compatible = "allwinner,sun7i-a20"; #address-cells = <1>; @@ -37,6 +39,14 @@ soc = &SOC; }; + timer { + compatible = "arm,armv7-timer"; + interrupts = , + , + , + ; + }; + SOC: a20 { #address-cells = <1>; #size-cells = <1>; @@ -47,9 +57,12 @@ GIC: interrupt-controller@01c81000 { compatible = "arm,gic"; reg = <0x01c81000 0x1000>, /* Distributor Registers */ - <0x01c82000 0x0100>; /* CPU Interface Registers */ + <0x01c82000 0x0100>, /* CPU Interface Registers */ + <0x01c84000 0x2000>, + <0x01c86000 0x2000>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <3>; + interrupts = ; }; sramc@01c00000 { @@ -74,53 +87,59 @@ }; timer@01c20c00 { - compatible = "allwinner,sun7i-timer"; + compatible = "allwinner,sun4i-a10-timer"; reg = <0x01c20c00 0x90>; - interrupts = < 22 >; + interrupts = , + , + , + , + , + ; interrupt-parent = <&GIC>; clock-frequency = < 24000000 >; }; watchdog@01c20c90 { - compatible = "allwinner,sun4i-wdt"; + compatible = "allwinner,sun4i-a10-wdt"; reg = <0x01c20c90 0x10>; }; pio: gpio@01c20800 { #gpio-cells = <3>; - compatible = "allwinner,sun4i-gpio"; + compatible = "allwinner,sun7i-a20-pinctrl"; gpio-controller; reg =< 0x01c20800 0x400 >; - interrupts = < 28 >; + interrupts = ; + interrupt-controller; + #interrupt-cells = <2>; interrupt-parent = <&GIC>; }; usb1: usb@01c14000 { - compatible = "allwinner,usb-ehci", "usb-ehci"; + compatible = "allwinner,sun7i-a20-ehci", "generic-ehci"; reg = <0x01c14000 0x1000>; - interrupts = < 39 >; + interrupts = ; interrupt-parent = <&GIC>; }; usb2: usb@01c1c000 { - compatible = "allwinner,usb-ehci", "usb-ehci"; + compatible = "allwinner,sun7i-a20-ehci", "generic-ehci"; reg = <0x01c1c000 0x1000>; - interrupts = < 40 >; + interrupts = ; interrupt-parent = <&GIC>; }; mmc0: mmc@01c0f000 { - compatible = "allwinner,sun4i-a10-mmc"; + compatible = "allwinner,sun5i-a13-mmc"; reg = <0x01c0f000 0x1000>; - interrupts = <32>; - interrupt-parent = <&GIC>; + interrupts = ; status = "disabled"; }; sata@01c18000 { compatible = "allwinner,sun4i-a10-ahci"; reg = <0x01c18000 0x1000>; - interrupts = <56>; + interrupts = ; interrupt-parent = <&GIC>; status = "disabled"; }; @@ -129,16 +148,15 @@ compatible = "snps,dw-apb-uart"; reg = <0x01c28000 0x400>; reg-shift = <2>; - interrupts = <1>; - interrupt-parent = <&GIC>; + interrupts = ; current-speed = <115200>; clock-frequency = < 24000000 >; }; emac@01c0b000 { - compatible = "allwinner,sun4i-emac"; + compatible = "allwinner,sun4i-a10-emac"; reg = <0x01c0b000 0x1000>; - interrupts = <55>; + interrupts = ; interrupt-parent = <&GIC>; status = "disabled"; }; @@ -146,7 +164,7 @@ gmac@01c50000 { compatible = "allwinner,sun7i-a20-gmac"; reg = <0x01c50000 0x10000>; - interrupts = <85>; + interrupts = ; interrupt-parent = <&GIC>; snps,pbl = <2>; snps,fixed-burst; Modified: head/sys/modules/dtb/allwinner/Makefile ============================================================================== --- head/sys/modules/dtb/allwinner/Makefile Wed Feb 10 08:03:10 2016 (r295463) +++ head/sys/modules/dtb/allwinner/Makefile Wed Feb 10 09:19:29 2016 (r295464) @@ -3,6 +3,8 @@ DTS= \ bananapi.dts \ cubieboard.dts \ - cubieboard2.dts + cubieboard2.dts \ + olimex-a20-som-evb.dts \ + olinuxino-lime.dts .include From owner-svn-src-all@freebsd.org Wed Feb 10 09:40:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FC29AA48BB; Wed, 10 Feb 2016 09:40:46 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 703691CA4; Wed, 10 Feb 2016 09:40:46 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1A9ej5s086176; Wed, 10 Feb 2016 09:40:45 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1A9ejb6086175; Wed, 10 Feb 2016 09:40:45 GMT (envelope-from se@FreeBSD.org) Message-Id: <201602100940.u1A9ejb6086175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Wed, 10 Feb 2016 09:40:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295465 - head/usr.sbin/services_mkdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 09:40:46 -0000 Author: se Date: Wed Feb 10 09:40:45 2016 New Revision: 295465 URL: https://svnweb.freebsd.org/changeset/base/295465 Log: Remove O_SYNC from the options passed to dbmopen(). The services db is created as a temporary file that is moved over the existing file after completion. Thus there is no need to immediately flush all created db records to the temporary file. This speeds up creation of the services db by a factor of 500 on my ZFS based /var/db filesytem (from 110 seconds to 0.235 seconds). MFC after: 1 week Modified: head/usr.sbin/services_mkdb/services_mkdb.c Modified: head/usr.sbin/services_mkdb/services_mkdb.c ============================================================================== --- head/usr.sbin/services_mkdb/services_mkdb.c Wed Feb 10 09:19:29 2016 (r295464) +++ head/usr.sbin/services_mkdb/services_mkdb.c Wed Feb 10 09:40:45 2016 (r295465) @@ -141,7 +141,7 @@ main(int argc, char *argv[]) err(1, "Cannot install exit handler"); (void)snprintf(tname, sizeof(tname), "%s.tmp", dbname); - db = dbopen(tname, O_RDWR | O_CREAT | O_EXCL | O_SYNC, + db = dbopen(tname, O_RDWR | O_CREAT | O_EXCL, (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH), DB_HASH, &hinfo); if (!db) err(1, "Error opening temporary database `%s'", tname); From owner-svn-src-all@freebsd.org Wed Feb 10 09:53:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 805F7AA30C8; Wed, 10 Feb 2016 09:53:45 +0000 (UTC) (envelope-from thomas@FreeBSD.ORG) Received: from melamine.cuivre.fr.eu.org (houdart.cuivre.fr.eu.org [81.57.40.110]) (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 49E89946; Wed, 10 Feb 2016 09:53:44 +0000 (UTC) (envelope-from thomas@FreeBSD.ORG) Received: by melamine.cuivre.fr.eu.org (Postfix, from userid 1000) id 5BEBE113AB2; Wed, 10 Feb 2016 10:46:31 +0100 (CET) Date: Wed, 10 Feb 2016 10:46:31 +0100 From: Thomas Quinot To: Maxim Sobolev Cc: kib@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn: head/bin/dd Message-ID: <20160210094631.GA27555@melamine.cuivre.fr.eu.org> References: <201405071933.s47JXUx0046697@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-message-flag: WARNING! Using Outlook can damage your computer. User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 09:53:45 -0000 * Maxim Sobolev, 2016-02-10 : > $ dd if=/dev/zero of=/tmp/foo.bar bs=1m count=10 > 10+0 records in > 10+0 records out > 10485760 bytes transferred in 0.003244 secs (3232431656 bytes/sec) > $ ktrace dd if=/tmp/foo.bar of=/tmp/foo.bar1 bs=1m conv=sparse > 10+0 records in > 10+0 records out > $ ls -l /tmp/foo.bar /tmp/foo.bar1 > -rw-r--r-- 1 sobomax wheel 10485760 Feb 9 23:59 /tmp/foo.bar > -rw-r--r-- 1 sobomax wheel 0 Feb 9 23:59 /tmp/foo.bar1 Hummm, this looks clearly incorrect :-) Will look into this ASAP. Would you mind opening a PR so that we can track the analysis and resolution of this issue? Thanks! Thomas. From owner-svn-src-all@freebsd.org Wed Feb 10 10:28:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47E99AA4632; Wed, 10 Feb 2016 10:28:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 177871F14; Wed, 10 Feb 2016 10:28:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1AASYiP001149; Wed, 10 Feb 2016 10:28:34 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1AASYp6001147; Wed, 10 Feb 2016 10:28:34 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602101028.u1AASYp6001147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 10 Feb 2016 10:28:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295466 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 10:28:35 -0000 Author: andrew Date: Wed Feb 10 10:28:33 2016 New Revision: 295466 URL: https://svnweb.freebsd.org/changeset/base/295466 Log: Revert an arm64 change that sneaked in with r295464. Modified: head/sys/arm64/arm64/swtch.S Modified: head/sys/arm64/arm64/swtch.S ============================================================================== --- head/sys/arm64/arm64/swtch.S Wed Feb 10 09:40:45 2016 (r295465) +++ head/sys/arm64/arm64/swtch.S Wed Feb 10 10:28:33 2016 (r295466) @@ -129,6 +129,12 @@ END(cpu_throw) * x3 to x7, x16 and x17 are caller saved */ ENTRY(cpu_switch) + /* Store the new curthread */ + str x1, [x18, #PC_CURTHREAD] + /* And the new pcb */ + ldr x4, [x1, #TD_PCB] + str x4, [x18, #PC_CURPCB] + /* * Save the old context. */ @@ -168,15 +174,10 @@ ENTRY(cpu_switch) mov x0, x19 #endif - /* Store the new curthread */ - str x1, [x18, #PC_CURTHREAD] - /* - * Restore the saved context and save it as the curpcb. + * Restore the saved context. */ ldr x4, [x1, #TD_PCB] - str x4, [x18, #PC_CURPCB] - /* * TODO: We may need to flush the cache here if switching From owner-svn-src-all@freebsd.org Wed Feb 10 10:44:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A443EAA4C66; Wed, 10 Feb 2016 10:44:16 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 746B719A5; Wed, 10 Feb 2016 10:44:16 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp.Home (bcdf01bd.skybroadband.com [188.223.1.189]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id C5932D78FE; Wed, 10 Feb 2016 10:43:45 +0000 (UTC) Date: Wed, 10 Feb 2016 10:43:44 +0000 From: Andrew Turner To: Adrian Chadd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295459 - in head/sys: arm/include sys Message-ID: <20160210104344.493c5ab9@zapp.Home> In-Reply-To: <201602100443.u1A4h80W000230@repo.freebsd.org> References: <201602100443.u1A4h80W000230@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 10:44:16 -0000 On Wed, 10 Feb 2016 04:43:08 +0000 (UTC) Adrian Chadd wrote: > Author: adrian > Date: Wed Feb 10 04:43:08 2016 > New Revision: 295459 > URL: https://svnweb.freebsd.org/changeset/base/295459 > > Log: > Break out the shared bits of the arm intrng definitions into > sys/intr.h; leave the machine dependent bits in sys/arm/. > > This is in preparation for MIPS INTRNG work. > > Submitted by: Stanislav Galabov ... > Added: head/sys/sys/intr.h > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is > newly added) +++ head/sys/sys/intr.h Wed Feb 10 04:43:08 > 2016 (r295459) @@ -0,0 +1,130 @@ > +/* $NetBSD: intr.h,v 1.7 2003/06/16 20:01:00 thorpej Exp > $ */ + > +/*- > + * Copyright (c) 1997 Mark Brinicombe. > + * All rights reserved. Is this still the case? It seems all the code in this file was written for intrng and not by Mark Brinicombe. I would expect we could also fix the license below to move to a standard FreeBSD license. This would need all authors agreement, but that is maybe 5 people. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above > copyright > + * notice, this list of conditions and the following disclaimer > in the > + * documentation and/or other materials provided with the > distribution. > + * 3. All advertising materials mentioning features or use of this > software > + * must display the following acknowledgement: > + * This product includes software developed by Mark Brinicombe > + * for the NetBSD Project. > + * 4. The name of the company nor the name of the author may be used > to > + * endorse or promote products derived from this software without > specific > + * prior written permission. > + * > + * 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 OR CONTRIBUTORS BE LIABLE FOR ANY > DIRECT, > + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES > + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR > + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN > ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE > POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $FreeBSD$ > + * > + */ Andrew From owner-svn-src-all@freebsd.org Wed Feb 10 11:47:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F780AA3A08 for ; Wed, 10 Feb 2016 11:47:28 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.81]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 198A11BCB for ; Wed, 10 Feb 2016 11:47:27 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smtp.greenhost.nl ([213.108.104.138]) by smarthost1.greenhost.nl with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aTSzl-0003pA-3e for svn-src-all@freebsd.org; Wed, 10 Feb 2016 12:31:46 +0100 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: svn-src-all@freebsd.org Subject: Re: svn commit: r295465 - head/usr.sbin/services_mkdb References: <201602100940.u1A9ejb6086175@repo.freebsd.org> Date: Wed, 10 Feb 2016 12:31:39 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Ronald Klop" Message-ID: In-Reply-To: <201602100940.u1A9ejb6086175@repo.freebsd.org> User-Agent: Opera Mail/12.16 (FreeBSD) X-Authenticated-As-Hash: 398f5522cb258ce43cb679602f8cfe8b62a256d1 X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: -0.2 X-Spam-Status: No, score=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 autolearn=disabled version=3.4.0 X-Scan-Signature: ba572e8a3bde05b4b19613c12a9e49fc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 11:47:28 -0000 On Wed, 10 Feb 2016 10:40:45 +0100, Stefan Esser wrote: > Author: se > Date: Wed Feb 10 09:40:45 2016 > New Revision: 295465 > URL: https://svnweb.freebsd.org/changeset/base/295465 > > Log: > Remove O_SYNC from the options passed to dbmopen(). > The services db is created as a temporary file that is moved over the > existing file after completion. Thus there is no need to immediately > flush all created db records to the temporary file. > This speeds up creation of the services db by a factor of 500 on my > ZFS based /var/db filesytem (from 110 seconds to 0.235 seconds). > MFC after: 1 week Nice! My ARM installation on an USB stick was so slow I stopped waiting for this and started to do tricks of running a tmp dir on the building host. Regards, Ronald. > Modified: > head/usr.sbin/services_mkdb/services_mkdb.c > > Modified: head/usr.sbin/services_mkdb/services_mkdb.c > ============================================================================== > --- head/usr.sbin/services_mkdb/services_mkdb.c Wed Feb 10 09:19:29 > 2016 (r295464) > +++ head/usr.sbin/services_mkdb/services_mkdb.c Wed Feb 10 09:40:45 > 2016 (r295465) > @@ -141,7 +141,7 @@ main(int argc, char *argv[]) > err(1, "Cannot install exit handler"); > (void)snprintf(tname, sizeof(tname), "%s.tmp", dbname); > - db = dbopen(tname, O_RDWR | O_CREAT | O_EXCL | O_SYNC, > + db = dbopen(tname, O_RDWR | O_CREAT | O_EXCL, > (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH), DB_HASH, &hinfo); > if (!db) > err(1, "Error opening temporary database `%s'", tname); > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-all@freebsd.org Wed Feb 10 12:14:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E09CEAA4D64; Wed, 10 Feb 2016 12:14:57 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 B76521152; Wed, 10 Feb 2016 12:14:57 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1ACEuAg033305; Wed, 10 Feb 2016 12:14:56 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1ACEuSQ033300; Wed, 10 Feb 2016 12:14:56 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201602101214.u1ACEuSQ033300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 10 Feb 2016 12:14:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295467 - in head/sys/dev/sfxge: . common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 12:14:58 -0000 Author: arybchik Date: Wed Feb 10 12:14:56 2016 New Revision: 295467 URL: https://svnweb.freebsd.org/changeset/base/295467 Log: sfxge: implement SIOCGI2C to read information from phy modules The IOCTL is used by 'ifconfig -v' to show SFP+/QSFP+ information including inventory information and dianostics (temperature, light levels, voltage etc). Reviewed by: gnn,melifaro Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D5240 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/efx_mcdi.h head/sys/dev/sfxge/common/efx_phy.c head/sys/dev/sfxge/sfxge.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Wed Feb 10 10:28:33 2016 (r295466) +++ head/sys/dev/sfxge/common/efx.h Wed Feb 10 12:14:56 2016 (r295467) @@ -879,6 +879,14 @@ efx_phy_media_type_get( __in efx_nic_t *enp, __out efx_phy_media_type_t *typep); +extern efx_rc_t +efx_phy_module_get_info( + __in efx_nic_t *enp, + __in uint8_t dev_addr, + __in uint8_t offset, + __in uint8_t len, + __out_bcount(len) uint8_t *data); + #if EFSYS_OPT_PHY_STATS /* START MKCONFIG GENERATED PhyHeaderStatsBlock 30ed56ad501f8e36 */ Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Wed Feb 10 10:28:33 2016 (r295466) +++ head/sys/dev/sfxge/common/efx_mcdi.c Wed Feb 10 12:14:56 2016 (r295467) @@ -2078,5 +2078,217 @@ fail1: return (rc); } +/* + * Size of media information page in accordance with SFF-8472 and SFF-8436. + * It is used in MCDI interface as well. + */ +#define EFX_PHY_MEDIA_INFO_PAGE_SIZE 0x80 + +static __checkReturn efx_rc_t +efx_mcdi_get_phy_media_info( + __in efx_nic_t *enp, + __in uint32_t mcdi_page, + __in uint8_t offset, + __in uint8_t len, + __out_bcount(len) uint8_t *data) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_GET_PHY_MEDIA_INFO_IN_LEN, + MC_CMD_GET_PHY_MEDIA_INFO_OUT_LEN( + EFX_PHY_MEDIA_INFO_PAGE_SIZE))]; + efx_rc_t rc; + + EFSYS_ASSERT((uint32_t)offset + len <= EFX_PHY_MEDIA_INFO_PAGE_SIZE); + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_GET_PHY_MEDIA_INFO; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_GET_PHY_MEDIA_INFO_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = + MC_CMD_GET_PHY_MEDIA_INFO_OUT_LEN(EFX_PHY_MEDIA_INFO_PAGE_SIZE); + + MCDI_IN_SET_DWORD(req, GET_PHY_MEDIA_INFO_IN_PAGE, mcdi_page); + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (req.emr_out_length_used != + MC_CMD_GET_PHY_MEDIA_INFO_OUT_LEN(EFX_PHY_MEDIA_INFO_PAGE_SIZE)) { + rc = EMSGSIZE; + goto fail2; + } + + if (MCDI_OUT_DWORD(req, GET_PHY_MEDIA_INFO_OUT_DATALEN) != + EFX_PHY_MEDIA_INFO_PAGE_SIZE) { + rc = EIO; + goto fail3; + } + + memcpy(data, + MCDI_OUT2(req, uint8_t, GET_PHY_MEDIA_INFO_OUT_DATA) + offset, + len); + + return (0); + +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +/* + * 2-wire device address of the base information in accordance with SFF-8472 + * Diagnostic Monitoring Interface for Optical Transceivers section + * 4 Memory Organization. + */ +#define EFX_PHY_MEDIA_INFO_DEV_ADDR_SFP_BASE 0xA0 + +/* + * 2-wire device address of the digital diagnostics monitoring interface + * in accordance with SFF-8472 Diagnostic Monitoring Interface for Optical + * Transceivers section 4 Memory Organization. + */ +#define EFX_PHY_MEDIA_INFO_DEV_ADDR_SFP_DDM 0xA2 + +/* + * Hard wired 2-wire device address for QSFP+ in accordance with SFF-8436 + * QSFP+ 10 Gbs 4X PLUGGABLE TRANSCEIVER section 7.4 Device Addressing and + * Operation. + */ +#define EFX_PHY_MEDIA_INFO_DEV_ADDR_QSFP 0xA0 + + __checkReturn efx_rc_t +efx_mcdi_phy_module_get_info( + __in efx_nic_t *enp, + __in uint8_t dev_addr, + __in uint8_t offset, + __in uint8_t len, + __out_bcount(len) uint8_t *data) +{ + efx_port_t *epp = &(enp->en_port); + efx_rc_t rc; + uint32_t mcdi_lower_page; + uint32_t mcdi_upper_page; + + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); + + /* + * Map device address to MC_CMD_GET_PHY_MEDIA_INFO pages. + * Offset plus length interface allows to access page 0 only. + * I.e. non-zero upper pages are not accessible. + * See SFF-8472 section 4 Memory Organization and SFF-8436 section 7.6 + * QSFP+ Memory Map for details on how information is structured + * and accessible. + */ + switch (epp->ep_fixed_port_type) { + case EFX_PHY_MEDIA_SFP_PLUS: + /* + * In accordance with SFF-8472 Diagnostic Monitoring + * Interface for Optical Transceivers section 4 Memory + * Organization two 2-wire addresses are defined. + */ + switch (dev_addr) { + /* Base information */ + case EFX_PHY_MEDIA_INFO_DEV_ADDR_SFP_BASE: + /* + * MCDI page 0 should be used to access lower + * page 0 (0x00 - 0x7f) at the device address 0xA0. + */ + mcdi_lower_page = 0; + /* + * MCDI page 1 should be used to access upper + * page 0 (0x80 - 0xff) at the device address 0xA0. + */ + mcdi_upper_page = 1; + break; + /* Diagnostics */ + case EFX_PHY_MEDIA_INFO_DEV_ADDR_SFP_DDM: + /* + * MCDI page 2 should be used to access lower + * page 0 (0x00 - 0x7f) at the device address 0xA2. + */ + mcdi_lower_page = 2; + /* + * MCDI page 3 should be used to access upper + * page 0 (0x80 - 0xff) at the device address 0xA2. + */ + mcdi_upper_page = 3; + break; + default: + rc = ENOTSUP; + goto fail1; + } + break; + case EFX_PHY_MEDIA_QSFP_PLUS: + switch (dev_addr) { + case EFX_PHY_MEDIA_INFO_DEV_ADDR_QSFP: + /* + * MCDI page -1 should be used to access lower page 0 + * (0x00 - 0x7f). + */ + mcdi_lower_page = (uint32_t)-1; + /* + * MCDI page 0 should be used to access upper page 0 + * (0x80h - 0xff). + */ + mcdi_upper_page = 0; + break; + default: + rc = ENOTSUP; + goto fail1; + } + break; + default: + rc = ENOTSUP; + goto fail1; + } + + if (offset < EFX_PHY_MEDIA_INFO_PAGE_SIZE) { + uint8_t read_len = + MIN(len, EFX_PHY_MEDIA_INFO_PAGE_SIZE - offset); + + rc = efx_mcdi_get_phy_media_info(enp, + mcdi_lower_page, offset, read_len, data); + if (rc != 0) + goto fail2; + + data += read_len; + len -= read_len; + + offset = 0; + } else { + offset -= EFX_PHY_MEDIA_INFO_PAGE_SIZE; + } + + if (len > 0) { + EFSYS_ASSERT3U(len, <=, EFX_PHY_MEDIA_INFO_PAGE_SIZE); + EFSYS_ASSERT3U(offset, <, EFX_PHY_MEDIA_INFO_PAGE_SIZE); + + rc = efx_mcdi_get_phy_media_info(enp, + mcdi_upper_page, offset, len, data); + if (rc != 0) + goto fail3; + } + + return (0); + +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} #endif /* EFSYS_OPT_MCDI */ Modified: head/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.h Wed Feb 10 10:28:33 2016 (r295466) +++ head/sys/dev/sfxge/common/efx_mcdi.h Wed Feb 10 12:14:56 2016 (r295467) @@ -228,6 +228,14 @@ efx_mcdi_get_loopback_modes( __in efx_nic_t *enp); #endif /* EFSYS_OPT_LOOPBACK */ +extern __checkReturn efx_rc_t +efx_mcdi_phy_module_get_info( + __in efx_nic_t *enp, + __in uint8_t dev_addr, + __in uint8_t offset, + __in uint8_t len, + __out_bcount(len) uint8_t *data); + #define MCDI_IN(_emr, _type, _ofst) \ ((_type *)((_emr).emr_in_buf + (_ofst))) Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Wed Feb 10 10:28:33 2016 (r295466) +++ head/sys/dev/sfxge/common/efx_phy.c Wed Feb 10 12:14:56 2016 (r295467) @@ -560,6 +560,38 @@ efx_phy_media_type_get( *typep = epp->ep_fixed_port_type; } + __checkReturn efx_rc_t +efx_phy_module_get_info( + __in efx_nic_t *enp, + __in uint8_t dev_addr, + __in uint8_t offset, + __in uint8_t len, + __out_bcount(len) uint8_t *data) +{ + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT(data != NULL); + + if ((uint32_t)offset + len > 0xff) { + rc = EINVAL; + goto fail1; + } + + if ((rc = efx_mcdi_phy_module_get_info(enp, dev_addr, + offset, len, data)) != 0) + goto fail2; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + #if EFSYS_OPT_PHY_STATS #if EFSYS_OPT_NAMES Modified: head/sys/dev/sfxge/sfxge.c ============================================================================== --- head/sys/dev/sfxge/sfxge.c Wed Feb 10 10:28:33 2016 (r295466) +++ head/sys/dev/sfxge/sfxge.c Wed Feb 10 12:14:56 2016 (r295467) @@ -500,6 +500,30 @@ sfxge_if_ioctl(struct ifnet *ifp, unsign case SIOCGIFMEDIA: error = ifmedia_ioctl(ifp, ifr, &sc->media, command); break; +#ifdef SIOCGI2C + case SIOCGI2C: + { + struct ifi2creq i2c; + + error = copyin(ifr->ifr_data, &i2c, sizeof(i2c)); + if (error != 0) + break; + + if (i2c.len > sizeof(i2c.data)) { + error = EINVAL; + break; + } + + SFXGE_ADAPTER_LOCK(sc); + error = efx_phy_module_get_info(sc->enp, i2c.dev_addr, + i2c.offset, i2c.len, + &i2c.data[0]); + SFXGE_ADAPTER_UNLOCK(sc); + if (error == 0) + error = copyout(&i2c, ifr->ifr_data, sizeof(i2c)); + break; + } +#endif case SIOCGPRIVATE_0: error = priv_check(curthread, PRIV_DRIVER); if (error != 0) From owner-svn-src-all@freebsd.org Wed Feb 10 14:48:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DA03AA3D22; Wed, 10 Feb 2016 14:48:51 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 12662CC4; Wed, 10 Feb 2016 14:48:51 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1AEmoJ3077595; Wed, 10 Feb 2016 14:48:50 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1AEmnm1077592; Wed, 10 Feb 2016 14:48:49 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201602101448.u1AEmnm1077592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Wed, 10 Feb 2016 14:48:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295468 - in head: lib/libc/sys usr.sbin/jail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 14:48:51 -0000 Author: jamie Date: Wed Feb 10 14:48:49 2016 New Revision: 295468 URL: https://svnweb.freebsd.org/changeset/base/295468 Log: Remove man page references to rndassociates.com, which has been taken over by a domain squatter. Modified: head/lib/libc/sys/jail.2 head/usr.sbin/jail/jail.8 head/usr.sbin/jail/jail.conf.5 Modified: head/lib/libc/sys/jail.2 ============================================================================== --- head/lib/libc/sys/jail.2 Wed Feb 10 12:14:56 2016 (r295467) +++ head/lib/libc/sys/jail.2 Wed Feb 10 14:48:49 2016 (r295468) @@ -405,7 +405,6 @@ system calls appeared in The jail feature was written by .An Poul-Henning Kamp for R&D Associates -.Dq Li http://www.rndassociates.com/ who contributed it to .Fx . .An James Gritton Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Wed Feb 10 12:14:56 2016 (r295467) +++ head/usr.sbin/jail/jail.8 Wed Feb 10 14:48:49 2016 (r295468) @@ -1260,7 +1260,6 @@ The configuration file was introduced in The jail feature was written by .An Poul-Henning Kamp for R&D Associates -.Pa http://www.rndassociates.com/ who contributed it to .Fx . .Pp Modified: head/usr.sbin/jail/jail.conf.5 ============================================================================== --- head/usr.sbin/jail/jail.conf.5 Wed Feb 10 12:14:56 2016 (r295467) +++ head/usr.sbin/jail/jail.conf.5 Wed Feb 10 14:48:49 2016 (r295468) @@ -224,7 +224,6 @@ file was added in The jail feature was written by .An Poul-Henning Kamp for R&D Associates -.Pa http://www.rndassociates.com/ who contributed it to .Fx . .Pp From owner-svn-src-all@freebsd.org Wed Feb 10 15:07:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A88E1AA4598 for ; Wed, 10 Feb 2016 15:07:41 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from erouter6.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) (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 733471539 for ; Wed, 10 Feb 2016 15:07:41 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 829f6b7c-d007-11e5-a023-11ad6df26ed1 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Wed, 10 Feb 2016 15:03:57 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u1AF6SNT013680; Wed, 10 Feb 2016 08:06:29 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1455116788.1337.99.camel@freebsd.org> Subject: Re: svn commit: r295459 - in head/sys: arm/include sys From: Ian Lepore To: Andrew Turner , Adrian Chadd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 10 Feb 2016 08:06:28 -0700 In-Reply-To: <20160210104344.493c5ab9@zapp.Home> References: <201602100443.u1A4h80W000230@repo.freebsd.org> <20160210104344.493c5ab9@zapp.Home> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 15:07:41 -0000 On Wed, 2016-02-10 at 10:43 +0000, Andrew Turner wrote: > On Wed, 10 Feb 2016 04:43:08 +0000 (UTC) > Adrian Chadd wrote: > > > Author: adrian > > Date: Wed Feb 10 04:43:08 2016 > > New Revision: 295459 > > URL: https://svnweb.freebsd.org/changeset/base/295459 > > > > Log: > > Break out the shared bits of the arm intrng definitions into > > sys/intr.h; leave the machine dependent bits in sys/arm/. > > > > This is in preparation for MIPS INTRNG work. > > > > Submitted by: Stanislav Galabov > ... > > Added: head/sys/sys/intr.h > > =================================================================== > > =========== > > --- /dev/null 00:00:00 1970 (empty, because file is > > newly added) +++ head/sys/sys/intr.h Wed Feb 10 04:43:08 > > 2016 (r295459) @@ -0,0 +1,130 @@ > > +/* $NetBSD: intr.h,v 1.7 2003/06/16 20:01:00 thorpej Exp > > $ */ + > > +/*- > > + * Copyright (c) 1997 Mark Brinicombe. > > + * All rights reserved. > > Is this still the case? It seems all the code in this file was > written > for intrng and not by Mark Brinicombe. > > I would expect we could also fix the license below to move to a > standard FreeBSD license. This would need all authors agreement, but > that is maybe 5 people. Yep, that's all pasted boilerplate from some older arm/include file that just doesn't apply to even a single line of this intr.h. The actual authors of this would be Jakub Klama, Svata Kraus, and me. -- Ian From owner-svn-src-all@freebsd.org Wed Feb 10 15:08:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA604AA4669 for ; Wed, 10 Feb 2016 15:08:44 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm20.bullet.mail.bf1.yahoo.com (nm20.bullet.mail.bf1.yahoo.com [98.139.212.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FA9917CB for ; Wed, 10 Feb 2016 15:08:44 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1455116922; bh=HG6NtfK5KSdAbMJgo985p4UzXox9V4TtNhi4C4xb6JE=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=JJ7/Gon+4uOhf/R+mwJKks8l5xSpnkHShEXfnk2bpwC605Ly9ryQjz+wkQg5CXGpkuecAygRAH8uIJdP9Y8mj6tJzjbSKAhP2MHEbZ5htl710xJlDjk1hkHK/gpb8Q/+rW/4yqmLrqPsCxYpnAeE86GzVHm2jUTSld6f2J4T3BHuC9nHwyTHuQ79ikbMx519PnlihmUVO+uo7350975Ol57DuMwN+vrzfGKT06ZSK4uovTiWyk68BmsbAjsmbwDDbGAPQ3bZ8WS6fbsfjcdHyKXFTtdZyPGl4C+gX9L7bD3gS860jB/ecJB3jEHcU6/dJD2UC4NprF/UX9x2FgIsgw== Received: from [98.139.170.178] by nm20.bullet.mail.bf1.yahoo.com with NNFMP; 10 Feb 2016 15:08:42 -0000 Received: from [68.142.230.71] by tm21.bullet.mail.bf1.yahoo.com with NNFMP; 10 Feb 2016 15:08:42 -0000 Received: from [127.0.0.1] by smtp228.mail.bf1.yahoo.com with NNFMP; 10 Feb 2016 15:08:42 -0000 X-Yahoo-Newman-Id: 780862.37068.bm@smtp228.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: IcuoONEVM1mNEsvhaOG4hgWczuh0o1AdgvQNBDpGKg_M988 dLFS8Hd886UJgfWUnr2eSJIK9il.leN84zg254BEk3_WhMFH._seGTXqevJC JdApNt.0lyySaV1Q6H8L4P_7deGxwVNtrAFlWrzK5Db.pifabOshkPVHsmua EfqR_rUbLx8nivL9yZ1WhJDyqTGGCROdcitFYpipmpWt7y7twEBMzTiiDSeC G5H3NMTWUcg8uvhApstozTRDU5UooksIF838lrKlxOfIqZdaVTsiaJ2j8jnp m4kAl3cyIc2.86.sbD8rkVkRkkzXTuhTzOOZHCLzaEIv7htEkNfbXhWQFVcZ cwjs5H2CZX21Riz_IImanbwjztDQSyC3fMINXC0x.9O.6qQVk3UvDuA0Qitj KiLhdOyQE8qr9JlFgKmuXi0jFApYzHlbP35N0wDU2xfRz5jwxAaQ3EzWQyfk x9qN_brgPIp8hLIRoaVC7j.b4lQ8lgbFAIhjY2fqikd4YNZSODxM4ubeWMev 3J3Fmk3EgM0d9JWA_74.FxRRqmxquS_z. X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r294327 - in head/sys: dev/cxgb dev/cxgbe dev/e1000 dev/hyperv/netvsc dev/ixgbe dev/mxge netinet sys To: Hans Petter Selasky , Ryan Stone References: <201601191533.u0JFXSxf037804@repo.freebsd.org> <56BAE4BC.9000105@selasky.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Pedro Giffuni Message-ID: <56BB5280.5060609@FreeBSD.org> Date: Wed, 10 Feb 2016 10:08:48 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56BAE4BC.9000105@selasky.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 15:08:45 -0000 Hello; El 10/02/2016 a las 02:20, Hans Petter Selasky escribió: > On 01/19/16 17:09, Ryan Stone wrote: >> On Tue, Jan 19, 2016 at 10:33 AM, Hans Petter Selasky >> >> wrote: >> >>> >>> + qsort(lc->lro_mbuf_data, lc->lro_mbuf_count, sizeof(struct >>> mbuf *), >>> + &tcp_lro_mbuf_compare_header); >>> >> >> In the worst case, qsort() can take O(n**2) time and consume O(n) stack >> space. Is there a DOS concern here? >> > > Hi, > > Our FreeBSD qsort() routine has been specifically modified to not > exhibit the so-called QuickSort worst case behaviour of O(N**2) > sorting time. This is not documented in our source code, but here: > > http://cs.fit.edu/~pkc/classes/writing/samples/bentley93engineering.pdf > > So I think DOS w.r.t O(N**2) is not a valid consern. > > Thank you for your input Ryan. > > BTW: > > Drew Gallatin has tested our qsort() v.s. my mergesort() and found that: > > "It looks like mergesort is nearly 2x as expensive. (4.7% vs 2.5%)" > FWIW, our libc qsort() has an additional enhancement: http://svnweb.freebsd.org/base?view=revision&revision=279663 In my measurements qsort(3) was now always faster than mergesort(3). Pedro. From owner-svn-src-all@freebsd.org Wed Feb 10 15:56:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0080AA3B7F; Wed, 10 Feb 2016 15:56:53 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 6F5D5FEB; Wed, 10 Feb 2016 15:56:53 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1AFuqUs097852; Wed, 10 Feb 2016 15:56:52 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1AFuqUo097851; Wed, 10 Feb 2016 15:56:52 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602101556.u1AFuqUo097851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 10 Feb 2016 15:56:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295470 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 15:56:53 -0000 Author: andrew Date: Wed Feb 10 15:56:52 2016 New Revision: 295470 URL: https://svnweb.freebsd.org/changeset/base/295470 Log: Use OF_getencprop to read a property, it already handles the endian conversion so we don't need to pass the data through fdt32_to_cpu. Modified: head/sys/arm/arm/generic_timer.c Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Wed Feb 10 15:39:59 2016 (r295469) +++ head/sys/arm/arm/generic_timer.c Wed Feb 10 15:56:52 2016 (r295470) @@ -361,11 +361,8 @@ arm_tmr_attach(device_t dev) /* Get the base clock frequency */ node = ofw_bus_get_node(dev); if (node > 0) { - error = OF_getprop(node, "clock-frequency", &clock, + error = OF_getencprop(node, "clock-frequency", &clock, sizeof(clock)); - if (error > 0) { - sc->clkfreq = fdt32_to_cpu(clock); - } } #endif From owner-svn-src-all@freebsd.org Wed Feb 10 16:14:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7DF9AA44DF; Wed, 10 Feb 2016 16:14:00 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 5CBBA1B07; Wed, 10 Feb 2016 16:14:00 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1AGDxFP003887; Wed, 10 Feb 2016 16:13:59 GMT (envelope-from feld@FreeBSD.org) Received: (from feld@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1AGDx0I003885; Wed, 10 Feb 2016 16:13:59 GMT (envelope-from feld@FreeBSD.org) Message-Id: <201602101613.u1AGDx0I003885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: feld set sender to feld@FreeBSD.org using -f From: Mark Felder Date: Wed, 10 Feb 2016 16:13:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295471 - in head/etc: defaults rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 16:14:00 -0000 Author: feld (ports committer) Date: Wed Feb 10 16:13:59 2016 New Revision: 295471 URL: https://svnweb.freebsd.org/changeset/base/295471 Log: Add new rc.conf parameter "jail_reverse_stop" When a user defines "jail_list" in rc.conf the jails are started in the order defined. Currently the jails are not are stopped in reverse order which may break dependencies between jails/services and prevent a clean shutdown. The new parameter "jail_reverse_stop" will shutdown jails in "jail_list" in reverse order when set to "YES". Please note that this does not affect manual invocation of the jail rc script. If a user runs the command # service jail stop jail1 jail2 jail3 the jails will be stopped in exactly the order specified regardless of jail_reverse_stop being defined in rc.conf. PR: 196152 Approved by: jamie MFC after: 1 week Relnotes: yes Differential Revision: https://reviews.freebsd.org/D5233 Modified: head/etc/defaults/rc.conf head/etc/rc.d/jail Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Wed Feb 10 15:56:52 2016 (r295470) +++ head/etc/defaults/rc.conf Wed Feb 10 16:13:59 2016 (r295471) @@ -694,6 +694,7 @@ iovctl_files="" # Config files for iovc jail_enable="NO" # Set to NO to disable starting of any jails jail_parallel_start="NO" # Start jails in the background jail_list="" # Space separated list of names of jails +jail_reverse_stop="NO" # Stop jails in reverse order ############################################################## ### Define source_rc_confs, the mechanism used by /etc/rc.* ## Modified: head/etc/rc.d/jail ============================================================================== --- head/etc/rc.d/jail Wed Feb 10 15:56:52 2016 (r295470) +++ head/etc/rc.d/jail Wed Feb 10 16:13:59 2016 (r295471) @@ -521,7 +521,11 @@ jail_stop() command=$jail_program rc_flags=$jail_flags command_args="-f $jail_conf -r" - $jail_jls name | while read _j; do + if checkyesno jail_reverse_stop; then + $jail_jls name | tail -r + else + $jail_jls name + fi | while read _j; do echo -n " $_j" _tmp=`mktemp -t jail` || exit 3 $command $rc_flags $command_args $_j >> $_tmp 2>&1 @@ -536,6 +540,7 @@ jail_stop() return ;; esac + checkyesno jail_reverse_stop && set -- $(reverse_list $@) for _j in $@; do _j=$(echo $_j | tr /. _) _jv=$(echo -n $_j | tr -c '[:alnum:]' _) @@ -571,5 +576,6 @@ jail_warn() load_rc_config $name case $# in 1) run_rc_command $@ ${jail_list:-_ALL} ;; -*) run_rc_command $@ ;; +*) jail_reverse_stop="no" + run_rc_command $@ ;; esac From owner-svn-src-all@freebsd.org Wed Feb 10 16:21:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B08FAA48CF for ; Wed, 10 Feb 2016 16:21:35 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (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 179D11FE1 for ; Wed, 10 Feb 2016 16:21:35 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 13D1521969 for ; Wed, 10 Feb 2016 11:21:33 -0500 (EST) Received: from web6 ([10.202.2.216]) by compute2.internal (MEProxy); Wed, 10 Feb 2016 11:21:33 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=M4mxfRBSSeSm5ew aGtrYiYuY5F8=; b=GjqEfJoT3afZsTxzhyEg+T8Kz5M7Jlerksnd0NAbJkmwQ8F CBqF9rHkZdAgzh9own5587EJ3eluOUUWo3Smfd6DAYHKtQw64j9W/0/1tyJI9/OG aieT2eZ5FhkYu7hjpCGdazijFgUYuCjL4tHpjf5OJaEMoJGO14AJmxHyt8nk= Received: by web6.nyi.internal (Postfix, from userid 99) id DE02548542; Wed, 10 Feb 2016 11:21:32 -0500 (EST) Message-Id: <1455121292.39853.517444890.26CE5F4A@webmail.messagingengine.com> X-Sasl-Enc: 0VhNeuTqpwmBQMFLAbsRoTyjiZGtkCyxngXBv4nLpkdk 1455121292 From: Mark Felder To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Cc: jamie@FreeBSD.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-e69f0414 In-Reply-To: <201602101613.u1AGDx0I003885@repo.freebsd.org> References: <201602101613.u1AGDx0I003885@repo.freebsd.org> Subject: Re: svn commit: r295471 - in head/etc: defaults rc.d Date: Wed, 10 Feb 2016 10:21:32 -0600 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 16:21:35 -0000 On Wed, Feb 10, 2016, at 10:13, Mark Felder wrote: > Author: feld (ports committer) > Date: Wed Feb 10 16:13:59 2016 > New Revision: 295471 > URL: https://svnweb.freebsd.org/changeset/base/295471 > > Log: > Add new rc.conf parameter "jail_reverse_stop" > It has occurred to me that these settings are also defined in the rc.conf man page. I will open a review with Jamie immediately and rectify this oversight. -- Mark Felder ports-secteam member feld@FreeBSD.org From owner-svn-src-all@freebsd.org Wed Feb 10 16:39:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0D86AA4E6D; Wed, 10 Feb 2016 16:39:03 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 A19F4DC1; Wed, 10 Feb 2016 16:39:03 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1AGd21s009798; Wed, 10 Feb 2016 16:39:02 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1AGd2uo009797; Wed, 10 Feb 2016 16:39:02 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602101639.u1AGd2uo009797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 10 Feb 2016 16:39:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295472 - head/sys/arm/qemu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 16:39:03 -0000 Author: andrew Date: Wed Feb 10 16:39:02 2016 New Revision: 295472 URL: https://svnweb.freebsd.org/changeset/base/295472 Log: Only use fdt_pic_table when not using ARM_INTRNG Modified: head/sys/arm/qemu/virt_common.c Modified: head/sys/arm/qemu/virt_common.c ============================================================================== --- head/sys/arm/qemu/virt_common.c Wed Feb 10 16:13:59 2016 (r295471) +++ head/sys/arm/qemu/virt_common.c Wed Feb 10 16:39:02 2016 (r295472) @@ -41,7 +41,9 @@ struct fdt_fixup_entry fdt_fixup_table[] { NULL, NULL } }; +#ifdef ARM_INTRNG fdt_pic_decode_t fdt_pic_table[] = { &gic_decode_fdt, NULL }; +#endif From owner-svn-src-all@freebsd.org Wed Feb 10 16:44:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45B82AA3092; Wed, 10 Feb 2016 16:44:22 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 1921F1186; Wed, 10 Feb 2016 16:44:22 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1AGiLSE012584; Wed, 10 Feb 2016 16:44:21 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1AGiLFV012583; Wed, 10 Feb 2016 16:44:21 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602101644.u1AGiLFV012583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 10 Feb 2016 16:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295473 - head/sys/arm/qemu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 16:44:22 -0000 Author: andrew Date: Wed Feb 10 16:44:20 2016 New Revision: 295473 URL: https://svnweb.freebsd.org/changeset/base/295473 Log: Fix a logic inversion when checking for ARM_INTRNG Pointy hat to: andrew Modified: head/sys/arm/qemu/virt_common.c Modified: head/sys/arm/qemu/virt_common.c ============================================================================== --- head/sys/arm/qemu/virt_common.c Wed Feb 10 16:39:02 2016 (r295472) +++ head/sys/arm/qemu/virt_common.c Wed Feb 10 16:44:20 2016 (r295473) @@ -41,7 +41,7 @@ struct fdt_fixup_entry fdt_fixup_table[] { NULL, NULL } }; -#ifdef ARM_INTRNG +#ifndef ARM_INTRNG fdt_pic_decode_t fdt_pic_table[] = { &gic_decode_fdt, NULL From owner-svn-src-all@freebsd.org Wed Feb 10 16:49:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4793EAA3173; Wed, 10 Feb 2016 16:49:22 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 18CD013A2; Wed, 10 Feb 2016 16:49:22 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1AGnLDL012778; Wed, 10 Feb 2016 16:49:21 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1AGnL4U012777; Wed, 10 Feb 2016 16:49:21 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602101649.u1AGnL4U012777@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 10 Feb 2016 16:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295474 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 16:49:22 -0000 Author: andrew Date: Wed Feb 10 16:49:20 2016 New Revision: 295474 URL: https://svnweb.freebsd.org/changeset/base/295474 Log: Explicitly include . Previously we were pulling it in due to header pollution. Modified: head/sys/dev/uart/uart_bus_fdt.c Modified: head/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- head/sys/dev/uart/uart_bus_fdt.c Wed Feb 10 16:44:20 2016 (r295473) +++ head/sys/dev/uart/uart_bus_fdt.c Wed Feb 10 16:49:20 2016 (r295474) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include "opt_platform.h" #include +#include #include #include #include From owner-svn-src-all@freebsd.org Wed Feb 10 17:05:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 025BCAA3ABE; Wed, 10 Feb 2016 17:05:14 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.81]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFB591A0; Wed, 10 Feb 2016 17:05:13 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smtp.greenhost.nl ([213.108.104.138]) by smarthost1.greenhost.nl with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aTYCP-0007wl-Dj; Wed, 10 Feb 2016 18:05:10 +0100 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "Mark Felder" Subject: Re: svn commit: r295471 - in head/etc: defaults rc.d References: <201602101613.u1AGDx0I003885@repo.freebsd.org> Date: Wed, 10 Feb 2016 18:04:58 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Ronald Klop" Message-ID: In-Reply-To: <201602101613.u1AGDx0I003885@repo.freebsd.org> User-Agent: Opera Mail/12.16 (FreeBSD) X-Authenticated-As-Hash: 398f5522cb258ce43cb679602f8cfe8b62a256d1 X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: -0.2 X-Spam-Status: No, score=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 autolearn=disabled version=3.4.0 X-Scan-Signature: 02b201d9c048bcde4aa7ed91fc024d05 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 17:05:14 -0000 On Wed, 10 Feb 2016 17:13:59 +0100, Mark Felder wrote: > Author: feld (ports committer) > Date: Wed Feb 10 16:13:59 2016 > New Revision: 295471 > URL: https://svnweb.freebsd.org/changeset/base/295471 > > Log: > Add new rc.conf parameter "jail_reverse_stop" > When a user defines "jail_list" in rc.conf the jails are started in the > order defined. Currently the jails are not are stopped in reverse order > which may break dependencies between jails/services and prevent a clean > shutdown. The new parameter "jail_reverse_stop" will shutdown jails in > "jail_list" in reverse order when set to "YES". > Please note that this does not affect manual invocation of the jail rc > script. If a user runs the command > # service jail stop jail1 jail2 jail3 > the jails will be stopped in exactly the order specified regardless of > jail_reverse_stop being defined in rc.conf. > PR: 196152 Good feature. I know POLA is always very important in FreeBSD development, but having this setting on by default seems very reasonable to me. Regards, Ronald. > Approved by: jamie > MFC after: 1 week > Relnotes: yes > Differential Revision: https://reviews.freebsd.org/D5233 > > Modified: > head/etc/defaults/rc.conf > head/etc/rc.d/jail > > Modified: head/etc/defaults/rc.conf > ============================================================================== > --- head/etc/defaults/rc.conf Wed Feb 10 15:56:52 2016 (r295470) > +++ head/etc/defaults/rc.conf Wed Feb 10 16:13:59 2016 (r295471) > @@ -694,6 +694,7 @@ iovctl_files="" # Config files for iovc > jail_enable="NO" # Set to NO to disable starting of any jails > jail_parallel_start="NO" # Start jails in the background > jail_list="" # Space separated list of names of jails > +jail_reverse_stop="NO" # Stop jails in reverse order > ############################################################## > ### Define source_rc_confs, the mechanism used by /etc/rc.* ## > > Modified: head/etc/rc.d/jail > ============================================================================== > --- head/etc/rc.d/jail Wed Feb 10 15:56:52 2016 (r295470) > +++ head/etc/rc.d/jail Wed Feb 10 16:13:59 2016 (r295471) > @@ -521,7 +521,11 @@ jail_stop() > command=$jail_program > rc_flags=$jail_flags > command_args="-f $jail_conf -r" > - $jail_jls name | while read _j; do > + if checkyesno jail_reverse_stop; then > + $jail_jls name | tail -r > + else > + $jail_jls name > + fi | while read _j; do > echo -n " $_j" > _tmp=`mktemp -t jail` || exit 3 > $command $rc_flags $command_args $_j >> $_tmp 2>&1 > @@ -536,6 +540,7 @@ jail_stop() > return > ;; > esac > + checkyesno jail_reverse_stop && set -- $(reverse_list $@) > for _j in $@; do > _j=$(echo $_j | tr /. _) > _jv=$(echo -n $_j | tr -c '[:alnum:]' _) > @@ -571,5 +576,6 @@ jail_warn() > load_rc_config $name > case $# in > 1) run_rc_command $@ ${jail_list:-_ALL} ;; > -*) run_rc_command $@ ;; > +*) jail_reverse_stop="no" > + run_rc_command $@ ;; > esac > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-all@freebsd.org Wed Feb 10 17:28:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF6F7AA48CD; Wed, 10 Feb 2016 17:28:44 +0000 (UTC) (envelope-from rionda@gmail.com) Received: from mail-qg0-x233.google.com (mail-qg0-x233.google.com [IPv6:2607:f8b0:400d:c04::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C7AA106A; Wed, 10 Feb 2016 17:28:44 +0000 (UTC) (envelope-from rionda@gmail.com) Received: by mail-qg0-x233.google.com with SMTP id b35so18878302qge.0; Wed, 10 Feb 2016 09:28:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :message-id:references:to; bh=2DUwG66/pPdqxghLRf6kuW5pIGfmgNaRuyG11Cs2P2o=; b=DgfHGdh8YX7DNjFRBuBnCKXGgmN/WkbgYSdNjPTh44H51B7RykukPIGwdtMUHWCNjo 7tvhdXm/bJZZaYFBC0+urngm1E4V5y037SRnHiON+8H1ocHSWwenIMbh159pnel9hPBw j5yRkw/1znl06RgyAyEGNvkzbcsfraw6lSbJHMOf7WDg29o7I/taD0kYK8biPYDa7uOz dlxht0Ujm1fJkeT6RkMPAdZFQ+0aZxkiRVmf2YWcqe5z3jm4+5GbxYsPwpsTxe/nxAeu 9+TCZ7osCyDDlnOq1ZhI5xCaQqPZ+oKyYGc2uhb5qxYe1B5NOqMy6uuxBqKy5s9yyquu M5zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=2DUwG66/pPdqxghLRf6kuW5pIGfmgNaRuyG11Cs2P2o=; b=FG3qev4aTF1UEgAGQQcnEoe7o9jLYWWhDMLdDW0XUHYBBG9+vsaEZUZQix12zPiNbx 76hIHj7tEHy4NDiB7K1SfkBJ6oDd26LUt9UXaafQLDs/pxaImUci7dmDT/JtgITzXmw1 oluWKJ4X0h3xTA479iJWhhgbuTjTrIGzDmKuItB11eL5HovJdZjoDbE8WeUInDJCMYtk vm+QdUPWZHU2Ts2kCUpiIGR5N0mpoxwYrK8oQy+P1K97XnULU+3AgvnsCcBGeUdgAzEQ ZpqfitJPQ3WNAjK/3xy3kcA4WO/rnfzv+GgVttcdHREl58VvATfmqhLVoeO0fJh2AgyR DX4A== X-Gm-Message-State: AG10YOT7LPpT8grCNJT5Zc2HorLxULD9ObtRAzjfv8TNM6zL7qw1PKWR0jWTMGdncWWPIw== X-Received: by 10.140.235.137 with SMTP id g131mr53851134qhc.43.1455125323383; Wed, 10 Feb 2016 09:28:43 -0800 (PST) Received: from [172.31.22.154] (gzac12-mdf2-1.aoa.twosigma.com. [208.77.215.155]) by smtp.gmail.com with ESMTPSA id d62sm1712309qka.3.2016.02.10.09.28.41 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 10 Feb 2016 09:28:42 -0800 (PST) Sender: Matteo Riondato Subject: Re: svn commit: r295471 - in head/etc: defaults rc.d Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Content-Type: multipart/signed; boundary="Apple-Mail=_4920B564-A0A2-425B-BFFC-F6832A628767"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.6b2 From: Matteo Riondato In-Reply-To: Date: Wed, 10 Feb 2016 12:28:40 -0500 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Mark Felder Message-Id: <0CAF4F00-7711-4F0F-8487-0B17381940F2@FreeBSD.org> References: <201602101613.u1AGDx0I003885@repo.freebsd.org> To: Ronald Klop X-Mailer: Apple Mail (2.3112) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 17:28:44 -0000 --Apple-Mail=_4920B564-A0A2-425B-BFFC-F6832A628767 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Feb 10, 2016, at 12:04 PM, Ronald Klop = wrote: >=20 > On Wed, 10 Feb 2016 17:13:59 +0100, Mark Felder = wrote: >=20 >> Author: feld (ports committer) >> Date: Wed Feb 10 16:13:59 2016 >> New Revision: 295471 >> URL: https://svnweb.freebsd.org/changeset/base/295471 >>=20 >> Log: >> Add new rc.conf parameter "jail_reverse_stop" >> When a user defines "jail_list" in rc.conf the jails are started in = the >> order defined. Currently the jails are not are stopped in reverse = order >> which may break dependencies between jails/services and prevent a = clean >> shutdown. The new parameter "jail_reverse_stop" will shutdown jails = in >> "jail_list" in reverse order when set to "YES". >> Please note that this does not affect manual invocation of the jail = rc >> script. If a user runs the command >> # service jail stop jail1 jail2 jail3 >> the jails will be stopped in exactly the order specified regardless = of >> jail_reverse_stop being defined in rc.conf. >> PR: 196152 >=20 > Good feature. I know POLA is always very important in FreeBSD = development, but having this setting on by default seems very reasonable = to me. +1, perhaps with a note in UPDATING and, when MFC=E2=80=99ed, having the = default to off. Matteo --Apple-Mail=_4920B564-A0A2-425B-BFFC-F6832A628767 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAla7c0gACgkQ2Mp4pR7Fa+z+bwCgyvcF+eCAVkQS5nw8EpvoADDK HGkAoI1daSw3nG5G4P9yMzP4KU3ep9gu =Nrom -----END PGP SIGNATURE----- --Apple-Mail=_4920B564-A0A2-425B-BFFC-F6832A628767-- From owner-svn-src-all@freebsd.org Wed Feb 10 17:49:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F2B0AA322D; Wed, 10 Feb 2016 17:49:24 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 18DBC1C07; Wed, 10 Feb 2016 17:49:24 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1AHnN8b030558; Wed, 10 Feb 2016 17:49:23 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1AHnM19030552; Wed, 10 Feb 2016 17:49:22 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201602101749.u1AHnM19030552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Wed, 10 Feb 2016 17:49: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: r295475 - in stable/10/sys/boot: efi/loader i386/loader userboot/userboot zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 17:49:24 -0000 Author: allanjude Date: Wed Feb 10 17:49:22 2016 New Revision: 295475 URL: https://svnweb.freebsd.org/changeset/base/295475 Log: Catch the EFI loader up to the latest ZFS Boot Environment Menu features MFC: r294072 Move init_zfs_bootenv to sys/boot/zfs/zfs.c instead of having a copy in each loader MFC: r294073 Connect the ZFS boot environment menu to the UEFI loader MFC: r295357 Do not set vfs.root.mountfrom unnecessarily when initializing ZFS BE menu Approved by: re (marius) Relnotes: yes Sponsored by: ScaleEngine Inc. Modified: stable/10/sys/boot/efi/loader/main.c stable/10/sys/boot/i386/loader/main.c stable/10/sys/boot/userboot/userboot/main.c stable/10/sys/boot/zfs/libzfs.h stable/10/sys/boot/zfs/zfs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/loader/main.c ============================================================================== --- stable/10/sys/boot/efi/loader/main.c Wed Feb 10 16:49:20 2016 (r295474) +++ stable/10/sys/boot/efi/loader/main.c Wed Feb 10 17:49:22 2016 (r295475) @@ -198,6 +198,7 @@ main(int argc, CHAR16 *argv[]) efi_setcurrdev, env_nounset); env_setenv("loaddev", EV_VOLATILE, efi_fmtdev(&currdev), env_noset, env_nounset); + init_zfs_bootenv(zfs_fmtdev(&currdev)); break; } #endif @@ -504,6 +505,38 @@ command_lszfs(int argc, char *argv[]) } return (CMD_OK); } + +COMMAND_SET(reloadbe, "reloadbe", "refresh the list of ZFS Boot Environments", + command_reloadbe); + +static int +command_reloadbe(int argc, char *argv[]) +{ + int err; + char *root; + + if (argc > 2) { + command_errmsg = "wrong number of arguments"; + return (CMD_ERROR); + } + + if (argc == 2) { + err = zfs_bootenv(argv[1]); + } else { + root = getenv("zfs_be_root"); + if (root == NULL) { + return (CMD_OK); + } + err = zfs_bootenv(root); + } + + if (err != 0) { + command_errmsg = strerror(err); + return (CMD_ERROR); + } + + return (CMD_OK); +} #endif #ifdef EFI_ZFS_BOOT Modified: stable/10/sys/boot/i386/loader/main.c ============================================================================== --- stable/10/sys/boot/i386/loader/main.c Wed Feb 10 16:49:20 2016 (r295474) +++ stable/10/sys/boot/i386/loader/main.c Wed Feb 10 17:49:22 2016 (r295475) @@ -69,7 +69,6 @@ static int isa_inb(int port); static void isa_outb(int port, int value); void exit(int code); #ifdef LOADER_ZFS_SUPPORT -static void init_zfs_bootenv(char *currdev); static void i386_zfs_probe(void); #endif @@ -303,34 +302,6 @@ extract_currdev(void) env_nounset); } -#ifdef LOADER_ZFS_SUPPORT -static void -init_zfs_bootenv(char *currdev) -{ - char *beroot; - - if (strlen(currdev) == 0) - return; - if(strncmp(currdev, "zfs:", 4) != 0) - return; - /* Remove the trailing : */ - currdev[strlen(currdev) - 1] = '\0'; - setenv("zfs_be_active", currdev, 1); - setenv("zfs_be_currpage", "1", 1); - /* Do not overwrite if already set */ - setenv("vfs.root.mountfrom", currdev, 0); - /* Forward past zfs: */ - currdev = strchr(currdev, ':'); - currdev++; - /* Remove the last element (current bootenv) */ - beroot = strrchr(currdev, '/'); - if (beroot != NULL) - beroot[0] = '\0'; - beroot = currdev; - setenv("zfs_be_root", beroot, 1); -} -#endif - COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot); static int Modified: stable/10/sys/boot/userboot/userboot/main.c ============================================================================== --- stable/10/sys/boot/userboot/userboot/main.c Wed Feb 10 16:49:20 2016 (r295474) +++ stable/10/sys/boot/userboot/userboot/main.c Wed Feb 10 17:49:22 2016 (r295475) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); static void userboot_zfs_probe(void); static int userboot_zfs_found; -static void init_zfs_bootenv(char *currdev); #endif #define USERBOOT_VERSION USERBOOT_VERSION_3 @@ -200,32 +199,6 @@ extract_currdev(void) #if defined(USERBOOT_ZFS_SUPPORT) static void -init_zfs_bootenv(char *currdev) -{ - char *beroot; - - if (strlen(currdev) == 0) - return; - if(strncmp(currdev, "zfs:", 4) != 0) - return; - /* Remove the trailing : */ - currdev[strlen(currdev) - 1] = '\0'; - setenv("zfs_be_active", currdev, 1); - setenv("zfs_be_currpage", "1", 1); - /* Do not overwrite if already set */ - setenv("vfs.root.mountfrom", currdev, 0); - /* Forward past zfs: */ - currdev = strchr(currdev, ':'); - currdev++; - /* Remove the last element (current bootenv) */ - beroot = strrchr(currdev, '/'); - if (beroot != NULL) - beroot[0] = '\0'; - beroot = currdev; - setenv("zfs_be_root", beroot, 1); -} - -static void userboot_zfs_probe(void) { char devname[32]; Modified: stable/10/sys/boot/zfs/libzfs.h ============================================================================== --- stable/10/sys/boot/zfs/libzfs.h Wed Feb 10 16:49:20 2016 (r295474) +++ stable/10/sys/boot/zfs/libzfs.h Wed Feb 10 17:49:22 2016 (r295475) @@ -62,6 +62,7 @@ int zfs_parsedev(struct zfs_devdesc *dev char *zfs_fmtdev(void *vdev); int zfs_probe_dev(const char *devname, uint64_t *pool_guid); int zfs_list(const char *name); +void init_zfs_bootenv(char *currdev); int zfs_bootenv(const char *name); int zfs_belist_add(const char *name); int zfs_set_env(void); Modified: stable/10/sys/boot/zfs/zfs.c ============================================================================== --- stable/10/sys/boot/zfs/zfs.c Wed Feb 10 16:49:20 2016 (r295474) +++ stable/10/sys/boot/zfs/zfs.c Wed Feb 10 17:49:22 2016 (r295475) @@ -709,6 +709,30 @@ zfs_list(const char *name) return (zfs_list_dataset(spa, objid)); } +void +init_zfs_bootenv(char *currdev) +{ + char *beroot; + + if (strlen(currdev) == 0) + return; + if(strncmp(currdev, "zfs:", 4) != 0) + return; + /* Remove the trailing : */ + currdev[strlen(currdev) - 1] = '\0'; + setenv("zfs_be_active", currdev, 1); + setenv("zfs_be_currpage", "1", 1); + /* Forward past zfs: */ + currdev = strchr(currdev, ':'); + currdev++; + /* Remove the last element (current bootenv) */ + beroot = strrchr(currdev, '/'); + if (beroot != NULL) + beroot[0] = '\0'; + beroot = currdev; + setenv("zfs_be_root", beroot, 1); +} + int zfs_bootenv(const char *name) { @@ -779,8 +803,15 @@ int zfs_belist_add(const char *name) { + /* Skip special datasets that start with a $ character */ + if (strncmp(name, "$", 1) == 0) { + return (0); + } /* Add the boot environment to the head of the SLIST */ zfs_be = malloc(sizeof(struct zfs_be_entry)); + if (zfs_be == NULL) { + return (ENOMEM); + } zfs_be->name = name; SLIST_INSERT_HEAD(&zfs_be_head, zfs_be, entries); zfs_env_count++; From owner-svn-src-all@freebsd.org Wed Feb 10 17:55:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 582D7AA3670; Wed, 10 Feb 2016 17:55:41 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 260891C4; Wed, 10 Feb 2016 17:55:41 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1AHteZc033385; Wed, 10 Feb 2016 17:55:40 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1AHte50033383; Wed, 10 Feb 2016 17:55:40 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201602101755.u1AHte50033383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 10 Feb 2016 17:55:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295476 - in head/sys: cam/ctl dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 17:55:41 -0000 Author: trasz Date: Wed Feb 10 17:55:39 2016 New Revision: 295476 URL: https://svnweb.freebsd.org/changeset/base/295476 Log: Remove stray semicolons from the iSCSI code. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/ctl/ctl.c head/sys/dev/iscsi/iscsi.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Wed Feb 10 17:49:22 2016 (r295475) +++ head/sys/cam/ctl/ctl.c Wed Feb 10 17:55:39 2016 (r295476) @@ -5694,7 +5694,7 @@ ctl_write_same(struct ctl_scsiio *ctsio) */ if ((byte2 & SWS_NDOB) == 0 && (ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { - ctsio->kern_data_ptr = malloc(len, M_CTL, M_WAITOK);; + ctsio->kern_data_ptr = malloc(len, M_CTL, M_WAITOK); ctsio->kern_data_len = len; ctsio->kern_total_len = len; ctsio->kern_data_resid = 0; @@ -5742,7 +5742,7 @@ ctl_unmap(struct ctl_scsiio *ctsio) * malloc it and tell the caller the data buffer is here. */ if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { - ctsio->kern_data_ptr = malloc(len, M_CTL, M_WAITOK);; + ctsio->kern_data_ptr = malloc(len, M_CTL, M_WAITOK); ctsio->kern_data_len = len; ctsio->kern_total_len = len; ctsio->kern_data_resid = 0; Modified: head/sys/dev/iscsi/iscsi.h ============================================================================== --- head/sys/dev/iscsi/iscsi.h Wed Feb 10 17:49:22 2016 (r295475) +++ head/sys/dev/iscsi/iscsi.h Wed Feb 10 17:55:39 2016 (r295476) @@ -119,7 +119,7 @@ struct iscsi_session { char is_reason[ISCSI_REASON_LEN]; #ifdef ICL_KERNEL_PROXY - struct cv is_login_cv;; + struct cv is_login_cv; struct icl_pdu *is_login_pdu; #endif }; From owner-svn-src-all@freebsd.org Wed Feb 10 17:57:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5BAEAA377D; Wed, 10 Feb 2016 17:57:25 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 9A38C3E6; Wed, 10 Feb 2016 17:57:25 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1AHvOcM033480; Wed, 10 Feb 2016 17:57:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1AHvOxe033479; Wed, 10 Feb 2016 17:57:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201602101757.u1AHvOxe033479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 10 Feb 2016 17:57:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295477 - head/tests/sys/geom/class/gate X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 17:57:25 -0000 Author: ngie Date: Wed Feb 10 17:57:24 2016 New Revision: 295477 URL: https://svnweb.freebsd.org/changeset/base/295477 Log: Similar to r295116, add an additional 1 second sleep after calling ggatel before calling dd to defeat a race when writing out to the geom_gate(4) device MFC after: 1 month Reported by: Jenkins Sponsored by: EMC / Isilon Storage Division Modified: head/tests/sys/geom/class/gate/3_test.sh Modified: head/tests/sys/geom/class/gate/3_test.sh ============================================================================== --- head/tests/sys/geom/class/gate/3_test.sh Wed Feb 10 17:55:39 2016 (r295476) +++ head/tests/sys/geom/class/gate/3_test.sh Wed Feb 10 17:57:24 2016 (r295477) @@ -27,6 +27,7 @@ if ! ggatel create -u $us /dev/$work; th exit 1 fi +sleep 1 dd if=/dev/${src} of=/dev/ggate${us} bs=1m count=1 conv=sync sleep 1 From owner-svn-src-all@freebsd.org Wed Feb 10 18:29:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E30F7AA478F; Wed, 10 Feb 2016 18:29:35 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B131A1A79; Wed, 10 Feb 2016 18:29:35 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u1AITPwX018751; Wed, 10 Feb 2016 10:29:29 -0800 (PST) (envelope-from truckman@FreeBSD.org) Message-Id: <201602101829.u1AITPwX018751@gw.catspoiler.org> Date: Wed, 10 Feb 2016 10:29:25 -0800 (PST) From: Don Lewis Subject: Re: svn commit: r295465 - head/usr.sbin/services_mkdb To: se@FreeBSD.org cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201602100940.u1A9ejb6086175@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 18:29:36 -0000 On 10 Feb, Stefan Esser wrote: > Author: se > Date: Wed Feb 10 09:40:45 2016 > New Revision: 295465 > URL: https://svnweb.freebsd.org/changeset/base/295465 > > Log: > Remove O_SYNC from the options passed to dbmopen(). > > The services db is created as a temporary file that is moved over the > existing file after completion. Thus there is no need to immediately > flush all created db records to the temporary file. > > This speeds up creation of the services db by a factor of 500 on my > ZFS based /var/db filesytem (from 110 seconds to 0.235 seconds). Thanks! I was wondering why this was so s...l...o...w... From owner-svn-src-all@freebsd.org Wed Feb 10 18:29:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BCA4AA47BB; Wed, 10 Feb 2016 18:29:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 3FBF01ACC; Wed, 10 Feb 2016 18:29:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1AITcKs042513; Wed, 10 Feb 2016 18:29:38 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1AITbAC042505; Wed, 10 Feb 2016 18:29:37 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201602101829.u1AITbAC042505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 10 Feb 2016 18:29:37 +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: r295480 - stable/10/sys/dev/random X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 18:29:39 -0000 Author: jhb Date: Wed Feb 10 18:29:37 2016 New Revision: 295480 URL: https://svnweb.freebsd.org/changeset/base/295480 Log: Adjust initialization of random(9) so it is usable earlier. A few existing SYSINITs expect the in-kernel PRNG (random(9)) to be useable at SI_SUB_RANDOM / SI_ORDER_ANY. However, the random(4) overhaul merged for 10.0 performs all of its initialization at SI_SUB_DRIVERS (since it is tied in with creating the /dev/random character device). This has changed in HEAD where the random initialization is split such that the in-kernel random(9) is initialized at SI_SUB_RANDOM and the supporting bits for userland random(4) (such as /dev/random) are initialized later. However, the changes in HEAD are large and invasive. Instead, this change is being directly committed to stable/10. This change moves most of the random(9)/random(4) initialization to SI_SUB_RANDOM with the exception that the creation of the harvesting kernel process and the /dev/random character device are deferred to new SYSINITs that run at SI_SUB_DRIVERS. This fixes the "random device not loaded; using insecure entropy" message output during boot on some systems. PR: 205800 Reviewed by: markm, so@ Approved by: so Approved by: re (gjb) Tested by: Mark Saad Modified: stable/10/sys/dev/random/live_entropy_sources.c stable/10/sys/dev/random/live_entropy_sources.h stable/10/sys/dev/random/random_adaptors.c stable/10/sys/dev/random/random_adaptors.h stable/10/sys/dev/random/random_harvestq.c stable/10/sys/dev/random/randomdev.c stable/10/sys/dev/random/randomdev_soft.c Modified: stable/10/sys/dev/random/live_entropy_sources.c ============================================================================== --- stable/10/sys/dev/random/live_entropy_sources.c Wed Feb 10 18:23:47 2016 (r295479) +++ stable/10/sys/dev/random/live_entropy_sources.c Wed Feb 10 18:29:37 2016 (r295480) @@ -189,7 +189,7 @@ live_entropy_sources_deinit(void *unused sx_destroy(&les_lock); } -SYSINIT(random_adaptors, SI_SUB_DRIVERS, SI_ORDER_FIRST, +SYSINIT(random_adaptors, SI_SUB_RANDOM, SI_ORDER_FIRST, live_entropy_sources_init, NULL); -SYSUNINIT(random_adaptors, SI_SUB_DRIVERS, SI_ORDER_FIRST, +SYSUNINIT(random_adaptors, SI_SUB_RANDOM, SI_ORDER_FIRST, live_entropy_sources_deinit, NULL); Modified: stable/10/sys/dev/random/live_entropy_sources.h ============================================================================== --- stable/10/sys/dev/random/live_entropy_sources.h Wed Feb 10 18:23:47 2016 (r295479) +++ stable/10/sys/dev/random/live_entropy_sources.h Wed Feb 10 18:29:37 2016 (r295480) @@ -52,7 +52,7 @@ void live_entropy_sources_feed(int, even modevent, \ 0 \ }; \ - DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, \ + DECLARE_MODULE(name, name##_mod, SI_SUB_RANDOM, \ SI_ORDER_SECOND); \ MODULE_VERSION(name, ver); \ MODULE_DEPEND(name, random, 1, 1, 1); Modified: stable/10/sys/dev/random/random_adaptors.c ============================================================================== --- stable/10/sys/dev/random/random_adaptors.c Wed Feb 10 18:23:47 2016 (r295479) +++ stable/10/sys/dev/random/random_adaptors.c Wed Feb 10 18:29:37 2016 (r295480) @@ -233,9 +233,9 @@ random_adaptors_init(void *unused) SYSCTL_NODE(_kern, OID_AUTO, random, CTLFLAG_RW, 0, "Random Number Generator"); -SYSINIT(random_adaptors, SI_SUB_DRIVERS, SI_ORDER_FIRST, random_adaptors_init, +SYSINIT(random_adaptors, SI_SUB_RANDOM, SI_ORDER_FIRST, random_adaptors_init, NULL); -SYSUNINIT(random_adaptors, SI_SUB_DRIVERS, SI_ORDER_FIRST, +SYSUNINIT(random_adaptors, SI_SUB_RANDOM, SI_ORDER_FIRST, random_adaptors_deinit, NULL); static void Modified: stable/10/sys/dev/random/random_adaptors.h ============================================================================== --- stable/10/sys/dev/random/random_adaptors.h Wed Feb 10 18:23:47 2016 (r295479) +++ stable/10/sys/dev/random/random_adaptors.h Wed Feb 10 18:29:37 2016 (r295480) @@ -47,7 +47,7 @@ extern struct random_adaptor *random_ada /* * random_adaptor's should be registered prior to - * random module (SI_SUB_DRIVERS/SI_ORDER_MIDDLE) + * random module (SI_SUB_RANDOM/SI_ORDER_MIDDLE) */ #define RANDOM_ADAPTOR_MODULE(name, modevent, ver) \ static moduledata_t name##_mod = { \ @@ -55,7 +55,7 @@ extern struct random_adaptor *random_ada modevent, \ 0 \ }; \ - DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, \ + DECLARE_MODULE(name, name##_mod, SI_SUB_RANDOM, \ SI_ORDER_SECOND); \ MODULE_VERSION(name, ver); \ MODULE_DEPEND(name, random, 1, 1, 1); Modified: stable/10/sys/dev/random/random_harvestq.c ============================================================================== --- stable/10/sys/dev/random/random_harvestq.c Wed Feb 10 18:23:47 2016 (r295479) +++ stable/10/sys/dev/random/random_harvestq.c Wed Feb 10 18:29:37 2016 (r295480) @@ -81,6 +81,8 @@ int random_kthread_control = 0; static struct proc *random_kthread_proc; +static event_proc_f random_cb; + #ifdef RANDOM_RWFILE static const char *entropy_files[] = { "/entropy", @@ -219,7 +221,7 @@ random_kthread(void *arg) void random_harvestq_init(event_proc_f cb) { - int error, i; + int i; struct harvest *np; /* Initialise the harvest fifos */ @@ -238,13 +240,26 @@ random_harvestq_init(event_proc_f cb) mtx_init(&harvest_mtx, "entropy harvest mutex", NULL, MTX_SPIN); + random_cb = cb; +} + +static void +random_harvestq_start_kproc(void *arg __unused) +{ + int error; + + if (random_cb == NULL) + return; + /* Start the hash/reseed thread */ - error = kproc_create(random_kthread, cb, + error = kproc_create(random_kthread, random_cb, &random_kthread_proc, RFHIGHPID, 0, "rand_harvestq"); /* RANDOM_CSPRNG_NAME */ if (error != 0) panic("Cannot create entropy maintenance thread."); } +SYSINIT(random_kthread, SI_SUB_DRIVERS, SI_ORDER_ANY, + random_harvestq_start_kproc, NULL); void random_harvestq_deinit(void) @@ -265,6 +280,17 @@ random_harvestq_deinit(void) } harvestfifo.count = 0; + /* + * Command the hash/reseed thread to end and wait for it to finish + */ + mtx_lock_spin(&harvest_mtx); + if (random_kthread_proc != NULL) { + random_kthread_control = -1; + msleep_spin((void *)&random_kthread_control, &harvest_mtx, + "term", 0); + } + mtx_unlock_spin(&harvest_mtx); + mtx_destroy(&harvest_mtx); } Modified: stable/10/sys/dev/random/randomdev.c ============================================================================== --- stable/10/sys/dev/random/randomdev.c Wed Feb 10 18:23:47 2016 (r295479) +++ stable/10/sys/dev/random/randomdev.c Wed Feb 10 18:29:37 2016 (r295480) @@ -175,15 +175,24 @@ random_initialize(void *p, struct random printf("random: <%s> initialized\n", s->ident); + /* mark random(4) as initialized, to avoid being called again */ + random_inited = 1; +} + +static void +random_makedev(void *arg __unused) +{ + + if (random_adaptor == NULL) + return; + /* Use an appropriately evil mode for those who are concerned * with daemons */ random_dev = make_dev_credf(MAKEDEV_ETERNAL_KLD, &random_cdevsw, RANDOM_MINOR, NULL, UID_ROOT, GID_WHEEL, 0666, "random"); make_dev_alias(random_dev, "urandom"); /* compatibility */ - - /* mark random(4) as initialized, to avoid being called again */ - random_inited = 1; } +SYSINIT(random_makedev, SI_SUB_DRIVERS, SI_ORDER_ANY, random_makedev, NULL); /* ARGSUSED */ static int @@ -229,5 +238,11 @@ random_modevent(module_t mod __unused, i return (error); } -DEV_MODULE(random, random_modevent, NULL); +static moduledata_t random_mod = { + "random", + random_modevent, + NULL +}; + +DECLARE_MODULE(random, random_mod, SI_SUB_RANDOM, SI_ORDER_MIDDLE); MODULE_VERSION(random, 1); Modified: stable/10/sys/dev/random/randomdev_soft.c ============================================================================== --- stable/10/sys/dev/random/randomdev_soft.c Wed Feb 10 18:23:47 2016 (r295479) +++ stable/10/sys/dev/random/randomdev_soft.c Wed Feb 10 18:29:37 2016 (r295480) @@ -182,12 +182,6 @@ randomdev_deinit(void) /* Deregister the randomness harvesting routine */ randomdev_deinit_harvester(); - /* - * Command the hash/reseed thread to end and wait for it to finish - */ - random_kthread_control = -1; - tsleep((void *)&random_kthread_control, 0, "term", 0); - #if defined(RANDOM_YARROW) random_yarrow_deinit_alg(); #endif From owner-svn-src-all@freebsd.org Wed Feb 10 18:36:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B77AAA4C49; Wed, 10 Feb 2016 18:36:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 D1B9C300; Wed, 10 Feb 2016 18:36:52 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1AIapIi045271; Wed, 10 Feb 2016 18:36:51 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1AIapaA045270; Wed, 10 Feb 2016 18:36:51 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201602101836.u1AIapaA045270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 10 Feb 2016 18:36:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295481 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 18:36:53 -0000 Author: glebius Date: Wed Feb 10 18:36:51 2016 New Revision: 295481 URL: https://svnweb.freebsd.org/changeset/base/295481 Log: Garbage collect m_getclr(). Modified: head/sys/sys/mbuf.h Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Wed Feb 10 18:29:37 2016 (r295480) +++ head/sys/sys/mbuf.h Wed Feb 10 18:36:51 2016 (r295481) @@ -647,23 +647,6 @@ m_get(int how, short type) return (uma_zalloc_arg(zone_mbuf, &args, how)); } -/* - * XXX This should be deprecated, very little use. - */ -static __inline struct mbuf * -m_getclr(int how, short type) -{ - struct mbuf *m; - struct mb_args args; - - args.flags = 0; - args.type = type; - m = uma_zalloc_arg(zone_mbuf, &args, how); - if (m != NULL) - bzero(m->m_data, MLEN); - return (m); -} - static __inline struct mbuf * m_gethdr(int how, short type) { From owner-svn-src-all@freebsd.org Wed Feb 10 18:54:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F489AA3CEB; Wed, 10 Feb 2016 18:54:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 155181532; Wed, 10 Feb 2016 18:54:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1AIsJ2Y051134; Wed, 10 Feb 2016 18:54:19 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1AIsINp051128; Wed, 10 Feb 2016 18:54:18 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201602101854.u1AIsINp051128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 10 Feb 2016 18:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295482 - in head/sys: dev/cxgb dev/cxgbe kern netinet sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 18:54:20 -0000 Author: glebius Date: Wed Feb 10 18:54:18 2016 New Revision: 295482 URL: https://svnweb.freebsd.org/changeset/base/295482 Log: Garbage collect unused arguments of m_init(). Modified: head/sys/dev/cxgb/cxgb_sge.c head/sys/dev/cxgbe/t4_sge.c head/sys/kern/kern_mbuf.c head/sys/netinet/tcp_pcap.c head/sys/sys/mbuf.h Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Wed Feb 10 18:36:51 2016 (r295481) +++ head/sys/dev/cxgb/cxgb_sge.c Wed Feb 10 18:54:18 2016 (r295482) @@ -795,12 +795,10 @@ free_rx_bufs(adapter_t *sc, struct sge_f bus_dmamap_unload(q->entry_tag, d->map); bus_dmamap_destroy(q->entry_tag, d->map); if (q->zone == zone_pack) { - m_init(d->m, zone_pack, MCLBYTES, - M_NOWAIT, MT_DATA, M_EXT); + m_init(d->m, M_NOWAIT, MT_DATA, M_EXT); uma_zfree(zone_pack, d->m); } else { - m_init(d->m, zone_mbuf, MLEN, - M_NOWAIT, MT_DATA, 0); + m_init(d->m, M_NOWAIT, MT_DATA, 0); uma_zfree(zone_mbuf, d->m); uma_zfree(q->zone, d->rxsd_cl); } @@ -2725,7 +2723,7 @@ get_packet(adapter_t *adap, unsigned int if ((sopeop == RSPQ_SOP_EOP) || (sopeop == RSPQ_SOP)) flags |= M_PKTHDR; - m_init(m, fl->zone, fl->buf_size, M_NOWAIT, MT_DATA, flags); + m_init(m, M_NOWAIT, MT_DATA, flags); if (fl->zone == zone_pack) { /* * restore clobbered data pointer Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Wed Feb 10 18:36:51 2016 (r295481) +++ head/sys/dev/cxgbe/t4_sge.c Wed Feb 10 18:54:18 2016 (r295482) @@ -1570,7 +1570,7 @@ get_scatter_segment(struct adapter *sc, MPASS(clm != NULL); m = (struct mbuf *)(sd->cl + sd->nmbuf * MSIZE); /* No bzero required */ - if (m_init(m, NULL, 0, M_NOWAIT, MT_DATA, + if (m_init(m, M_NOWAIT, MT_DATA, fr_offset == 0 ? M_PKTHDR | M_NOFREE : M_NOFREE)) return (NULL); fl->mbuf_inlined++; Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Wed Feb 10 18:36:51 2016 (r295481) +++ head/sys/kern/kern_mbuf.c Wed Feb 10 18:54:18 2016 (r295482) @@ -435,7 +435,7 @@ mb_ctor_mbuf(void *mem, int size, void * m = (struct mbuf *)mem; flags = args->flags; - error = m_init(m, NULL, size, how, type, flags); + error = m_init(m, how, type, flags); return (error); } @@ -635,7 +635,7 @@ mb_ctor_pack(void *mem, int size, void * trash_ctor(m->m_ext.ext_buf, MCLBYTES, arg, how); #endif - error = m_init(m, NULL, size, how, type, flags); + error = m_init(m, how, type, flags); /* m_ext is already initialized. */ m->m_data = m->m_ext.ext_buf; Modified: head/sys/netinet/tcp_pcap.c ============================================================================== --- head/sys/netinet/tcp_pcap.c Wed Feb 10 18:36:51 2016 (r295481) +++ head/sys/netinet/tcp_pcap.c Wed Feb 10 18:54:18 2016 (r295482) @@ -341,7 +341,7 @@ tcp_pcap_add(struct tcphdr *th, struct m n = mhead; tcp_pcap_m_freem(n->m_next); - m_init(n, NULL, 0, M_NOWAIT, MT_DATA, 0); + m_init(n, M_NOWAIT, MT_DATA, 0); } } Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Wed Feb 10 18:36:51 2016 (r295481) +++ head/sys/sys/mbuf.h Wed Feb 10 18:54:18 2016 (r295482) @@ -618,8 +618,7 @@ m_getzone(int size) * should go away with constant propagation for !MGETHDR. */ static __inline int -m_init(struct mbuf *m, uma_zone_t zone __unused, int size __unused, int how, - short type, int flags) +m_init(struct mbuf *m, int how, short type, int flags) { int error; From owner-svn-src-all@freebsd.org Wed Feb 10 19:01:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2C1EAA40C0; Wed, 10 Feb 2016 19:01:27 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 5507A1C2E; Wed, 10 Feb 2016 19:01:27 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1AJ1QUm051567; Wed, 10 Feb 2016 19:01:26 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1AJ1QYj051566; Wed, 10 Feb 2016 19:01:26 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201602101901.u1AJ1QYj051566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 10 Feb 2016 19:01:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295483 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 19:01:27 -0000 Author: trasz Date: Wed Feb 10 19:01:26 2016 New Revision: 295483 URL: https://svnweb.freebsd.org/changeset/base/295483 Log: Add a kern.icl.drivers sysctl, to retrieve the list of registered ICL drivers. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/icl.c Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Wed Feb 10 18:54:18 2016 (r295482) +++ head/sys/dev/iscsi/icl.c Wed Feb 10 19:01:26 2016 (r295483) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -66,13 +67,42 @@ struct icl_softc { TAILQ_HEAD(, icl_module) sc_modules; }; +static int sysctl_kern_icl_drivers(SYSCTL_HANDLER_ARGS); +static MALLOC_DEFINE(M_ICL, "icl", "iSCSI Common Layer"); +static struct icl_softc *sc; + SYSCTL_NODE(_kern, OID_AUTO, icl, CTLFLAG_RD, 0, "iSCSI Common Layer"); int icl_debug = 1; SYSCTL_INT(_kern_icl, OID_AUTO, debug, CTLFLAG_RWTUN, &icl_debug, 0, "Enable debug messages"); +SYSCTL_PROC(_kern_icl, OID_AUTO, drivers, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + NULL, 0, sysctl_kern_icl_drivers, "A", + "List of ICL drivers"); -static MALLOC_DEFINE(M_ICL, "icl", "iSCSI Common Layer"); -static struct icl_softc *sc; +static int +sysctl_kern_icl_drivers(SYSCTL_HANDLER_ARGS) +{ + const struct icl_module *im; + struct sbuf sb; + int error; + + sbuf_new(&sb, NULL, 256, SBUF_AUTOEXTEND | SBUF_INCLUDENUL); + + sx_slock(&sc->sc_lock); + TAILQ_FOREACH(im, &sc->sc_modules, im_next) { + if (im != TAILQ_FIRST(&sc->sc_modules)) + sbuf_putc(&sb, ' '); + sbuf_printf(&sb, "%s", im->im_name); + } + sx_sunlock(&sc->sc_lock); + + error = sbuf_finish(&sb); + if (error == 0) + error = SYSCTL_OUT(req, sbuf_data(&sb), sbuf_len(&sb)); + sbuf_delete(&sb); + return (error); +} static struct icl_module * icl_find(const char *name) From owner-svn-src-all@freebsd.org Wed Feb 10 19:07:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD211AA44A7; Wed, 10 Feb 2016 19:07:33 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 86ECD1F82; Wed, 10 Feb 2016 19:07:33 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x235.google.com with SMTP id f81so31497923iof.0; Wed, 10 Feb 2016 11:07:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=r3kB19p4YwMCC7cI8lrl95VgpCYXX3CMZxh4aZU7SFk=; b=JTmJIV7zoJjX+A6yOnkTAxSDQm9YyhcvVRFdyIJin4C81UrspGGrOzSA1AfK2SjSSM hqenuVX1lAcjC4mnr+yuI3e5GpUhgRDWclT9OxkTchyc7Phh0OE6vx0mXBLzjLd1o1Qt +N8PPzZfIMIKGhusspEy+RdxzbOGTdC4PH4HvfDJSpa6Fba4QUFgmSBOpPKPC56pcv57 RsR5rSDkSvr+TuPdzSAsgnym9VZtfO1Hy55E1+mk7+9K0hp+r2MLhdkThDcarqmw4x7Y audxgZ2Y+pdUdFKPKB+GxXwlyY+XnWrlEzmxrBOgVyYd9ErMqfVhdhFG/rJ87XLDQBJ3 7edg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=r3kB19p4YwMCC7cI8lrl95VgpCYXX3CMZxh4aZU7SFk=; b=Epy817gAjc0DSKag0TvTSU7fFnNfgTrowjX0KkBLsNSGcrARzEcQwB7QdRL+HIysTc 5bbtz0eB6jZ5h3yxTzTEg/5nceNGKIGLbnXuC3mjhd9DyMVvij6HcQuBPjKGQLxUUWIk 9Oih0/TM2kvROHVmG1GXe4e/tFh/2lE+b9ChiyBBAwLHqlugPZS6sAoEKnLleKP3CS7t G+ObklLPkB5C96BsX/8qCmHKJDHUiLfNk1mWL8/YELuBa+DMThEGpfcggleY+pYNd/Sb +6Gu/3OJ1tkngL9H/37TH+AlUGNVWtMgf1fvfOa6T1t725vjbbenpHBaZenDXZDbtB1N M8RQ== X-Gm-Message-State: AG10YOQH+oB+bL4K3sXMmx04dhZp68rmdVQhWvD+A29pCizVAyCVn8vDOu8k44b96RSNmuHPrI0VWZGXYmd59g== MIME-Version: 1.0 X-Received: by 10.107.11.231 with SMTP id 100mr18695596iol.165.1455131252534; Wed, 10 Feb 2016 11:07:32 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.14.19 with HTTP; Wed, 10 Feb 2016 11:07:32 -0800 (PST) In-Reply-To: <1455116788.1337.99.camel@freebsd.org> References: <201602100443.u1A4h80W000230@repo.freebsd.org> <20160210104344.493c5ab9@zapp.Home> <1455116788.1337.99.camel@freebsd.org> Date: Wed, 10 Feb 2016 11:07:32 -0800 X-Google-Sender-Auth: 7GkHWZa7xK-hsdR3Vf---JmCe-Y Message-ID: Subject: Re: svn commit: r295459 - in head/sys: arm/include sys From: Adrian Chadd To: Ian Lepore Cc: Andrew Turner , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 19:07:33 -0000 ok. would you like to update the copyright or should i? -a On 10 February 2016 at 07:06, Ian Lepore wrote: > On Wed, 2016-02-10 at 10:43 +0000, Andrew Turner wrote: >> On Wed, 10 Feb 2016 04:43:08 +0000 (UTC) >> Adrian Chadd wrote: >> >> > Author: adrian >> > Date: Wed Feb 10 04:43:08 2016 >> > New Revision: 295459 >> > URL: https://svnweb.freebsd.org/changeset/base/295459 >> > >> > Log: >> > Break out the shared bits of the arm intrng definitions into >> > sys/intr.h; leave the machine dependent bits in sys/arm/. >> > >> > This is in preparation for MIPS INTRNG work. >> > >> > Submitted by: Stanislav Galabov >> ... >> > Added: head/sys/sys/intr.h >> > =================================================================== >> > =========== >> > --- /dev/null 00:00:00 1970 (empty, because file is >> > newly added) +++ head/sys/sys/intr.h Wed Feb 10 04:43:08 >> > 2016 (r295459) @@ -0,0 +1,130 @@ >> > +/* $NetBSD: intr.h,v 1.7 2003/06/16 20:01:00 thorpej Exp >> > $ */ + >> > +/*- >> > + * Copyright (c) 1997 Mark Brinicombe. >> > + * All rights reserved. >> >> Is this still the case? It seems all the code in this file was >> written >> for intrng and not by Mark Brinicombe. >> >> I would expect we could also fix the license below to move to a >> standard FreeBSD license. This would need all authors agreement, but >> that is maybe 5 people. > > Yep, that's all pasted boilerplate from some older arm/include file > that just doesn't apply to even a single line of this intr.h. The > actual authors of this would be Jakub Klama, Svata Kraus, and me. > > -- Ian > From owner-svn-src-all@freebsd.org Wed Feb 10 19:39:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85480AA43F3; Wed, 10 Feb 2016 19:39:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 40DB41217; Wed, 10 Feb 2016 19:39:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1AJdct5063458; Wed, 10 Feb 2016 19:39:38 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1AJdaR7063441; Wed, 10 Feb 2016 19:39:36 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602101939.u1AJdaR7063441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 10 Feb 2016 19:39:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295484 - in vendor/elftoolchain/dist: . addr2line ar brandelf common cxxfilt elfcopy elfdump findtextrel ld libdwarf libelftc libpe mk nm readelf size strings test/ar/plugin test/ar/tc... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 19:39:39 -0000 Author: emaste Date: Wed Feb 10 19:39:36 2016 New Revision: 295484 URL: https://svnweb.freebsd.org/changeset/base/295484 Log: Import ELF Tool Chain snapshot revision 3395 This is close to the upcoming 0.7.1 release. From http://svn.code.sf.net/p/elftoolchain/code Added: vendor/elftoolchain/dist/addr2line/os.NetBSD.mk (contents, props changed) vendor/elftoolchain/dist/elfcopy/pe.c (contents, props changed) vendor/elftoolchain/dist/elfdump/os.NetBSD.mk (contents, props changed) vendor/elftoolchain/dist/ld/bigmips_script.ld vendor/elftoolchain/dist/ld/littlemips_script.ld vendor/elftoolchain/dist/ld/mips.c (contents, props changed) vendor/elftoolchain/dist/ld/mips.h (contents, props changed) vendor/elftoolchain/dist/libdwarf/os.NetBSD.mk (contents, props changed) vendor/elftoolchain/dist/libelftc/os.NetBSD.mk (contents, props changed) vendor/elftoolchain/dist/libpe/ vendor/elftoolchain/dist/libpe/Makefile (contents, props changed) vendor/elftoolchain/dist/libpe/_libpe.h (contents, props changed) vendor/elftoolchain/dist/libpe/libpe.h (contents, props changed) vendor/elftoolchain/dist/libpe/libpe_buffer.c (contents, props changed) vendor/elftoolchain/dist/libpe/libpe_coff.c (contents, props changed) vendor/elftoolchain/dist/libpe/libpe_dos.c (contents, props changed) vendor/elftoolchain/dist/libpe/libpe_init.c (contents, props changed) vendor/elftoolchain/dist/libpe/libpe_rich.c (contents, props changed) vendor/elftoolchain/dist/libpe/libpe_section.c (contents, props changed) vendor/elftoolchain/dist/libpe/libpe_utils.c (contents, props changed) vendor/elftoolchain/dist/libpe/os.Linux.mk (contents, props changed) vendor/elftoolchain/dist/libpe/os.NetBSD.mk (contents, props changed) vendor/elftoolchain/dist/libpe/pe.h (contents, props changed) vendor/elftoolchain/dist/libpe/pe_buffer.c (contents, props changed) vendor/elftoolchain/dist/libpe/pe_cntl.c (contents, props changed) vendor/elftoolchain/dist/libpe/pe_coff.c (contents, props changed) vendor/elftoolchain/dist/libpe/pe_dos.c (contents, props changed) vendor/elftoolchain/dist/libpe/pe_flag.c (contents, props changed) vendor/elftoolchain/dist/libpe/pe_init.c (contents, props changed) vendor/elftoolchain/dist/libpe/pe_rich.c (contents, props changed) vendor/elftoolchain/dist/libpe/pe_section.c (contents, props changed) vendor/elftoolchain/dist/libpe/pe_symtab.c (contents, props changed) vendor/elftoolchain/dist/libpe/pe_update.c (contents, props changed) vendor/elftoolchain/dist/mk/elftoolchain.components.mk (contents, props changed) vendor/elftoolchain/dist/nm/os.NetBSD.mk (contents, props changed) vendor/elftoolchain/dist/readelf/os.NetBSD.mk (contents, props changed) vendor/elftoolchain/dist/size/os.NetBSD.mk (contents, props changed) vendor/elftoolchain/dist/strings/os.NetBSD.mk (contents, props changed) Deleted: vendor/elftoolchain/dist/libelftc/elftc_symbol_table_create.3 Modified: vendor/elftoolchain/dist/INSTALL vendor/elftoolchain/dist/Makefile vendor/elftoolchain/dist/RELEASE-NOTES vendor/elftoolchain/dist/addr2line/addr2line.c vendor/elftoolchain/dist/ar/ar.c vendor/elftoolchain/dist/brandelf/brandelf.c vendor/elftoolchain/dist/common/elfdefinitions.h vendor/elftoolchain/dist/common/native-elf-format vendor/elftoolchain/dist/cxxfilt/cxxfilt.c vendor/elftoolchain/dist/elfcopy/Makefile vendor/elftoolchain/dist/elfcopy/archive.c vendor/elftoolchain/dist/elfcopy/elfcopy.1 vendor/elftoolchain/dist/elfcopy/elfcopy.h vendor/elftoolchain/dist/elfcopy/main.c vendor/elftoolchain/dist/elfcopy/sections.c vendor/elftoolchain/dist/elfcopy/segments.c vendor/elftoolchain/dist/elfcopy/symbols.c vendor/elftoolchain/dist/elfdump/elfdump.c vendor/elftoolchain/dist/findtextrel/findtextrel.c vendor/elftoolchain/dist/ld/Makefile vendor/elftoolchain/dist/ld/amd64.c vendor/elftoolchain/dist/ld/i386.c vendor/elftoolchain/dist/ld/ld_arch.c vendor/elftoolchain/dist/ld/ld_arch.h vendor/elftoolchain/dist/ld/ld_dynamic.c vendor/elftoolchain/dist/ld/ld_exp.c vendor/elftoolchain/dist/ld/ld_file.c vendor/elftoolchain/dist/ld/ld_layout.c vendor/elftoolchain/dist/ld/ld_output.c vendor/elftoolchain/dist/ld/ld_script.c vendor/elftoolchain/dist/ld/ld_script.h vendor/elftoolchain/dist/ld/ld_script_lexer.l vendor/elftoolchain/dist/ld/ld_script_parser.y vendor/elftoolchain/dist/ld/ld_strtab.c vendor/elftoolchain/dist/ld/ld_symbols.c vendor/elftoolchain/dist/libdwarf/_libdwarf.h vendor/elftoolchain/dist/libdwarf/dwarf.3 vendor/elftoolchain/dist/libdwarf/dwarf_str.c vendor/elftoolchain/dist/libdwarf/libdwarf.h vendor/elftoolchain/dist/libdwarf/libdwarf_rw.c vendor/elftoolchain/dist/libelftc/Makefile vendor/elftoolchain/dist/libelftc/elftc_bfd_find_target.3 vendor/elftoolchain/dist/libelftc/elftc_copyfile.c vendor/elftoolchain/dist/libelftc/elftc_demangle.c vendor/elftoolchain/dist/libelftc/libelftc.h vendor/elftoolchain/dist/libelftc/libelftc_bfdtarget.c vendor/elftoolchain/dist/libelftc/libelftc_dem_gnu3.c vendor/elftoolchain/dist/libelftc/make-toolchain-version vendor/elftoolchain/dist/mk/elftoolchain.prog.mk vendor/elftoolchain/dist/readelf/readelf.c vendor/elftoolchain/dist/strings/strings.1 vendor/elftoolchain/dist/strings/strings.c vendor/elftoolchain/dist/test/ar/plugin/Makefile vendor/elftoolchain/dist/test/ar/plugin/ardiff.c vendor/elftoolchain/dist/test/ar/plugin/teraser.c vendor/elftoolchain/dist/test/ar/tc/usage-bi/usage-bi.err vendor/elftoolchain/dist/test/elfcopy/plugin/Makefile vendor/elftoolchain/dist/test/elfcopy/plugin/ardiff.c vendor/elftoolchain/dist/test/elfcopy/plugin/teraser.c vendor/elftoolchain/dist/test/elfcopy/tc/elfcopy-L-1/out/elfcopy-L-1.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/elfcopy-L-2/out/elfcopy-L-2.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/elfcopy-N-1/out/elfcopy-N-1.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/elfcopy-N-2/out/elfcopy-N-2.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/elfcopy-noops-1/out/elfcopy-noops-1.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/elfcopy-noops-2/out/elfcopy-noops-2.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/elfcopy-noops-3/out/elfcopy-noops-3.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/elfcopy-noops-4/out/elfcopy-noops-4.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/elfcopy-noops-5/out/elfcopy-noops-5.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/elfcopy-noops-6/out/elfcopy-noops-6.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/elfcopy-noops-7/out/elfcopy-noops-7.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/elfcopy-noops-archive-1/out/elfcopy-noops-archive-1.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/elfcopy-noops-archive-2/out/elfcopy-noops-archive-2.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/elfcopy-rename-1/out/elfcopy-rename-1.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-K-2/out/strip-K-2.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-all-1/out/strip-all-1.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-all-10/out/strip-all-10.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-all-2/out/strip-all-2.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-all-3/out/strip-all-3.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-all-4/out/strip-all-4.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-all-5/out/strip-all-5.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-all-6/out/strip-all-6.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-all-7/out/strip-all-7.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-all-8/out/strip-all-8.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-all-9/out/strip-all-9.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-all-archive-1/out/strip-all-archive-1.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-all-archive-2/out/strip-all-archive-2.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-debug-1/out/strip-debug-1.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-debug-2/out/strip-debug-2.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-debug-3/out/strip-debug-3.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-debug-4/out/strip-debug-4.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-onlydebug-1/out/strip-onlydebug-1.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-unneeded-1/out/strip-unneeded-1.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-unneeded-2/out/strip-unneeded-2.out.shar vendor/elftoolchain/dist/test/elfdump/ts/dso1/@G%libelf.so.out vendor/elftoolchain/dist/test/elfdump/ts/dso1/@S@G%libelf.so.out vendor/elftoolchain/dist/test/elfdump/ts/dso1/@S@r%libelf.so.out vendor/elftoolchain/dist/test/elfdump/ts/dso2/@G%test.so.out vendor/elftoolchain/dist/test/elfdump/ts/dso2/@S@G%test.so.out vendor/elftoolchain/dist/test/elfdump/ts/dso2/@S@r%test.so.out vendor/elftoolchain/dist/test/elfdump/ts/dso2/@e%test.so.out vendor/elftoolchain/dist/test/elfdump/ts/dso2/@e@i%test.so.out vendor/elftoolchain/dist/test/elfdump/ts/dso2/@e@p@c%test.so.out vendor/elftoolchain/dist/test/elfdump/ts/exec1/@G%ls.out vendor/elftoolchain/dist/test/elfdump/ts/exec1/@G@e%ls.out vendor/elftoolchain/dist/test/elfdump/ts/exec1/@S@G%ls.out vendor/elftoolchain/dist/test/elfdump/ts/exec1/@S@r%ls.out vendor/elftoolchain/dist/test/elfdump/ts/exec1/@S@r@N%.rela.dyn@N%.rela.plt%ls.out vendor/elftoolchain/dist/test/elfdump/ts/exec2/@G%cp.out vendor/elftoolchain/dist/test/elfdump/ts/exec2/@G@e%cp.out vendor/elftoolchain/dist/test/elfdump/ts/exec2/@S@G%cp.out vendor/elftoolchain/dist/test/elfdump/ts/exec2/@S@r%cp.out vendor/elftoolchain/dist/test/libdwarf/ts/Makefile.tset Modified: vendor/elftoolchain/dist/INSTALL ============================================================================== --- vendor/elftoolchain/dist/INSTALL Wed Feb 10 19:01:26 2016 (r295483) +++ vendor/elftoolchain/dist/INSTALL Wed Feb 10 19:39:36 2016 (r295484) @@ -14,13 +14,11 @@ operating systems. Operating System Version Supported Architectures ----------------- -------- ----------------------- `DragonFly BSD`_ 2.10.1 i386 - FreeBSD_ v8.2 amd64 & i386 - FreeBSD_ v10.1 i386 + FreeBSD_ 10.2 amd64 & i386 Minix_ 3.0.2 i386 - NetBSD_ v5.0.2 i386 + NetBSD_ 7.0 i386 OpenBSD_ v5.0 i386 - Ubuntu_ GNU/Linux 10.04LTS i386 & x86_64 - Ubuntu_ GNU/Linux 12.04LTS i386 & x86_64 + Ubuntu_ GNU/Linux 14.04LTS x86_64 ================= ======== ======================= .. _DragonFly BSD: http://www.dragonflybsd.org/ @@ -35,9 +33,9 @@ Building the Source Tree The core libraries and utilities that make up the software release are always built by default. Builds of the project's test suites (in the -``test/`` subdirectory), and of additional documentation (in the -directory ``documentation/``) are optional and will only be attempted -if these directories are present. +``test/`` subdirectory), and of additional documentation (in the directory +``documentation/``) are optional, and will only be attempted if these +directories are present. Prerequisites ------------- @@ -58,39 +56,24 @@ Prerequisites - Building additional documentation is not currently supported under DragonFly BSD. -:FreeBSD 8.2: +:FreeBSD 10.2: - The core libraries and utilities should build out of the box on a stock install of FreeBSD. - To build and run the test suite: #. The current release of the `Test Execution Toolkit`_ needs to - be downloaded and unpacked into the ``test/tet/`` directory. - - #. The ``py-yaml`` package needs to be installed:: + be downloaded and unpacked into the ``test/tet/`` directory:: - % sudo pkg_add -r py-yaml - - - To build additional documentation, the ``latex-pgf`` package is - needed:: - - % sudo pkg_add -r latex-pgf - -:FreeBSD 10.1: - - The core libraries and utilities should build out of the box on - a stock install of FreeBSD. - - - To build and run the test suite: - - #. The current release of the `Test Execution Toolkit`_ needs to - be downloaded and unpacked into the ``test/tet/`` directory. + % cd /test/tet + % tar -xf /PATH/TO/DOWNLOADED/TET-3.8-SOURCES #. The ``python`` and ``py27-yaml`` packages need to be installed:: % sudo pkg install python py27-yaml - Building additional documentation is not currently supported under - FreeBSD 10.1. + FreeBSD 10.2. :Minix 3.2.0: - The following packages are pre-requisites for building the @@ -152,9 +135,20 @@ Prerequisites - Building additional documentation is not currently supported under OpenBSD. -:NetBSD 5.0.2: - - The core libraries and utilities should build out of the box - on a stock install of NetBSD. +:NetBSD 7.0: + - The following packages are pre-requisites for building the + sources on NetBSD 7.0: + + =================== ===================================== + **Package** **Description** + =================== ===================================== + ``libarchive`` An archive access library. + =================== ===================================== + + The following command line may be used to install the necessary + pre-requisites:: + + # pkg_add libarchive - To build and run the test suite: @@ -165,7 +159,7 @@ Prerequisites #. The following additional package needs to be installed, as listed in the example command line below :: - % sudo pkg_add py26-yaml + % sudo pkg_add py27-yaml - Building additional documentation is not currently supported under NetBSD. @@ -213,9 +207,9 @@ Prerequisites % sudo apt-get install pgf -:Ubuntu GNU/Linux 12.04: +:Ubuntu GNU/Linux 14.04: - The following packages are pre-requisites for building the - sources on Ubuntu GNU/Linux 12.04: + sources on Ubuntu GNU/Linux 14.04: =================== ===================================== **Package** **Description** @@ -226,7 +220,7 @@ Prerequisites ``libarchive-dev`` Archive access library. ``libexpat1-dev`` An XML processing library. ``m4`` Macro processor. - ``pmake`` A ``make`` that uses BSD-make syntax. + ``bmake`` NetBSD ``make``. ``python-yaml`` A YAML library for Python. ``sharutils`` For ``uudecode``. ``zlib1g-dev`` Compression library. @@ -236,7 +230,7 @@ Prerequisites pre-requisites:: % sudo apt-get install bison build-essential flex libarchive-dev \ - m4 pmake zlib1g-dev + m4 bmake zlib1g-dev - To build and run the test suite: @@ -250,7 +244,7 @@ Prerequisites % sudo apt-get install libexpat1-dev python-yaml sharutils - Builds of additional documentation are not currently supported - under Ubuntu GNU/Linux 12.04. + under Ubuntu GNU/Linux 14.04. .. _Test Execution Toolkit: http://tetworks.opengroup.org/ .. _OpenGroup: http://www.opengroup.org/ @@ -316,7 +310,7 @@ website`_. .. _project website: http://elftoolchain.sourceforge.net/ -.. $Id: INSTALL 3193 2015-05-04 17:47:14Z jkoshy $ +.. $Id: INSTALL 3353 2016-01-18 21:50:13Z jkoshy $ .. Local Variables: .. mode: rst Modified: vendor/elftoolchain/dist/Makefile ============================================================================== --- vendor/elftoolchain/dist/Makefile Wed Feb 10 19:01:26 2016 (r295483) +++ vendor/elftoolchain/dist/Makefile Wed Feb 10 19:39:36 2016 (r295484) @@ -1,7 +1,8 @@ -# $Id: Makefile 3016 2014-04-10 16:01:42Z jkoshy $ +# $Id: Makefile 3382 2016-01-31 12:31:08Z jkoshy $ TOP= . +.include "${TOP}/mk/elftoolchain.components.mk" .include "${TOP}/mk/elftoolchain.os.mk" # Build configuration information first. @@ -13,10 +14,14 @@ SUBDIR += libdwarf # Build additional APIs. SUBDIR += libelftc +.if defined(WITH_PE) && ${WITH_PE:tl} == "yes" +SUBDIR += libpe +.endif -# Build the tools needed for the rest of the build. - -# SUBDIR += isa # ('isa' does not build on all platforms yet). +# The instruction set analyser. +.if defined(WITH_ISA) && ${WITH_ISA:tl} == "yes" +SUBDIR += isa # ('isa' does not build on all platforms yet). +.endif # Build tools after the libraries. SUBDIR += addr2line @@ -26,6 +31,7 @@ SUBDIR += cxxfilt SUBDIR += elfcopy SUBDIR += elfdump SUBDIR += findtextrel +SUBDIR += ld SUBDIR += nm SUBDIR += readelf SUBDIR += size @@ -33,12 +39,18 @@ SUBDIR += strings SUBDIR += tools # Build the test suites. -.if exists(${.CURDIR}/test) && defined(MKTESTS) && ${MKTESTS} == "yes" +.if exists(${.CURDIR}/test) && defined(WITH_TESTS) && ${WITH_TESTS:tl} == "yes" SUBDIR += test .endif +# Build additional build tooling. +.if defined(WITH_BUILD_TOOLS) && ${WITH_BUILD_TOOLS:tl} == "yes" +SUBDIR += tools +.endif + # Build documentation at the end. -.if exists(${.CURDIR}/documentation) && defined(MKDOC) && ${MKDOC} == "yes" +.if exists(${.CURDIR}/documentation) && defined(WITH_DOCUMENTATION) && \ + ${WITH_DOCUMENTATION:tl} == "yes" SUBDIR += documentation .endif @@ -49,7 +61,7 @@ SUBDIR += documentation # # Run the test suites. -.if exists(${.CURDIR}/test) && defined(MKTESTS) && ${MKTESTS} == "yes" +.if exists(${.CURDIR}/test) && defined(WITH_TESTS) && ${WITH_TESTS:tl} == "yes" run-tests: all .PHONY (cd ${.CURDIR}/test; ${MAKE} test) .endif Modified: vendor/elftoolchain/dist/RELEASE-NOTES ============================================================================== --- vendor/elftoolchain/dist/RELEASE-NOTES Wed Feb 10 19:01:26 2016 (r295483) +++ vendor/elftoolchain/dist/RELEASE-NOTES Wed Feb 10 19:39:36 2016 (r295484) @@ -1,4 +1,4 @@ -.. $Id: RELEASE-NOTES 2599 2012-09-25 06:25:51Z jkoshy $ +.. $Id: RELEASE-NOTES 3353 2016-01-18 21:50:13Z jkoshy $ .. This file contains a template for use when writing release notes. .. It needs to be updated with release-specific content prior to @@ -96,11 +96,11 @@ systems: **Operating System** **Version** **Supported Architectures** -------------------- ----------- --------------------------- `DragonFly BSD`_ 2.10.1 i386 - FreeBSD_ v8.2 amd64 & i386 + FreeBSD_ 10.2 amd64 & i386 Minix_ 3.2.0 i386 - NetBSD_ v5.0.2 i386 + NetBSD_ 7.0 i386 OpenBSD_ v5.0 i386 - Ubuntu_ GNU/Linux 10.04LTS i386 & x86_64 + Ubuntu_ GNU/Linux 14.04LTS x86_64 ==================== =========== =========================== Modified: vendor/elftoolchain/dist/addr2line/addr2line.c ============================================================================== --- vendor/elftoolchain/dist/addr2line/addr2line.c Wed Feb 10 19:01:26 2016 (r295483) +++ vendor/elftoolchain/dist/addr2line/addr2line.c Wed Feb 10 19:39:36 2016 (r295484) @@ -40,7 +40,7 @@ #include "uthash.h" #include "_elftc.h" -ELFTC_VCSID("$Id: addr2line.c 3264 2015-11-30 05:38:14Z kaiwang27 $"); +ELFTC_VCSID("$Id: addr2line.c 3273 2015-12-11 21:38:57Z kaiwang27 $"); struct Func { char *name; @@ -368,7 +368,8 @@ print_inlines(struct CU *cu, struct Func printf("%s\n", f->name); } } - (void) printf("%s:%ju\n", base ? basename(file) : file, call_line); + (void) printf("%s:%ju\n", base ? basename(file) : file, + (uintmax_t) call_line); if (f->inlined_caller != NULL) print_inlines(cu, f->inlined_caller, f->call_file, @@ -562,7 +563,8 @@ out: } } - (void) printf("%s:%ju\n", base ? basename(file) : file, lineno); + (void) printf("%s:%ju\n", base ? basename(file) : file, + (uintmax_t) lineno); if (ret == DW_DLV_OK && inlines && cu != NULL && cu->srcfiles != NULL && f != NULL && f->inlined_caller != NULL) Added: vendor/elftoolchain/dist/addr2line/os.NetBSD.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/elftoolchain/dist/addr2line/os.NetBSD.mk Wed Feb 10 19:39:36 2016 (r295484) @@ -0,0 +1,2 @@ +# TODO(#511): Revert after the source tree is -Wconversion clean. +WARNS=5 Modified: vendor/elftoolchain/dist/ar/ar.c ============================================================================== --- vendor/elftoolchain/dist/ar/ar.c Wed Feb 10 19:01:26 2016 (r295483) +++ vendor/elftoolchain/dist/ar/ar.c Wed Feb 10 19:39:36 2016 (r295484) @@ -72,7 +72,7 @@ #include "ar.h" -ELFTC_VCSID("$Id: ar.c 3243 2015-08-31 19:28:45Z emaste $"); +ELFTC_VCSID("$Id: ar.c 3319 2016-01-13 21:37:53Z jkoshy $"); enum options { @@ -407,7 +407,7 @@ Usage: %s [options] archive fi -F FORMAT | --flavor=FORMAT\n\ Create archives with the specified format.\n\ -S Do not generate an archive symbol table.\n\ - -U Use original metadata, for unique archive checksums.\n" + -U Use original metadata for archive members.\n" static void bsdar_usage(void) Modified: vendor/elftoolchain/dist/brandelf/brandelf.c ============================================================================== --- vendor/elftoolchain/dist/brandelf/brandelf.c Wed Feb 10 19:01:26 2016 (r295483) +++ vendor/elftoolchain/dist/brandelf/brandelf.c Wed Feb 10 19:39:36 2016 (r295484) @@ -44,7 +44,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: brandelf.c 3234 2015-07-31 12:35:09Z emaste $"); +ELFTC_VCSID("$Id: brandelf.c 3354 2016-01-18 21:50:15Z jkoshy $"); static int elftype(const char *); static const char *iselftype(int); @@ -212,7 +212,7 @@ main(int argc, char **argv) /* * Update the ABI type. */ - ehdr.e_ident[EI_OSABI] = type; + ehdr.e_ident[EI_OSABI] = (unsigned char) type; if (gelf_update_ehdr(elf, &ehdr) == 0) { warnx("gelf_update_ehdr error: %s", elf_errmsg(-1)); Modified: vendor/elftoolchain/dist/common/elfdefinitions.h ============================================================================== --- vendor/elftoolchain/dist/common/elfdefinitions.h Wed Feb 10 19:01:26 2016 (r295483) +++ vendor/elftoolchain/dist/common/elfdefinitions.h Wed Feb 10 19:39:36 2016 (r295484) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: elfdefinitions.h 3253 2015-10-10 18:31:33Z kaiwang27 $ + * $Id: elfdefinitions.h 3392 2016-02-05 19:51:22Z emaste $ */ /* @@ -1228,6 +1228,7 @@ _ELF_DEFINE_STB(STB_GLOBAL, 1, _ELF_DEFINE_STB(STB_WEAK, 2, \ "visible across all object files but with low precedence") \ _ELF_DEFINE_STB(STB_LOOS, 10, "start of OS-specific range") \ +_ELF_DEFINE_STB(STB_GNU_UNIQUE, 10, "unique symbol (GNU)") \ _ELF_DEFINE_STB(STB_HIOS, 12, "end of OS-specific range") \ _ELF_DEFINE_STB(STB_LOPROC, 13, \ "start of processor-specific range") \ @@ -1259,6 +1260,7 @@ _ELF_DEFINE_STT(STT_LOPROC, 13, "start of processor-specific types") \ _ELF_DEFINE_STT(STT_ARM_TFUNC, 13, "Thumb function (GNU)") \ _ELF_DEFINE_STT(STT_ARM_16BIT, 15, "Thumb label (GNU)") \ +_ELF_DEFINE_STT(STT_SPARC_REGISTER, 13, "SPARC register information") \ _ELF_DEFINE_STT(STT_HIPROC, 15, \ "end of processor-specific types") @@ -1395,7 +1397,7 @@ _ELF_DEFINE_RELOC(R_386_GOT32, 3) \ _ELF_DEFINE_RELOC(R_386_PLT32, 4) \ _ELF_DEFINE_RELOC(R_386_COPY, 5) \ _ELF_DEFINE_RELOC(R_386_GLOB_DAT, 6) \ -_ELF_DEFINE_RELOC(R_386_JMP_SLOT, 7) \ +_ELF_DEFINE_RELOC(R_386_JUMP_SLOT, 7) \ _ELF_DEFINE_RELOC(R_386_RELATIVE, 8) \ _ELF_DEFINE_RELOC(R_386_GOTOFF, 9) \ _ELF_DEFINE_RELOC(R_386_GOTPC, 10) \ @@ -1407,9 +1409,129 @@ _ELF_DEFINE_RELOC(R_386_PC8, 23) /* */ -#define _ELF_DEFINE_AARCH64_RELOCATIONS() \ -_ELF_DEFINE_RELOC(R_AARCH64_ABS64, 257) \ -_ELF_DEFINE_RELOC(R_AARCH64_ABS32, 258) \ +#define _ELF_DEFINE_AARCH64_RELOCATIONS() \ +_ELF_DEFINE_RELOC(R_AARCH64_NONE, 0) \ +_ELF_DEFINE_RELOC(R_AARCH64_ABS64, 257) \ +_ELF_DEFINE_RELOC(R_AARCH64_ABS32, 258) \ +_ELF_DEFINE_RELOC(R_AARCH64_ABS16, 259) \ +_ELF_DEFINE_RELOC(R_AARCH64_PREL64, 260) \ +_ELF_DEFINE_RELOC(R_AARCH64_PREL32, 261) \ +_ELF_DEFINE_RELOC(R_AARCH64_PREL16, 262) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_UABS_G0, 263) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_UABS_G0_NC, 264) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_UABS_G1, 265) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_UABS_G1_NC, 266) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_UABS_G2, 267) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_UABS_G2_NC, 268) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_UABS_G3, 269) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_SABS_G0, 270) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_SABS_G1, 271) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_SABS_G2, 272) \ +_ELF_DEFINE_RELOC(R_AARCH64_LD_PREL_LO19, 273) \ +_ELF_DEFINE_RELOC(R_AARCH64_ADR_PREL_LO21, 274) \ +_ELF_DEFINE_RELOC(R_AARCH64_ADR_PREL_PG_HI21, 275) \ +_ELF_DEFINE_RELOC(R_AARCH64_ADR_PREL_PG_HI21_NC, 276) \ +_ELF_DEFINE_RELOC(R_AARCH64_ADD_ABS_LO12_NC, 277) \ +_ELF_DEFINE_RELOC(R_AARCH64_LDST8_ABS_LO12_NC, 278) \ +_ELF_DEFINE_RELOC(R_AARCH64_TSTBR14, 279) \ +_ELF_DEFINE_RELOC(R_AARCH64_CONDBR19, 280) \ +_ELF_DEFINE_RELOC(R_AARCH64_JUMP26, 282) \ +_ELF_DEFINE_RELOC(R_AARCH64_CALL26, 283) \ +_ELF_DEFINE_RELOC(R_AARCH64_LDST16_ABS_LO12_NC, 284) \ +_ELF_DEFINE_RELOC(R_AARCH64_LDST32_ABS_LO12_NC, 285) \ +_ELF_DEFINE_RELOC(R_AARCH64_LDST64_ABS_LO12_NC, 286) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_PREL_G0, 287) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_PREL_G0_NC, 288) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_PREL_G1, 289) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_PREL_G1_NC, 290) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_PREL_G2, 291) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_PREL_G2_NC, 292) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_PREL_G3, 293) \ +_ELF_DEFINE_RELOC(R_AARCH64_LDST128_ABS_LO12_NC, 299) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_GOTOFF_G0, 300) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_GOTOFF_G0_NC, 301) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_GOTOFF_G1, 302) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_GOTOFF_G1_NC, 303) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_GOTOFF_G2, 304) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_GOTOFF_G2_NC, 305) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_GOTOFF_G3, 306) \ +_ELF_DEFINE_RELOC(R_AARCH64_GOTREL64, 307) \ +_ELF_DEFINE_RELOC(R_AARCH64_GOTREL32, 308) \ +_ELF_DEFINE_RELOC(R_AARCH64_GOT_LD_PREL19, 309) \ +_ELF_DEFINE_RELOC(R_AARCH64_LD64_GOTOFF_LO15, 310) \ +_ELF_DEFINE_RELOC(R_AARCH64_ADR_GOT_PAGE, 311) \ +_ELF_DEFINE_RELOC(R_AARCH64_LD64_GOT_LO12_NC, 312) \ +_ELF_DEFINE_RELOC(R_AARCH64_LD64_GOTPAGE_LO15, 313) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSGD_ADR_PREL21, 512) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSGD_ADR_PAGE21, 513) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSGD_ADD_LO12_NC, 514) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSGD_MOVW_G1, 515) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSGD_MOVW_G0_NC, 516) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_ADR_PREL21, 517) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_ADR_PAGE21, 518) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_ADD_LO12_NC, 519) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_MOVW_G1, 520) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_MOVW_G0_NC, 521) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LD_PREL19, 522) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_MOVW_DTPREL_G2, 523) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_MOVW_DTPREL_G1, 524) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, 525) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_MOVW_DTPREL_G0, 526) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, 527) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_ADD_DTPREL_HI12, 529) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, 530) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST8_DTPREL_LO12, 531) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, 532) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST16_DTPREL_LO12, 533) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, 534) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST32_DTPREL_LO12, 535) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, 536) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST64_DTPREL_LO12, 537) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, 538) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSIE_MOVW_GOTTPREL_G1, 539) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, 540) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, 541) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, 542) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSIE_LD_GOTTPREL_PREL19, 543) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G2, 544) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G1, 545) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G1_NC, 546) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G0, 547) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G0_NC, 548) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_ADD_TPREL_HI12, 549) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_ADD_TPREL_LO12, 550) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_ADD_TPREL_LO12_NC, 551) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST8_TPREL_LO12, 552) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, 553) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST16_TPREL_LO12, 554) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, 555) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST32_TPREL_LO12, 556) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, 557) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST64_TPREL_LO12, 558) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, 559) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_LD_PREL19, 560) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_ADR_PREL21, 561) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_ADR_PAGE21, 562) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_LD64_LO12, 563) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_ADD_LO12, 564) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_OFF_G1, 565) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_OFF_G0_NC, 566) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_LDR, 567) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_ADD, 568) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_CALL, 569) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST128_TPREL_LO12, 570) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC, 571) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST128_DTPREL_LO12, 572) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC, 573) \ +_ELF_DEFINE_RELOC(R_AARCH64_COPY, 1024) \ +_ELF_DEFINE_RELOC(R_AARCH64_GLOB_DAT, 1025) \ +_ELF_DEFINE_RELOC(R_AARCH64_JUMP_SLOT, 1026) \ +_ELF_DEFINE_RELOC(R_AARCH64_RELATIVE, 1027) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLS_DTPREL64, 1028) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLS_DTPMOD64, 1029) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLS_TPREL64, 1030) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC, 1031) \ +_ELF_DEFINE_RELOC(R_AARCH64_IRELATIVE, 1032) /* * These are the symbols used in the Sun ``Linkers and Loaders @@ -1633,7 +1755,7 @@ _ELF_DEFINE_RELOC(R_IA_64_LTV32MSB, 0x7 _ELF_DEFINE_RELOC(R_IA_64_LTV32LSB, 0x75) \ _ELF_DEFINE_RELOC(R_IA_64_LTV64MSB, 0x76) \ _ELF_DEFINE_RELOC(R_IA_64_LTV64LSB, 0x77) \ -_ELF_DEFINE_RELOC(R_IA_64_PCREL21BIa, 0x79) \ +_ELF_DEFINE_RELOC(R_IA_64_PCREL21BI, 0x79) \ _ELF_DEFINE_RELOC(R_IA_64_PCREL22, 0x7A) \ _ELF_DEFINE_RELOC(R_IA_64_PCREL64I, 0x7B) \ _ELF_DEFINE_RELOC(R_IA_64_IPLTMSB, 0x80) \ @@ -1723,7 +1845,7 @@ _ELF_DEFINE_RELOC(R_PPC_REL32, 26) \ _ELF_DEFINE_RELOC(R_PPC_PLT32, 27) \ _ELF_DEFINE_RELOC(R_PPC_PLTREL32, 28) \ _ELF_DEFINE_RELOC(R_PPC_PLT16_LO, 29) \ -_ELF_DEFINE_RELOC(R_PPL_PLT16_HI, 30) \ +_ELF_DEFINE_RELOC(R_PPC_PLT16_HI, 30) \ _ELF_DEFINE_RELOC(R_PPC_PLT16_HA, 31) \ _ELF_DEFINE_RELOC(R_PPC_SDAREL16, 32) \ _ELF_DEFINE_RELOC(R_PPC_SECTOFF, 33) \ @@ -1926,7 +2048,7 @@ _ELF_DEFINE_RELOC(R_RISCV_SUB32, 39) \ _ELF_DEFINE_RELOC(R_RISCV_SUB64, 40) \ _ELF_DEFINE_RELOC(R_RISCV_GNU_VTINHERIT, 41) \ _ELF_DEFINE_RELOC(R_RISCV_GNU_VTENTRY, 42) \ -_ELF_DEFINE_RELOC(R_RISCV_ALIGN 43) \ +_ELF_DEFINE_RELOC(R_RISCV_ALIGN, 43) \ _ELF_DEFINE_RELOC(R_RISCV_RVC_BRANCH, 44) \ _ELF_DEFINE_RELOC(R_RISCV_RVC_JUMP, 45) @@ -2042,6 +2164,7 @@ _ELF_DEFINE_IA64_RELOCATIONS() \ _ELF_DEFINE_MIPS_RELOCATIONS() \ _ELF_DEFINE_PPC32_RELOCATIONS() \ _ELF_DEFINE_PPC64_RELOCATIONS() \ +_ELF_DEFINE_RISCV_RELOCATIONS() \ _ELF_DEFINE_SPARC_RELOCATIONS() \ _ELF_DEFINE_X86_64_RELOCATIONS() Modified: vendor/elftoolchain/dist/common/native-elf-format ============================================================================== --- vendor/elftoolchain/dist/common/native-elf-format Wed Feb 10 19:01:26 2016 (r295483) +++ vendor/elftoolchain/dist/common/native-elf-format Wed Feb 10 19:39:36 2016 (r295484) @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: native-elf-format 3186 2015-04-16 22:16:40Z emaste $ +# $Id: native-elf-format 3293 2016-01-07 19:26:27Z emaste $ # # Find the native ELF format for a host platform by compiling a # test object and examining the resulting object. @@ -33,6 +33,8 @@ $1 ~ "Data:" { $1 ~ "Machine:" { if (match($0, "Intel.*386")) { elfarch = "EM_386"; + } else if (match($0, "MIPS")) { + elfarch = "EM_MIPS"; } else if (match($0, ".*[xX]86-64")) { elfarch = "EM_X86_64"; } else { Modified: vendor/elftoolchain/dist/cxxfilt/cxxfilt.c ============================================================================== --- vendor/elftoolchain/dist/cxxfilt/cxxfilt.c Wed Feb 10 19:01:26 2016 (r295483) +++ vendor/elftoolchain/dist/cxxfilt/cxxfilt.c Wed Feb 10 19:39:36 2016 (r295484) @@ -35,7 +35,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: cxxfilt.c 3174 2015-03-27 17:13:41Z emaste $"); +ELFTC_VCSID("$Id: cxxfilt.c 3356 2016-01-22 22:31:38Z jkoshy $"); #define STRBUFSZ 8192 @@ -112,11 +112,11 @@ find_format(const char *fstr) } static char * -demangle(char *name, int strict, int *pos) +demangle(char *name, int strict, size_t *pos) { static char dem[STRBUFSZ]; char nb[STRBUFSZ]; - int p, t; + size_t p, t; if (stripus && *name == '_') { strncpy(nb, name + 1, sizeof(nb) - 1); @@ -128,10 +128,10 @@ demangle(char *name, int strict, int *po nb[sizeof(nb) - 1] = '\0'; p = strlen(nb); - if (p <= 0) + if (p == 0) return NULL; - while (elftc_demangle(nb, dem, sizeof(dem), format) < 0) { + while (elftc_demangle(nb, dem, sizeof(dem), (unsigned) format) < 0) { if (!strict && p > 1) { nb[--p] = '\0'; continue; @@ -149,7 +149,8 @@ int main(int argc, char **argv) { char *dem, buf[STRBUFSZ]; - int c, i, p, s, opt; + size_t i, p, s; + int c, n, opt; while ((opt = getopt_long(argc, argv, "_nps:V", longopts, NULL)) != -1) { @@ -182,9 +183,9 @@ main(int argc, char **argv) argc -= optind; if (*argv != NULL) { - for (i = 0; i < argc; i++) { - if ((dem = demangle(argv[i], 1, NULL)) == NULL) - fprintf(stderr, "Failed: %s\n", argv[i]); + for (n = 0; n < argc; n++) { + if ((dem = demangle(argv[n], 1, NULL)) == NULL) + fprintf(stderr, "Failed: %s\n", argv[n]); else printf("%s\n", dem); } @@ -213,7 +214,7 @@ main(int argc, char **argv) if ((size_t) p >= sizeof(buf) - 1) warnx("buffer overflowed"); else - buf[p++] = c; + buf[p++] = (char) c; } } Modified: vendor/elftoolchain/dist/elfcopy/Makefile ============================================================================== --- vendor/elftoolchain/dist/elfcopy/Makefile Wed Feb 10 19:01:26 2016 (r295483) +++ vendor/elftoolchain/dist/elfcopy/Makefile Wed Feb 10 19:39:36 2016 (r295484) @@ -1,10 +1,13 @@ -# $Id: Makefile 2290 2011-12-04 07:20:46Z jkoshy $ +# $Id: Makefile 3381 2016-01-30 19:39:47Z jkoshy $ TOP= .. +.include "${TOP}/mk/elftoolchain.components.mk" + PROG= elfcopy -SRCS= archive.c ascii.c binary.c main.c sections.c segments.c symbols.c +SRCS= archive.c ascii.c binary.c main.c sections.c segments.c \ + symbols.c WARNS?= 5 @@ -15,14 +18,24 @@ LDADD= -lelf -lelftc LDADD+= -larchive .endif +.if defined(WITH_PE) && ${WITH_PE:tl} == "yes" +SRCS+= pe.c +CFLAGS+= -DWITH_PE=1 + +DPADD+= ${LIBPE} +LDADD+= -lpe +.endif + MAN= elfcopy.1 mcs.1 strip.1 +MLINKS= elfcopy.1 objcopy.1 NO_SHARED?= yes -LINKS= ${BINDIR}/elfcopy ${BINDIR}/strip \ - ${BINDIR}/elfcopy ${BINDIR}/mcs +LINKS= ${BINDIR}/elfcopy ${BINDIR}/mcs \ + ${BINDIR}/elfcopy ${BINDIR}/objcopy \ + ${BINDIR}/elfcopy ${BINDIR}/strip -EXTRA_TARGETS= strip mcs +EXTRA_TARGETS= mcs strip objcopy CLEANFILES+= ${EXTRA_TARGETS} Modified: vendor/elftoolchain/dist/elfcopy/archive.c ============================================================================== --- vendor/elftoolchain/dist/elfcopy/archive.c Wed Feb 10 19:01:26 2016 (r295483) +++ vendor/elftoolchain/dist/elfcopy/archive.c Wed Feb 10 19:39:36 2016 (r295484) @@ -38,7 +38,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: archive.c 3174 2015-03-27 17:13:41Z emaste $"); +ELFTC_VCSID("$Id: archive.c 3287 2015-12-31 16:58:48Z emaste $"); #define _ARMAG_LEN 8 /* length of ar magic string */ #define _ARHDR_LEN 60 /* length of ar header */ @@ -382,7 +382,7 @@ ac_read_objs(struct elfcopy *ecp, int if if (lseek(ifd, 0, SEEK_SET) == -1) err(EXIT_FAILURE, "lseek failed"); if ((a = archive_read_new()) == NULL) - errx(EXIT_FAILURE, "%s", archive_error_string(a)); + errx(EXIT_FAILURE, "archive_read_new failed"); archive_read_support_format_ar(a); AC(archive_read_open_fd(a, ifd, 10240)); for(;;) { @@ -443,7 +443,7 @@ ac_write_objs(struct elfcopy *ecp, int o int nr; if ((a = archive_write_new()) == NULL) - errx(EXIT_FAILURE, "%s", archive_error_string(a)); + errx(EXIT_FAILURE, "archive_write_new failed"); archive_write_set_format_ar_svr4(a); AC(archive_write_open_fd(a, ofd)); Modified: vendor/elftoolchain/dist/elfcopy/elfcopy.1 ============================================================================== --- vendor/elftoolchain/dist/elfcopy/elfcopy.1 Wed Feb 10 19:01:26 2016 (r295483) +++ vendor/elftoolchain/dist/elfcopy/elfcopy.1 Wed Feb 10 19:39:36 2016 (r295484) @@ -21,13 +21,14 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elfcopy.1 3266 2015-12-07 15:38:26Z emaste $ +.\" $Id: elfcopy.1 3381 2016-01-30 19:39:47Z jkoshy $ .\" -.Dd December 7, 2015 +.Dd January 29, 2016 .Os .Dt ELFCOPY 1 .Sh NAME -.Nm elfcopy +.Nm elfcopy , +.Nm objcopy .Nd copy and translate object files .Sh SYNOPSIS .Nm @@ -85,7 +86,7 @@ .Sh DESCRIPTION The .Nm -utility copies the content of the ELF object named by argument +utility copies the content of the binary object named by argument .Ar infile to that named by argument .Ar outfile , @@ -121,6 +122,10 @@ to the output. .It Fl O Ar objformat | Fl -output-target= Ns Ar objformat Write the output file using the object format specified in argument .Ar objformat . +The argument +.Ar objformat +should be one of the target names recognized by +.Xr elftc_bfd_find_target 3 . .It Fl R Ar sectionname | Fl -remove-section= Ns Ar sectionname Remove any section with name .Ar sectionname @@ -330,8 +335,14 @@ Do not copy symbols that are not needed .Xr mcs 1 , .Xr strip 1 , .Xr elf 3 , +.Xr elftc_bfd_find_target 3 , .Xr ar 5 , .Xr elf 5 +.Sh COMPATIBILITY +The +.Nm +utility is expected to be option compatible with GNU +.Nm objcopy . .Sh HISTORY .Nm has been implemented by Modified: vendor/elftoolchain/dist/elfcopy/elfcopy.h ============================================================================== --- vendor/elftoolchain/dist/elfcopy/elfcopy.h Wed Feb 10 19:01:26 2016 (r295483) +++ vendor/elftoolchain/dist/elfcopy/elfcopy.h Wed Feb 10 19:39:36 2016 (r295484) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: elfcopy.h 3221 2015-05-24 23:42:43Z kaiwang27 $ + * $Id: elfcopy.h 3310 2016-01-10 09:10:54Z kaiwang27 $ */ #include @@ -287,6 +287,7 @@ struct section *create_external_section( int _loadable); void create_external_symtab(struct elfcopy *_ecp); void create_ihex(int _ifd, int _ofd); +void create_pe(struct elfcopy *_ecp, int _ifd, int _ofd); void create_scn(struct elfcopy *_ecp); void create_srec(struct elfcopy *_ecp, int _ifd, int _ofd, const char *_ofn); void create_symtab(struct elfcopy *_ecp); Modified: vendor/elftoolchain/dist/elfcopy/main.c ============================================================================== --- vendor/elftoolchain/dist/elfcopy/main.c Wed Feb 10 19:01:26 2016 (r295483) +++ vendor/elftoolchain/dist/elfcopy/main.c Wed Feb 10 19:39:36 2016 (r295484) @@ -39,7 +39,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: main.c 3268 2015-12-07 20:30:55Z emaste $"); +ELFTC_VCSID("$Id: main.c 3381 2016-01-30 19:39:47Z jkoshy $"); enum options { @@ -722,6 +722,15 @@ create_file(struct elfcopy *ecp, const c create_srec(ecp, ofd, ofd0, dst != NULL ? dst : src); break; + case ETF_PE: + case ETF_EFI: +#if WITH_PE + create_pe(ecp, ofd, ofd0); +#else + errx(EXIT_FAILURE, "PE/EFI support not enabled" + " at compile time"); +#endif + break; default: errx(EXIT_FAILURE, "Internal: unsupported" " output flavour %d", ecp->oec); @@ -1345,6 +1354,9 @@ set_output_target(struct elfcopy *ecp, c ecp->oed = elftc_bfd_target_byteorder(tgt); ecp->oem = elftc_bfd_target_machine(tgt); } + if (ecp->otf == ETF_EFI || ecp->otf == ETF_PE) + ecp->oem = elftc_bfd_target_machine(tgt); + ecp->otgt = target_name; } @@ -1366,7 +1378,7 @@ set_osabi(struct elfcopy *ecp, const cha #define ELFCOPY_USAGE_MESSAGE "\ Usage: %s [options] infile [outfile]\n\ - Transform an ELF object.\n\n\ + Transform object files.\n\n\ Options:\n\ -d | -g | --strip-debug Remove debugging information from the output.\n\ -j SECTION | --only-section=SECTION\n\ @@ -1382,6 +1394,8 @@ Usage: %s [options] infile [outfile]\n\ -N SYM | --strip-symbol=SYM Do not copy symbol SYM to the output.\n\ -O FORMAT | --output-target=FORMAT\n\ Specify object format for the output file.\n\ + FORMAT should be a target name understood by\n\ + elftc_bfd_find_target(3).\n\ -R NAME | --remove-section=NAME\n\ Remove the named section.\n\ -S | --strip-all Remove all symbol and relocation information\n\ Added: vendor/elftoolchain/dist/elfcopy/pe.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/elftoolchain/dist/elfcopy/pe.c Wed Feb 10 19:39:36 2016 (r295484) @@ -0,0 +1,233 @@ +/*- + * Copyright (c) 2016 Kai Wang + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "elfcopy.h" + +ELFTC_VCSID("$Id: pe.c 3312 2016-01-10 09:23:51Z kaiwang27 $"); + +/* Convert ELF object to Portable Executable (PE). */ +void +create_pe(struct elfcopy *ecp, int ifd, int ofd) +{ + Elf *e; + Elf_Scn *scn; + Elf_Data *d; + GElf_Ehdr eh; + GElf_Shdr sh; + PE *pe; + PE_Scn *ps; + PE_SecHdr psh; + PE_CoffHdr pch; + PE_OptHdr poh; + PE_Object po; + PE_Buffer *pb; + const char *name; + size_t indx; + int elferr, i; + + if (ecp->otf == ETF_EFI || ecp->oem == EM_X86_64) + po = PE_O_PE32P; + else + po = PE_O_PE32; + + if ((e = elf_begin(ifd, ELF_C_READ, NULL)) == NULL) + errx(EXIT_FAILURE, "elf_begin() failed: %s", + elf_errmsg(-1)); + + if (gelf_getehdr(e, &eh) == NULL) + errx(EXIT_FAILURE, "gelf_getehdr() failed: %s", + elf_errmsg(-1)); + + if (elf_getshstrndx(ecp->ein, &indx) == 0) + errx(EXIT_FAILURE, "elf_getshstrndx() failed: %s", + elf_errmsg(-1)); + + if ((pe = pe_init(ofd, PE_C_WRITE, po)) == NULL) + err(EXIT_FAILURE, "pe_init() failed"); + + /* Setup PE COFF header. */ + memset(&pch, 0, sizeof(pch)); + switch (ecp->oem) { + case EM_386: + pch.ch_machine = IMAGE_FILE_MACHINE_I386; + break; + case EM_X86_64: + pch.ch_machine = IMAGE_FILE_MACHINE_AMD64; + break; + default: + pch.ch_machine = IMAGE_FILE_MACHINE_UNKNOWN; + break; + } + pch.ch_timestamp = (uint32_t) time(NULL); + if (pe_update_coff_header(pe, &pch) < 0) + err(EXIT_FAILURE, "pe_update_coff_header() failed"); + + /* Setup PE optional header. */ + memset(&poh, 0, sizeof(poh)); + if (ecp->otf == ETF_EFI) + poh.oh_subsystem = IMAGE_SUBSYSTEM_EFI_APPLICATION; + poh.oh_entry = (uint32_t) eh.e_entry; + + /* + * Default section alignment and file alignment. (Here the + * section alignment is set to the default page size of the + * archs supported. We should use different section alignment + * for some arch. (e.g. IA64) + */ + poh.oh_secalign = 0x1000; + poh.oh_filealign = 0x200; + + /* Copy sections. */ + scn = NULL; + while ((scn = elf_nextscn(e, scn)) != NULL) { + + /* + * Read in ELF section. + */ + + if (gelf_getshdr(scn, &sh) == NULL) { + warnx("gelf_getshdr() failed: %s", elf_errmsg(-1)); + (void) elf_errno(); + continue; + } + if ((name = elf_strptr(ecp->ein, indx, sh.sh_name)) == + NULL) { + warnx("elf_strptr() failed: %s", elf_errmsg(-1)); + (void) elf_errno(); + continue; + } + + /* Skip sections unneeded. */ + if (strcmp(name, ".shstrtab") == 0 || + strcmp(name, ".symtab") == 0 || + strcmp(name, ".strtab") == 0) + continue; + + if ((d = elf_getdata(scn, NULL)) == NULL) { + warnx("elf_getdata() failed: %s", elf_errmsg(-1)); + (void) elf_errno(); + continue; + } + + if (strcmp(name, ".text") == 0) { + poh.oh_textbase = (uint32_t) sh.sh_addr; + poh.oh_textsize = (uint32_t) roundup(sh.sh_size, + poh.oh_filealign); + } else { + if (po == PE_O_PE32 && strcmp(name, ".data") == 0) + poh.oh_database = sh.sh_addr; + if (sh.sh_type == SHT_NOBITS) + poh.oh_bsssize += (uint32_t) + roundup(sh.sh_size, poh.oh_filealign); + else if (sh.sh_flags & SHF_ALLOC) + poh.oh_datasize += (uint32_t) + roundup(sh.sh_size, poh.oh_filealign); + } + + /* + * Create PE/COFF section. + */ + + if ((ps = pe_newscn(pe)) == NULL) { + warn("pe_newscn() failed"); + continue; + } + + /* + * Setup PE/COFF section header. The section name is not + * NUL-terminated if its length happens to be 8. Long + * section name should be truncated for PE image according + * to the PE/COFF specification. + */ + memset(&psh, 0, sizeof(psh)); + strncpy(psh.sh_name, name, sizeof(psh.sh_name)); + psh.sh_addr = sh.sh_addr; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Feb 10 19:40:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13E11AA4485; Wed, 10 Feb 2016 19:40:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 C113A1392; Wed, 10 Feb 2016 19:40:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1AJeSXi063543; Wed, 10 Feb 2016 19:40:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1AJeSap063542; Wed, 10 Feb 2016 19:40:28 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602101940.u1AJeSap063542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 10 Feb 2016 19:40:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295485 - vendor/elftoolchain/elftoolchain-r3395 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 19:40:30 -0000 Author: emaste Date: Wed Feb 10 19:40:28 2016 New Revision: 295485 URL: https://svnweb.freebsd.org/changeset/base/295485 Log: Tag elftoolchain-r3395 Added: vendor/elftoolchain/elftoolchain-r3395/ - copied from r295484, vendor/elftoolchain/dist/ From owner-svn-src-all@freebsd.org Wed Feb 10 20:08:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 133A7AA3626; Wed, 10 Feb 2016 20:08:26 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 027CFAEB; Wed, 10 Feb 2016 20:08:26 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from 50-196-156-133-static.hfc.comcastbusiness.net ([50.196.156.133]:55485 helo=tinkerbell.pixel8networks.com) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1aTVso-0005pa-P7; Wed, 10 Feb 2016 06:36:43 -0800 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r295471 - in head/etc: defaults rc.d From: Devin Teske In-Reply-To: <0CAF4F00-7711-4F0F-8487-0B17381940F2@FreeBSD.org> Date: Wed, 10 Feb 2016 12:08:25 -0800 Cc: Ronald Klop , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Devin Teske , Matteo Riondato Message-Id: References: <201602101613.u1AGDx0I003885@repo.freebsd.org> <0CAF4F00-7711-4F0F-8487-0B17381940F2@FreeBSD.org> To: Mark Felder X-Mailer: Apple Mail (2.2104) Sender: devin@shxd.cx Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 20:08:26 -0000 > On Feb 10, 2016, at 9:28 AM, Matteo Riondato = wrote: >=20 >>=20 >> On Feb 10, 2016, at 12:04 PM, Ronald Klop = wrote: >>=20 >> On Wed, 10 Feb 2016 17:13:59 +0100, Mark Felder = wrote: >>=20 >>> Author: feld (ports committer) >>> Date: Wed Feb 10 16:13:59 2016 >>> New Revision: 295471 >>> URL: https://svnweb.freebsd.org/changeset/base/295471 >>>=20 >>> Log: >>> Add new rc.conf parameter "jail_reverse_stop" >>> When a user defines "jail_list" in rc.conf the jails are started in = the >>> order defined. Currently the jails are not are stopped in reverse = order >>> which may break dependencies between jails/services and prevent a = clean >>> shutdown. The new parameter "jail_reverse_stop" will shutdown jails = in >>> "jail_list" in reverse order when set to "YES". >>> Please note that this does not affect manual invocation of the jail = rc >>> script. If a user runs the command >>> # service jail stop jail1 jail2 jail3 >>> the jails will be stopped in exactly the order specified regardless = of >>> jail_reverse_stop being defined in rc.conf. >>> PR: 196152 >>=20 >> Good feature. I know POLA is always very important in FreeBSD = development, but having this setting on by default seems very reasonable = to me. >=20 > +1, perhaps with a note in UPDATING and, when MFC=E2=80=99ed, having = the default to off. >=20 +1 Great work, Mark! --=20 Devin= From owner-svn-src-all@freebsd.org Wed Feb 10 20:13:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0214BAA3B5F for ; Wed, 10 Feb 2016 20:13:59 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (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 CEE2D108D for ; Wed, 10 Feb 2016 20:13:58 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id E1E0F21A8D for ; Wed, 10 Feb 2016 15:13:50 -0500 (EST) Received: from web6 ([10.202.2.216]) by compute2.internal (MEProxy); Wed, 10 Feb 2016 15:13:50 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=kFH00KCYEog5x9y uC9/HyEIiXQs=; b=NDpvKjz8y2bHomSDBBh1MrOh2dvdzHFxcwUjqA/kmqIdFp3 y43Dcu9H1+P0M5RGUEhXJuCeUBY8BKPIdUlQ+FppxVF1RUt+nHsOpwpZa45OjBe+ Uy9au9UyoaGJ3jey+QuK69h2jUt+dYaHFWyr6fMWPNXP+7+VYLQvPIfaDjZA= Received: by web6.nyi.internal (Postfix, from userid 99) id A939048CB0; Wed, 10 Feb 2016 15:13:50 -0500 (EST) Message-Id: <1455135230.94915.517674594.46214C39@webmail.messagingengine.com> X-Sasl-Enc: jimk+w1Hzcw+6W4fOoRj8nQbEo7c3vL6s9gUYxG43eAq 1455135230 From: Mark Felder To: Matteo Riondato , Ronald Klop Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-e69f0414 Subject: Re: svn commit: r295471 - in head/etc: defaults rc.d Date: Wed, 10 Feb 2016 14:13:50 -0600 In-Reply-To: <0CAF4F00-7711-4F0F-8487-0B17381940F2@FreeBSD.org> References: <201602101613.u1AGDx0I003885@repo.freebsd.org> <0CAF4F00-7711-4F0F-8487-0B17381940F2@FreeBSD.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 20:13:59 -0000 On Wed, Feb 10, 2016, at 11:28, Matteo Riondato wrote: >=20 > > On Feb 10, 2016, at 12:04 PM, Ronald Klop wrote: > >=20 > > On Wed, 10 Feb 2016 17:13:59 +0100, Mark Felder wrot= e: > >=20 > >> Author: feld (ports committer) > >> Date: Wed Feb 10 16:13:59 2016 > >> New Revision: 295471 > >> URL: https://svnweb.freebsd.org/changeset/base/295471 > >>=20 > >> Log: > >> Add new rc.conf parameter "jail_reverse_stop" > >> When a user defines "jail_list" in rc.conf the jails are started in the > >> order defined. Currently the jails are not are stopped in reverse ord= er > >> which may break dependencies between jails/services and prevent a cle= an > >> shutdown. The new parameter "jail_reverse_stop" will shutdown jails in > >> "jail_list" in reverse order when set to "YES". > >> Please note that this does not affect manual invocation of the jail rc > >> script. If a user runs the command > >> # service jail stop jail1 jail2 jail3 > >> the jails will be stopped in exactly the order specified regardless of > >> jail_reverse_stop being defined in rc.conf. > >> PR: 196152 > >=20 > > Good feature. I know POLA is always very important in FreeBSD developme= nt, but having this setting on by default seems very reasonable to me. >=20 > +1, perhaps with a note in UPDATING and, when MFC=E2=80=99ed, having the = default > to off. >=20 I also agree it's probably fine to be enabled by default in CURRENT, but the last thing I wanted to do was throw an unexpected wrench into the next cluster refresh and make Pete even more Evil. --=20 Mark Felder ports-secteam member feld@FreeBSD.org From owner-svn-src-all@freebsd.org Wed Feb 10 20:28:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79C46AA474B; Wed, 10 Feb 2016 20:28:30 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 37A7C1D0C; Wed, 10 Feb 2016 20:28:30 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1AKST0B078648; Wed, 10 Feb 2016 20:28:29 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1AKSTXg078647; Wed, 10 Feb 2016 20:28:29 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201602102028.u1AKSTXg078647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 10 Feb 2016 20:28:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295486 - head/sys/dev/ntb/ntb_hw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 20:28:30 -0000 Author: cem Date: Wed Feb 10 20:28:28 2016 New Revision: 295486 URL: https://svnweb.freebsd.org/changeset/base/295486 Log: ntb_hw(4): Allow any x86 PAT caching flags for MW defaults Replace the hw.ntb.enable_writecombine tunable with hw.ntb.default_mw_pat. It can be set with several specific numerical values to select a caching type. Any bogus value is treated as Uncacheable (UC). The ntb_mw_set_wc() KPI has removed the restriction that the selected mode must be one of UC, WC, or WB. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Feb 10 19:40:28 2016 (r295485) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Feb 10 20:28:28 2016 (r295486) @@ -331,9 +331,43 @@ SYSCTL_UINT(_hw_ntb, OID_AUTO, debug_lev } \ } while (0) -static unsigned g_ntb_enable_wc = 1; -SYSCTL_UINT(_hw_ntb, OID_AUTO, enable_writecombine, CTLFLAG_RDTUN, - &g_ntb_enable_wc, 0, "Set to 1 to map memory windows write combining"); +#define _NTB_PAT_UC 0 +#define _NTB_PAT_WC 1 +#define _NTB_PAT_WT 4 +#define _NTB_PAT_WP 5 +#define _NTB_PAT_WB 6 +#define _NTB_PAT_UCM 7 +static unsigned g_ntb_mw_pat = _NTB_PAT_UC; +SYSCTL_UINT(_hw_ntb, OID_AUTO, default_mw_pat, CTLFLAG_RDTUN, + &g_ntb_mw_pat, 0, "Configure the default memory window cache flags (PAT): " + "UC: " __XSTRING(_NTB_PAT_UC) ", " + "WC: " __XSTRING(_NTB_PAT_WC) ", " + "WT: " __XSTRING(_NTB_PAT_WT) ", " + "WP: " __XSTRING(_NTB_PAT_WP) ", " + "WB: " __XSTRING(_NTB_PAT_WB) ", " + "UC-: " __XSTRING(_NTB_PAT_UCM)); + +static inline vm_memattr_t +ntb_pat_flags(void) +{ + + switch (g_ntb_mw_pat) { + case _NTB_PAT_WC: + return (VM_MEMATTR_WRITE_COMBINING); + case _NTB_PAT_WT: + return (VM_MEMATTR_WRITE_THROUGH); + case _NTB_PAT_WP: + return (VM_MEMATTR_WRITE_PROTECTED); + case _NTB_PAT_WB: + return (VM_MEMATTR_WRITE_BACK); + case _NTB_PAT_UCM: + return (VM_MEMATTR_WEAK_UNCACHEABLE); + case _NTB_PAT_UC: + /* FALLTHROUGH */ + default: + return (VM_MEMATTR_UNCACHEABLE); + } +} static int g_ntb_mw_idx = -1; SYSCTL_INT(_hw_ntb, OID_AUTO, b2b_mw_idx, CTLFLAG_RDTUN, &g_ntb_mw_idx, @@ -777,10 +811,13 @@ map_memory_window_bar(struct ntb_softc * bar->map_mode = VM_MEMATTR_UNCACHEABLE; print_map_success(ntb, bar, "mw"); - /* Mark bar region as write combining to improve performance. */ - mapmode = VM_MEMATTR_WRITE_COMBINING; - if (g_ntb_enable_wc == 0) - mapmode = VM_MEMATTR_WRITE_BACK; + /* + * Optionally, mark MW BARs as anything other than UC to improve + * performance. + */ + mapmode = ntb_pat_flags(); + if (mapmode == bar->map_mode) + return (0); rc = pmap_change_attr((vm_offset_t)bar->vbase, bar->size, mapmode); if (rc == 0) { @@ -2728,10 +2765,6 @@ ntb_mw_set_wc_internal(struct ntb_softc if (bar->map_mode == mode) return (0); - if (mode != VM_MEMATTR_UNCACHEABLE && mode != VM_MEMATTR_DEFAULT && - mode != VM_MEMATTR_WRITE_COMBINING) - return (EINVAL); - rc = pmap_change_attr((vm_offset_t)bar->vbase, bar->size, mode); if (rc == 0) bar->map_mode = mode; From owner-svn-src-all@freebsd.org Wed Feb 10 20:38:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5735AA4D12; Wed, 10 Feb 2016 20:38:29 +0000 (UTC) (envelope-from thomas@FreeBSD.ORG) Received: from melamine.cuivre.fr.eu.org (houdart.cuivre.fr.eu.org [81.57.40.110]) (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 ADB963F8; Wed, 10 Feb 2016 20:38:29 +0000 (UTC) (envelope-from thomas@FreeBSD.ORG) Received: by melamine.cuivre.fr.eu.org (Postfix, from userid 1000) id 8FAD0115E8A; Wed, 10 Feb 2016 21:38:23 +0100 (CET) Date: Wed, 10 Feb 2016 21:38:23 +0100 From: Thomas Quinot To: Maxim Sobolev Cc: kib@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn: head/bin/dd Message-ID: <20160210203823.GA74615@melamine.cuivre.fr.eu.org> References: <201405071933.s47JXUx0046697@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="XsQoSWH+UP9D9v3l" Content-Disposition: inline In-Reply-To: X-message-flag: WARNING! Using Outlook can damage your computer. User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 20:38:30 -0000 --XsQoSWH+UP9D9v3l Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Maxim Sobolev, 2016-02-10 : > Looking at the code in question I don't see how could it have worked. Look > at the following piece of code in your diff for example: >=20 > + if (force && cnt =3D=3D 0) { > + pending -=3D last_sp; > + assert(outp =3D=3D out.db= ); > + memset(outp, 0, cnt); > + } >=20 > When the branch is taken, cnt is 0, so at the very least memset(x, y, 0) = is > NOP. Later on, write(2) is conditional on cnt !=3D 0, so that it's never > taken. As a result, lseek is the last operation the file sees. Correct :-( In the context of the current logic, I think the simple fix is: Index: dd.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- dd.c (r=E9vision 265593) +++ dd.c (copie de travail) @@ -470,6 +470,7 @@ */ if (force && cnt =3D=3D 0) { pending -=3D last_sp; + cnt +=3D last_sp; assert(outp =3D=3D out.db); memset(outp, 0, cnt); } > Also, for what it's worth, you can use ftruncate(2) instead of write() for > regular sparse files to ensure correct size. That would write just as much > data as needed to the end. I've made a quick and dirty patch, that seems = to > be working better than current code at least: >=20 > http://sobomax.sippysoft.com/dd.diff >=20 > Please fix. Leveraging ftruncate certainly seems attractive, if the destination is a regular file. I'll look into this option. Thanks! Thomas. --XsQoSWH+UP9D9v3l Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJWu5+zXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRDRUU5NDNCMDA4OUI3QTg3NUZGMDg3RDdE RjhFMEI1QzdDQzYyRUYyAAoJEN+OC1x8xi7ySXAP/j2bfwtylmhCJ0I9b8oqQ1Yx +yxxhXFc8ovcfUFwoze1W70ijps5bpMwebGnvMBj7HPqd/08dgquG95JTlhKLThg 1BhrOV0rz2kAGd2W6ewXxeUDSLl7SQ69jI6wKcmkNu8wFEkAdE2ZkYQiaz5HtS8V lhPkbdwjIeB8bzLvhyVWaBx0VXs0GpoIvf184PhbUb79uMkWk0xcC863JGI0S29g RhFGOF8NFnfXNH1+nV6S9nfcYPmdq6qqCLLwzghQSSHZfCAe+aSlDm86wmK2B3XB g0qbkKhTMQ3boFiM+JYcpbdVh1JTuynqWLz2qAxwQ4l0FyPknDwboI/AaDbFh5Jf M3OseI183IJqTztdDIs/LhOZnc6nJhGvNb4jEsx+pt1J9O+rQR72phEr5ObxBqOf ZiXrhpLR6D2zpELusWuTAJ2nJw3kPPOAgb979Nhl0jt4WpelumPvbOyR9UUBFZmW d3eROWUWXsf3En6C1G9Puwtq5jafUecnDaTK+5c/txM1iDxdie2+3IQWF0oHy/eQ tb/AF+Rrl6/BO/5Rc8sEJ1ArzP/g8hRkaVEvL5jYlLWjb+1KFSkcrPWQNO+l4vGZ i07Li7tSGheHj33P2Qwsii2QFOtm+oS9GyUokh+DbJvEcrbaaSymAy+Q0a8wRP/Q NffgaysChYiFB9IxU2Uv =zgdt -----END PGP SIGNATURE----- --XsQoSWH+UP9D9v3l-- From owner-svn-src-all@freebsd.org Wed Feb 10 20:49:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29F8AAA41CC; Wed, 10 Feb 2016 20:49:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 D87EDAA7; Wed, 10 Feb 2016 20:49:23 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1AKnMvd084587; Wed, 10 Feb 2016 20:49:22 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1AKnMQ0084586; Wed, 10 Feb 2016 20:49:22 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201602102049.u1AKnMQ0084586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 10 Feb 2016 20:49:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295487 - head/sys/dev/ntb/ntb_hw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 20:49:24 -0000 Author: cem Date: Wed Feb 10 20:49:22 2016 New Revision: 295487 URL: https://svnweb.freebsd.org/changeset/base/295487 Log: ntb_hw(4): Print correct PAT name for non-WC/WB types mapped at load Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Feb 10 20:28:28 2016 (r295486) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Feb 10 20:49:22 2016 (r295487) @@ -369,6 +369,32 @@ ntb_pat_flags(void) } } +/* + * Well, this obviously doesn't belong here, but it doesn't seem to exist + * anywhere better yet. + */ +static inline const char * +ntb_vm_memattr_to_str(vm_memattr_t pat) +{ + + switch (pat) { + case VM_MEMATTR_WRITE_COMBINING: + return ("WRITE_COMBINING"); + case VM_MEMATTR_WRITE_THROUGH: + return ("WRITE_THROUGH"); + case VM_MEMATTR_WRITE_PROTECTED: + return ("WRITE_PROTECTED"); + case VM_MEMATTR_WRITE_BACK: + return ("WRITE_BACK"); + case VM_MEMATTR_WEAK_UNCACHEABLE: + return ("UNCACHED"); + case VM_MEMATTR_UNCACHEABLE: + return ("UNCACHEABLE"); + default: + return ("UNKNOWN"); + } +} + static int g_ntb_mw_idx = -1; SYSCTL_INT(_hw_ntb, OID_AUTO, b2b_mw_idx, CTLFLAG_RDTUN, &g_ntb_mw_idx, 0, "Use this memory window to access the peer NTB registers. A " @@ -828,8 +854,7 @@ map_memory_window_bar(struct ntb_softc * PCI_RID2BAR(bar->pci_resource_id), bar->vbase, (char *)bar->vbase + bar->size - 1, (void *)bar->pbase, (void *)(bar->pbase + bar->size - 1), - (mapmode == VM_MEMATTR_WRITE_COMBINING) ? "WRITE_COMBINING" - : "WRITE_BACK"); + ntb_vm_memattr_to_str(mapmode)); } else device_printf(ntb->device, "Unable to mark BAR%d v:[%p-%p] p:[%p-%p] as " @@ -837,8 +862,7 @@ map_memory_window_bar(struct ntb_softc * PCI_RID2BAR(bar->pci_resource_id), bar->vbase, (char *)bar->vbase + bar->size - 1, (void *)bar->pbase, (void *)(bar->pbase + bar->size - 1), - (mapmode == VM_MEMATTR_WRITE_COMBINING) ? "WRITE_COMBINING" - : "WRITE_BACK", rc); + ntb_vm_memattr_to_str(mapmode), rc); /* Proceed anyway */ return (0); } From owner-svn-src-all@freebsd.org Wed Feb 10 21:16:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25A36AA416D; Wed, 10 Feb 2016 21:16:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 ECCDE1C0E; Wed, 10 Feb 2016 21:16:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1ALGbND093148; Wed, 10 Feb 2016 21:16:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1ALGbv6093147; Wed, 10 Feb 2016 21:16:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201602102116.u1ALGbv6093147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 10 Feb 2016 21:16:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295488 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 21:16:39 -0000 Author: kib Date: Wed Feb 10 21:16:37 2016 New Revision: 295488 URL: https://svnweb.freebsd.org/changeset/base/295488 Log: Finish r173600. There is no need to test a condition if both cases result in the same value. Found by: PVS-Studio Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/subr_turnstile.c Modified: head/sys/kern/subr_turnstile.c ============================================================================== --- head/sys/kern/subr_turnstile.c Wed Feb 10 20:49:22 2016 (r295487) +++ head/sys/kern/subr_turnstile.c Wed Feb 10 21:16:37 2016 (r295488) @@ -1026,8 +1026,7 @@ print_thread(struct thread *td, const ch { db_printf("%s%p (tid %d, pid %d, \"%s\")\n", prefix, td, td->td_tid, - td->td_proc->p_pid, td->td_name[0] != '\0' ? td->td_name : - td->td_name); + td->td_proc->p_pid, td->td_name); } static void @@ -1109,8 +1108,7 @@ print_lockchain(struct thread *td, const */ while (!db_pager_quit) { db_printf("%sthread %d (pid %d, %s) ", prefix, td->td_tid, - td->td_proc->p_pid, td->td_name[0] != '\0' ? td->td_name : - td->td_name); + td->td_proc->p_pid, td->td_name); switch (td->td_state) { case TDS_INACTIVE: db_printf("is inactive\n"); @@ -1193,8 +1191,7 @@ print_sleepchain(struct thread *td, cons */ while (!db_pager_quit) { db_printf("%sthread %d (pid %d, %s) ", prefix, td->td_tid, - td->td_proc->p_pid, td->td_name[0] != '\0' ? td->td_name : - td->td_name); + td->td_proc->p_pid, td->td_name); switch (td->td_state) { case TDS_INACTIVE: db_printf("is inactive\n"); From owner-svn-src-all@freebsd.org Wed Feb 10 21:29:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63327AA47BF for ; Wed, 10 Feb 2016 21:29:49 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE2F8366 for ; Wed, 10 Feb 2016 21:29:48 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-wm0-x22c.google.com with SMTP id g62so44784871wme.0 for ; Wed, 10 Feb 2016 13:29:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=RmoszIHyOiOeC9hDGBBNkjzJQMi56+Jr00tYE/9Zlws=; b=XxSpi8/YkScJbrXUrRwqhkgdUlmwE6aClc3+r/sm0jBwwfeR1OGEB+rcBqoEDuEXw7 IKIwzZ/vSMyhCAgDgGua+T44de4sKQcaeXyriOlUSMjhqGH5uA4UizrwJmMRoedQfCf8 WesPl/IFgw0HXoWsqvudWFu7a4CmE//l6rAvQWxpX6yqvyclUPTbYr9Qr5fOfpW3U6xz v633Qwf6dWHHnkHhtfsvYplwhpHvdO+Eyyx2FD/k1nf4Dd0ceJc7zLgVwiaN/x2H9GZG Ug+LQrcMiFf/KA5UrZvUHNrtm5u/JtPyGuSWjjYw4FlEtfcLhc1ZAMzA6tvwwmgbf7kS GN9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=RmoszIHyOiOeC9hDGBBNkjzJQMi56+Jr00tYE/9Zlws=; b=a7wtA35pAR3g77IzZwCwSlOBNSfSZZEv7/oSLjKo0TKZSKczuDYAHePcHvjK9hqbZn HDTs2iT8cZKIK4bXjLXtoK+bw1rg9opFclJ6NVbaiJvIv3+NiHWLrdyjsJkk2rKKNKyV dOl3vJSpuJo4c9flNevVlJrwsy/EPvGgyrkiW1oW6UBeQ1LU/9BS1n6KqohSg8+UDh3B O9visyg79aTNMZLWJUyUJST+h9VJw4xmWutgxADTqVSAQWsZ5KDVsCWPz1yGLbfPEl1e 5fs6Hq4RSsRdz/aq5OAe62jMdt8jUZwVs2H7kqMKIpiLILNUsN6h5LsKj/++D3J3b6fW tjdQ== X-Gm-Message-State: AG10YORSnGepYMCIsCAzhleHRpltOIUCELWbwFl84UmXZptWlZf4vhLJwQxEhf54lL6y7dOX5ucFSysB6Od1RzbA MIME-Version: 1.0 X-Received: by 10.28.225.8 with SMTP id y8mr14498095wmg.94.1455139787439; Wed, 10 Feb 2016 13:29:47 -0800 (PST) Sender: sobomax@sippysoft.com Received: by 10.27.172.16 with HTTP; Wed, 10 Feb 2016 13:29:47 -0800 (PST) In-Reply-To: <20160210203823.GA74615@melamine.cuivre.fr.eu.org> References: <201405071933.s47JXUx0046697@svn.freebsd.org> <20160210203823.GA74615@melamine.cuivre.fr.eu.org> Date: Wed, 10 Feb 2016 13:29:47 -0800 X-Google-Sender-Auth: _vfkvHRIUbv0TEz5rEFJ8P3edVs Message-ID: Subject: Re: svn: head/bin/dd From: Maxim Sobolev To: Thomas Quinot Cc: kib@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 21:29:49 -0000 The patch looks fair to me, although I have not got chance to test it yet. You probably don't need +=3D since cnt is already tested to be 0, so "=3D" would suffice. :) In any case, I've opened a bug here: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D207092 So please make sure to deal with it when you are done with the commit. On another note it would be nice to add some kind of basic test case for the dd to verify correct behavior while we at it. Thanks! On Wed, Feb 10, 2016 at 12:38 PM, Thomas Quinot wrote: > * Maxim Sobolev, 2016-02-10 : > > > Looking at the code in question I don't see how could it have worked. > Look > > at the following piece of code in your diff for example: > > > > + if (force && cnt =3D=3D 0) { > > + pending -=3D last_sp; > > + assert(outp =3D=3D out.= db); > > + memset(outp, 0, cnt); > > + } > > > > When the branch is taken, cnt is 0, so at the very least memset(x, y, 0= ) > is > > NOP. Later on, write(2) is conditional on cnt !=3D 0, so that it's nev= er > > taken. As a result, lseek is the last operation the file sees. > > Correct :-( > > In the context of the current logic, I think the simple fix is: > > Index: dd.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- dd.c (r=C3=A9vision 265593) > +++ dd.c (copie de travail) > @@ -470,6 +470,7 @@ > */ > if (force && cnt =3D=3D 0) { > pending -=3D last_sp; > + cnt +=3D last_sp; > assert(outp =3D=3D out.db= ); > memset(outp, 0, cnt); > } > > > Also, for what it's worth, you can use ftruncate(2) instead of write() > for > > regular sparse files to ensure correct size. That would write just as > much > > data as needed to the end. I've made a quick and dirty patch, that seem= s > to > > be working better than current code at least: > > > > http://sobomax.sippysoft.com/dd.diff > > > > Please fix. > > Leveraging ftruncate certainly seems attractive, if the destination is a > regular file. I'll look into this option. > > Thanks! > Thomas. > > From owner-svn-src-all@freebsd.org Wed Feb 10 21:35:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D11B8AA4ABA; Wed, 10 Feb 2016 21:35:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 AD732A79; Wed, 10 Feb 2016 21:35:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1ALZ0u2099055; Wed, 10 Feb 2016 21:35:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1ALZ0lU099053; Wed, 10 Feb 2016 21:35:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201602102135.u1ALZ0lU099053@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 10 Feb 2016 21:35:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295489 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 21:35:01 -0000 Author: kib Date: Wed Feb 10 21:35:00 2016 New Revision: 295489 URL: https://svnweb.freebsd.org/changeset/base/295489 Log: Remove useless checks for NULL before calling free(9), in the kernel elf linkers. Found by: Related PVS-Studio diagnostic Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/link_elf.c head/sys/kern/link_elf_obj.c Modified: head/sys/kern/link_elf.c ============================================================================== --- head/sys/kern/link_elf.c Wed Feb 10 21:16:37 2016 (r295488) +++ head/sys/kern/link_elf.c Wed Feb 10 21:35:00 2016 (r295489) @@ -1090,12 +1090,9 @@ out: vn_close(nd.ni_vp, FREAD, td->td_ucred, td); if (error != 0 && lf != NULL) linker_file_unload(lf, LINKER_UNLOAD_FORCE); - if (shdr != NULL) - free(shdr, M_LINKER); - if (firstpage != NULL) - free(firstpage, M_LINKER); - if (shstrs != NULL) - free(shstrs, M_LINKER); + free(shdr, M_LINKER); + free(firstpage, M_LINKER); + free(shstrs, M_LINKER); return (error); } @@ -1157,19 +1154,13 @@ link_elf_unload_file(linker_file_t file) + (ef->object->size << PAGE_SHIFT)); } #else - if (ef->address != NULL) - free(ef->address, M_LINKER); + free(ef->address, M_LINKER); #endif - if (ef->symbase != NULL) - free(ef->symbase, M_LINKER); - if (ef->strbase != NULL) - free(ef->strbase, M_LINKER); - if (ef->ctftab != NULL) - free(ef->ctftab, M_LINKER); - if (ef->ctfoff != NULL) - free(ef->ctfoff, M_LINKER); - if (ef->typoff != NULL) - free(ef->typoff, M_LINKER); + free(ef->symbase, M_LINKER); + free(ef->strbase, M_LINKER); + free(ef->ctftab, M_LINKER); + free(ef->ctfoff, M_LINKER); + free(ef->typoff, M_LINKER); } static void Modified: head/sys/kern/link_elf_obj.c ============================================================================== --- head/sys/kern/link_elf_obj.c Wed Feb 10 21:16:37 2016 (r295488) +++ head/sys/kern/link_elf_obj.c Wed Feb 10 21:35:00 2016 (r295489) @@ -898,8 +898,7 @@ out: vn_close(nd.ni_vp, FREAD, td->td_ucred, td); if (error && lf) linker_file_unload(lf, LINKER_UNLOAD_FORCE); - if (hdr) - free(hdr, M_LINKER); + free(hdr, M_LINKER); return error; } @@ -930,18 +929,12 @@ link_elf_unload_file(linker_file_t file) } } if (ef->preloaded) { - if (ef->reltab) - free(ef->reltab, M_LINKER); - if (ef->relatab) - free(ef->relatab, M_LINKER); - if (ef->progtab) - free(ef->progtab, M_LINKER); - if (ef->ctftab) - free(ef->ctftab, M_LINKER); - if (ef->ctfoff) - free(ef->ctfoff, M_LINKER); - if (ef->typoff) - free(ef->typoff, M_LINKER); + free(ef->reltab, M_LINKER); + free(ef->relatab, M_LINKER); + free(ef->progtab, M_LINKER); + free(ef->ctftab, M_LINKER); + free(ef->ctfoff, M_LINKER); + free(ef->typoff, M_LINKER); if (file->filename != NULL) preload_delete_name(file->filename); /* XXX reclaim module memory? */ @@ -949,37 +942,25 @@ link_elf_unload_file(linker_file_t file) } for (i = 0; i < ef->nreltab; i++) - if (ef->reltab[i].rel) - free(ef->reltab[i].rel, M_LINKER); + free(ef->reltab[i].rel, M_LINKER); for (i = 0; i < ef->nrelatab; i++) - if (ef->relatab[i].rela) - free(ef->relatab[i].rela, M_LINKER); - if (ef->reltab) - free(ef->reltab, M_LINKER); - if (ef->relatab) - free(ef->relatab, M_LINKER); - if (ef->progtab) - free(ef->progtab, M_LINKER); + free(ef->relatab[i].rela, M_LINKER); + free(ef->reltab, M_LINKER); + free(ef->relatab, M_LINKER); + free(ef->progtab, M_LINKER); if (ef->object) { vm_map_remove(kernel_map, (vm_offset_t) ef->address, (vm_offset_t) ef->address + (ef->object->size << PAGE_SHIFT)); } - if (ef->e_shdr) - free(ef->e_shdr, M_LINKER); - if (ef->ddbsymtab) - free(ef->ddbsymtab, M_LINKER); - if (ef->ddbstrtab) - free(ef->ddbstrtab, M_LINKER); - if (ef->shstrtab) - free(ef->shstrtab, M_LINKER); - if (ef->ctftab) - free(ef->ctftab, M_LINKER); - if (ef->ctfoff) - free(ef->ctfoff, M_LINKER); - if (ef->typoff) - free(ef->typoff, M_LINKER); + free(ef->e_shdr, M_LINKER); + free(ef->ddbsymtab, M_LINKER); + free(ef->ddbstrtab, M_LINKER); + free(ef->shstrtab, M_LINKER); + free(ef->ctftab, M_LINKER); + free(ef->ctfoff, M_LINKER); + free(ef->typoff, M_LINKER); } static const char * From owner-svn-src-all@freebsd.org Wed Feb 10 22:28:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64F01AA42CD; Wed, 10 Feb 2016 22:28:58 +0000 (UTC) (envelope-from thomas@FreeBSD.ORG) Received: from melamine.cuivre.fr.eu.org (houdart.cuivre.fr.eu.org [81.57.40.110]) (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 2F56FB05; Wed, 10 Feb 2016 22:28:57 +0000 (UTC) (envelope-from thomas@FreeBSD.ORG) Received: by melamine.cuivre.fr.eu.org (Postfix, from userid 1000) id B0E2A1166C7; Wed, 10 Feb 2016 23:28:55 +0100 (CET) Date: Wed, 10 Feb 2016 23:28:55 +0100 From: Thomas Quinot To: Maxim Sobolev Cc: kib@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn: head/bin/dd Message-ID: <20160210222855.GA89220@melamine.cuivre.fr.eu.org> References: <201405071933.s47JXUx0046697@svn.freebsd.org> <20160210203823.GA74615@melamine.cuivre.fr.eu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="dDRMvlgZJXvWKvBx" Content-Disposition: inline In-Reply-To: X-message-flag: WARNING! Using Outlook can damage your computer. User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 22:28:58 -0000 --dDRMvlgZJXvWKvBx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline * Maxim Sobolev, 2016-02-10 : > In any case, I've opened a bug here: > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207092 Thanks Maxim, much appreciated. Candidate fix is on review: https://reviews.freebsd.org/D5248 Thomas. --dDRMvlgZJXvWKvBx Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJWu7mcXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRDRUU5NDNCMDA4OUI3QTg3NUZGMDg3RDdE RjhFMEI1QzdDQzYyRUYyAAoJEN+OC1x8xi7yMpAP/icu3NOq4Ut38n2I4PwdWcaB a1ZjFFntKGq8f9SHGhZ4pFpNh1BPRW4lAZ4/ymtxpriRP1gr0V2CgSu1/GH0zboB XwirzIfP/PsrjJS0FvQBU/R6HvM4WnZExIj70kjXQb+6F4NtNswAv7SQIdtbvXYy 92iwijsyqLyHbkNVS5ThPfQdDvuAXHoOHW86av9RcRiZWtPN+pjQ17YsDvJDF+OK uFl9t7OxxM1B5dBzGLq3KVct42yxUXXIiiGND1fvtWIEzStgki685tfTZAAmqvxA b1jrXphf4zpo572izKJTo12dZRhE6Q9Nyq9Rura1vRib9l0qzdzti/UO1Dnw4EhG 0gb6faOOnO5BUkn1dh9GvrxJ0DJj6IMFHFG9C11/AyeKHTMlBEAZnsrmLC4H9mBB H1Hsd+FfJt7zeZxYtqkXjhoXgiYaxv3ojMwjUHSfF8BDiWhWe5rID+4lKM6jS1kZ CQ/xMdFqYxEsQO2ikTs4cEUBxTwJX2yMqvf6eC8/d60IrtQvp1Zlo6mKBjEdYdLA e8Dq0w68aqriv//o9HQ8YmQKg8/RKib50wIYh8kk2CQ3Rf24qfDRkhc2LJMCfv1J ozvhpy1zMjvaz2cARiWg27zKVJgn5E2Z/EISdo2z9Auxmay++UyxXVSu59mJoIZ5 oGuzFWRej6wmUdpgAsr/ =Ijgz -----END PGP SIGNATURE----- --dDRMvlgZJXvWKvBx-- From owner-svn-src-all@freebsd.org Wed Feb 10 23:57:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E068AA4D79; Wed, 10 Feb 2016 23:57:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 10F121CF7; Wed, 10 Feb 2016 23:57:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1ANvA12041021; Wed, 10 Feb 2016 23:57:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1ANvAKb041020; Wed, 10 Feb 2016 23:57:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602102357.u1ANvAKb041020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 10 Feb 2016 23:57:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295490 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 23:57:11 -0000 Author: emaste Date: Wed Feb 10 23:57:09 2016 New Revision: 295490 URL: https://svnweb.freebsd.org/changeset/base/295490 Log: Update list of binutils controlled by WITHOUT_BINUTILS_BOOTSTRAP Tools removed from the list are now provided by the ELF Tool Chain project and are not controlled by the WITHOUT_BINUTILS_BOOTSTRAP knob. Sponsored by: The FreeBSD Foundation Modified: head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP Modified: head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP ============================================================================== --- head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP Wed Feb 10 21:35:00 2016 (r295489) +++ head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP Wed Feb 10 23:57:09 2016 (r295490) @@ -1,6 +1,5 @@ .\" $FreeBSD$ -Set to not build binutils (as, c++-filt, gconv, -ld, nm, objcopy, objdump, readelf, size and strip) +Set to not build binutils (as, ld, objcopy and objdump) as part of the bootstrap process. .Bf -symbolic The option does not work for build targets unless some alternative From owner-svn-src-all@freebsd.org Thu Feb 11 00:14:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78F09AA35EB; Thu, 11 Feb 2016 00:14:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 4C8AB7CF; Thu, 11 Feb 2016 00:14:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1B0E1A7046656; Thu, 11 Feb 2016 00:14:01 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1B0E1Sh046652; Thu, 11 Feb 2016 00:14:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602110014.u1B0E1Sh046652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 11 Feb 2016 00:14:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295491 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 00:14:02 -0000 Author: emaste Date: Thu Feb 11 00:14:00 2016 New Revision: 295491 URL: https://svnweb.freebsd.org/changeset/base/295491 Log: Add missing src.conf(5) descriptions for tool chain components Sponsored by: The FreeBSD Foundation Added: head/tools/build/options/WITHOUT_ELFTOOLCHAIN_BOOTSTRAP (contents, props changed) head/tools/build/options/WITH_BINUTILS (contents, props changed) head/tools/build/options/WITH_BINUTILS_BOOTSTRAP (contents, props changed) Added: head/tools/build/options/WITHOUT_ELFTOOLCHAIN_BOOTSTRAP ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_ELFTOOLCHAIN_BOOTSTRAP Thu Feb 11 00:14:00 2016 (r295491) @@ -0,0 +1,7 @@ +.\" $FreeBSD$ +Set to not build ELF Tool Chain tools +(addr2line, nm, size, strings and strip) +as part of the bootstrap process. +.Bf -symbolic +An alternate bootstrap tool chain must be provided. +.Ef Added: head/tools/build/options/WITH_BINUTILS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_BINUTILS Thu Feb 11 00:14:00 2016 (r295491) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to build and install binutils (as, ld, objcopy, and objdump) as part +of the normal system build. Added: head/tools/build/options/WITH_BINUTILS_BOOTSTRAP ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_BINUTILS_BOOTSTRAP Thu Feb 11 00:14:00 2016 (r295491) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set build binutils (as, ld, objcopy and objdump) +as part of the bootstrap process. From owner-svn-src-all@freebsd.org Thu Feb 11 00:27:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D566DAA3D56; Thu, 11 Feb 2016 00:27:05 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 86203E96; Thu, 11 Feb 2016 00:27:05 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1B0R4Qi049670; Thu, 11 Feb 2016 00:27:04 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1B0R4HF049669; Thu, 11 Feb 2016 00:27:04 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201602110027.u1B0R4HF049669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Thu, 11 Feb 2016 00: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: r295492 - in stable/10/contrib: libucl/tests unbound X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 00:27:05 -0000 Author: sobomax Date: Thu Feb 11 00:27:04 2016 New Revision: 295492 URL: https://svnweb.freebsd.org/changeset/base/295492 Log: MFC: r295159, kill foreign VCS files. Approved by: re (marius) Deleted: stable/10/contrib/libucl/tests/.gitignore stable/10/contrib/unbound/.gitignore Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-all@freebsd.org Thu Feb 11 00:30:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91664AA3E89; Thu, 11 Feb 2016 00:30:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 6306E106D; Thu, 11 Feb 2016 00:30:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1B0UpkH049837; Thu, 11 Feb 2016 00:30:51 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1B0UpH3049836; Thu, 11 Feb 2016 00:30:51 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602110030.u1B0UpH3049836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 11 Feb 2016 00:30:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295493 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 00:30:52 -0000 Author: emaste Date: Thu Feb 11 00:30:51 2016 New Revision: 295493 URL: https://svnweb.freebsd.org/changeset/base/295493 Log: Add WITH_GDB src.conf(5) description Added: head/tools/build/options/WITH_GDB (contents, props changed) Added: head/tools/build/options/WITH_GDB ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_GDB Thu Feb 11 00:30:51 2016 (r295493) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to build +.Xr gdb 1 . From owner-svn-src-all@freebsd.org Thu Feb 11 00:34:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77FCDAA415F; Thu, 11 Feb 2016 00:34:13 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 35BE613D0; Thu, 11 Feb 2016 00:34:13 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1B0YCD2052445; Thu, 11 Feb 2016 00:34:12 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1B0YC5t052443; Thu, 11 Feb 2016 00:34:12 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602110034.u1B0YC5t052443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 11 Feb 2016 00:34:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295494 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 00:34:13 -0000 Author: pfg Date: Thu Feb 11 00:34:11 2016 New Revision: 295494 URL: https://svnweb.freebsd.org/changeset/base/295494 Log: Ext4: fix handling of files with sparse blocks before extent's index. This is ongoing work from Damjan Jovanovic to improve ext4 read support with sparse files: Keep track of the first and last block in each extent as it descends down the extent tree, thus being able to work out that some blocks are sparse earlier. This solves an issue on r293680. In ext4_bmapext() start supporting the runb parameter, which appears to be the number of adjacent blocks prior to the block being converted in the same way that runp is the number of blocks after, speding up random access to mmaped files. PR: 206652 Modified: head/sys/fs/ext2fs/ext2_bmap.c head/sys/fs/ext2fs/ext2_extents.c Modified: head/sys/fs/ext2fs/ext2_bmap.c ============================================================================== --- head/sys/fs/ext2fs/ext2_bmap.c Thu Feb 11 00:30:51 2016 (r295493) +++ head/sys/fs/ext2fs/ext2_bmap.c Thu Feb 11 00:34:11 2016 (r295494) @@ -114,6 +114,8 @@ ext4_bmapext(struct vnode *vp, int32_t b if (runp != NULL) *runp = path.ep_sparse_ext.e_len - (lbn - path.ep_sparse_ext.e_blk) - 1; + if (runb != NULL) + *runb = lbn - path.ep_sparse_ext.e_blk; } else { ep = path.ep_ext; if (ep == NULL) @@ -127,6 +129,8 @@ ext4_bmapext(struct vnode *vp, int32_t b if (runp != NULL) *runp = ep->e_len - (lbn - ep->e_blk) - 1; + if (runb != NULL) + *runb = lbn - ep->e_blk; } } Modified: head/sys/fs/ext2fs/ext2_extents.c ============================================================================== --- head/sys/fs/ext2fs/ext2_extents.c Thu Feb 11 00:30:51 2016 (r295493) +++ head/sys/fs/ext2fs/ext2_extents.c Thu Feb 11 00:34:11 2016 (r295494) @@ -43,14 +43,17 @@ #include #include -static void ext4_ext_binsearch_index(struct inode *ip, struct ext4_extent_path - *path, daddr_t lbn) +static int +ext4_ext_binsearch_index(struct inode *ip, struct ext4_extent_path *path, + daddr_t lbn, daddr_t *first_lbn, daddr_t *last_lbn) { struct ext4_extent_header *ehp = path->ep_header; - struct ext4_extent_index *l, *r, *m; + struct ext4_extent_index *first, *last, *l, *r, *m; - l = (struct ext4_extent_index *)(char *)(ehp + 1); - r = (struct ext4_extent_index *)(char *)(ehp + 1) + ehp->eh_ecount - 1; + first = (struct ext4_extent_index *)(char *)(ehp + 1); + last = first + ehp->eh_ecount - 1; + l = first; + r = last; while (l <= r) { m = l + (r - l) / 2; if (lbn < m->ei_blk) @@ -59,11 +62,24 @@ static void ext4_ext_binsearch_index(str l = m + 1; } + if (l == first) { + path->ep_sparse_ext.e_blk = *first_lbn; + path->ep_sparse_ext.e_len = first->ei_blk - *first_lbn; + path->ep_sparse_ext.e_start_hi = 0; + path->ep_sparse_ext.e_start_lo = 0; + path->ep_is_sparse = 1; + return (1); + } path->ep_index = l - 1; + *first_lbn = path->ep_index->ei_blk; + if (path->ep_index < last) + *last_lbn = l->ei_blk - 1; + return (0); } static void -ext4_ext_binsearch(struct inode *ip, struct ext4_extent_path *path, daddr_t lbn) +ext4_ext_binsearch(struct inode *ip, struct ext4_extent_path *path, daddr_t lbn, + daddr_t first_lbn, daddr_t last_lbn) { struct ext4_extent_header *ehp = path->ep_header; struct ext4_extent *first, *l, *r, *m; @@ -83,8 +99,8 @@ ext4_ext_binsearch(struct inode *ip, str } if (l == first) { - path->ep_sparse_ext.e_blk = lbn; - path->ep_sparse_ext.e_len = first->e_blk - lbn; + path->ep_sparse_ext.e_blk = first_lbn; + path->ep_sparse_ext.e_len = first->e_blk - first_lbn; path->ep_sparse_ext.e_start_hi = 0; path->ep_sparse_ext.e_start_lo = 0; path->ep_is_sparse = 1; @@ -92,11 +108,14 @@ ext4_ext_binsearch(struct inode *ip, str } path->ep_ext = l - 1; if (path->ep_ext->e_blk + path->ep_ext->e_len <= lbn) { - path->ep_sparse_ext.e_blk = lbn; + path->ep_sparse_ext.e_blk = path->ep_ext->e_blk + + path->ep_ext->e_len; if (l <= (first + ehp->eh_ecount - 1)) - path->ep_sparse_ext.e_len = l->e_blk - lbn; - else // XXX: where does it end? - path->ep_sparse_ext.e_len = 1; + path->ep_sparse_ext.e_len = l->e_blk - + path->ep_sparse_ext.e_blk; + else + path->ep_sparse_ext.e_len = last_lbn - + path->ep_sparse_ext.e_blk + 1; path->ep_sparse_ext.e_start_hi = 0; path->ep_sparse_ext.e_start_lo = 0; path->ep_is_sparse = 1; @@ -162,10 +181,16 @@ ext4_ext_find_extent(struct m_ext2fs *fs path->ep_header = ehp; + daddr_t first_lbn = 0; + daddr_t last_lbn = lblkno(ip->i_e2fs, ip->i_size); + for (i = ehp->eh_depth; i != 0; --i) { - ext4_ext_binsearch_index(ip, path, lbn); - path->ep_depth = 0; + path->ep_depth = i; path->ep_ext = NULL; + if (ext4_ext_binsearch_index(ip, path, lbn, &first_lbn, + &last_lbn)) { + return (path); + } nblk = (daddr_t)path->ep_index->ei_leaf_hi << 32 | path->ep_index->ei_leaf_lo; @@ -190,6 +215,6 @@ ext4_ext_find_extent(struct m_ext2fs *fs path->ep_index = NULL; path->ep_is_sparse = 0; - ext4_ext_binsearch(ip, path, lbn); + ext4_ext_binsearch(ip, path, lbn, first_lbn, last_lbn); return (path); } From owner-svn-src-all@freebsd.org Thu Feb 11 01:16:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE270AA5AFF; Thu, 11 Feb 2016 01:16:58 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 AFBFBD9E; Thu, 11 Feb 2016 01:16:58 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1B1GvPw064413; Thu, 11 Feb 2016 01:16:57 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1B1GvGq064412; Thu, 11 Feb 2016 01:16:57 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201602110116.u1B1GvGq064412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 11 Feb 2016 01:16:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295495 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 01:16:59 -0000 Author: cy Date: Thu Feb 11 01:16:57 2016 New Revision: 295495 URL: https://svnweb.freebsd.org/changeset/base/295495 Log: Update leapsecond file in non-chroot environments. PR: 207095 Submitted by: madpilot MFC after: 3 days Modified: head/etc/rc.d/ntpd Modified: head/etc/rc.d/ntpd ============================================================================== --- head/etc/rc.d/ntpd Thu Feb 11 00:34:11 2016 (r295494) +++ head/etc/rc.d/ntpd Thu Feb 11 01:16:57 2016 (r295495) @@ -28,14 +28,14 @@ ntpd_precmd() rc_flags="-g $rc_flags" fi - if [ -z "$ntpd_chrootdir" ]; then - return 0; - fi - if [ ! -f $ntp_db_leapfile ]; then ntpd_fetch_leapfile fi + if [ -z "$ntpd_chrootdir" ]; then + return 0; + fi + # If running in a chroot cage, ensure that the appropriate files # exist inside the cage, as well as helper symlinks into the cage # from outside. From owner-svn-src-all@freebsd.org Thu Feb 11 01:18:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E011DAA5C20; Thu, 11 Feb 2016 01:18:45 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from mail.madpilot.net (grunt.madpilot.net [78.47.145.38]) (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 A90B8F81; Thu, 11 Feb 2016 01:18:45 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from mail (mail [192.168.254.3]) by mail.madpilot.net (Postfix) with ESMTP id 3q10TY6KV5zZqn; Thu, 11 Feb 2016 02:18:41 +0100 (CET) Received: from mail.madpilot.net ([192.168.254.3]) by mail (mail.madpilot.net [192.168.254.3]) (amavisd-new, port 10024) with ESMTP id TTma4uajPCrK; Thu, 11 Feb 2016 02:18:38 +0100 (CET) Received: from tommy.madpilot.net (micro.madpilot.net [88.149.173.206]) by mail.madpilot.net (Postfix) with ESMTPSA; Thu, 11 Feb 2016 02:18:38 +0100 (CET) Subject: Re: svn commit: r295495 - head/etc/rc.d To: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201602110116.u1B1GvGq064412@repo.freebsd.org> From: Guido Falsi Message-ID: <56BBE16D.6070807@FreeBSD.org> Date: Thu, 11 Feb 2016 02:18:37 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <201602110116.u1B1GvGq064412@repo.freebsd.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 01:18:46 -0000 On 02/11/16 02:16, Cy Schubert wrote: > Author: cy > Date: Thu Feb 11 01:16:57 2016 > New Revision: 295495 > URL: https://svnweb.freebsd.org/changeset/base/295495 > > Log: > Update leapsecond file in non-chroot environments. > > PR: 207095 > Submitted by: madpilot > MFC after: 3 days > This was fast! Thanks a lot! -- Guido Falsi From owner-svn-src-all@freebsd.org Thu Feb 11 01:30:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64CD5AA5FD9; Thu, 11 Feb 2016 01:30:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 3796F1475; Thu, 11 Feb 2016 01:30:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1B1UhEf067595; Thu, 11 Feb 2016 01:30:43 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1B1Uh1r067594; Thu, 11 Feb 2016 01:30:43 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602110130.u1B1Uh1r067594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 11 Feb 2016 01:30:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295496 - head/share/man/man8 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 01:30:44 -0000 Author: emaste Date: Thu Feb 11 01:30:43 2016 New Revision: 295496 URL: https://svnweb.freebsd.org/changeset/base/295496 Log: Document boot1.efi's handling of /boot.config, added in r294768 MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/share/man/man8/uefi.8 Modified: head/share/man/man8/uefi.8 ============================================================================== --- head/share/man/man8/uefi.8 Thu Feb 11 01:16:57 2016 (r295495) +++ head/share/man/man8/uefi.8 Thu Feb 11 01:30:43 2016 (r295496) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 26, 2015 +.Dd February 11, 2016 .Dt UEFI 8 .Os .Sh NAME @@ -73,6 +73,16 @@ as .Pa /EFI/BOOT/BOOTX64.EFI . .It .Pa boot1.efi +reads boot configuration from +.Pa /boot.config +or +.Pa /boot/config . +Unlike other first-stage boot loaders, +.Pa boot1.efi +passes the configuration to the next stage boot loader and does not +itself act on the contents of the file. +.It +.Pa boot1.efi locates the first partition with the type .Li freebsd-ufs , and from it loads @@ -112,6 +122,7 @@ typical non-default kernel (optional) .El .Sh SEE ALSO .Xr vt 4 , +.Xr boot.config 5 , .Xr msdosfs 5 , .Xr boot 8 , .Xr gpart 8 , From owner-svn-src-all@freebsd.org Thu Feb 11 02:02:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61B82AA0FCC; Thu, 11 Feb 2016 02:02:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 333DF25A; Thu, 11 Feb 2016 02:02:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1B2213r078896; Thu, 11 Feb 2016 02:02:01 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1B221Cw078895; Thu, 11 Feb 2016 02:02:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602110202.u1B221Cw078895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 11 Feb 2016 02:02:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295497 - head/share/man/man8 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 02:02:02 -0000 Author: emaste Date: Thu Feb 11 02:02:01 2016 New Revision: 295497 URL: https://svnweb.freebsd.org/changeset/base/295497 Log: Update uefi.8 for ZFS and multi device boot support As of r294068 boot1.efi can load loader.efi from ZFS. As of r295320 boot1.efi prefers to load loader.efi from the same device it was loaded from. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/share/man/man8/uefi.8 Modified: head/share/man/man8/uefi.8 ============================================================================== --- head/share/man/man8/uefi.8 Thu Feb 11 01:30:43 2016 (r295496) +++ head/share/man/man8/uefi.8 Thu Feb 11 02:02:01 2016 (r295497) @@ -83,9 +83,17 @@ passes the configuration to the next sta itself act on the contents of the file. .It .Pa boot1.efi -locates the first partition with the type -.Li freebsd-ufs , -and from it loads +searches partitions of type +.Li freebsd-ufs +and +.Li freebsd-zfs +for +.Pa loader.efi . +The search begins with partitions on the device from which +.Pa boot1.efi +was loaded, and continues with other available partitions. +.Pa boot1.efi +then loads and executes .Pa loader.efi . .It .Pa loader.efi @@ -146,19 +154,3 @@ Foundation sponsored portions of the wor EFI environment variables are not supported by .Xr loader 8 or the kernel. -.Pp -.Pa boot1.efi -loads -.Pa loader.efi -from the first FreeBSD-UFS file system it locates, even if it is on a -different disk. -.Pp -.Pa boot1.efi -cannot load -.Pa loader.efi -from a -.Xr ZFS 8 -file system. -As a result, -.Nm -does not support a typical root file system on ZFS configuration. From owner-svn-src-all@freebsd.org Thu Feb 11 06:09:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53C7DAA4537; Thu, 11 Feb 2016 06:09:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 1E53A37D; Thu, 11 Feb 2016 06:09:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1B69SEN048611; Thu, 11 Feb 2016 06:09:28 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1B69RQ1048606; Thu, 11 Feb 2016 06:09:27 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201602110609.u1B69RQ1048606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 11 Feb 2016 06:09:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295498 - in head/sys/mips: include mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 06:09:29 -0000 Author: adrian Date: Thu Feb 11 06:09:27 2016 New Revision: 295498 URL: https://svnweb.freebsd.org/changeset/base/295498 Log: Begin the MIPS_INTRNG support. This is a prelude to intr-ng support for MIPS boards that need it - notably the CI20 port from kan@ that's upcoming, but also work that Stanislav is doing for the Mediatek platforms. This is the initial platform dependent bits in include/intr.h, some #defines for the nexus code for the intrng initialisation/runtime bits, some changed naming (which I'll fix later to be the same, much like what I did for ARM intr-ng) in exception.S, and the first cut at a PIC. Stanislav and I refactored out the common code for intrng support, so the mips intrng definitions are quite small (sys/mips/include/intr.h.) This is all work done by kan@, which stanislav has been cherry picking into common code for his mediatek chipset work. Tested: * Carambola2 - no regressions (not intr-ng though!) Submitted by: Stanislav Galabov Reviewed by: kan (original author) Differential Revision: https://reviews.freebsd.org/D5182 Added: head/sys/mips/include/intr.h (contents, props changed) head/sys/mips/mips/mips_pic.c (contents, props changed) Modified: head/sys/mips/include/smp.h head/sys/mips/mips/exception.S head/sys/mips/mips/nexus.c Added: head/sys/mips/include/intr.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/include/intr.h Thu Feb 11 06:09:27 2016 (r295498) @@ -0,0 +1,67 @@ +/* $NetBSD: intr.h,v 1.7 2003/06/16 20:01:00 thorpej Exp $ */ + +/*- + * Copyright (c) 1997 Mark Brinicombe. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Mark Brinicombe + * for the NetBSD Project. + * 4. The name of the company nor the name of the author may be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * 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 OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef _MACHINE_INTR_H_ +#define _MACHINE_INTR_H_ + +#ifdef MIPS_INTRNG + +#ifdef FDT +#include +#endif + +#include + +#ifndef NIRQ +#define NIRQ 128 +#endif + +#define INTR_IRQ_NSPC_SWI 4 + +/* MIPS compatibility for legacy mips code */ +void cpu_init_interrupts(void); +void cpu_establish_hardintr(const char *, driver_filter_t *, driver_intr_t *, + void *, int, int, void **); +void cpu_establish_softintr(const char *, driver_filter_t *, void (*)(void*), + void *, int, int, void **); +/* MIPS interrupt C entry point */ +void cpu_intr(struct trapframe *); + +#endif /* MIPS_INTRNG */ + +#endif /* _MACHINE_INTR_H */ Modified: head/sys/mips/include/smp.h ============================================================================== --- head/sys/mips/include/smp.h Thu Feb 11 02:02:01 2016 (r295497) +++ head/sys/mips/include/smp.h Thu Feb 11 06:09:27 2016 (r295498) @@ -21,6 +21,11 @@ #include +#ifdef MIPS_INTRNG +# define MIPS_IPI_COUNT 1 +# define INTR_IPI_COUNT MIPS_IPI_COUNT +#endif + /* * Interprocessor interrupts for SMP. */ Modified: head/sys/mips/mips/exception.S ============================================================================== --- head/sys/mips/mips/exception.S Thu Feb 11 02:02:01 2016 (r295497) +++ head/sys/mips/mips/exception.S Thu Feb 11 06:09:27 2016 (r295498) @@ -646,7 +646,11 @@ NESTED_NOPROFILE(MipsKernIntr, KERN_EXC_ * Call the interrupt handler. a0 points at the saved frame. */ PTR_LA gp, _C_LABEL(_gp) +#ifdef MIPS_INTRNG + PTR_LA k0, _C_LABEL(intr_irq_handler) +#else PTR_LA k0, _C_LABEL(cpu_intr) +#endif jalr k0 REG_S a3, CALLFRAME_RA + KERN_REG_SIZE(sp) # for debugging @@ -758,7 +762,11 @@ NESTED_NOPROFILE(MipsUserIntr, CALLFRAME /* * Call the interrupt handler. */ +#ifdef MIPS_INTRNG + PTR_LA k0, _C_LABEL(intr_irq_handler) +#else PTR_LA k0, _C_LABEL(cpu_intr) +#endif jalr k0 REG_S a3, CALLFRAME_RA(sp) # for debugging @@ -1190,6 +1198,7 @@ FPReturn: PTR_ADDU sp, sp, CALLFRAME_SIZ END(MipsFPTrap) +#ifndef MIPS_INTRNG /* * Interrupt counters for vmstat. */ @@ -1216,6 +1225,7 @@ sintrcnt: #else .int INTRCNT_COUNT * (_MIPS_SZLONG / 8) * 2 #endif +#endif /* MIPS_INTRNG */ /* Added: head/sys/mips/mips/mips_pic.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/mips/mips_pic.c Thu Feb 11 06:09:27 2016 (r295498) @@ -0,0 +1,512 @@ +/*- + * Copyright (c) 2015 Alexander Kabaev + * Copyright (c) 2006 Oleksandr Tymoshenko + * Copyright (c) 2002-2004 Juli Mallett + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. + * 2. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" +#include "opt_hwpmc_hooks.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#ifdef FDT +#include +#include +#include +#include +#endif + +#include "pic_if.h" + +#define NHARD_IRQS 6 +#define NSOFT_IRQS 2 +#define NREAL_IRQS (NHARD_IRQS + NSOFT_IRQS) + +static int mips_pic_intr(void *); + +struct mips_pic_softc { + device_t pic_dev; + struct intr_irqsrc * pic_irqs[NREAL_IRQS]; + struct mtx mutex; + uint32_t nirqs; +}; + +static struct mips_pic_softc *pic_sc; + +#ifdef FDT +static struct ofw_compat_data compat_data[] = { + {"mti,cpu-interrupt-controller", true}, + {NULL, false} +}; +#endif + +#ifndef FDT +static void +mips_pic_identify(driver_t *drv, device_t parent) +{ + + BUS_ADD_CHILD(parent, 0, "cpupic", 0); +} +#endif + +static int +mips_pic_probe(device_t dev) +{ + +#ifdef FDT + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) + return (ENXIO); +#endif + device_set_desc(dev, "MIPS32 Interrupt Controller"); + return (BUS_PROBE_DEFAULT); +} + +static inline void +pic_irq_unmask(struct mips_pic_softc *sc, u_int irq) +{ + + mips_wr_status(mips_rd_status() | ((1 << irq) << 8)); +} + +static inline void +pic_irq_mask(struct mips_pic_softc *sc, u_int irq) +{ + + mips_wr_status(mips_rd_status() & ~((1 << irq) << 8)); +} + +#ifdef SMP +static void +mips_pic_init_secondary(device_t dev) +{ +} +#endif /* SMP */ + +static inline intptr_t +pic_xref(device_t dev) +{ +#ifdef FDT + return (OF_xref_from_node(ofw_bus_get_node(dev))); +#else + return (0); +#endif +} + +static int +mips_pic_attach(device_t dev) +{ + struct mips_pic_softc *sc; + intptr_t xref = pic_xref(dev); + + if (pic_sc) + return (ENXIO); + + sc = device_get_softc(dev); + + sc->pic_dev = dev; + pic_sc = sc; + + /* Initialize mutex */ + mtx_init(&sc->mutex, "PIC lock", "", MTX_SPIN); + + /* Set the number of interrupts */ + sc->nirqs = nitems(sc->pic_irqs); + + /* + * Now, when everything is initialized, it's right time to + * register interrupt controller to interrupt framefork. + */ + if (intr_pic_register(dev, xref) != 0) { + device_printf(dev, "could not register PIC\n"); + goto cleanup; + } + + /* Claim our root controller role */ + if (intr_pic_claim_root(dev, xref, mips_pic_intr, sc, 0) != 0) { + device_printf(dev, "could not set PIC as a root\n"); + intr_pic_unregister(dev, xref); + goto cleanup; + } + + return (0); + +cleanup: + return(ENXIO); +} + +int +mips_pic_intr(void *arg) +{ + struct mips_pic_softc *sc = arg; + register_t cause, status; + struct intr_irqsrc *isrc; + int i, intr; + + cause = mips_rd_cause(); + status = mips_rd_status(); + intr = (cause & MIPS_INT_MASK) >> 8; + /* + * Do not handle masked interrupts. They were masked by + * pre_ithread function (mips_mask_XXX_intr) and will be + * unmasked once ithread is through with handler + */ + intr &= (status & MIPS_INT_MASK) >> 8; + while ((i = fls(intr)) != 0) { + i--; /* Get a 0-offset interrupt. */ + intr &= ~(1 << i); + + isrc = sc->pic_irqs[i]; + if (isrc == NULL) { + device_printf(sc->pic_dev, + "Stray interrupt %u detected\n", i); + pic_irq_mask(sc, i); + continue; + } + + intr_irq_dispatch(isrc, curthread->td_intr_frame); + } + + KASSERT(i == 0, ("all interrupts handled")); + +#ifdef HWPMC_HOOKS + if (pmc_hook && (PCPU_GET(curthread)->td_pflags & TDP_CALLCHAIN)) + pmc_hook(PCPU_GET(curthread), PMC_FN_USER_CALLCHAIN, tf); +#endif + return (FILTER_HANDLED); +} + +static int +pic_attach_isrc(struct mips_pic_softc *sc, struct intr_irqsrc *isrc, u_int irq) +{ + + /* + * 1. The link between ISRC and controller must be set atomically. + * 2. Just do things only once in rare case when consumers + * of shared interrupt came here at the same moment. + */ + mtx_lock_spin(&sc->mutex); + if (sc->pic_irqs[irq] != NULL) { + mtx_unlock_spin(&sc->mutex); + return (sc->pic_irqs[irq] == isrc ? 0 : EEXIST); + } + sc->pic_irqs[irq] = isrc; + isrc->isrc_data = irq; + mtx_unlock_spin(&sc->mutex); + + if (irq < NSOFT_IRQS) + intr_irq_set_name(isrc, "sint%u", irq); + else if (irq < NREAL_IRQS) + intr_irq_set_name(isrc, "int%u", irq - NSOFT_IRQS); + else + panic("Invalid irq %u", irq); + return (0); +} + +static int +pic_detach_isrc(struct mips_pic_softc *sc, struct intr_irqsrc *isrc, u_int irq) +{ + + mtx_lock_spin(&sc->mutex); + if (sc->pic_irqs[irq] != isrc) { + mtx_unlock_spin(&sc->mutex); + return (sc->pic_irqs[irq] == NULL ? 0 : EINVAL); + } + sc->pic_irqs[irq] = NULL; + isrc->isrc_data = 0; + mtx_unlock_spin(&sc->mutex); + + intr_irq_set_name(isrc, "%s", ""); + return (0); +} + +static int +pic_irq_from_nspc(struct mips_pic_softc *sc, u_int type, u_int num, u_int *irqp) +{ + + switch (type) { + case INTR_IRQ_NSPC_PLAIN: + *irqp = num; + return (*irqp < sc->nirqs ? 0 : EINVAL); + + case INTR_IRQ_NSPC_SWI: + *irqp = num; + return (num < NSOFT_IRQS ? 0 : EINVAL); + + case INTR_IRQ_NSPC_IRQ: + *irqp = num + NSOFT_IRQS; + return (num < NHARD_IRQS ? 0 : EINVAL); + + default: + return (EINVAL); + } +} + +static int +pic_map_nspc(struct mips_pic_softc *sc, struct intr_irqsrc *isrc, u_int *irqp) +{ + int error; + + error = pic_irq_from_nspc(sc, isrc->isrc_nspc_type, isrc->isrc_nspc_num, + irqp); + if (error != 0) + return (error); + return (pic_attach_isrc(sc, isrc, *irqp)); +} + +#ifdef FDT +static int +pic_map_fdt(struct mips_pic_softc *sc, struct intr_irqsrc *isrc, u_int *irqp) +{ + u_int irq; + int error; + + irq = isrc->isrc_cells[0]; + + if (irq >= sc->nirqs) + return (EINVAL); + + error = pic_attach_isrc(sc, isrc, irq); + if (error != 0) + return (error); + + isrc->isrc_nspc_type = INTR_IRQ_NSPC_PLAIN; + isrc->isrc_nspc_num = irq; + isrc->isrc_trig = INTR_TRIGGER_CONFORM; + isrc->isrc_pol = INTR_POLARITY_CONFORM; + + *irqp = irq; + return (0); +} +#endif + +static int +mips_pic_register(device_t dev, struct intr_irqsrc *isrc, boolean_t *is_percpu) +{ + struct mips_pic_softc *sc = device_get_softc(dev); + u_int irq; + int error; + + if (isrc->isrc_type == INTR_ISRCT_NAMESPACE) + error = pic_map_nspc(sc, isrc, &irq); +#ifdef FDT + else if (isrc->isrc_type == INTR_ISRCT_FDT) + error = pic_map_fdt(sc, isrc, &irq); +#endif + else + return (EINVAL); + + if (error == 0) + *is_percpu = TRUE; + return (error); +} + +static void +mips_pic_enable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + + if (isrc->isrc_trig == INTR_TRIGGER_CONFORM) + isrc->isrc_trig = INTR_TRIGGER_LEVEL; +} + +static void +mips_pic_enable_source(device_t dev, struct intr_irqsrc *isrc) +{ + struct mips_pic_softc *sc = device_get_softc(dev); + u_int irq = isrc->isrc_data; + + pic_irq_unmask(sc, irq); +} + +static void +mips_pic_disable_source(device_t dev, struct intr_irqsrc *isrc) +{ + struct mips_pic_softc *sc = device_get_softc(dev); + u_int irq = isrc->isrc_data; + + pic_irq_mask(sc, irq); +} + +static int +mips_pic_unregister(device_t dev, struct intr_irqsrc *isrc) +{ + struct mips_pic_softc *sc = device_get_softc(dev); + u_int irq = isrc->isrc_data; + + return (pic_detach_isrc(sc, isrc, irq)); +} + +static void +mips_pic_pre_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + + mips_pic_disable_source(dev, isrc); +} + +static void +mips_pic_post_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + + mips_pic_enable_source(dev, isrc); +} + +static void +mips_pic_post_filter(device_t dev, struct intr_irqsrc *isrc) +{ +} + +#ifdef SMP +static int +mips_pic_bind(device_t dev, struct intr_irqsrc *isrc) +{ + return (EOPNOTSUPP); +} + +static void +mips_pic_ipi_send(device_t dev, struct intr_irqsrc *isrc, cpuset_t cpus) +{ +} +#endif + +static device_method_t mips_pic_methods[] = { + /* Device interface */ +#ifndef FDT + DEVMETHOD(device_identify, mips_pic_identify), +#endif + DEVMETHOD(device_probe, mips_pic_probe), + DEVMETHOD(device_attach, mips_pic_attach), + /* Interrupt controller interface */ + DEVMETHOD(pic_disable_source, mips_pic_disable_source), + DEVMETHOD(pic_enable_intr, mips_pic_enable_intr), + DEVMETHOD(pic_enable_source, mips_pic_enable_source), + DEVMETHOD(pic_post_filter, mips_pic_post_filter), + DEVMETHOD(pic_post_ithread, mips_pic_post_ithread), + DEVMETHOD(pic_pre_ithread, mips_pic_pre_ithread), + DEVMETHOD(pic_register, mips_pic_register), + DEVMETHOD(pic_unregister, mips_pic_unregister), +#ifdef SMP + DEVMETHOD(pic_bind, mips_pic_bind), + DEVMETHOD(pic_init_secondary, mips_pic_init_secondary), + DEVMETHOD(pic_ipi_send, mips_pic_ipi_send), +#endif + { 0, 0 } +}; + +static driver_t mips_pic_driver = { + "cpupic", + mips_pic_methods, + sizeof(struct mips_pic_softc), +}; + +static devclass_t mips_pic_devclass; + +#ifdef FDT +DRIVER_MODULE(cpupic, ofwbus, mips_pic_driver, mips_pic_devclass, 0, 0); +#else +DRIVER_MODULE(cpupic, nexus, mips_pic_driver, mips_pic_devclass, 0, 0); +#endif + +void +cpu_init_interrupts(void) +{ +} + +void +cpu_establish_hardintr(const char *name, driver_filter_t *filt, + void (*handler)(void*), void *arg, int irq, int flags, void **cookiep) +{ + u_int vec; + int res; + + /* + * We have 6 levels, but thats 0 - 5 (not including 6) + */ + if (irq < 0 || irq >= NHARD_IRQS) + panic("%s called for unknown hard intr %d", __func__, irq); + + KASSERT(pic_sc != NULL, ("%s: no pic", __func__)); + vec = intr_namespace_map_irq(pic_sc->pic_dev, INTR_IRQ_NSPC_IRQ, irq); + KASSERT(vec != NIRQ, ("Unable to map hard IRQ %d\n", irq)); + + res = intr_irq_add_handler(pic_sc->pic_dev, filt, handler, arg, vec, + flags, cookiep); + if (res != 0) panic("Unable to add hard IRQ %d handler", irq); + + (void)pic_irq_from_nspc(pic_sc, INTR_IRQ_NSPC_IRQ, irq, &vec); + KASSERT(pic_sc->pic_irqs[vec] != NULL, + ("Hard IRQ %d not registered\n", irq)); + intr_irq_set_name(pic_sc->pic_irqs[vec], "%s", name); +} + +void +cpu_establish_softintr(const char *name, driver_filter_t *filt, + void (*handler)(void*), void *arg, int irq, int flags, + void **cookiep) +{ + u_int vec; + int res; + + if (irq < 0 || irq > NSOFT_IRQS) + panic("%s called for unknown soft intr %d", __func__, irq); + + KASSERT(pic_sc != NULL, ("%s: no pic", __func__)); + vec = intr_namespace_map_irq(pic_sc->pic_dev, INTR_IRQ_NSPC_SWI, irq); + KASSERT(vec <= NIRQ, ("Unable to map soft IRQ %d\n", irq)); + + intr_irq_add_handler(pic_sc->pic_dev, filt, handler, arg, vec, + flags, cookiep); + if (res != 0) panic("Unable to add soft IRQ %d handler", irq); + + (void)pic_irq_from_nspc(pic_sc, INTR_IRQ_NSPC_SWI, irq, &vec); + KASSERT(pic_sc->pic_irqs[vec] != NULL, + ("Soft IRQ %d not registered\n", irq)); + intr_irq_set_name(pic_sc->pic_irqs[vec], "%s", name); +} + Modified: head/sys/mips/mips/nexus.c ============================================================================== --- head/sys/mips/mips/nexus.c Thu Feb 11 02:02:01 2016 (r295497) +++ head/sys/mips/mips/nexus.c Thu Feb 11 06:09:27 2016 (r295498) @@ -36,6 +36,7 @@ * this code implements the core resource managers for interrupt * requests and memory address space. */ +#include "opt_platform.h" #include __FBSDID("$FreeBSD$"); @@ -53,13 +54,23 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include +#ifdef MIPS_INTRNG +#include +#else +#include +#endif + #include "opt_platform.h" +#ifdef FDT +#include +#include "ofw_bus_if.h" +#endif + #undef NEXUS_DEBUG #ifdef NEXUS_DEBUG #define dprintf printf @@ -107,6 +118,19 @@ static int nexus_setup_intr(device_t dev driver_intr_t *intr, void *arg, void **cookiep); static int nexus_teardown_intr(device_t, device_t, struct resource *, void *); +#ifdef MIPS_INTRNG +#ifdef SMP +static int nexus_bind_intr(device_t, device_t, struct resource *, int); +#endif +#ifdef FDT +static int nexus_ofw_map_intr(device_t dev, device_t child, + phandle_t iparent, int icells, pcell_t *intr); +#endif +static int nexus_describe_intr(device_t dev, device_t child, + struct resource *irq, void *cookie, const char *descr); +static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, + enum intr_polarity pol); +#endif static device_method_t nexus_methods[] = { /* Device interface */ @@ -127,6 +151,16 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_activate_resource,nexus_activate_resource), DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), DEVMETHOD(bus_hinted_child, nexus_hinted_child), +#ifdef MIPS_INTRNG + DEVMETHOD(bus_config_intr, nexus_config_intr), + DEVMETHOD(bus_describe_intr, nexus_describe_intr), +#ifdef SMP + DEVMETHOD(bus_bind_intr, nexus_bind_intr), +#endif +#ifdef FDT + DEVMETHOD(ofw_bus_map_intr, nexus_ofw_map_intr), +#endif +#endif { 0, 0 } }; @@ -416,9 +450,16 @@ static int nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) { - register_t s; int irq; +#ifdef MIPS_INTRNG + for (irq = rman_get_start(res); irq <= rman_get_end(res); irq++) { + intr_irq_add_handler(child, filt, intr, arg, irq, flags, + cookiep); + } +#else + register_t s; + s = intr_disable(); irq = rman_get_start(res); if (irq >= NUM_MIPS_IRQS) { @@ -429,6 +470,7 @@ nexus_setup_intr(device_t dev, device_t cpu_establish_hardintr(device_get_nameunit(child), filt, intr, arg, irq, flags, cookiep); intr_restore(s); +#endif return (0); } @@ -436,9 +478,50 @@ static int nexus_teardown_intr(device_t dev, device_t child, struct resource *r, void *ih) { +#ifdef MIPS_INTRNG + return (intr_irq_remove_handler(child, rman_get_start(r), ih)); +#else printf("Unimplemented %s at %s:%d\n", __func__, __FILE__, __LINE__); return (0); +#endif +} + +#ifdef MIPS_INTRNG +static int +nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, + enum intr_polarity pol) +{ + + return (intr_irq_config(irq, trig, pol)); +} + +static int +nexus_describe_intr(device_t dev, device_t child, struct resource *irq, + void *cookie, const char *descr) +{ + + return (intr_irq_describe(rman_get_start(irq), cookie, descr)); +} + +#ifdef SMP +static int +nexus_bind_intr(device_t dev, device_t child, struct resource *irq, int cpu) +{ + + return (intr_irq_bind(rman_get_start(irq), cpu)); +} +#endif + +#ifdef FDT +static int +nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, int icells, + pcell_t *intr) +{ + + return (intr_fdt_map_irq(iparent, intr, icells)); } +#endif +#endif /* MIPS_INTRNG */ static void nexus_hinted_child(device_t bus, const char *dname, int dunit) From owner-svn-src-all@freebsd.org Thu Feb 11 06:13:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10FF9AA485B; Thu, 11 Feb 2016 06:13:55 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 D752F9D0; Thu, 11 Feb 2016 06:13:54 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1B6DrF8051363; Thu, 11 Feb 2016 06:13:53 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1B6DrnY051362; Thu, 11 Feb 2016 06:13:53 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201602110613.u1B6DrnY051362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 11 Feb 2016 06:13:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295499 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 06:13:55 -0000 Author: adrian Date: Thu Feb 11 06:13:53 2016 New Revision: 295499 URL: https://svnweb.freebsd.org/changeset/base/295499 Log: Teach the MIPS ticker to attach itself properly when using INTRNG. Submitted by: Stanislav Galabov Reviewed by: kan Differential Revision: https://reviews.freebsd.org/D5183 Modified: head/sys/mips/mips/tick.c Modified: head/sys/mips/mips/tick.c ============================================================================== --- head/sys/mips/mips/tick.c Thu Feb 11 06:09:27 2016 (r295498) +++ head/sys/mips/mips/tick.c Thu Feb 11 06:13:53 2016 (r295499) @@ -51,6 +51,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef MIPS_INTRNG +#include +#endif + uint64_t counter_freq; struct timecounter *platform_timecounter; @@ -324,12 +328,18 @@ static int clock_attach(device_t dev) { struct clock_softc *sc; +#ifndef MIPS_INTRNG int error; +#endif if (device_get_unit(dev) != 0) panic("can't attach more clocks"); softc = sc = device_get_softc(dev); +#ifdef MIPS_INTRNG + cpu_establish_hardintr("clock", clock_intr, NULL, sc, 5, INTR_TYPE_CLK, + NULL); +#else sc->intr_rid = 0; sc->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->intr_rid, 5, 5, 1, RF_ACTIVE); @@ -343,6 +353,7 @@ clock_attach(device_t dev) device_printf(dev, "bus_setup_intr returned %d\n", error); return (error); } +#endif sc->tc.tc_get_timecount = counter_get_timecount; sc->tc.tc_counter_mask = 0xffffffff; From owner-svn-src-all@freebsd.org Thu Feb 11 06:15:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7F3CAA4942; Thu, 11 Feb 2016 06:15:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 A82B8BE5; Thu, 11 Feb 2016 06:15:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1B6Fhvf051519; Thu, 11 Feb 2016 06:15:43 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1B6FhL9051516; Thu, 11 Feb 2016 06:15:43 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201602110615.u1B6FhL9051516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 11 Feb 2016 06:15:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295500 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 06:15:44 -0000 Author: adrian Date: Thu Feb 11 06:15:43 2016 New Revision: 295500 URL: https://svnweb.freebsd.org/changeset/base/295500 Log: Convert MIPS nexus and mips_pic to BUS_PASS Submitted by: Stanislav Galabov Reviewed by: kan Differential Revision: https://reviews.freebsd.org/D5196 Modified: head/sys/mips/mips/mips_pic.c head/sys/mips/mips/nexus.c Modified: head/sys/mips/mips/mips_pic.c ============================================================================== --- head/sys/mips/mips/mips_pic.c Thu Feb 11 06:13:53 2016 (r295499) +++ head/sys/mips/mips/mips_pic.c Thu Feb 11 06:15:43 2016 (r295500) @@ -448,9 +448,11 @@ static driver_t mips_pic_driver = { static devclass_t mips_pic_devclass; #ifdef FDT -DRIVER_MODULE(cpupic, ofwbus, mips_pic_driver, mips_pic_devclass, 0, 0); +EARLY_DRIVER_MODULE(cpupic, ofwbus, mips_pic_driver, mips_pic_devclass, 0, 0, + BUS_PASS_INTERRUPT); #else -DRIVER_MODULE(cpupic, nexus, mips_pic_driver, mips_pic_devclass, 0, 0); +EARLY_DRIVER_MODULE(cpupic, nexus, mips_pic_driver, mips_pic_devclass, 0, 0, + BUS_PASS_INTERRUPT); #endif void Modified: head/sys/mips/mips/nexus.c ============================================================================== --- head/sys/mips/mips/nexus.c Thu Feb 11 06:13:53 2016 (r295499) +++ head/sys/mips/mips/nexus.c Thu Feb 11 06:15:43 2016 (r295500) @@ -576,4 +576,5 @@ nexus_hinted_child(device_t bus, const c } } -DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0); +EARLY_DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0, + BUS_PASS_BUS + BUS_PASS_ORDER_EARLY); From owner-svn-src-all@freebsd.org Thu Feb 11 06:19:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA2C9AA4AC4; Thu, 11 Feb 2016 06:19:33 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 769D5DB1; Thu, 11 Feb 2016 06:19:33 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1B6JWJ1051681; Thu, 11 Feb 2016 06:19:32 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1B6JWlv051678; Thu, 11 Feb 2016 06:19:32 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201602110619.u1B6JWlv051678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 11 Feb 2016 06:19:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295501 - in head/sys: conf mips/include mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 06:19:33 -0000 Author: adrian Date: Thu Feb 11 06:19:32 2016 New Revision: 295501 URL: https://svnweb.freebsd.org/changeset/base/295501 Log: Remove bus space fdt for MIPS. This was originall done by kan@. Submitted by: Stanislav Galabov Reviewed by: kan Differential Revision: https://reviews.freebsd.org/D5184 Deleted: head/sys/mips/mips/bus_space_fdt.c Modified: head/sys/conf/files.mips head/sys/mips/include/fdt.h Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Thu Feb 11 06:15:43 2016 (r295500) +++ head/sys/conf/files.mips Thu Feb 11 06:19:32 2016 (r295501) @@ -7,7 +7,6 @@ # Arch dependent files mips/mips/autoconf.c standard mips/mips/bus_space_generic.c standard -mips/mips/bus_space_fdt.c optional fdt mips/mips/busdma_machdep.c standard mips/mips/cache.c standard mips/mips/cache_mipsNN.c standard Modified: head/sys/mips/include/fdt.h ============================================================================== --- head/sys/mips/include/fdt.h Thu Feb 11 06:15:43 2016 (r295500) +++ head/sys/mips/include/fdt.h Thu Feb 11 06:19:32 2016 (r295501) @@ -40,7 +40,7 @@ #if defined(CPU_RMI) || defined(CPU_NLM) #define fdtbus_bs_tag rmi_uart_bus_space #else -#define fdtbus_bs_tag mips_bus_space_fdt +#define fdtbus_bs_tag mips_bus_space_generic #endif #endif /* _MACHINE_FDT_H_ */ From owner-svn-src-all@freebsd.org Thu Feb 11 06:20:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08254AA4B5C; Thu, 11 Feb 2016 06:20:00 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 CE164F3B; Thu, 11 Feb 2016 06:19:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1B6Jwj4051741; Thu, 11 Feb 2016 06:19:58 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1B6JwRd051740; Thu, 11 Feb 2016 06:19:58 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201602110619.u1B6JwRd051740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 11 Feb 2016 06:19:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295502 - head/sys/mips/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 06:20:00 -0000 Author: adrian Date: Thu Feb 11 06:19:58 2016 New Revision: 295502 URL: https://svnweb.freebsd.org/changeset/base/295502 Log: Missing commit - remove MIPS fdt bus space. Differential Revision: https://reviews.freebsd.org/D5184 Modified: head/sys/mips/include/bus.h Modified: head/sys/mips/include/bus.h ============================================================================== --- head/sys/mips/include/bus.h Thu Feb 11 06:19:32 2016 (r295501) +++ head/sys/mips/include/bus.h Thu Feb 11 06:19:58 2016 (r295502) @@ -721,7 +721,6 @@ void __bs_c(f,_bs_c_8) (void *t, bus_spa */ DECLARE_BUS_SPACE_PROTOTYPES(generic); extern bus_space_tag_t mips_bus_space_generic; -extern bus_space_tag_t mips_bus_space_fdt; /* Special bus space for RMI processors */ #if defined(CPU_RMI) || defined (CPU_NLM) From owner-svn-src-all@freebsd.org Thu Feb 11 06:23:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95573AA4DED; Thu, 11 Feb 2016 06:23:04 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 49D3F130A; Thu, 11 Feb 2016 06:23:04 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1B6N3rs054469; Thu, 11 Feb 2016 06:23:03 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1B6N2QN054465; Thu, 11 Feb 2016 06:23:02 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201602110623.u1B6N2QN054465@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 11 Feb 2016 06:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295503 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 06:23:04 -0000 Author: adrian Date: Thu Feb 11 06:23:02 2016 New Revision: 295503 URL: https://svnweb.freebsd.org/changeset/base/295503 Log: Migrate the other MIPS24K SoC cores to use the CPU_MIPS24K option. Modified: head/sys/mips/conf/AR71XX_BASE head/sys/mips/conf/AR724X_BASE head/sys/mips/conf/AR91XX_BASE head/sys/mips/conf/QCA953X_BASE Modified: head/sys/mips/conf/AR71XX_BASE ============================================================================== --- head/sys/mips/conf/AR71XX_BASE Thu Feb 11 06:19:58 2016 (r295502) +++ head/sys/mips/conf/AR71XX_BASE Thu Feb 11 06:23:02 2016 (r295503) @@ -9,7 +9,7 @@ machine mips mips ident AR71XX_BASE -cpu CPU_MIPS4KC +cpu CPU_MIPS24K makeoptions KERNLOADADDR=0x80050000 options HZ=1000 options HWPMC_HOOKS Modified: head/sys/mips/conf/AR724X_BASE ============================================================================== --- head/sys/mips/conf/AR724X_BASE Thu Feb 11 06:19:58 2016 (r295502) +++ head/sys/mips/conf/AR724X_BASE Thu Feb 11 06:23:02 2016 (r295503) @@ -10,7 +10,7 @@ machine mips mips ident AR724X_BASE -cpu CPU_MIPS4KC +cpu CPU_MIPS24K makeoptions KERNLOADADDR=0x80050000 options HZ=1000 options HWPMC_HOOKS Modified: head/sys/mips/conf/AR91XX_BASE ============================================================================== --- head/sys/mips/conf/AR91XX_BASE Thu Feb 11 06:19:58 2016 (r295502) +++ head/sys/mips/conf/AR91XX_BASE Thu Feb 11 06:23:02 2016 (r295503) @@ -12,7 +12,7 @@ machine mips mips ident AR91XX_BASE -cpu CPU_MIPS4KC +cpu CPU_MIPS24K makeoptions KERNLOADADDR=0x80050000 options HZ=1000 Modified: head/sys/mips/conf/QCA953X_BASE ============================================================================== --- head/sys/mips/conf/QCA953X_BASE Thu Feb 11 06:19:58 2016 (r295502) +++ head/sys/mips/conf/QCA953X_BASE Thu Feb 11 06:23:02 2016 (r295503) @@ -12,7 +12,7 @@ machine mips mips ident QCA953X_BASE -cpu CPU_MIPS4KC +cpu CPU_MIPS24K makeoptions KERNLOADADDR=0x80050000 options HZ=1000 From owner-svn-src-all@freebsd.org Thu Feb 11 06:24:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F390AA4EF7; Thu, 11 Feb 2016 06:24:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 00FC71553; Thu, 11 Feb 2016 06:24:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1B6OZwr054561; Thu, 11 Feb 2016 06:24:35 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1B6OY8W054559; Thu, 11 Feb 2016 06:24:34 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201602110624.u1B6OY8W054559@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 11 Feb 2016 06:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295504 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 06:24:36 -0000 Author: adrian Date: Thu Feb 11 06:24:34 2016 New Revision: 295504 URL: https://svnweb.freebsd.org/changeset/base/295504 Log: Make bus_space_generic properly map/unmap memory (using pmap_mapdev and pmap_unmapdev respectively) so that resources are properly managed. This is work originally done by kan@. Stanislav picked it up as part of his Mediatek SoC work. Tested: * Carambola2, AR933x SoC Submitted by: Stanislav Galabov Reviewed by: kan Differential Revision: https://reviews.freebsd.org/D5184 Modified: head/sys/mips/mips/bus_space_generic.c head/sys/mips/mips/nexus.c Modified: head/sys/mips/mips/bus_space_generic.c ============================================================================== --- head/sys/mips/mips/bus_space_generic.c Thu Feb 11 06:23:02 2016 (r295503) +++ head/sys/mips/mips/bus_space_generic.c Thu Feb 11 06:24:34 2016 (r295504) @@ -228,20 +228,21 @@ bus_space_tag_t mips_bus_space_generic = int generic_bs_map(void *t __unused, bus_addr_t addr, - bus_size_t size __unused, int flags __unused, + bus_size_t size, int flags __unused, bus_space_handle_t *bshp) { - *bshp = addr; + *bshp = (bus_space_handle_t)pmap_mapdev((vm_paddr_t)addr, + (vm_size_t)size); return (0); } void -generic_bs_unmap(void *t __unused, bus_space_handle_t bh __unused, - bus_size_t size __unused) +generic_bs_unmap(void *t __unused, bus_space_handle_t bh, + bus_size_t size) { - /* Do nothing */ + pmap_unmapdev((vm_offset_t)bh, (vm_size_t)size); } int Modified: head/sys/mips/mips/nexus.c ============================================================================== --- head/sys/mips/mips/nexus.c Thu Feb 11 06:23:02 2016 (r295503) +++ head/sys/mips/mips/nexus.c Thu Feb 11 06:24:34 2016 (r295504) @@ -415,6 +415,7 @@ nexus_activate_resource(device_t bus, de void *vaddr; vm_paddr_t paddr; vm_size_t psize; + int err; /* * If this is a memory resource, use pmap_mapdev to map it. @@ -422,10 +423,14 @@ nexus_activate_resource(device_t bus, de if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { paddr = rman_get_start(r); psize = rman_get_size(r); - vaddr = pmap_mapdev(paddr, psize); - - rman_set_virtual(r, vaddr); rman_set_bustag(r, mips_bus_space_generic); + err = bus_space_map(rman_get_bustag(r), paddr, psize, 0, + (bus_space_handle_t *)&vaddr); + if (err != 0) { + rman_deactivate_resource(r); + return (err); + } + rman_set_virtual(r, vaddr); rman_set_bushandle(r, (bus_space_handle_t)(uintptr_t)vaddr); } @@ -436,11 +441,16 @@ static int nexus_deactivate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { - vm_offset_t va; - - if (type == SYS_RES_MEMORY) { - va = (vm_offset_t)rman_get_virtual(r); - pmap_unmapdev(va, rman_get_size(r)); + bus_space_handle_t vaddr; + bus_size_t psize; + + vaddr = rman_get_bushandle(r); + + if (type == SYS_RES_MEMORY && vaddr != 0) { + psize = (bus_size_t)rman_get_size(r); + bus_space_unmap(rman_get_bustag(r), vaddr, psize); + rman_set_virtual(r, NULL); + rman_set_bushandle(r, 0); } return (rman_deactivate_resource(r)); From owner-svn-src-all@freebsd.org Thu Feb 11 06:50:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6670AA59DB; Thu, 11 Feb 2016 06:50:12 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 A49C31EAE; Thu, 11 Feb 2016 06:50:12 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1B6oBdR060542; Thu, 11 Feb 2016 06:50:11 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1B6oBEn060541; Thu, 11 Feb 2016 06:50:11 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201602110650.u1B6oBEn060541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Thu, 11 Feb 2016 06:50:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295505 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 06:50:13 -0000 Author: wma Date: Thu Feb 11 06:50:11 2016 New Revision: 295505 URL: https://svnweb.freebsd.org/changeset/base/295505 Log: ARM64 disassembler: support for LDR instructions Implemented disassembly for a whole bunch of various ldr instructions. Obtained from: Semihalf Sponsored by: Cavium Approved by: cognet (mentor) Reviewed by: zbb Differential revision: https://reviews.freebsd.org/D5217 Modified: head/sys/arm64/arm64/disassem.c Modified: head/sys/arm64/arm64/disassem.c ============================================================================== --- head/sys/arm64/arm64/disassem.c Thu Feb 11 06:24:34 2016 (r295504) +++ head/sys/arm64/arm64/disassem.c Thu Feb 11 06:50:11 2016 (r295505) @@ -38,6 +38,16 @@ __FBSDID("$FreeBSD$"); #define ARM64_MAX_TOKEN_LEN 8 #define ARM64_MAX_TOKEN_CNT 10 +#define ARM_INSN_SIZE_OFFSET 30 +#define ARM_INSN_SIZE_MASK 0x3 + +/* Special options for instruction printing */ +#define OP_SIGN_EXT (1UL << 0) /* Sign-extend immediate value */ +#define OP_LITERAL (1UL << 1) /* Use literal (memory offset) */ +#define OP_MULT_4 (1UL << 2) /* Multiply immediate by 4 */ +#define OP_SF32 (1UL << 3) /* Force 32-bit access */ +#define OP_SF_INV (1UL << 6) /* SF is inverted (1 means 32 bit access) */ + static const char *w_reg[] = { "w0", "w1", "w2", "w3", "w4", "w5", "w6", "w7", "w8", "w9", "w10", "w11", "w12", "w13", "w14", "w15", @@ -74,6 +84,10 @@ struct arm64_insn_token { enum arm64_format_type { TYPE_01, /* OP , , {, #} SF32/64 OP , , #{, } SF32/64 */ + TYPE_02, /* OP , [, #]{!}] SF32/64 + OP , [], #{!} SF32/64 + OP , , {, EXTEND AMOUNT } */ + TYPE_03, /* OP , #imm SF32/64 */ }; /* @@ -112,12 +126,57 @@ struct arm64_insn { * SHIFT - type of shift (instruction dependent) * IMM - immediate value * Rx - register number + * OPTION - command specific options + * SCALE - scaling of immediate value */ static struct arm64_insn arm64_i[] = { - { "add", "SF(1)|0001011|SHIFT(2)|0|RM(5)|IMM(6)|RN(5)|RD(5)", TYPE_01, 0 }, - { "mov", "SF(1)|001000100000000000000|RN(5)|RD(5)", TYPE_01, 0 }, - { "add", "SF(1)|0010001|SHIFT(2)|IMM(12)|RN(5)|RD(5)", TYPE_01, 0 }, - { NULL, NULL } + { "add", "SF(1)|0001011|SHIFT(2)|0|RM(5)|IMM(6)|RN(5)|RD(5)", + TYPE_01, 0 }, + { "mov", "SF(1)|001000100000000000000|RN(5)|RD(5)", + TYPE_01, 0 }, + { "add", "SF(1)|0010001|SHIFT(2)|IMM(12)|RN(5)|RD(5)", + TYPE_01, 0 }, + { "ldr", "1|SF(1)|111000010|IMM(9)|OPTION(2)|RN(5)|RT(5)", + TYPE_02, OP_SIGN_EXT }, /* ldr immediate post/pre index */ + { "ldr", "1|SF(1)|11100101|IMM(12)|RN(5)|RT(5)", + TYPE_02, 0 }, /* ldr immediate unsigned */ + { "ldr", "1|SF(1)|111000011|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", + TYPE_02, 0 }, /* ldr register */ + { "ldr", "0|SF(1)|011000|IMM(19)|RT(5)", + TYPE_03, OP_SIGN_EXT | OP_LITERAL | OP_MULT_4 }, /* ldr literal */ + { "ldrb", "00|111000010|IMM(9)|OPTION(2)|RN(5)|RT(5)", + TYPE_02, OP_SIGN_EXT | OP_SF32 }, /* ldrb immediate post/pre index */ + { "ldrb", "00|11100101|IMM(12)|RN(5)|RT(5)", + TYPE_02, OP_SF32 }, /* ldrb immediate unsigned */ + { "ldrb", "00|111000011|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", + TYPE_02, OP_SF32 }, /* ldrb register */ + { "ldrh", "01|111000010|IMM(9)|OPTION(2)|RN(5)|RT(5)", TYPE_02, + OP_SIGN_EXT | OP_SF32 }, /* ldrh immediate post/pre index */ + { "ldrh", "01|11100101|IMM(12)|RN(5)|RT(5)", + TYPE_02, OP_SF32 }, /* ldrh immediate unsigned */ + { "ldrh", "01|111000011|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", + TYPE_02, OP_SF32 }, /* ldrh register */ + { "ldrsb", "001110001|SF(1)|0|IMM(9)|OPTION(2)|RN(5)|RT(5)", + TYPE_02, OP_SIGN_EXT | OP_SF_INV }, /* ldrsb immediate post/pre index */ + { "ldrsb", "001110011|SF(1)|IMM(12)|RN(5)|RT(5)",\ + TYPE_02, OP_SF_INV}, /* ldrsb immediate unsigned */ + { "ldrsb", "001110001|SF(1)|1|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", + TYPE_02, OP_SF_INV }, /* ldrsb register */ + { "ldrsh", "011110001|SF(1)|0|IMM(9)|OPTION(2)|RN(5)|RT(5)", + TYPE_02, OP_SIGN_EXT | OP_SF_INV }, /* ldrsh immediate post/pre index */ + { "ldrsh", "011110011|SF(1)|IMM(12)|RN(5)|RT(5)", + TYPE_02, OP_SF_INV}, /* ldrsh immediate unsigned */ + { "ldrsh", "011110001|SF(1)|1|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", + TYPE_02, OP_SF_INV }, /* ldrsh register */ + { "ldrsw", "10111000100|IMM(9)|OPTION(2)|RN(5)|RT(5)", + TYPE_02, OP_SIGN_EXT }, /* ldrsw immediate post/pre index */ + { "ldrsw", "1011100110|IMM(12)|RN(5)|RT(5)", + TYPE_02, 0 }, /* ldrsw immediate unsigned */ + { "ldrsw", "10111000101|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", + TYPE_02, 0 }, /* ldrsw register */ + { "ldrsw", "10011000|IMM(19)|RT(5)", + TYPE_03, OP_SIGN_EXT | OP_LITERAL | OP_MULT_4 }, /* ldr literal */ + { NULL, NULL } }; static void @@ -240,6 +299,29 @@ arm64_disasm_read_token(struct arm64_ins return (EINVAL); } +static int +arm64_disasm_read_token_sign_ext(struct arm64_insn *insn, u_int opcode, + const char *token, int *val) +{ + int i; + int msk; + + for (i = 0; i < ARM64_MAX_TOKEN_CNT; i++) { + if (strcmp(insn->tokens[i].name, token) == 0) { + msk = (1 << insn->tokens[i].len) - 1; + *val = ((opcode >> insn->tokens[i].pos) & msk); + + /* If last bit is 1, sign-extend the value */ + if (*val & (1 << (insn->tokens[i].len - 1))) + *val |= ~msk; + + return (0); + } + } + + return (EINVAL); +} + static const char * arm64_reg(int b64, int num) { @@ -257,11 +339,17 @@ disasm(const struct disasm_interface *di uint32_t insn; int matchp; int ret; - int shift, rm, rd, rn, imm, sf; + int shift, rm, rt, rd, rn, imm, sf, idx, option, scale, amount; + int sign_ext; int rm_absent; + /* Indicate if immediate should be outside or inside brackets */ + int inside; + /* Print exclamation mark if pre-incremented */ + int pre; /* Initialize defaults, all are 0 except SF indicating 64bit access */ - shift = rd = rm = rn = imm = 0; + shift = rd = rm = rn = imm = idx = option = amount = scale = 0; + sign_ext = 0; sf = 1; matchp = 0; @@ -278,14 +366,33 @@ disasm(const struct disasm_interface *di if (matchp == 0) goto undefined; + /* Global options */ + if (i_ptr->special_ops & OP_SF32) + sf = 0; + + /* Global optional tokens */ + arm64_disasm_read_token(i_ptr, insn, "SF", &sf); + if (i_ptr->special_ops & OP_SF_INV) + sf = 1 - sf; + if (arm64_disasm_read_token(i_ptr, insn, "SIGN", &sign_ext) == 0) + sign_ext = 1 - sign_ext; + if (i_ptr->special_ops & OP_SIGN_EXT) + sign_ext = 1; + if (sign_ext != 0) + arm64_disasm_read_token_sign_ext(i_ptr, insn, "IMM", &imm); + else + arm64_disasm_read_token(i_ptr, insn, "IMM", &imm); + if (i_ptr->special_ops & OP_MULT_4) + imm <<= 2; + + /* Print opcode by type */ switch (i_ptr->type) { case TYPE_01: /* OP , , {, #} SF32/64 OP , , #{, } SF32/64 */ /* Mandatory tokens */ - ret = arm64_disasm_read_token(i_ptr, insn, "SF", &sf); - ret |= arm64_disasm_read_token(i_ptr, insn, "RD", &rd); + ret = arm64_disasm_read_token(i_ptr, insn, "RD", &rd); ret |= arm64_disasm_read_token(i_ptr, insn, "RN", &rn); if (ret != 0) { printf("ERROR: Missing mandatory token for op %s type %d\n", @@ -294,7 +401,6 @@ disasm(const struct disasm_interface *di } /* Optional tokens */ - arm64_disasm_read_token(i_ptr, insn, "IMM", &imm); arm64_disasm_read_token(i_ptr, insn, "SHIFT", &shift); rm_absent = arm64_disasm_read_token(i_ptr, insn, "RM", &rm); @@ -313,6 +419,115 @@ disasm(const struct disasm_interface *di di->di_printf(" LSL #12"); } break; + case TYPE_02: + /* OP , [, #]{!}] SF32/64 + OP , [], #{!} SF32/64 + OP , , {, EXTEND AMOUNT } */ + + /* Mandatory tokens */ + ret = arm64_disasm_read_token(i_ptr, insn, "RT", &rt); + ret |= arm64_disasm_read_token(i_ptr, insn, "RN", &rn); + if (ret != 0) { + printf("ERROR: Missing mandatory token for op %s type %d\n", + i_ptr->name, i_ptr->type); + goto undefined; + } + + /* Optional tokens */ + arm64_disasm_read_token(i_ptr, insn, "OPTION", &option); + arm64_disasm_read_token(i_ptr, insn, "SCALE", &scale); + rm_absent = arm64_disasm_read_token(i_ptr, insn, "RM", &rm); + + if (rm_absent) { + /* + * In unsigned operation, shift immediate value + * and reset options to default. + */ + if (sign_ext == 0) { + imm = imm << ((insn >> ARM_INSN_SIZE_OFFSET) & + ARM_INSN_SIZE_MASK); + option = 0; + } + switch (option) { + case 0x0: + pre = 0; + inside = 1; + break; + case 0x1: + pre = 0; + inside = 0; + break; + case 0x2: + default: + pre = 1; + inside = 1; + break; + } + + di->di_printf("%s\t%s, ", i_ptr->name, arm64_reg(sf, rt)); + if (inside != 0) { + di->di_printf("[%s", arm64_reg(1, rn)); + if (imm != 0) + di->di_printf(", #%d", imm); + di->di_printf("]"); + } else { + di->di_printf("[%s]", arm64_reg(1, rn)); + if (imm != 0) + di->di_printf(", #%d", imm); + } + if (pre != 0) + di->di_printf("!"); + } else { + /* Last bit of option field determines 32/64 bit offset */ + di->di_printf("%s\t%s, [%s, %s", i_ptr->name, + arm64_reg(sf, rt), arm64_reg(1, rn), + arm64_reg(option & 1, rm)); + + /* Calculate amount, it's op(31:30) */ + amount = (insn >> ARM_INSN_SIZE_OFFSET) & + ARM_INSN_SIZE_MASK; + + switch (option) { + case 0x2: + di->di_printf(", uxtw #%d", amount); + break; + case 0x3: + if (scale != 0) + di->di_printf(", lsl #%d", amount); + break; + case 0x6: + di->di_printf(", sxtw #%d", amount); + break; + case 0x7: + di->di_printf(", sxts #%d", amount); + break; + default: + di->di_printf(", RSVD"); + break; + } + di->di_printf("]"); + } + + break; + + case TYPE_03: + /* OP , #imm SF32/64 */ + + /* Mandatory tokens */ + ret = arm64_disasm_read_token(i_ptr, insn, "RT", &rt); + if (ret != 0) { + printf("ERROR: Missing mandatory token for op %s type %d\n", + i_ptr->name, i_ptr->type); + goto undefined; + } + + di->di_printf("%s\t%s, ", i_ptr->name, arm64_reg(sf, rt)); + if (i_ptr->special_ops & OP_LITERAL) + di->di_printf("0x%lx", loc + imm); + else + di->di_printf("#%d", imm); + + break; default: goto undefined; } From owner-svn-src-all@freebsd.org Thu Feb 11 09:15:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 008A2AA582C; Thu, 11 Feb 2016 09:15:36 +0000 (UTC) (envelope-from dwmalone@maths.tcd.ie) Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) (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 02F762C3; Thu, 11 Feb 2016 09:15:35 +0000 (UTC) (envelope-from dwmalone@maths.tcd.ie) Received: from salmon.maths.tcd.ie (localhost [127.0.0.1]) by salmon.maths.tcd.ie (Postfix) with ESMTP id CF97B1591BF; Thu, 11 Feb 2016 09:15:26 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=maths.tcd.ie; h= user-agent:in-reply-to:content-disposition:content-type :content-type:mime-version:references:message-id:subject:subject :from:from:date:date:received:received:received; s=20150418; t= 1455182117; x=1456996518; bh=+hTzNB/pDIP+Ffr1Pt3n7JLs6j//LglDpGD 3MGoqMIY=; b=CgHmhDqVWpwI182kfbNhcySd2rZ6epIhbep2tWBCii68anao1Nw Zh30IvuIe/+0A+pqtIoG644T9+8GmouY4mziV9nVS+u7PVh44Znjf1lSz+CU7FSf NLQKRVA2OwQD1kC1Lp2BJ8qaUyDAHsX/lSWfON005y3LbIOQixGFymFc= X-Virus-Scanned: amavisd-new at maths.tcd.ie Received: from salmon.maths.tcd.ie ([127.0.0.1]) by salmon.maths.tcd.ie (salmon.maths.tcd.ie [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rnHVW5rrJnFn; Thu, 11 Feb 2016 09:15:17 +0000 (GMT) Received: from smtp.maths.tcd.ie (walton.maths.tcd.ie [IPv6:2001:770:10:300::86e2:510a]) by salmon.maths.tcd.ie (Postfix) with ESMTP id 219781591B1; Thu, 11 Feb 2016 09:15:17 +0000 (GMT) Received: by smtp.maths.tcd.ie (Postfix, from userid 238) id 1D6EB7309F; Thu, 11 Feb 2016 09:15:17 +0000 (GMT) Date: Thu, 11 Feb 2016 09:15:16 +0000 From: David Malone To: Stefan Esser Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295465 - head/usr.sbin/services_mkdb Message-ID: <20160211091516.GA37735@walton.maths.tcd.ie> References: <201602100940.u1A9ejb6086175@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201602100940.u1A9ejb6086175@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 09:15:36 -0000 On Wed, Feb 10, 2016 at 09:40:45AM +0000, Stefan Esser wrote: > Author: se > Date: Wed Feb 10 09:40:45 2016 > New Revision: 295465 > URL: https://svnweb.freebsd.org/changeset/base/295465 > > Log: > Remove O_SYNC from the options passed to dbmopen(). > > The services db is created as a temporary file that is moved over the > existing file after completion. Thus there is no need to immediately > flush all created db records to the temporary file. This was changed to fix a problem with fsync not being called, which can leave the db files empty after a sudden reboot. O_SYNC is not the right fix, but I think I've found the real problem and there is an open phabricator report on this, which fixes the problem in a better way: https://reviews.freebsd.org/D5186 Reviews appreciated. David. From owner-svn-src-all@freebsd.org Thu Feb 11 10:03:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99951A9F3DB; Thu, 11 Feb 2016 10:03:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 65D2E1C22; Thu, 11 Feb 2016 10:03:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BA3oVo018010; Thu, 11 Feb 2016 10:03:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BA3oiV018009; Thu, 11 Feb 2016 10:03:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201602111003.u1BA3oiV018009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 11 Feb 2016 10:03:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295506 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 10:03:51 -0000 Author: hselasky Date: Thu Feb 11 10:03:50 2016 New Revision: 295506 URL: https://svnweb.freebsd.org/changeset/base/295506 Log: Use a pair of ifs when comparing the 32-bit flowid integers so that the sign bit doesn't cause an overflow. The overflow manifests itself as a sorting index wrap around in the middle of the sorted array, which is not a problem for the LRO code, but might be a problem for the logic inside qsort(). Reviewed by: gnn @ Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D5239 Modified: head/sys/netinet/tcp_lro.c Modified: head/sys/netinet/tcp_lro.c ============================================================================== --- head/sys/netinet/tcp_lro.c Thu Feb 11 06:50:11 2016 (r295505) +++ head/sys/netinet/tcp_lro.c Thu Feb 11 10:03:50 2016 (r295506) @@ -347,9 +347,10 @@ tcp_lro_mbuf_compare_header(const void * if (ret != 0) goto done; - ret = ma->m_pkthdr.flowid - mb->m_pkthdr.flowid; - if (ret != 0) - goto done; + if (ma->m_pkthdr.flowid > mb->m_pkthdr.flowid) + return (1); + else if (ma->m_pkthdr.flowid < mb->m_pkthdr.flowid) + return (-1); ret = TCP_LRO_SEQUENCE(ma) - TCP_LRO_SEQUENCE(mb); done: From owner-svn-src-all@freebsd.org Thu Feb 11 10:48:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D74F8AA4CAF; Thu, 11 Feb 2016 10:48:16 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 A72A0135A; Thu, 11 Feb 2016 10:48:16 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BAmFCs029742; Thu, 11 Feb 2016 10:48:15 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BAmFZV029741; Thu, 11 Feb 2016 10:48:15 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602111048.u1BAmFZV029741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 11 Feb 2016 10:48:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295507 - in head/sys/arm: conf xilinx/zedboard X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 10:48:16 -0000 Author: andrew Date: Thu Feb 11 10:48:15 2016 New Revision: 295507 URL: https://svnweb.freebsd.org/changeset/base/295507 Log: Remove unused Zedboard config files. files.zedboard was empty other than comments, and std.zedboard just pointed to files.zedboard and std.xilinx. Deleted: head/sys/arm/xilinx/zedboard/ Modified: head/sys/arm/conf/ZEDBOARD Modified: head/sys/arm/conf/ZEDBOARD ============================================================================== --- head/sys/arm/conf/ZEDBOARD Thu Feb 11 10:03:50 2016 (r295506) +++ head/sys/arm/conf/ZEDBOARD Thu Feb 11 10:48:15 2016 (r295507) @@ -22,7 +22,7 @@ ident ZEDBOARD include "std.armv6" -include "../xilinx/zedboard/std.zedboard" +include "../xilinx/std.zynq7" options SCHED_ULE # ULE scheduler #options NFSSD # Network Filesystem Server From owner-svn-src-all@freebsd.org Thu Feb 11 11:21:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0895FAA5ECA; Thu, 11 Feb 2016 11:21:47 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 CD38AB62; Thu, 11 Feb 2016 11:21:46 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BBLjf5041225; Thu, 11 Feb 2016 11:21:45 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BBLjFj041224; Thu, 11 Feb 2016 11:21:45 GMT (envelope-from br@FreeBSD.org) Message-Id: <201602111121.u1BBLjFj041224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 11 Feb 2016 11:21:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295508 - head/sys/riscv/htif X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 11:21:47 -0000 Author: br Date: Thu Feb 11 11:21:45 2016 New Revision: 295508 URL: https://svnweb.freebsd.org/changeset/base/295508 Log: Stop device enumeration when we see first empty slot. This fixes operation in QEMU and saves some booting time as well. Pointed out by: Sagar Karandikar Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/sys/riscv/htif/htif.c Modified: head/sys/riscv/htif/htif.c ============================================================================== --- head/sys/riscv/htif/htif.c Thu Feb 11 10:48:15 2016 (r295507) +++ head/sys/riscv/htif/htif.c Thu Feb 11 11:21:45 2016 (r295508) @@ -183,9 +183,8 @@ htif_enumerate(struct htif_softc *sc) } len = strnlen(id, sizeof(id)); - if (len <= 0) { - continue; - } + if (len <= 0) + break; if (bootverbose) printf(" %d %s\n", i, id); From owner-svn-src-all@freebsd.org Thu Feb 11 11:49:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5881AA4CC2; Thu, 11 Feb 2016 11:49:29 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 A1F9B1795; Thu, 11 Feb 2016 11:49:29 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BBnSFU047293; Thu, 11 Feb 2016 11:49:28 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BBnRQ9047280; Thu, 11 Feb 2016 11:49:27 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602111149.u1BBnRQ9047280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 11 Feb 2016 11:49:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295509 - in head/sys/arm: altera/socfpga amlogic/aml8726 annapurna/alpine at91 broadcom/bcm2835 freescale/imx freescale/vybrid lpc mv rockchip samsung/exynos versatile xilinx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 11:49:30 -0000 Author: andrew Date: Thu Feb 11 11:49:27 2016 New Revision: 295509 URL: https://svnweb.freebsd.org/changeset/base/295509 Log: Stop defining fdt_pic_table when building for ARM_INTRNG. Modified: head/sys/arm/altera/socfpga/socfpga_common.c head/sys/arm/amlogic/aml8726/aml8726_machdep.c head/sys/arm/annapurna/alpine/common.c head/sys/arm/at91/at91_common.c head/sys/arm/broadcom/bcm2835/bcm2835_common.c head/sys/arm/freescale/imx/imx_common.c head/sys/arm/freescale/vybrid/vf_common.c head/sys/arm/lpc/lpc_intc.c head/sys/arm/mv/mv_common.c head/sys/arm/rockchip/rk30xx_common.c head/sys/arm/samsung/exynos/exynos5_common.c head/sys/arm/versatile/versatile_common.c head/sys/arm/xilinx/zy7_machdep.c Modified: head/sys/arm/altera/socfpga/socfpga_common.c ============================================================================== --- head/sys/arm/altera/socfpga/socfpga_common.c Thu Feb 11 11:21:45 2016 (r295508) +++ head/sys/arm/altera/socfpga/socfpga_common.c Thu Feb 11 11:49:27 2016 (r295509) @@ -74,6 +74,7 @@ struct fdt_fixup_entry fdt_fixup_table[] { NULL, NULL } }; +#ifndef ARM_INTRNG static int fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, int *pol) @@ -92,3 +93,4 @@ fdt_pic_decode_t fdt_pic_table[] = { &fdt_pic_decode_ic, NULL }; +#endif Modified: head/sys/arm/amlogic/aml8726/aml8726_machdep.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_machdep.c Thu Feb 11 11:21:45 2016 (r295508) +++ head/sys/arm/amlogic/aml8726/aml8726_machdep.c Thu Feb 11 11:49:27 2016 (r295509) @@ -184,6 +184,7 @@ struct fdt_fixup_entry fdt_fixup_table[] { NULL, NULL } }; +#ifndef ARM_INTRNG #ifndef DEV_GIC static int fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, @@ -212,3 +213,4 @@ fdt_pic_decode_t fdt_pic_table[] = { #endif NULL }; +#endif /* ARM_INTRNG */ Modified: head/sys/arm/annapurna/alpine/common.c ============================================================================== --- head/sys/arm/annapurna/alpine/common.c Thu Feb 11 11:21:45 2016 (r295508) +++ head/sys/arm/annapurna/alpine/common.c Thu Feb 11 11:49:27 2016 (r295509) @@ -136,6 +136,7 @@ infinite: while (1) {} } +#ifndef ARM_INTRNG static int alpine_pic_decode_fdt(uint32_t iparent, uint32_t *intr, int *interrupt, int *trig, int *pol) @@ -158,3 +159,4 @@ fdt_pic_decode_t fdt_pic_table[] = { &alpine_pic_decode_fdt, NULL }; +#endif Modified: head/sys/arm/at91/at91_common.c ============================================================================== --- head/sys/arm/at91/at91_common.c Thu Feb 11 11:21:45 2016 (r295508) +++ head/sys/arm/at91/at91_common.c Thu Feb 11 11:49:27 2016 (r295509) @@ -53,6 +53,7 @@ struct fdt_fixup_entry fdt_fixup_table[] { NULL, NULL } }; +#ifndef ARM_INTRNG static int fdt_aic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, int *pol) @@ -75,6 +76,7 @@ fdt_pic_decode_t fdt_pic_table[] = { &fdt_aic_decode_ic, NULL }; +#endif static void at91_eoi(void *unused) Modified: head/sys/arm/broadcom/bcm2835/bcm2835_common.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_common.c Thu Feb 11 11:21:45 2016 (r295508) +++ head/sys/arm/broadcom/bcm2835/bcm2835_common.c Thu Feb 11 11:49:27 2016 (r295509) @@ -50,6 +50,7 @@ struct fdt_fixup_entry fdt_fixup_table[] { NULL, NULL } }; +#ifndef ARM_INTRNG static int fdt_intc_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, int *pol) @@ -70,3 +71,4 @@ fdt_pic_decode_t fdt_pic_table[] = { &fdt_intc_decode_ic, NULL }; +#endif /* ARM_INTRNG */ Modified: head/sys/arm/freescale/imx/imx_common.c ============================================================================== --- head/sys/arm/freescale/imx/imx_common.c Thu Feb 11 11:21:45 2016 (r295508) +++ head/sys/arm/freescale/imx/imx_common.c Thu Feb 11 11:49:27 2016 (r295509) @@ -54,6 +54,7 @@ struct fdt_fixup_entry fdt_fixup_table[] { NULL, NULL } }; +#ifndef ARM_INTRNG static int fdt_intc_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, int *pol) @@ -70,3 +71,4 @@ fdt_pic_decode_t fdt_pic_table[] = { &fdt_intc_decode_ic, NULL }; +#endif /* ARM_INTRNG */ Modified: head/sys/arm/freescale/vybrid/vf_common.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_common.c Thu Feb 11 11:21:45 2016 (r295508) +++ head/sys/arm/freescale/vybrid/vf_common.c Thu Feb 11 11:49:27 2016 (r295509) @@ -66,6 +66,7 @@ struct fdt_fixup_entry fdt_fixup_table[] { NULL, NULL } }; +#ifndef ARM_INTRNG static int fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, int *pol) @@ -84,3 +85,4 @@ fdt_pic_decode_t fdt_pic_table[] = { &fdt_pic_decode_ic, NULL }; +#endif Modified: head/sys/arm/lpc/lpc_intc.c ============================================================================== --- head/sys/arm/lpc/lpc_intc.c Thu Feb 11 11:21:45 2016 (r295508) +++ head/sys/arm/lpc/lpc_intc.c Thu Feb 11 11:49:27 2016 (r295509) @@ -231,6 +231,7 @@ struct fdt_fixup_entry fdt_fixup_table[] { NULL, NULL } }; +#ifndef ARM_INTRNG static int fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, int *pol) @@ -248,3 +249,4 @@ fdt_pic_decode_t fdt_pic_table[] = { &fdt_pic_decode_ic, NULL }; +#endif Modified: head/sys/arm/mv/mv_common.c ============================================================================== --- head/sys/arm/mv/mv_common.c Thu Feb 11 11:21:45 2016 (r295508) +++ head/sys/arm/mv/mv_common.c Thu Feb 11 11:49:27 2016 (r295509) @@ -2181,6 +2181,7 @@ struct fdt_fixup_entry fdt_fixup_table[] { NULL, NULL } }; +#ifndef ARM_INTRNG static int fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, int *pol) @@ -2204,6 +2205,7 @@ fdt_pic_decode_t fdt_pic_table[] = { &fdt_pic_decode_ic, NULL }; +#endif uint64_t get_sar_value(void) Modified: head/sys/arm/rockchip/rk30xx_common.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_common.c Thu Feb 11 11:21:45 2016 (r295508) +++ head/sys/arm/rockchip/rk30xx_common.c Thu Feb 11 11:49:27 2016 (r295509) @@ -42,6 +42,7 @@ struct fdt_fixup_entry fdt_fixup_table[] { NULL, NULL } }; +#ifndef ARM_INTRNG static int fdt_aintc_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, int *pol) @@ -61,3 +62,4 @@ fdt_pic_decode_t fdt_pic_table[] = { &fdt_aintc_decode_ic, NULL }; +#endif Modified: head/sys/arm/samsung/exynos/exynos5_common.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_common.c Thu Feb 11 11:21:45 2016 (r295508) +++ head/sys/arm/samsung/exynos/exynos5_common.c Thu Feb 11 11:49:27 2016 (r295509) @@ -53,6 +53,7 @@ struct fdt_fixup_entry fdt_fixup_table[] { NULL, NULL } }; +#ifndef ARM_INTRNG static int fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, int *pol) @@ -71,3 +72,4 @@ fdt_pic_decode_t fdt_pic_table[] = { &fdt_pic_decode_ic, NULL }; +#endif Modified: head/sys/arm/versatile/versatile_common.c ============================================================================== --- head/sys/arm/versatile/versatile_common.c Thu Feb 11 11:21:45 2016 (r295508) +++ head/sys/arm/versatile/versatile_common.c Thu Feb 11 11:49:27 2016 (r295509) @@ -50,6 +50,7 @@ struct fdt_fixup_entry fdt_fixup_table[] { NULL, NULL } }; +#ifndef ARM_INTRNG static int fdt_intc_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, int *pol) @@ -70,3 +71,4 @@ fdt_pic_decode_t fdt_pic_table[] = { &fdt_intc_decode_ic, NULL }; +#endif Modified: head/sys/arm/xilinx/zy7_machdep.c ============================================================================== --- head/sys/arm/xilinx/zy7_machdep.c Thu Feb 11 11:21:45 2016 (r295508) +++ head/sys/arm/xilinx/zy7_machdep.c Thu Feb 11 11:49:27 2016 (r295509) @@ -98,6 +98,7 @@ struct fdt_fixup_entry fdt_fixup_table[] { NULL, NULL } }; +#ifndef ARM_INTRNG static int fdt_gic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, int *pol) @@ -117,7 +118,7 @@ fdt_pic_decode_t fdt_pic_table[] = { &fdt_gic_decode_ic, NULL }; - +#endif struct arm32_dma_range * bus_dma_get_range(void) From owner-svn-src-all@freebsd.org Thu Feb 11 11:50:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2436DAA4D59; Thu, 11 Feb 2016 11:50:33 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 E8B46195C; Thu, 11 Feb 2016 11:50:32 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BBoVj9047383; Thu, 11 Feb 2016 11:50:31 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BBoVA9047382; Thu, 11 Feb 2016 11:50:31 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201602111150.u1BBoVA9047382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Thu, 11 Feb 2016 11:50:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295510 - head/sys/dev/xen/netfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 11:50:33 -0000 Author: royger Date: Thu Feb 11 11:50:31 2016 New Revision: 295510 URL: https://svnweb.freebsd.org/changeset/base/295510 Log: xen-netfront: remove pointless assignment in xn_ioctl The variable error is assigned to 0 before entering the switch. Assigning error to 0 before break pointless rewrites the real error value that should be returned. Coverity ID: 1304974 Submitted by: Wei Liu Reviewed by: royger Sponsored by: Citrix Systems R&D Differential revision: https://reviews.freebsd.org/D5250 Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Thu Feb 11 11:49:27 2016 (r295509) +++ head/sys/dev/xen/netfront/netfront.c Thu Feb 11 11:50:31 2016 (r295510) @@ -1863,7 +1863,6 @@ xn_ioctl(struct ifnet *ifp, u_long cmd, } sc->xn_if_flags = ifp->if_flags; XN_UNLOCK(sc); - error = 0; break; case SIOCSIFCAP: mask = ifr->ifr_reqcap ^ ifp->if_capenable; @@ -1898,7 +1897,6 @@ xn_ioctl(struct ifnet *ifp, u_long cmd, ifp->if_capenable ^= IFCAP_LRO; } - error = 0; break; case SIOCADDMULTI: case SIOCDELMULTI: From owner-svn-src-all@freebsd.org Thu Feb 11 11:53:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85D7FAA4FCA; Thu, 11 Feb 2016 11:53:33 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 5753D1CE9; Thu, 11 Feb 2016 11:53:33 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BBrWNQ049958; Thu, 11 Feb 2016 11:53:32 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BBrWn0049957; Thu, 11 Feb 2016 11:53:32 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201602111153.u1BBrWn0049957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Thu, 11 Feb 2016 11:53:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295511 - head/sys/dev/xen/netfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 11:53:33 -0000 Author: royger Date: Thu Feb 11 11:53:32 2016 New Revision: 295511 URL: https://svnweb.freebsd.org/changeset/base/295511 Log: xen-netfront: rearrange error paths in setup_txqs Coverity spotted double free errors in error path. Fix that by removing the extraneous calls. Coverity ID: 1349798 Submitted by: Wei Liu Reviewed by: royger Sponsored by: Citrix Systems R&D Differential revision: https://reviews.freebsd.org/D5251 Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Thu Feb 11 11:50:31 2016 (r295510) +++ head/sys/dev/xen/netfront/netfront.c Thu Feb 11 11:53:32 2016 (r295511) @@ -906,11 +906,9 @@ setup_txqs(device_t dev, struct netfront fail_bind_port: taskqueue_drain_all(txq->tq); fail_start_thread: - gnttab_free_grant_references(txq->gref_head); - free(txq->ring.sring, M_DEVBUF); - gnttab_end_foreign_access_ref(txq->ring_ref); buf_ring_free(txq->br, M_DEVBUF); taskqueue_free(txq->tq); + gnttab_end_foreign_access_ref(txq->ring_ref); fail_grant_ring: gnttab_free_grant_references(txq->gref_head); free(txq->ring.sring, M_DEVBUF); From owner-svn-src-all@freebsd.org Thu Feb 11 11:55:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CC52AA5077; Thu, 11 Feb 2016 11:55:39 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 66D541E6F; Thu, 11 Feb 2016 11:55:39 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BBtcf9050091; Thu, 11 Feb 2016 11:55:38 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BBtcxH050087; Thu, 11 Feb 2016 11:55:38 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201602111155.u1BBtcxH050087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 11 Feb 2016 11:55:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295512 - in head/sys/arm64: arm64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 11:55:39 -0000 Author: zbb Date: Thu Feb 11 11:55:37 2016 New Revision: 295512 URL: https://svnweb.freebsd.org/changeset/base/295512 Log: Minor clean-ups for ARM64 GICv3 and GIC drivers GICv3: - move ICC_SGI1R_EL1 definitions to armreg.h and use proper system register's names GIC: - remove unused functions Reviewed by: andrew Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5119 Modified: head/sys/arm64/arm64/gic.c head/sys/arm64/arm64/gic_v3.c head/sys/arm64/arm64/gic_v3_reg.h head/sys/arm64/include/armreg.h Modified: head/sys/arm64/arm64/gic.c ============================================================================== --- head/sys/arm64/arm64/gic.c Thu Feb 11 11:53:32 2016 (r295511) +++ head/sys/arm64/arm64/gic.c Thu Feb 11 11:55:37 2016 (r295512) @@ -303,29 +303,6 @@ gic_ipi_send(device_t dev, cpuset_t cpus gic_d_write_4(sc, GICD_SGIR(0), val | ipi); } - -static int -arm_gic_ipi_read(device_t dev, int i) -{ - - if (i != -1) { - /* - * The intr code will automagically give the frame pointer - * if the interrupt argument is 0. - */ - if ((unsigned int)i > 16) - return (0); - return (i); - } - - return (0x3ff); -} - -static void -arm_gic_ipi_clear(device_t dev, int ipi) -{ - /* no-op */ -} #endif static device_method_t arm_gic_methods[] = { Modified: head/sys/arm64/arm64/gic_v3.c ============================================================================== --- head/sys/arm64/arm64/gic_v3.c Thu Feb 11 11:53:32 2016 (r295511) +++ head/sys/arm64/arm64/gic_v3.c Thu Feb 11 11:55:37 2016 (r295512) @@ -412,14 +412,15 @@ gic_v3_ipi_send(device_t dev, cpuset_t c } } if (tlist) { - KASSERT((tlist & ~GICI_SGI_TLIST_MASK) == 0, + KASSERT((tlist & ~ICC_SGI1R_EL1_TL_MASK) == 0, ("Target list too long for GICv3 IPI")); /* Send SGI to CPUs in target list */ val = tlist; - val |= (uint64_t)CPU_AFF3(aff) << GICI_SGI_AFF3_SHIFT; - val |= (uint64_t)CPU_AFF2(aff) << GICI_SGI_AFF2_SHIFT; - val |= (uint64_t)CPU_AFF1(aff) << GICI_SGI_AFF1_SHIFT; - val |= (uint64_t)(ipi & GICI_SGI_IPI_MASK) << GICI_SGI_IPI_SHIFT; + val |= (uint64_t)CPU_AFF3(aff) << ICC_SGI1R_EL1_AFF3_SHIFT; + val |= (uint64_t)CPU_AFF2(aff) << ICC_SGI1R_EL1_AFF2_SHIFT; + val |= (uint64_t)CPU_AFF1(aff) << ICC_SGI1R_EL1_AFF1_SHIFT; + val |= (uint64_t)(ipi & ICC_SGI1R_EL1_SGIID_MASK) << + ICC_SGI1R_EL1_SGIID_SHIFT; gic_icc_write(SGI1R, val); } } Modified: head/sys/arm64/arm64/gic_v3_reg.h ============================================================================== --- head/sys/arm64/arm64/gic_v3_reg.h Thu Feb 11 11:53:32 2016 (r295511) +++ head/sys/arm64/arm64/gic_v3_reg.h Thu Feb 11 11:55:37 2016 (r295512) @@ -356,12 +356,6 @@ /* * CPU interface */ -#define GICI_SGI_TLIST_MASK (0xffffUL) -#define GICI_SGI_AFF1_SHIFT (16UL) -#define GICI_SGI_AFF2_SHIFT (32UL) -#define GICI_SGI_AFF3_SHIFT (48UL) -#define GICI_SGI_IPI_MASK (0xfUL) -#define GICI_SGI_IPI_SHIFT (24UL) /* * Registers list (ICC_xyz_EL1): Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Thu Feb 11 11:53:32 2016 (r295511) +++ head/sys/arm64/include/armreg.h Thu Feb 11 11:55:37 2016 (r295512) @@ -118,6 +118,15 @@ /* ICC_PMR_EL1 */ #define ICC_PMR_EL1_PRIO_MASK (0xFFUL) +/* ICC_SGI1R_EL1 */ +#define ICC_SGI1R_EL1_TL_MASK 0xffffUL +#define ICC_SGI1R_EL1_AFF1_SHIFT 16 +#define ICC_SGI1R_EL1_SGIID_SHIFT 24 +#define ICC_SGI1R_EL1_AFF2_SHIFT 32 +#define ICC_SGI1R_EL1_AFF3_SHIFT 48 +#define ICC_SGI1R_EL1_SGIID_MASK 0xfUL +#define ICC_SGI1R_EL1_IRM (0x1UL << 40) + /* ICC_SRE_EL1 */ #define ICC_SRE_EL1_SRE (1U << 0) From owner-svn-src-all@freebsd.org Thu Feb 11 11:57:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D763CAA514B; Thu, 11 Feb 2016 11:57:13 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 A38C7192; Thu, 11 Feb 2016 11:57:13 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BBvCZP050192; Thu, 11 Feb 2016 11:57:12 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BBvCAN050191; Thu, 11 Feb 2016 11:57:12 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201602111157.u1BBvCAN050191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Thu, 11 Feb 2016 11:57:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295513 - head/sys/dev/xen/netfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 11:57:13 -0000 Author: royger Date: Thu Feb 11 11:57:12 2016 New Revision: 295513 URL: https://svnweb.freebsd.org/changeset/base/295513 Log: xen-netfront: remove useless NULL check in netif_free xn_ifp is allocated in create_netdev with if_alloc(IFT_ETHER). According to the current arrangement it can't be NULL. Coverity ID: 1349805 Submitted by: Wei Liu Reviewed by: royger Sponsored by: Citrix Systems R&D Differential revision: https://reviews.freebsd.org/D5252 Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Thu Feb 11 11:55:37 2016 (r295512) +++ head/sys/dev/xen/netfront/netfront.c Thu Feb 11 11:57:12 2016 (r295513) @@ -2280,11 +2280,9 @@ netif_free(struct netfront_info *np) netif_disconnect_backend(np); free(np->rxq, M_DEVBUF); free(np->txq, M_DEVBUF); - if (np->xn_ifp != NULL) { - ether_ifdetach(np->xn_ifp); - if_free(np->xn_ifp); - np->xn_ifp = NULL; - } + ether_ifdetach(np->xn_ifp); + if_free(np->xn_ifp); + np->xn_ifp = NULL; ifmedia_removeall(&np->sc_media); } From owner-svn-src-all@freebsd.org Thu Feb 11 11:57:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42A8EAA515D; Thu, 11 Feb 2016 11:57:15 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 03356194; Thu, 11 Feb 2016 11:57:14 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BBvERE050236; Thu, 11 Feb 2016 11:57:14 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BBvENP050235; Thu, 11 Feb 2016 11:57:14 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201602111157.u1BBvENP050235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 11 Feb 2016 11:57:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295514 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 11:57:15 -0000 Author: zbb Date: Thu Feb 11 11:57:13 2016 New Revision: 295514 URL: https://svnweb.freebsd.org/changeset/base/295514 Log: Fix bugs in interrupts allocation on ARM64 Separate interrupt descriptors lookup from allocation. It was possible to perform config on non-existing interrupt simply by allocating spurious descriptor. Must lock the interrupt descriptors table lookup to avoid mismatches. This ought to prevent trouble while setting up new interrupt and dispatching existing one. Use spin mutex rather than sleep mutex. This is mainly due to lock in arm_dispatch_intr. This should be eventually changed to a lock-less solution without walking through a linked list on each interrupt. Reviewed by: andrew, wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5121 Modified: head/sys/arm64/arm64/intr_machdep.c Modified: head/sys/arm64/arm64/intr_machdep.c ============================================================================== --- head/sys/arm64/arm64/intr_machdep.c Thu Feb 11 11:57:12 2016 (r295513) +++ head/sys/arm64/arm64/intr_machdep.c Thu Feb 11 11:57:13 2016 (r295514) @@ -105,7 +105,7 @@ static void intr_init(void *dummy __unused) { - mtx_init(&intr_list_lock, "intr sources lock", NULL, MTX_DEF); + mtx_init(&intr_list_lock, "intr sources lock", NULL, MTX_SPIN); } SYSINIT(intr_init, SI_SUB_INTR, SI_ORDER_FIRST, intr_init, NULL); @@ -123,33 +123,44 @@ intrcnt_setname(const char *name, u_int } /* + * Find the interrupt descriptor in the list + * based on the hardware IRQ number. + */ +static __inline struct arm64_intr_entry * +intr_lookup_locked(u_int hw_irq) +{ + struct arm64_intr_entry *intr; + + mtx_assert(&intr_list_lock, MA_OWNED); + SLIST_FOREACH(intr, &irq_slist_head, entries) { + if (intr->i_hw_irq == hw_irq) + return (intr); + } + return (NULL); +} +/* * Get intr structure for the given interrupt number. * Allocate one if this is the first time. - * (Similar to ppc's intr_lookup() but without actual - * lookup since irq number is an index in arm64_intrs[]). */ static struct arm64_intr_entry * -intr_acquire(u_int hw_irq) +intr_allocate(u_int hw_irq) { struct arm64_intr_entry *intr; - mtx_lock(&intr_list_lock); - - SLIST_FOREACH(intr, &irq_slist_head, entries) { - if (intr->i_hw_irq == hw_irq) { - break; - } - } + /* Check if already allocated */ + mtx_lock_spin(&intr_list_lock); + intr = intr_lookup_locked(hw_irq); + mtx_unlock_spin(&intr_list_lock); if (intr != NULL) - goto out; + return (intr); /* Do not alloc another intr when max number of IRQs has been reached */ if (intrcntidx >= NIRQS) - goto out; + return (NULL); intr = malloc(sizeof(*intr), M_INTR, M_NOWAIT); if (intr == NULL) - goto out; + return (NULL); intr->i_event = NULL; intr->i_handlers = 0; @@ -158,9 +169,10 @@ intr_acquire(u_int hw_irq) intr->i_cntidx = atomic_fetchadd_int(&intrcntidx, 1); intr->i_cntp = &intrcnt[intr->i_cntidx]; intr->i_hw_irq = hw_irq; + mtx_lock_spin(&intr_list_lock); SLIST_INSERT_HEAD(&irq_slist_head, intr, entries); -out: - mtx_unlock(&intr_list_lock); + mtx_unlock_spin(&intr_list_lock); + return intr; } @@ -312,7 +324,7 @@ arm_setup_intr(const char *name, driver_ struct arm64_intr_entry *intr; int error; - intr = intr_acquire(hw_irq); + intr = intr_allocate(hw_irq); if (intr == NULL) return (ENOMEM); @@ -336,7 +348,6 @@ arm_setup_intr(const char *name, driver_ intr_priority(flags), flags, cookiep); if (!error) { - mtx_lock(&intr_list_lock); intrcnt_setname(intr->i_event->ie_fullname, intr->i_cntidx); intr->i_handlers++; @@ -349,7 +360,6 @@ arm_setup_intr(const char *name, driver_ PIC_UNMASK(root_pic, intr->i_hw_irq); } - mtx_unlock(&intr_list_lock); } return (error); @@ -364,12 +374,10 @@ arm_teardown_intr(void *cookie) intr = intr_handler_source(cookie); error = intr_event_remove_handler(cookie); if (!error) { - mtx_lock(&intr_list_lock); intr->i_handlers--; if (intr->i_handlers == 0) PIC_MASK(root_pic, intr->i_hw_irq); intrcnt_setname(intr->i_event->ie_fullname, intr->i_cntidx); - mtx_unlock(&intr_list_lock); } return (error); @@ -380,9 +388,11 @@ arm_config_intr(u_int hw_irq, enum intr_ { struct arm64_intr_entry *intr; - intr = intr_acquire(hw_irq); + mtx_lock_spin(&intr_list_lock); + intr = intr_lookup_locked(hw_irq); + mtx_unlock_spin(&intr_list_lock); if (intr == NULL) - return (ENOMEM); + return (EINVAL); intr->i_trig = trig; intr->i_pol = pol; @@ -398,12 +408,9 @@ arm_dispatch_intr(u_int hw_irq, struct t { struct arm64_intr_entry *intr; - SLIST_FOREACH(intr, &irq_slist_head, entries) { - if (intr->i_hw_irq == hw_irq) { - break; - } - } - + mtx_lock_spin(&intr_list_lock); + intr = intr_lookup_locked(hw_irq); + mtx_unlock_spin(&intr_list_lock); if (intr == NULL) goto stray; From owner-svn-src-all@freebsd.org Thu Feb 11 11:58:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8469AA5285; Thu, 11 Feb 2016 11:58:28 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 8E9D96BB; Thu, 11 Feb 2016 11:58:28 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BBwRhc050319; Thu, 11 Feb 2016 11:58:27 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BBwRRI050315; Thu, 11 Feb 2016 11:58:27 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201602111158.u1BBwRRI050315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 11 Feb 2016 11:58:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295515 - in head/sys/arm64: arm64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 11:58:28 -0000 Author: zbb Date: Thu Feb 11 11:58:27 2016 New Revision: 295515 URL: https://svnweb.freebsd.org/changeset/base/295515 Log: Introduce bus_bind_intr method for ARM64 It can be used to bind specific interrupt to a particular CPU. Requires PIC support for interrupts binding. Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5122 Modified: head/sys/arm64/arm64/intr_machdep.c head/sys/arm64/arm64/nexus.c head/sys/arm64/arm64/pic_if.m head/sys/arm64/include/intr.h Modified: head/sys/arm64/arm64/intr_machdep.c ============================================================================== --- head/sys/arm64/arm64/intr_machdep.c Thu Feb 11 11:57:13 2016 (r295514) +++ head/sys/arm64/arm64/intr_machdep.c Thu Feb 11 11:58:27 2016 (r295515) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -84,6 +85,7 @@ struct arm64_intr_entry { u_int i_hw_irq; /* Physical interrupt number */ u_int i_cntidx; /* Index in intrcnt table */ u_int i_handlers; /* Allocated handlers */ + u_int i_cpu; /* Assigned CPU */ u_long *i_cntp; /* Interrupt hit counter */ }; @@ -162,6 +164,8 @@ intr_allocate(u_int hw_irq) if (intr == NULL) return (NULL); + /* The default CPU is 0 but can be changed later by bind or shuffle */ + intr->i_cpu = 0; intr->i_event = NULL; intr->i_handlers = 0; intr->i_trig = INTR_TRIGGER_CONFORM; @@ -176,6 +180,44 @@ intr_allocate(u_int hw_irq) return intr; } +static int +intr_assign_cpu(void *arg, int cpu) +{ +#ifdef SMP + struct arm64_intr_entry *intr; + int error; + + if (root_pic == NULL) + panic("Cannot assing interrupt to CPU. No PIC configured"); + /* + * Set the interrupt to CPU affinity. + * Do not configure this in hardware during early boot. + * We will pick up the assignment once the APs are started. + */ + if (cpu != NOCPU) { + intr = arg; + if (!cold && smp_started) { + /* + * Bind the interrupt immediately + * if SMP is up and running. + */ + error = PIC_BIND(root_pic, intr->i_hw_irq, cpu); + if (error == 0) + intr->i_cpu = cpu; + } else { + /* Postpone binding until SMP is operational */ + intr->i_cpu = cpu; + error = 0; + } + } else + error = 0; + + return (error); +#else + return (EOPNOTSUPP); +#endif +} + static void intr_pre_ithread(void *arg) { @@ -339,7 +381,7 @@ arm_setup_intr(const char *name, driver_ if (intr->i_event == NULL) { error = intr_event_create(&intr->i_event, (void *)intr, 0, hw_irq, intr_pre_ithread, intr_post_ithread, - intr_post_filter, NULL, "irq%u", hw_irq); + intr_post_filter, intr_assign_cpu, "irq%u", hw_irq); if (error) return (error); } @@ -447,6 +489,42 @@ arm_cpu_intr(struct trapframe *tf) } #ifdef SMP +static void +arm_intr_smp_init(void *dummy __unused) +{ + struct arm64_intr_entry *intr; + int error; + + if (root_pic == NULL) + panic("Cannot assing interrupts to CPUs. No PIC configured"); + + mtx_lock_spin(&intr_list_lock); + SLIST_FOREACH(intr, &irq_slist_head, entries) { + mtx_unlock_spin(&intr_list_lock); + error = PIC_BIND(root_pic, intr->i_hw_irq, intr->i_cpu); + if (error != 0) + intr->i_cpu = 0; + mtx_lock_spin(&intr_list_lock); + } + mtx_unlock_spin(&intr_list_lock); +} +SYSINIT(arm_intr_smp_init, SI_SUB_SMP, SI_ORDER_ANY, arm_intr_smp_init, NULL); + +/* Attempt to bind the specified IRQ to the specified CPU. */ +int +arm_intr_bind(u_int hw_irq, int cpu) +{ + struct arm64_intr_entry *intr; + + mtx_lock_spin(&intr_list_lock); + intr = intr_lookup_locked(hw_irq); + mtx_unlock_spin(&intr_list_lock); + if (intr == NULL) + return (EINVAL); + + return (intr_event_bind(intr->i_event, cpu)); +} + void arm_setup_ipihandler(driver_filter_t *filt, u_int ipi) { Modified: head/sys/arm64/arm64/nexus.c ============================================================================== --- head/sys/arm64/arm64/nexus.c Thu Feb 11 11:57:13 2016 (r295514) +++ head/sys/arm64/arm64/nexus.c Thu Feb 11 11:58:27 2016 (r295515) @@ -113,6 +113,9 @@ static int nexus_deactivate_resource(dev static int nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep); static int nexus_teardown_intr(device_t, device_t, struct resource *, void *); +#ifdef SMP +static int nexus_bind_intr(device_t, device_t, struct resource *, int); +#endif #ifdef FDT static int nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, @@ -131,7 +134,9 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), DEVMETHOD(bus_setup_intr, nexus_setup_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), - +#ifdef SMP + DEVMETHOD(bus_bind_intr, nexus_bind_intr), +#endif { 0, 0 } }; @@ -293,6 +298,15 @@ nexus_teardown_intr(device_t dev, device return (arm_teardown_intr(ih)); } +#ifdef SMP +static int +nexus_bind_intr(device_t dev, device_t child, struct resource *irq, int cpu) +{ + + return (arm_intr_bind(rman_get_start(irq), cpu)); +} +#endif + static int nexus_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) Modified: head/sys/arm64/arm64/pic_if.m ============================================================================== --- head/sys/arm64/arm64/pic_if.m Thu Feb 11 11:57:13 2016 (r295514) +++ head/sys/arm64/arm64/pic_if.m Thu Feb 11 11:58:27 2016 (r295515) @@ -34,7 +34,11 @@ INTERFACE pic; CODE { - static pic_translate_code_t pic_translate_code_default; + static int pic_bind_default(device_t dev, u_int irq, u_int cpu) + { + + return (EOPNOTSUPP); + } static void pic_translate_code_default(device_t dev, u_int irq, int code, enum intr_trigger *trig, enum intr_polarity *pol) @@ -60,11 +64,11 @@ CODE { } }; -METHOD void bind { +METHOD int bind { device_t dev; u_int irq; - cpuset_t cpumask; -}; + u_int cpu; +} DEFAULT pic_bind_default; METHOD void translate_code { device_t dev; Modified: head/sys/arm64/include/intr.h ============================================================================== --- head/sys/arm64/include/intr.h Thu Feb 11 11:57:13 2016 (r295514) +++ head/sys/arm64/include/intr.h Thu Feb 11 11:58:27 2016 (r295515) @@ -49,6 +49,7 @@ void arm_unmask_irq(u_int); #ifdef SMP void arm_init_secondary(void); +int arm_intr_bind(u_int, int); void arm_setup_ipihandler(driver_filter_t *, u_int); void arm_unmask_ipi(u_int); #endif From owner-svn-src-all@freebsd.org Thu Feb 11 11:59:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FA8BAA530E; Thu, 11 Feb 2016 11:59:34 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 0FCE5892; Thu, 11 Feb 2016 11:59:33 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BBxXPU050395; Thu, 11 Feb 2016 11:59:33 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BBxXj5050394; Thu, 11 Feb 2016 11:59:33 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201602111159.u1BBxXj5050394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 11 Feb 2016 11:59:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295516 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 11:59:34 -0000 Author: zbb Date: Thu Feb 11 11:59:32 2016 New Revision: 295516 URL: https://svnweb.freebsd.org/changeset/base/295516 Log: Call pmc_hook() correctly in the ARM64 interrupt handler pmc_hook() was called only in case of the stray interrupt but should rather be called on each interrupt. Move in to the arm_cpu_intr() handler, out of the critical section too. Reviewed by: br Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5161 Modified: head/sys/arm64/arm64/intr_machdep.c Modified: head/sys/arm64/arm64/intr_machdep.c ============================================================================== --- head/sys/arm64/arm64/intr_machdep.c Thu Feb 11 11:58:27 2016 (r295515) +++ head/sys/arm64/arm64/intr_machdep.c Thu Feb 11 11:59:32 2016 (r295516) @@ -473,10 +473,6 @@ stray: if (intr != NULL) PIC_MASK(root_pic, intr->i_hw_irq); -#ifdef HWPMC_HOOKS - if (pmc_hook && (PCPU_GET(curthread)->td_pflags & TDP_CALLCHAIN)) - pmc_hook(PCPU_GET(curthread), PMC_FN_USER_CALLCHAIN, tf); -#endif } void @@ -486,6 +482,10 @@ arm_cpu_intr(struct trapframe *tf) critical_enter(); PIC_DISPATCH(root_pic, tf); critical_exit(); +#ifdef HWPMC_HOOKS + if (pmc_hook && (PCPU_GET(curthread)->td_pflags & TDP_CALLCHAIN)) + pmc_hook(PCPU_GET(curthread), PMC_FN_USER_CALLCHAIN, tf); +#endif } #ifdef SMP From owner-svn-src-all@freebsd.org Thu Feb 11 12:01:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 335BCAA5A87; Thu, 11 Feb 2016 12:01:35 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 05964D7E; Thu, 11 Feb 2016 12:01:34 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BC1YGZ050536; Thu, 11 Feb 2016 12:01:34 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BC1XXv050534; Thu, 11 Feb 2016 12:01:33 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201602111201.u1BC1XXv050534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 11 Feb 2016 12:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295517 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 12:01:35 -0000 Author: zbb Date: Thu Feb 11 12:01:33 2016 New Revision: 295517 URL: https://svnweb.freebsd.org/changeset/base/295517 Log: Initially bind all interrupts to the boot CPU when using GICv3 This should be done by routing all interrupts to CPU0, different assignment will be induced by either interrupts shuffling or bus_bind_intr(). Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5229 Modified: head/sys/arm64/arm64/gic_v3.c head/sys/arm64/arm64/gic_v3_its.c Modified: head/sys/arm64/arm64/gic_v3.c ============================================================================== --- head/sys/arm64/arm64/gic_v3.c Thu Feb 11 11:59:32 2016 (r295516) +++ head/sys/arm64/arm64/gic_v3.c Thu Feb 11 12:01:33 2016 (r295517) @@ -565,7 +565,7 @@ gic_v3_dist_init(struct gic_v3_softc *sc /* * 4. Route all interrupts to boot CPU. */ - aff = CPU_AFFINITY(PCPU_GET(cpuid)); + aff = CPU_AFFINITY(0); for (i = GIC_FIRST_SPI; i < sc->gic_nirqs; i++) gic_d_write(sc, 4, GICD_IROUTER(i), aff); Modified: head/sys/arm64/arm64/gic_v3_its.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_its.c Thu Feb 11 11:59:32 2016 (r295516) +++ head/sys/arm64/arm64/gic_v3_its.c Thu Feb 11 12:01:33 2016 (r295517) @@ -1430,10 +1430,10 @@ its_device_alloc_locked(struct gic_v3_it } /* - * XXX ARM64TODO: Currently all interrupts are going - * to be bound to the CPU that performs the configuration. + * Initially all interrupts go to CPU0 but can be moved + * to another CPU by bus_bind_intr() or interrupts shuffling. */ - cpuid = PCPU_GET(cpuid); + cpuid = 0; newdev->col = sc->its_cols[cpuid]; TAILQ_INSERT_TAIL(&sc->its_dev_list, newdev, entry); From owner-svn-src-all@freebsd.org Thu Feb 11 12:03:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEB51AA5C65; Thu, 11 Feb 2016 12:03:12 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 C9385104D; Thu, 11 Feb 2016 12:03:12 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BC3BHi053184; Thu, 11 Feb 2016 12:03:11 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BC3Bps053182; Thu, 11 Feb 2016 12:03:11 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201602111203.u1BC3Bps053182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 11 Feb 2016 12:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295518 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 12:03:13 -0000 Author: zbb Date: Thu Feb 11 12:03:11 2016 New Revision: 295518 URL: https://svnweb.freebsd.org/changeset/base/295518 Log: Implement finer locking in ITS - Change locks' names to be more suitable - Don't use blocking mutex. Lock only basic operations such as lists or bitmaps modifications. Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5230 Modified: head/sys/arm64/arm64/gic_v3_its.c head/sys/arm64/arm64/gic_v3_var.h Modified: head/sys/arm64/arm64/gic_v3_its.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_its.c Thu Feb 11 12:01:33 2016 (r295517) +++ head/sys/arm64/arm64/gic_v3_its.c Thu Feb 11 12:03:11 2016 (r295518) @@ -197,9 +197,9 @@ gic_v3_its_attach(device_t dev) * Initialize sleep & spin mutex for ITS */ /* Protects ITS device list and assigned LPIs bitmaps. */ - mtx_init(&sc->its_mtx, "ITS sleep lock", NULL, MTX_DEF); + mtx_init(&sc->its_dev_lock, "ITS dev lock", NULL, MTX_SPIN); /* Protects access to ITS command circular buffer. */ - mtx_init(&sc->its_spin_mtx, "ITS spin lock", NULL, MTX_SPIN); + mtx_init(&sc->its_cmd_lock, "ITS cmd lock", NULL, MTX_SPIN); rid = 0; sc->its_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, @@ -1181,7 +1181,7 @@ its_cmd_alloc_locked(struct gic_v3_its_s */ us_left = 1000000; - mtx_assert(&sc->its_spin_mtx, MA_OWNED); + mtx_assert(&sc->its_cmd_lock, MA_OWNED); while (its_cmd_queue_full(sc)) { if (us_left-- == 0) { /* Timeout while waiting for free command */ @@ -1334,11 +1334,11 @@ its_cmd_send(struct gic_v3_its_softc *sc struct its_cmd_desc desc_sync; uint64_t target, cwriter; - mtx_lock_spin(&sc->its_spin_mtx); + mtx_lock_spin(&sc->its_cmd_lock); cmd = its_cmd_alloc_locked(sc); if (cmd == NULL) { device_printf(sc->dev, "could not allocate ITS command\n"); - mtx_unlock_spin(&sc->its_spin_mtx); + mtx_unlock_spin(&sc->its_cmd_lock); return (EBUSY); } @@ -1360,7 +1360,7 @@ end: cwriter = its_cmd_cwriter_offset(sc, sc->its_cmdq_write); gic_its_write(sc, 8, GITS_CWRITER, cwriter); cmd_write = sc->its_cmdq_write; - mtx_unlock_spin(&sc->its_spin_mtx); + mtx_unlock_spin(&sc->its_cmd_lock); its_cmd_wait_completion(sc, cmd, cmd_write); @@ -1372,7 +1372,7 @@ its_device_find_locked(struct gic_v3_its { struct its_dev *its_dev; - mtx_assert(&sc->its_mtx, MA_OWNED); + mtx_assert(&sc->its_dev_lock, MA_OWNED); /* Find existing device if any */ TAILQ_FOREACH(its_dev, &sc->its_dev_list, entry) { if (its_dev->pci_dev == pci_dev) @@ -1383,7 +1383,7 @@ its_device_find_locked(struct gic_v3_its } static struct its_dev * -its_device_alloc_locked(struct gic_v3_its_softc *sc, device_t pci_dev, +its_device_alloc(struct gic_v3_its_softc *sc, device_t pci_dev, u_int nvecs) { struct its_dev *newdev; @@ -1391,10 +1391,12 @@ its_device_alloc_locked(struct gic_v3_it uint32_t devid; u_int cpuid; size_t esize; + int err; - mtx_assert(&sc->its_mtx, MA_OWNED); + mtx_lock_spin(&sc->its_dev_lock); /* Find existing device if any */ newdev = its_device_find_locked(sc, pci_dev); + mtx_unlock_spin(&sc->its_dev_lock); if (newdev != NULL) return (newdev); @@ -1408,7 +1410,10 @@ its_device_alloc_locked(struct gic_v3_it newdev->pci_dev = pci_dev; newdev->devid = devid; - if (lpi_alloc_chunk(sc, &newdev->lpis, nvecs) != 0) { + mtx_lock_spin(&sc->its_dev_lock); + err = lpi_alloc_chunk(sc, &newdev->lpis, nvecs); + mtx_unlock_spin(&sc->its_dev_lock); + if (err != 0) { free(newdev, M_GIC_V3_ITS); return (NULL); } @@ -1424,7 +1429,9 @@ its_device_alloc_locked(struct gic_v3_it roundup2(roundup2(nvecs, 2) * esize, 0x100), M_GIC_V3_ITS, (M_NOWAIT | M_ZERO), 0, ~0UL, 0x100, 0); if (newdev->itt == 0) { + mtx_lock_spin(&sc->its_dev_lock); lpi_free_chunk(sc, &newdev->lpis); + mtx_unlock_spin(&sc->its_dev_lock); free(newdev, M_GIC_V3_ITS); return (NULL); } @@ -1436,7 +1443,9 @@ its_device_alloc_locked(struct gic_v3_it cpuid = 0; newdev->col = sc->its_cols[cpuid]; + mtx_lock_spin(&sc->its_dev_lock); TAILQ_INSERT_TAIL(&sc->its_dev_list, newdev, entry); + mtx_unlock_spin(&sc->its_dev_lock); /* Map device to its ITT */ its_cmd_mapd(sc, newdev, 1); @@ -1449,7 +1458,7 @@ its_device_asign_lpi_locked(struct gic_v struct its_dev *its_dev, u_int *irq) { - mtx_assert(&sc->its_mtx, MA_OWNED); + mtx_assert(&sc->its_dev_lock, MA_OWNED); if (its_dev->lpis.lpi_free == 0) { panic("Requesting more LPIs than allocated for this device. " "LPI num: %u, free %u", its_dev->lpis.lpi_num, @@ -1612,21 +1621,19 @@ gic_v3_its_alloc_msix(device_t dev, devi sc = device_get_softc(dev); - mtx_lock(&sc->its_mtx); nvecs = PCI_MSIX_NUM(pci_dev); /* * Allocate device as seen by ITS if not already available. * Notice that MSI-X interrupts are allocated on one-by-one basis. */ - its_dev = its_device_alloc_locked(sc, pci_dev, nvecs); - if (its_dev == NULL) { - mtx_unlock(&sc->its_mtx); + its_dev = its_device_alloc(sc, pci_dev, nvecs); + if (its_dev == NULL) return (ENOMEM); - } + mtx_lock_spin(&sc->its_dev_lock); its_device_asign_lpi_locked(sc, its_dev, irq); - mtx_unlock(&sc->its_mtx); + mtx_unlock_spin(&sc->its_dev_lock); return (0); } @@ -1640,18 +1647,16 @@ gic_v3_its_alloc_msi(device_t dev, devic sc = device_get_softc(dev); /* Allocate device as seen by ITS if not already available. */ - mtx_lock(&sc->its_mtx); - its_dev = its_device_alloc_locked(sc, pci_dev, count); - if (its_dev == NULL) { - mtx_unlock(&sc->its_mtx); + its_dev = its_device_alloc(sc, pci_dev, count); + if (its_dev == NULL) return (ENOMEM); - } + mtx_lock_spin(&sc->its_dev_lock); for (; count > 0; count--) { its_device_asign_lpi_locked(sc, its_dev, irqs); irqs++; } - mtx_unlock(&sc->its_mtx); + mtx_unlock_spin(&sc->its_dev_lock); return (0); } @@ -1668,9 +1673,9 @@ gic_v3_its_map_msi(device_t dev, device_ sc = device_get_softc(dev); /* Verify that this device is allocated and owns this LPI */ - mtx_lock(&sc->its_mtx); - its_dev = its_device_find_locked(sc, pci_dev); - mtx_unlock(&sc->its_mtx); + mtx_lock_spin(&sc->its_dev_lock); + its_dev = its_device_find_locked(sc, pci_dev, 0); + mtx_unlock_spin(&sc->its_dev_lock); if (its_dev == NULL) return (EINVAL); Modified: head/sys/arm64/arm64/gic_v3_var.h ============================================================================== --- head/sys/arm64/arm64/gic_v3_var.h Thu Feb 11 12:01:33 2016 (r295517) +++ head/sys/arm64/arm64/gic_v3_var.h Thu Feb 11 12:03:11 2016 (r295518) @@ -230,8 +230,8 @@ struct gic_v3_its_softc { unsigned long * its_lpi_bitmap; uint32_t its_lpi_maxid; - struct mtx its_mtx; - struct mtx its_spin_mtx; + struct mtx its_dev_lock; + struct mtx its_cmd_lock; uint32_t its_socket; /* Socket number ITS is attached to */ }; From owner-svn-src-all@freebsd.org Thu Feb 11 12:05:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 428CCAA5D20; Thu, 11 Feb 2016 12:05:00 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 0E5FF11E7; Thu, 11 Feb 2016 12:04:59 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BC4x6C053278; Thu, 11 Feb 2016 12:04:59 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BC4wPL053275; Thu, 11 Feb 2016 12:04:58 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201602111204.u1BC4wPL053275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 11 Feb 2016 12:04:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295519 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 12:05:00 -0000 Author: zbb Date: Thu Feb 11 12:04:58 2016 New Revision: 295519 URL: https://svnweb.freebsd.org/changeset/base/295519 Log: Support interrupts binding in GICv3 and ITS - Add MOVI command and routine for the LPI migration - Allow to search for the ITS device descriptor using not only devID but also LPI number. - Bind SPIs in the Distributor - Don't bind its_dev to collection. Keep track of the collection IDs for each LPI. Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5231 Modified: head/sys/arm64/arm64/gic_v3.c head/sys/arm64/arm64/gic_v3_its.c head/sys/arm64/arm64/gic_v3_var.h Modified: head/sys/arm64/arm64/gic_v3.c ============================================================================== --- head/sys/arm64/arm64/gic_v3.c Thu Feb 11 12:03:11 2016 (r295518) +++ head/sys/arm64/arm64/gic_v3.c Thu Feb 11 12:04:58 2016 (r295519) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include "gic_v3_var.h" /* Device and PIC methods */ +static int gic_v3_bind(device_t, u_int, u_int); static void gic_v3_dispatch(device_t, struct trapframe *); static void gic_v3_eoi(device_t, u_int); static void gic_v3_mask_irq(device_t, u_int); @@ -72,6 +73,7 @@ static device_method_t gic_v3_methods[] DEVMETHOD(device_detach, gic_v3_detach), /* PIC interface */ + DEVMETHOD(pic_bind, gic_v3_bind), DEVMETHOD(pic_dispatch, gic_v3_dispatch), DEVMETHOD(pic_eoi, gic_v3_eoi), DEVMETHOD(pic_mask, gic_v3_mask_irq), @@ -244,6 +246,28 @@ gic_v3_detach(device_t dev) /* * PIC interface. */ + +static int +gic_v3_bind(device_t dev, u_int irq, u_int cpuid) +{ + uint64_t aff; + struct gic_v3_softc *sc; + + sc = device_get_softc(dev); + + if (irq <= GIC_LAST_PPI) { + /* Can't bind PPI to another CPU but it's not an error */ + return (0); + } else if (irq >= GIC_FIRST_SPI && irq <= GIC_LAST_SPI) { + aff = CPU_AFFINITY(cpuid); + gic_d_write(sc, 4, GICD_IROUTER(irq), aff); + return (0); + } else if (irq >= GIC_FIRST_LPI) + return (lpi_migrate(dev, irq, cpuid)); + + return (EINVAL); +} + static void gic_v3_dispatch(device_t dev, struct trapframe *frame) { Modified: head/sys/arm64/arm64/gic_v3_its.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_its.c Thu Feb 11 12:03:11 2016 (r295518) +++ head/sys/arm64/arm64/gic_v3_its.c Thu Feb 11 12:04:58 2016 (r295519) @@ -92,9 +92,13 @@ static void its_free_tables(struct gic_v static void its_init_commandq(struct gic_v3_its_softc *); static void its_init_cpu_collection(struct gic_v3_its_softc *); static uint32_t its_get_devid(device_t); +static struct its_dev * its_device_find_locked(struct gic_v3_its_softc *, + device_t, uint32_t); static int its_cmd_send(struct gic_v3_its_softc *, struct its_cmd_desc *); +static void its_cmd_movi(struct gic_v3_its_softc *, struct its_dev *, + struct its_col *, uint32_t); static void its_cmd_mapc(struct gic_v3_its_softc *, struct its_col *, uint8_t); static void its_cmd_mapvi(struct gic_v3_its_softc *, struct its_dev *, uint32_t, uint32_t); @@ -846,18 +850,28 @@ static int lpi_alloc_chunk(struct gic_v3_its_softc *sc, struct lpi_chunk *lpic, u_int nvecs) { + u_int *col_ids; int fclr; /* First cleared bit */ uint8_t *bitmap; size_t nb, i; + col_ids = malloc(sizeof(*col_ids) * nvecs, M_GIC_V3_ITS, + (M_NOWAIT | M_ZERO)); + if (col_ids == NULL) + return (ENOMEM); + + mtx_lock_spin(&sc->its_dev_lock); bitmap = (uint8_t *)sc->its_lpi_bitmap; fclr = 0; retry: /* Check other bits - sloooow */ for (i = 0, nb = fclr; i < nvecs; i++, nb++) { - if (nb > sc->its_lpi_maxid) + if (nb > sc->its_lpi_maxid) { + mtx_unlock_spin(&sc->its_dev_lock); + free(col_ids, M_GIC_V3_ITS); return (EINVAL); + } if (isset(bitmap, nb)) { /* To little free bits in this area. Move on. */ @@ -870,6 +884,15 @@ retry: lpic->lpi_base = fclr + GIC_FIRST_LPI; lpic->lpi_num = nvecs; lpic->lpi_free = lpic->lpi_num; + lpic->lpi_col_ids = col_ids; + for (i = 0; i < lpic->lpi_num; i++) { + /* + * Initially all interrupts go to CPU0 but can be moved + * to another CPU by bus_bind_intr() or interrupts shuffling. + */ + lpic->lpi_col_ids[i] = 0; + } + mtx_unlock_spin(&sc->its_dev_lock); return (0); } @@ -885,6 +908,7 @@ lpi_free_chunk(struct gic_v3_its_softc * KASSERT((lpic->lpi_free == lpic->lpi_num), ("Trying to free LPI chunk that is still in use.\n")); + mtx_lock_spin(&sc->its_dev_lock); /* First bit of this chunk in a global bitmap */ start = lpic->lpi_base - GIC_FIRST_LPI; /* and last bit of this chunk... */ @@ -892,6 +916,10 @@ lpi_free_chunk(struct gic_v3_its_softc * /* Finally free this chunk */ bit_nclear(bitmap, start, end); + mtx_unlock_spin(&sc->its_dev_lock); + + free(lpic->lpi_col_ids, M_GIC_V3_ITS); + lpic->lpi_col_ids = NULL; } static void @@ -953,6 +981,32 @@ lpi_xmask_irq(device_t parent, uint32_t (unmask == TRUE) ? "unmask" : "mask", irq); } +int +lpi_migrate(device_t parent, uint32_t irq, u_int cpuid) +{ + struct gic_v3_its_softc *sc; + struct its_dev *its_dev; + struct its_col *col; + + sc = its_sc; + mtx_lock_spin(&sc->its_dev_lock); + its_dev = its_device_find_locked(sc, NULL, irq); + mtx_unlock_spin(&sc->its_dev_lock); + if (its_dev == NULL) { + /* Cannot migrate not configured LPI */ + return (ENXIO); + } + + /* Find local device's interrupt identifier */ + irq = irq - its_dev->lpis.lpi_base; + /* Move interrupt to another collection */ + col = sc->its_cols[cpuid]; + its_cmd_movi(sc, its_dev, col, irq); + its_dev->lpis.lpi_col_ids[irq] = cpuid; + + return (0); +} + void lpi_unmask_irq(device_t parent, uint32_t irq) { @@ -1053,6 +1107,20 @@ cmd_fix_endian(struct its_cmd *cmd) } static void +its_cmd_movi(struct gic_v3_its_softc *sc, struct its_dev *its_dev, + struct its_col *col, uint32_t id) +{ + struct its_cmd_desc desc; + + desc.cmd_type = ITS_CMD_MOVI; + desc.cmd_desc_movi.its_dev = its_dev; + desc.cmd_desc_movi.col = col; + desc.cmd_desc_movi.id = id; + + its_cmd_send(sc, &desc); +} + +static void its_cmd_mapc(struct gic_v3_its_softc *sc, struct its_col *col, uint8_t valid) { struct its_cmd_desc desc; @@ -1073,9 +1141,15 @@ its_cmd_mapvi(struct gic_v3_its_softc *s uint32_t id, uint32_t pid) { struct its_cmd_desc desc; + struct its_col *col; + u_int col_id; + + col_id = its_dev->lpis.lpi_col_ids[id]; + col = sc->its_cols[col_id]; desc.cmd_type = ITS_CMD_MAPVI; desc.cmd_desc_mapvi.its_dev = its_dev; + desc.cmd_desc_mapvi.col = col; desc.cmd_desc_mapvi.id = id; desc.cmd_desc_mapvi.pid = pid; @@ -1083,14 +1157,23 @@ its_cmd_mapvi(struct gic_v3_its_softc *s } static void __unused -its_cmd_mapi(struct gic_v3_its_softc *sc, struct its_dev *its_dev, - uint32_t lpinum) +its_cmd_mapi(struct gic_v3_its_softc *sc, struct its_dev *its_dev, uint32_t pid) { struct its_cmd_desc desc; + struct its_col *col; + u_int col_id; + uint32_t id; + + KASSERT(pid >= its_dev->lpis.lpi_base, + ("%s: invalid pid: %d for the ITS device", __func__, pid)); + id = pid - its_dev->lpis.lpi_base; + col_id = its_dev->lpis.lpi_col_ids[id]; + col = sc->its_cols[col_id]; desc.cmd_type = ITS_CMD_MAPI; desc.cmd_desc_mapi.its_dev = its_dev; - desc.cmd_desc_mapi.lpinum = lpinum; + desc.cmd_desc_mapi.col = col; + desc.cmd_desc_mapi.pid = pid; its_cmd_send(sc, &desc); } @@ -1109,14 +1192,23 @@ its_cmd_mapd(struct gic_v3_its_softc *sc } static void -its_cmd_inv(struct gic_v3_its_softc *sc, struct its_dev *its_dev, - uint32_t lpinum) +its_cmd_inv(struct gic_v3_its_softc *sc, struct its_dev *its_dev, uint32_t pid) { struct its_cmd_desc desc; + struct its_col *col; + u_int col_id; + uint32_t id; + + KASSERT(pid >= its_dev->lpis.lpi_base, + ("%s: invalid pid: %d for the ITS device", __func__, pid)); + id = pid - its_dev->lpis.lpi_base; + col_id = its_dev->lpis.lpi_col_ids[id]; + col = sc->its_cols[col_id]; desc.cmd_type = ITS_CMD_INV; - desc.cmd_desc_inv.lpinum = lpinum - its_dev->lpis.lpi_base; + desc.cmd_desc_inv.pid = pid - its_dev->lpis.lpi_base; desc.cmd_desc_inv.its_dev = its_dev; + desc.cmd_desc_inv.col = col; its_cmd_send(sc, &desc); } @@ -1216,13 +1308,19 @@ its_cmd_prepare(struct its_cmd *cmd, str target = ITS_TARGET_NONE; switch (cmd_type) { + case ITS_CMD_MOVI: /* Move interrupt ID to another collection */ + target = desc->cmd_desc_movi.col->col_target; + cmd_format_command(cmd, ITS_CMD_MOVI); + cmd_format_id(cmd, desc->cmd_desc_movi.id); + cmd_format_col(cmd, desc->cmd_desc_movi.col->col_id); + cmd_format_devid(cmd, desc->cmd_desc_movi.its_dev->devid); + break; case ITS_CMD_SYNC: /* Wait for previous commands completion */ target = desc->cmd_desc_sync.col->col_target; cmd_format_command(cmd, ITS_CMD_SYNC); cmd_format_target(cmd, target); break; case ITS_CMD_MAPD: /* Assign ITT to device */ - target = desc->cmd_desc_mapd.its_dev->col->col_target; cmd_format_command(cmd, ITS_CMD_MAPD); cmd_format_itt(cmd, vtophys(desc->cmd_desc_mapd.its_dev->itt)); /* @@ -1249,25 +1347,25 @@ its_cmd_prepare(struct its_cmd *cmd, str cmd_format_target(cmd, target); break; case ITS_CMD_MAPVI: - target = desc->cmd_desc_mapvi.its_dev->col->col_target; + target = desc->cmd_desc_mapvi.col->col_target; cmd_format_command(cmd, ITS_CMD_MAPVI); cmd_format_devid(cmd, desc->cmd_desc_mapvi.its_dev->devid); cmd_format_id(cmd, desc->cmd_desc_mapvi.id); cmd_format_pid(cmd, desc->cmd_desc_mapvi.pid); - cmd_format_col(cmd, desc->cmd_desc_mapvi.its_dev->col->col_id); + cmd_format_col(cmd, desc->cmd_desc_mapvi.col->col_id); break; case ITS_CMD_MAPI: - target = desc->cmd_desc_mapi.its_dev->col->col_target; + target = desc->cmd_desc_mapi.col->col_target; cmd_format_command(cmd, ITS_CMD_MAPI); cmd_format_devid(cmd, desc->cmd_desc_mapi.its_dev->devid); - cmd_format_id(cmd, desc->cmd_desc_mapi.lpinum); - cmd_format_col(cmd, desc->cmd_desc_mapi.its_dev->col->col_id); + cmd_format_id(cmd, desc->cmd_desc_mapi.pid); + cmd_format_col(cmd, desc->cmd_desc_mapi.col->col_id); break; case ITS_CMD_INV: - target = desc->cmd_desc_inv.its_dev->col->col_target; + target = desc->cmd_desc_inv.col->col_target; cmd_format_command(cmd, ITS_CMD_INV); cmd_format_devid(cmd, desc->cmd_desc_inv.its_dev->devid); - cmd_format_id(cmd, desc->cmd_desc_inv.lpinum); + cmd_format_id(cmd, desc->cmd_desc_inv.pid); break; case ITS_CMD_INVALL: cmd_format_command(cmd, ITS_CMD_INVALL); @@ -1367,16 +1465,28 @@ end: return (0); } +/* Find ITS device descriptor by pci_dev or irq number */ static struct its_dev * -its_device_find_locked(struct gic_v3_its_softc *sc, device_t pci_dev) +its_device_find_locked(struct gic_v3_its_softc *sc, device_t pci_dev, + uint32_t irq) { struct its_dev *its_dev; + struct lpi_chunk *lpis; mtx_assert(&sc->its_dev_lock, MA_OWNED); + KASSERT((pci_dev == NULL || irq == 0), + ("%s: Can't search by both pci_dev and irq number", __func__)); /* Find existing device if any */ TAILQ_FOREACH(its_dev, &sc->its_dev_list, entry) { - if (its_dev->pci_dev == pci_dev) - return (its_dev); + if (pci_dev != NULL) { + if (its_dev->pci_dev == pci_dev) + return (its_dev); + } else if (irq != 0) { + lpis = &its_dev->lpis; + if ((irq >= lpis->lpi_base) && + (irq < (lpis->lpi_base + lpis->lpi_num))) + return (its_dev); + } } return (NULL); @@ -1389,13 +1499,12 @@ its_device_alloc(struct gic_v3_its_softc struct its_dev *newdev; uint64_t typer; uint32_t devid; - u_int cpuid; size_t esize; int err; mtx_lock_spin(&sc->its_dev_lock); /* Find existing device if any */ - newdev = its_device_find_locked(sc, pci_dev); + newdev = its_device_find_locked(sc, pci_dev, 0); mtx_unlock_spin(&sc->its_dev_lock); if (newdev != NULL) return (newdev); @@ -1410,9 +1519,7 @@ its_device_alloc(struct gic_v3_its_softc newdev->pci_dev = pci_dev; newdev->devid = devid; - mtx_lock_spin(&sc->its_dev_lock); err = lpi_alloc_chunk(sc, &newdev->lpis, nvecs); - mtx_unlock_spin(&sc->its_dev_lock); if (err != 0) { free(newdev, M_GIC_V3_ITS); return (NULL); @@ -1429,20 +1536,11 @@ its_device_alloc(struct gic_v3_its_softc roundup2(roundup2(nvecs, 2) * esize, 0x100), M_GIC_V3_ITS, (M_NOWAIT | M_ZERO), 0, ~0UL, 0x100, 0); if (newdev->itt == 0) { - mtx_lock_spin(&sc->its_dev_lock); lpi_free_chunk(sc, &newdev->lpis); - mtx_unlock_spin(&sc->its_dev_lock); free(newdev, M_GIC_V3_ITS); return (NULL); } - /* - * Initially all interrupts go to CPU0 but can be moved - * to another CPU by bus_bind_intr() or interrupts shuffling. - */ - cpuid = 0; - newdev->col = sc->its_cols[cpuid]; - mtx_lock_spin(&sc->its_dev_lock); TAILQ_INSERT_TAIL(&sc->its_dev_list, newdev, entry); mtx_unlock_spin(&sc->its_dev_lock); Modified: head/sys/arm64/arm64/gic_v3_var.h ============================================================================== --- head/sys/arm64/arm64/gic_v3_var.h Thu Feb 11 12:03:11 2016 (r295518) +++ head/sys/arm64/arm64/gic_v3_var.h Thu Feb 11 12:04:58 2016 (r295519) @@ -96,6 +96,7 @@ struct lpi_chunk { u_int lpi_base; u_int lpi_num; u_int lpi_free; /* First free LPI in set */ + u_int *lpi_col_ids; }; /* ITS device */ @@ -109,8 +110,6 @@ struct its_dev { struct lpi_chunk lpis; /* Virtual address of ITT */ vm_offset_t itt; - /* Interrupt collection */ - struct its_col * col; }; TAILQ_HEAD(its_dev_list, its_dev); @@ -133,6 +132,7 @@ struct its_cmd { }; /* ITS commands encoding */ +#define ITS_CMD_MOVI (0x01) #define ITS_CMD_SYNC (0x05) #define ITS_CMD_MAPD (0x08) #define ITS_CMD_MAPC (0x09) @@ -172,6 +172,12 @@ struct its_cmd_desc { union { struct { + struct its_dev *its_dev; + struct its_col *col; + uint32_t id; + } cmd_desc_movi; + + struct { struct its_col *col; } cmd_desc_sync; @@ -182,13 +188,15 @@ struct its_cmd_desc { struct { struct its_dev *its_dev; + struct its_col *col; uint32_t pid; uint32_t id; } cmd_desc_mapvi; struct { struct its_dev *its_dev; - uint32_t lpinum; + struct its_col *col; + uint32_t pid; } cmd_desc_mapi; struct { @@ -198,7 +206,8 @@ struct its_cmd_desc { struct { struct its_dev *its_dev; - uint32_t lpinum; + struct its_col *col; + uint32_t pid; } cmd_desc_inv; struct { @@ -257,6 +266,7 @@ int gic_v3_its_map_msi(device_t, device_ int its_init_cpu(struct gic_v3_its_softc *); +int lpi_migrate(device_t, uint32_t, u_int); void lpi_unmask_irq(device_t, uint32_t); void lpi_mask_irq(device_t, uint32_t); /* From owner-svn-src-all@freebsd.org Thu Feb 11 12:42:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D265FAA4F67 for ; Thu, 11 Feb 2016 12:42:13 +0000 (UTC) (envelope-from se@freebsd.org) Received: from mailout05.t-online.de (mailout05.t-online.de [194.25.134.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout00.t-online.de", Issuer "TeleSec ServerPass DE-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 636FC3B5; Thu, 11 Feb 2016 12:42:13 +0000 (UTC) (envelope-from se@freebsd.org) Received: from fwd08.aul.t-online.de (fwd08.aul.t-online.de [172.20.26.151]) by mailout05.t-online.de (Postfix) with SMTP id E7490D3767; Thu, 11 Feb 2016 13:33:26 +0100 (CET) Received: from [192.168.119.17] (ZGWexkZcQhriTiz5WEu+MWjVwusWtpQFx+Mf3qnhNqm3kmt0JjKbk0-5-zTpooZwZp@[87.151.208.3]) by fwd08.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-SHA encrypted) esmtp id 1aTqR2-38BHGK0; Thu, 11 Feb 2016 13:33:24 +0100 Subject: Re: svn commit: r295465 - head/usr.sbin/services_mkdb To: svn-src-all@freebsd.org References: <201602100940.u1A9ejb6086175@repo.freebsd.org> <20160211091516.GA37735@walton.maths.tcd.ie> From: Stefan Esser X-Enigmail-Draft-Status: N1110 Message-ID: <56BC7F91.6060207@freebsd.org> Date: Thu, 11 Feb 2016 13:33:21 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160211091516.GA37735@walton.maths.tcd.ie> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-ID: ZGWexkZcQhriTiz5WEu+MWjVwusWtpQFx+Mf3qnhNqm3kmt0JjKbk0-5-zTpooZwZp X-TOI-MSGID: dd33142c-2ea2-45ef-b22f-7d625b076222 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 12:42:14 -0000 Am 11.02.2016 um 10:15 schrieb David Malone: > On Wed, Feb 10, 2016 at 09:40:45AM +0000, Stefan Esser wrote: >> Author: se >> Date: Wed Feb 10 09:40:45 2016 >> New Revision: 295465 >> URL: https://svnweb.freebsd.org/changeset/base/295465 >> >> Log: >> Remove O_SYNC from the options passed to dbmopen(). >> >> The services db is created as a temporary file that is moved over the >> existing file after completion. Thus there is no need to immediately >> flush all created db records to the temporary file. > > This was changed to fix a problem with fsync not being called, which > can leave the db files empty after a sudden reboot. O_SYNC is not > the right fix, but I think I've found the real problem and there > is an open phabricator report on this, which fixes the problem in > a better way: > > https://reviews.freebsd.org/D5186 I added the following information as a comment to D5168: - I think that buffers are flushed in hdestroy() in hash.c, at least there is a comment that seems to indicate this. - Tests showed that the _mdb commands create bitwise identical files with or without O_SYNC (and without the _fsync() calls you suggest in D5168). - The cap_mkdb command does also use dbopen(O_SYNC) and completes in less than 1 second instead of more than 25 with O_SYNC removed. BTW there is one further problem in services_mkdb: There is a check for the existence of the temporary output file and if a second instance of services_mkdb is started, it will terminate, but only *after unlinking the other instance's temp output file*. Due to the speed-up without O_SYNC the time window is much smaller now, but I can easily provoke this even with the faster version: # services_mkdb -qo /tmp/xx.db & services_mkdb -qo /tmp/xx.db [2] 71869 services_mkdb: Error opening temporary database `/tmp/xx.db.tmp': File exists # services_mkdb-SYNC: Cannot rename `/tmp/xx.db.tmp' to `/tmp/xx.db': No such file or directory [2]- Exit 1 services_mkdb -qo /tmp/xx.db The second process detects that the temp output file exists complains and deletes it. When the first process completed the creation of the db, it tries to rename the file (that has already been removed by the second command). A better approach might be to have the second process unlink the temp file, but then to continue after creation of its own temp file. Then the first process will still find that it cannot rename the temp file to its final name, but the second one will complete its temp file and then rename it to its final name. Regards, STefan From owner-svn-src-all@freebsd.org Thu Feb 11 13:15:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFCC3AA5D71; Thu, 11 Feb 2016 13:15:38 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 A71FB10B9; Thu, 11 Feb 2016 13:15:38 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BDFbwH073252; Thu, 11 Feb 2016 13:15:37 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BDFbt2073248; Thu, 11 Feb 2016 13:15:37 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201602111315.u1BDFbt2073248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 11 Feb 2016 13:15:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295520 - in head/sys/powerpc: booke include powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 13:15:38 -0000 Author: jhibbits Date: Thu Feb 11 13:15:37 2016 New Revision: 295520 URL: https://svnweb.freebsd.org/changeset/base/295520 Log: Migrate the PTE format for book-e to standardize on the 'indirect PTE' format Summary: The revised Book-E spec, adding the specification for the MMUv2 and e6500, includes a hardware PTE layout for indirect page tables. In order to support this in the future, migrate the PTE format to match the MMUv2 hardware PTE format. Test Plan: Boot tested on a P5020 board. Booted to multiuser mode. Differential Revision: https://reviews.freebsd.org/D5224 Modified: head/sys/powerpc/booke/pmap.c head/sys/powerpc/booke/trap_subr.S head/sys/powerpc/include/pte.h head/sys/powerpc/powerpc/genassym.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Thu Feb 11 12:04:58 2016 (r295519) +++ head/sys/powerpc/booke/pmap.c Thu Feb 11 13:15:37 2016 (r295520) @@ -412,13 +412,13 @@ tlb_calc_wimg(vm_paddr_t pa, vm_memattr_ if (ma != VM_MEMATTR_DEFAULT) { switch (ma) { case VM_MEMATTR_UNCACHEABLE: - return (PTE_I | PTE_G); + return (MAS2_I | MAS2_G); case VM_MEMATTR_WRITE_COMBINING: case VM_MEMATTR_WRITE_BACK: case VM_MEMATTR_PREFETCHABLE: - return (PTE_I); + return (MAS2_I); case VM_MEMATTR_WRITE_THROUGH: - return (PTE_W | PTE_M); + return (MAS2_W | MAS2_M); } } @@ -900,8 +900,7 @@ pte_remove(mmu_t mmu, pmap_t pmap, vm_of tlb_miss_lock(); tlb0_flush_entry(va); - pte->flags = 0; - pte->rpn = 0; + *pte = 0; tlb_miss_unlock(); mtx_unlock_spin(&tlbivax_mutex); @@ -984,8 +983,8 @@ pte_enter(mmu_t mmu, pmap_t pmap, vm_pag pmap->pm_pdir[pdir_idx] = ptbl; } pte = &(pmap->pm_pdir[pdir_idx][ptbl_idx]); - pte->rpn = PTE_RPN_FROM_PA(VM_PAGE_TO_PHYS(m)); - pte->flags |= (PTE_VALID | flags); + *pte = PTE_RPN_FROM_PA(VM_PAGE_TO_PHYS(m)); + *pte |= (PTE_VALID | flags | PTE_PS_4KB); /* 4KB pages only */ tlb_miss_unlock(); mtx_unlock_spin(&tlbivax_mutex); @@ -1041,9 +1040,9 @@ kernel_pte_alloc(vm_offset_t data_end, v */ for (va = addr; va < data_end; va += PAGE_SIZE) { pte = &(kernel_pmap->pm_pdir[PDIR_IDX(va)][PTBL_IDX(va)]); - pte->rpn = kernload + (va - kernstart); - pte->flags = PTE_M | PTE_SR | PTE_SW | PTE_SX | PTE_WIRED | - PTE_VALID; + *pte = PTE_RPN_FROM_PA(kernload + (va - kernstart)); + *pte |= PTE_M | PTE_SR | PTE_SW | PTE_SX | PTE_WIRED | + PTE_VALID | PTE_PS_4KB; } } @@ -1525,7 +1524,8 @@ mmu_booke_kenter_attr(mmu_t mmu, vm_offs (va <= VM_MAX_KERNEL_ADDRESS)), ("mmu_booke_kenter: invalid va")); flags = PTE_SR | PTE_SW | PTE_SX | PTE_WIRED | PTE_VALID; - flags |= tlb_calc_wimg(pa, ma); + flags |= tlb_calc_wimg(pa, ma) << PTE_MAS2_SHIFT; + flags |= PTE_PS_4KB; pte = pte_find(mmu, kernel_pmap, va); @@ -1540,17 +1540,15 @@ mmu_booke_kenter_attr(mmu_t mmu, vm_offs tlb0_flush_entry(va); } - pte->rpn = PTE_RPN_FROM_PA(pa); - pte->flags = flags; + *pte = PTE_RPN_FROM_PA(pa) | flags; //debugf("mmu_booke_kenter: pdir_idx = %d ptbl_idx = %d va=0x%08x " // "pa=0x%08x rpn=0x%08x flags=0x%08x\n", // pdir_idx, ptbl_idx, va, pa, pte->rpn, pte->flags); /* Flush the real memory from the instruction cache. */ - if ((flags & (PTE_I | PTE_G)) == 0) { + if ((flags & (PTE_I | PTE_G)) == 0) __syncicache((void *)va, PAGE_SIZE); - } tlb_miss_unlock(); mtx_unlock_spin(&tlbivax_mutex); @@ -1584,8 +1582,7 @@ mmu_booke_kremove(mmu_t mmu, vm_offset_t /* Invalidate entry in TLB0, update PTE. */ tlb0_flush_entry(va); - pte->flags = 0; - pte->rpn = 0; + *pte = 0; tlb_miss_unlock(); mtx_unlock_spin(&tlbivax_mutex); @@ -1700,7 +1697,7 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t * Before actually updating pte->flags we calculate and * prepare its new value in a helper var. */ - flags = pte->flags; + flags = *pte; flags &= ~(PTE_UW | PTE_UX | PTE_SW | PTE_SX | PTE_MODIFIED); /* Wiring change, just update stats. */ @@ -1748,7 +1745,7 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t * are turning execute permissions on, icache should * be flushed. */ - if ((pte->flags & (PTE_UX | PTE_SX)) == 0) + if ((*pte & (PTE_UX | PTE_SX)) == 0) sync++; } @@ -1762,7 +1759,7 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t tlb_miss_lock(); tlb0_flush_entry(va); - pte->flags = flags; + *pte = flags; tlb_miss_unlock(); mtx_unlock_spin(&tlbivax_mutex); @@ -2069,7 +2066,7 @@ mmu_booke_protect(mmu_t mmu, pmap_t pmap vm_page_dirty(m); tlb0_flush_entry(va); - pte->flags &= ~(PTE_UW | PTE_SW | PTE_MODIFIED); + *pte &= ~(PTE_UW | PTE_SW | PTE_MODIFIED); tlb_miss_unlock(); mtx_unlock_spin(&tlbivax_mutex); @@ -2114,7 +2111,7 @@ mmu_booke_remove_write(mmu_t mmu, vm_pag vm_page_dirty(m); /* Flush mapping from TLB0. */ - pte->flags &= ~(PTE_UW | PTE_SW | PTE_MODIFIED); + *pte &= ~(PTE_UW | PTE_SW | PTE_MODIFIED); tlb_miss_unlock(); mtx_unlock_spin(&tlbivax_mutex); @@ -2194,7 +2191,7 @@ retry: else pte_wbit = PTE_UW; - if ((pte->flags & pte_wbit) || ((prot & VM_PROT_WRITE) == 0)) { + if ((*pte & pte_wbit) || ((prot & VM_PROT_WRITE) == 0)) { if (vm_page_pa_tryrelock(pmap, PTE_PA(pte), &pa)) goto retry; m = PHYS_TO_VM_PAGE(PTE_PA(pte)); @@ -2340,14 +2337,15 @@ mmu_booke_quick_enter_page(mmu_t mmu, vm paddr = VM_PAGE_TO_PHYS(m); flags = PTE_SR | PTE_SW | PTE_SX | PTE_WIRED | PTE_VALID; - flags |= tlb_calc_wimg(paddr, pmap_page_get_memattr(m)); + flags |= tlb_calc_wimg(paddr, pmap_page_get_memattr(m)) << PTE_MAS2_SHIFT; + flags |= PTE_PS_4KB; critical_enter(); qaddr = PCPU_GET(qmap_addr); pte = pte_find(mmu, kernel_pmap, qaddr); - KASSERT(pte->flags == 0, ("mmu_booke_quick_enter_page: PTE busy")); + KASSERT(*pte == 0, ("mmu_booke_quick_enter_page: PTE busy")); /* * XXX: tlbivax is broadcast to other cores, but qaddr should @@ -2357,8 +2355,7 @@ mmu_booke_quick_enter_page(mmu_t mmu, vm __asm __volatile("tlbivax 0, %0" :: "r"(qaddr & MAS2_EPN_MASK)); __asm __volatile("isync; msync"); - pte->rpn = paddr & ~PTE_PA_MASK; - pte->flags = flags; + *pte = PTE_RPN_FROM_PA(paddr) | flags; /* Flush the real memory from the instruction cache. */ if ((flags & (PTE_I | PTE_G)) == 0) @@ -2376,11 +2373,10 @@ mmu_booke_quick_remove_page(mmu_t mmu, v KASSERT(PCPU_GET(qmap_addr) == addr, ("mmu_booke_quick_remove_page: invalid address")); - KASSERT(pte->flags != 0, + KASSERT(*pte != 0, ("mmu_booke_quick_remove_page: PTE not in use")); - pte->flags = 0; - pte->rpn = 0; + *pte = 0; critical_exit(); } @@ -2494,9 +2490,9 @@ mmu_booke_clear_modify(mmu_t mmu, vm_pag mtx_lock_spin(&tlbivax_mutex); tlb_miss_lock(); - if (pte->flags & (PTE_SW | PTE_UW | PTE_MODIFIED)) { + if (*pte & (PTE_SW | PTE_UW | PTE_MODIFIED)) { tlb0_flush_entry(pv->pv_va); - pte->flags &= ~(PTE_SW | PTE_UW | PTE_MODIFIED | + *pte &= ~(PTE_SW | PTE_UW | PTE_MODIFIED | PTE_REFERENCED); } @@ -2538,7 +2534,7 @@ mmu_booke_ts_referenced(mmu_t mmu, vm_pa tlb_miss_lock(); tlb0_flush_entry(pv->pv_va); - pte->flags &= ~PTE_REFERENCED; + *pte &= ~PTE_REFERENCED; tlb_miss_unlock(); mtx_unlock_spin(&tlbivax_mutex); @@ -2577,7 +2573,7 @@ mmu_booke_unwire(mmu_t mmu, pmap_t pmap, if (!PTE_ISWIRED(pte)) panic("mmu_booke_unwire: pte %p isn't wired", pte); - pte->flags &= ~PTE_WIRED; + *pte &= ~PTE_WIRED; pmap->pm_stats.wired_count--; } } Modified: head/sys/powerpc/booke/trap_subr.S ============================================================================== --- head/sys/powerpc/booke/trap_subr.S Thu Feb 11 12:04:58 2016 (r295519) +++ head/sys/powerpc/booke/trap_subr.S Thu Feb 11 13:15:37 2016 (r295520) @@ -686,7 +686,7 @@ pte_lookup: * This load may cause a Data TLB miss for non-kernel pmap! */ lwz %r21, PTE_FLAGS(%r25) - andis. %r21, %r21, PTE_VALID@h + andi. %r21, %r21, PTE_VALID@l bne 2f 1: li %r25, 0 @@ -721,20 +721,21 @@ tlb_fill_entry: andi. %r22, %r21, (PTE_SW | PTE_UW)@l /* check if writable */ beq 2f - oris %r21, %r21, PTE_MODIFIED@h /* set modified bit */ + ori %r21, %r21, PTE_MODIFIED@l /* set modified bit */ 2: stwcx. %r21, %r23, %r25 /* write it back */ bne- 1b /* Update MAS2. */ - rlwimi %r27, %r21, 0, 27, 30 /* insert WIMG bits from pte */ + rlwimi %r27, %r21, 13, 27, 30 /* insert WIMG bits from pte */ /* Setup MAS3 value in r23. */ lwz %r23, PTE_RPN(%r25) /* get pte->rpn */ - rlwinm %r22, %r23, 12, 0, 20 /* extract MAS3 portion of RPN */ + rlwinm %r22, %r23, 20, 0, 11 /* extract MAS3 portion of RPN */ - rlwimi %r22, %r21, 24, 26, 31 /* insert protection bits from pte */ - rlwinm %r23, %r23, 12, 28, 31 /* MAS7 portion of RPN */ + rlwimi %r22, %r21, 30, 26, 31 /* insert protection bits from pte */ + rlwimi %r22, %r21, 20, 12, 19 /* insert lower 8 RPN bits to MAS3 */ + rlwinm %r23, %r23, 20, 24, 31 /* MAS7 portion of RPN */ /* Load MAS registers. */ mtspr SPR_MAS0, %r29 Modified: head/sys/powerpc/include/pte.h ============================================================================== --- head/sys/powerpc/include/pte.h Thu Feb 11 12:04:58 2016 (r295519) +++ head/sys/powerpc/include/pte.h Thu Feb 11 13:15:37 2016 (r295520) @@ -212,11 +212,7 @@ typedef struct lpte lpte_t; * page size is 4k (12-bit mask), so RPN can really fit into 24 bits. */ #ifndef LOCORE -struct pte { - vm_offset_t rpn; - uint32_t flags; -}; -typedef struct pte pte_t; +typedef uint64_t pte_t; #endif /* RPN mask, TLB0 4K pages */ @@ -225,13 +221,14 @@ typedef struct pte pte_t; #if defined(BOOKE_E500) /* PTE bits assigned to MAS2, MAS3 flags */ -#define PTE_W MAS2_W -#define PTE_I MAS2_I -#define PTE_M MAS2_M -#define PTE_G MAS2_G +#define PTE_MAS2_SHIFT 19 +#define PTE_W (MAS2_W << PTE_MAS2_SHIFT) +#define PTE_I (MAS2_I << PTE_MAS2_SHIFT) +#define PTE_M (MAS2_M << PTE_MAS2_SHIFT) +#define PTE_G (MAS2_G << PTE_MAS2_SHIFT) #define PTE_MAS2_MASK (MAS2_G | MAS2_M | MAS2_I | MAS2_W) -#define PTE_MAS3_SHIFT 8 +#define PTE_MAS3_SHIFT 2 #define PTE_UX (MAS3_UX << PTE_MAS3_SHIFT) #define PTE_SX (MAS3_SX << PTE_MAS3_SHIFT) #define PTE_UW (MAS3_UW << PTE_MAS3_SHIFT) @@ -241,6 +238,9 @@ typedef struct pte pte_t; #define PTE_MAS3_MASK ((MAS3_UX | MAS3_SX | MAS3_UW \ | MAS3_SW | MAS3_UR | MAS3_SR) << PTE_MAS3_SHIFT) +#define PTE_PS_SHIFT 8 +#define PTE_PS_4KB (2 << PTE_PS_SHIFT) + #elif defined(BOOKE_PPC4XX) #define PTE_WL1 TLB_WL1 @@ -262,21 +262,21 @@ typedef struct pte pte_t; #endif /* Other PTE flags */ -#define PTE_VALID 0x80000000 /* Valid */ -#define PTE_MODIFIED 0x40000000 /* Modified */ -#define PTE_WIRED 0x20000000 /* Wired */ -#define PTE_MANAGED 0x10000000 /* Managed */ -#define PTE_REFERENCED 0x04000000 /* Referenced */ +#define PTE_VALID 0x00000001 /* Valid */ +#define PTE_MODIFIED 0x00001000 /* Modified */ +#define PTE_WIRED 0x00002000 /* Wired */ +#define PTE_MANAGED 0x00000002 /* Managed */ +#define PTE_REFERENCED 0x00040000 /* Referenced */ /* Macro argument must of pte_t type. */ -#define PTE_PA_SHIFT 12 -#define PTE_RPN_FROM_PA(pa) ((pa) >> PTE_PA_SHIFT) -#define PTE_PA(pte) ((vm_paddr_t)((pte)->rpn) << PTE_PA_SHIFT) -#define PTE_ISVALID(pte) ((pte)->flags & PTE_VALID) -#define PTE_ISWIRED(pte) ((pte)->flags & PTE_WIRED) -#define PTE_ISMANAGED(pte) ((pte)->flags & PTE_MANAGED) -#define PTE_ISMODIFIED(pte) ((pte)->flags & PTE_MODIFIED) -#define PTE_ISREFERENCED(pte) ((pte)->flags & PTE_REFERENCED) +#define PTE_ARPN_SHIFT 12 +#define PTE_RPN_FROM_PA(pa) (((pa) & ~PAGE_MASK) << PTE_ARPN_SHIFT) +#define PTE_PA(pte) ((vm_paddr_t)(*pte >> PTE_ARPN_SHIFT) & ~PAGE_MASK) +#define PTE_ISVALID(pte) ((*pte) & PTE_VALID) +#define PTE_ISWIRED(pte) ((*pte) & PTE_WIRED) +#define PTE_ISMANAGED(pte) ((*pte) & PTE_MANAGED) +#define PTE_ISMODIFIED(pte) ((*pte) & PTE_MODIFIED) +#define PTE_ISREFERENCED(pte) ((*pte) & PTE_REFERENCED) #endif /* BOOKE */ #endif /* _MACHINE_PTE_H_ */ Modified: head/sys/powerpc/powerpc/genassym.c ============================================================================== --- head/sys/powerpc/powerpc/genassym.c Thu Feb 11 12:04:58 2016 (r295519) +++ head/sys/powerpc/powerpc/genassym.c Thu Feb 11 13:15:37 2016 (r295520) @@ -119,8 +119,12 @@ ASSYM(USER_SR, USER_SR); #endif #elif defined(BOOKE) ASSYM(PM_PDIR, offsetof(struct pmap, pm_pdir)); -ASSYM(PTE_RPN, offsetof(struct pte, rpn)); -ASSYM(PTE_FLAGS, offsetof(struct pte, flags)); +/* + * With pte_t being a bitfield struct, these fields cannot be addressed via + * offsetof(). + */ +ASSYM(PTE_RPN, 0); +ASSYM(PTE_FLAGS, sizeof(uint32_t)); #if defined(BOOKE_E500) ASSYM(TLB0_ENTRY_SIZE, sizeof(struct tlb_entry)); #endif From owner-svn-src-all@freebsd.org Thu Feb 11 13:28:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0B2BAA41E9; Thu, 11 Feb 2016 13:28:54 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 7B08515BC; Thu, 11 Feb 2016 13:28:54 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BDSrcQ076304; Thu, 11 Feb 2016 13:28:53 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BDSrP5076300; Thu, 11 Feb 2016 13:28:53 GMT (envelope-from br@FreeBSD.org) Message-Id: <201602111328.u1BDSrP5076300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 11 Feb 2016 13:28:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295521 - in head/sys: boot/fdt/dts/riscv riscv/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 13:28:54 -0000 Author: br Date: Thu Feb 11 13:28:52 2016 New Revision: 295521 URL: https://svnweb.freebsd.org/changeset/base/295521 Log: o Move non-generic kernel configuration out from GENERIC. o Add kernel configuration for QEMU. Both SPIKE and QEMU kernel configs are temporary (until we will be able to obtain DTB from loader). Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Added: head/sys/boot/fdt/dts/riscv/qemu.dts (contents, props changed) head/sys/riscv/conf/QEMU (contents, props changed) head/sys/riscv/conf/SPIKE (contents, props changed) Modified: head/sys/riscv/conf/GENERIC Added: head/sys/boot/fdt/dts/riscv/qemu.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/riscv/qemu.dts Thu Feb 11 13:28:52 2016 (r295521) @@ -0,0 +1,92 @@ +/*- + * Copyright (c) 2016 Ruslan Bukin + * All rights reserved. + * + * Portions of this software were developed by SRI International and the + * University of Cambridge Computer Laboratory under DARPA/AFRL contract + * FA8750-10-C-0237 ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Portions of this software were developed by the University of Cambridge + * Computer Laboratory as part of the CTSRD Project, with support from the + * UK Higher Education Innovation Fund (HEIF). + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/dts-v1/; + +/ { + model = "QEMU RV64I"; + compatible = "riscv,rv64i"; + #address-cells = <1>; + #size-cells = <1>; + #interrupt-cells = <1>; + + aliases { + console0 = &console0; + }; + + memory { + device_type = "memory"; + reg = <0x0 0x8000000>; /* 128MB at 0x0 */ + }; + + soc { + #address-cells = <2>; + #size-cells = <2>; + #interrupt-cells = <1>; + + compatible = "simple-bus"; + ranges; + + pic0: pic@0 { + compatible = "riscv,pic"; + interrupt-controller; + }; + + timer0: timer@0 { + compatible = "riscv,timer"; + interrupts = < 1 >; + interrupt-parent = < &pic0 >; + clock-frequency = < 400000000 >; + }; + + htif0: htif@0 { + compatible = "riscv,htif"; + interrupts = < 0 >; + interrupt-parent = < &pic0 >; + + console0: console@0 { + compatible = "htif,console"; + status = "okay"; + }; + }; + }; + + chosen { + bootargs = "-v"; + stdin = "console0"; + stdout = "console0"; + }; +}; Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Thu Feb 11 13:15:37 2016 (r295520) +++ head/sys/riscv/conf/GENERIC Thu Feb 11 13:28:52 2016 (r295521) @@ -98,7 +98,4 @@ device md # Memory "disks" device gif # IPv6 and IPv4 tunneling device firmware # firmware assist module -# RISCVTODO: This needs to be done via loader (when it's available). options FDT -options FDT_DTB_STATIC -makeoptions FDT_DTS_FILE=spike.dts Added: head/sys/riscv/conf/QEMU ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/conf/QEMU Thu Feb 11 13:28:52 2016 (r295521) @@ -0,0 +1,26 @@ +# +# Kernel configuration file for QEMU emulator. +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include GENERIC +ident QEMU + +# RISCVTODO: This needs to be done via loader (when it's available). +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=qemu.dts Added: head/sys/riscv/conf/SPIKE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/conf/SPIKE Thu Feb 11 13:28:52 2016 (r295521) @@ -0,0 +1,26 @@ +# +# Kernel configuration file for UCB Spike simulator. +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include GENERIC +ident SPIKE + +# RISCVTODO: This needs to be done via loader (when it's available). +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=spike.dts From owner-svn-src-all@freebsd.org Thu Feb 11 14:45:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD7E4AA4A58; Thu, 11 Feb 2016 14:45:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 8FA56B2F; Thu, 11 Feb 2016 14:45:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BEjI2p099641; Thu, 11 Feb 2016 14:45:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BEjIY5099640; Thu, 11 Feb 2016 14:45:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602111445.u1BEjIY5099640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 11 Feb 2016 14:45:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295522 - head/share/man/man8 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 14:45:19 -0000 Author: emaste Date: Thu Feb 11 14:45:18 2016 New Revision: 295522 URL: https://svnweb.freebsd.org/changeset/base/295522 Log: Explain that boot1.efi prefers ZFS over UFS Reported by: smh Modified: head/share/man/man8/uefi.8 Modified: head/share/man/man8/uefi.8 ============================================================================== --- head/share/man/man8/uefi.8 Thu Feb 11 13:28:52 2016 (r295521) +++ head/share/man/man8/uefi.8 Thu Feb 11 14:45:18 2016 (r295522) @@ -92,6 +92,13 @@ for The search begins with partitions on the device from which .Pa boot1.efi was loaded, and continues with other available partitions. +If both +.Li freebsd-ufs +and +.Li freebsd-zfs +partitions exist on the same device the +.Li freebsd-zfs +partition is preferred. .Pa boot1.efi then loads and executes .Pa loader.efi . From owner-svn-src-all@freebsd.org Thu Feb 11 15:27:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 892E5AA5F40; Thu, 11 Feb 2016 15:27:16 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 3D7C237C; Thu, 11 Feb 2016 15:27:16 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BFRFtM011285; Thu, 11 Feb 2016 15:27:15 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BFRFMe011283; Thu, 11 Feb 2016 15:27:15 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602111527.u1BFRFMe011283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 11 Feb 2016 15:27:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295523 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 15:27:16 -0000 Author: pfg Date: Thu Feb 11 15:27:14 2016 New Revision: 295523 URL: https://svnweb.freebsd.org/changeset/base/295523 Log: Ext4: Use boolean type instead of '0' and '1' There are precedents of uses of bool in the kernel and it is incorrect style to use integers as replacement for a boolean type. Modified: head/sys/fs/ext2fs/ext2_extents.c head/sys/fs/ext2fs/ext2_extents.h Modified: head/sys/fs/ext2fs/ext2_extents.c ============================================================================== --- head/sys/fs/ext2fs/ext2_extents.c Thu Feb 11 14:45:18 2016 (r295522) +++ head/sys/fs/ext2fs/ext2_extents.c Thu Feb 11 15:27:14 2016 (r295523) @@ -43,7 +43,7 @@ #include #include -static int +static bool ext4_ext_binsearch_index(struct inode *ip, struct ext4_extent_path *path, daddr_t lbn, daddr_t *first_lbn, daddr_t *last_lbn) { @@ -67,14 +67,14 @@ ext4_ext_binsearch_index(struct inode *i path->ep_sparse_ext.e_len = first->ei_blk - *first_lbn; path->ep_sparse_ext.e_start_hi = 0; path->ep_sparse_ext.e_start_lo = 0; - path->ep_is_sparse = 1; - return (1); + path->ep_is_sparse = true; + return (true); } path->ep_index = l - 1; *first_lbn = path->ep_index->ei_blk; if (path->ep_index < last) *last_lbn = l->ei_blk - 1; - return (0); + return (false); } static void @@ -103,7 +103,7 @@ ext4_ext_binsearch(struct inode *ip, str path->ep_sparse_ext.e_len = first->e_blk - first_lbn; path->ep_sparse_ext.e_start_hi = 0; path->ep_sparse_ext.e_start_lo = 0; - path->ep_is_sparse = 1; + path->ep_is_sparse = true; return; } path->ep_ext = l - 1; @@ -118,7 +118,7 @@ ext4_ext_binsearch(struct inode *ip, str path->ep_sparse_ext.e_blk + 1; path->ep_sparse_ext.e_start_hi = 0; path->ep_sparse_ext.e_start_lo = 0; - path->ep_is_sparse = 1; + path->ep_is_sparse = true; } } @@ -213,7 +213,7 @@ ext4_ext_find_extent(struct m_ext2fs *fs path->ep_depth = i; path->ep_ext = NULL; path->ep_index = NULL; - path->ep_is_sparse = 0; + path->ep_is_sparse = false; ext4_ext_binsearch(ip, path, lbn, first_lbn, last_lbn); return (path); Modified: head/sys/fs/ext2fs/ext2_extents.h ============================================================================== --- head/sys/fs/ext2fs/ext2_extents.h Thu Feb 11 14:45:18 2016 (r295522) +++ head/sys/fs/ext2fs/ext2_extents.h Thu Feb 11 15:27:14 2016 (r295523) @@ -84,7 +84,7 @@ struct ext4_extent_cache { struct ext4_extent_path { uint16_t ep_depth; struct buf *ep_bp; - int ep_is_sparse; + bool ep_is_sparse; union { struct ext4_extent ep_sparse_ext; struct ext4_extent *ep_ext; From owner-svn-src-all@freebsd.org Thu Feb 11 16:16:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CD8EAA5978; Thu, 11 Feb 2016 16:16:12 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 2526E1A9; Thu, 11 Feb 2016 16:16:12 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BGGB9e026010; Thu, 11 Feb 2016 16:16:11 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BGGBXI026007; Thu, 11 Feb 2016 16:16:11 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201602111616.u1BGGBXI026007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 11 Feb 2016 16:16: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: r295524 - in stable/10/sys: conf dev/ixgbe modules/ix modules/ixv X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 16:16:12 -0000 Author: sbruno Date: Thu Feb 11 16:16:10 2016 New Revision: 295524 URL: https://svnweb.freebsd.org/changeset/base/295524 Log: MFC r292674 Update ixgbe(4) to Intel FreeBSD Networking Group version 3.1.13-k. MFC r292571 and r292697 Add support for X552 and X550T. MFC r293334 Fix SFP module insertion post boot. MFC r293338 Fix VF handling of VLANs for Amazon Cloud. Reviewed by: erj smh ngie jeffrey.e.pieper@intel.com Approved by: re (marius) Relnotes: Yes Sponsored by: Intel Corporation and Limelight Networks Differential Revision: https://reviews.freebsd.org/D5117 Added: stable/10/sys/dev/ixgbe/ixgbe_osdep.c (contents, props changed) Deleted: stable/10/sys/dev/ixgbe/LICENSE Modified: stable/10/sys/conf/files stable/10/sys/dev/ixgbe/if_ix.c stable/10/sys/dev/ixgbe/if_ixv.c stable/10/sys/dev/ixgbe/ix_txrx.c stable/10/sys/dev/ixgbe/ixgbe.h stable/10/sys/dev/ixgbe/ixgbe_82598.c stable/10/sys/dev/ixgbe/ixgbe_82599.c stable/10/sys/dev/ixgbe/ixgbe_api.c stable/10/sys/dev/ixgbe/ixgbe_api.h stable/10/sys/dev/ixgbe/ixgbe_common.c stable/10/sys/dev/ixgbe/ixgbe_dcb.c stable/10/sys/dev/ixgbe/ixgbe_osdep.h stable/10/sys/dev/ixgbe/ixgbe_phy.c stable/10/sys/dev/ixgbe/ixgbe_phy.h stable/10/sys/dev/ixgbe/ixgbe_type.h stable/10/sys/dev/ixgbe/ixgbe_vf.c stable/10/sys/dev/ixgbe/ixgbe_x540.c stable/10/sys/dev/ixgbe/ixgbe_x550.c stable/10/sys/dev/ixgbe/ixgbe_x550.h stable/10/sys/modules/ix/Makefile stable/10/sys/modules/ixv/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Thu Feb 11 15:27:14 2016 (r295523) +++ stable/10/sys/conf/files Thu Feb 11 16:16:10 2016 (r295524) @@ -1728,6 +1728,8 @@ dev/ixgbe/ix_txrx.c optional ix inet | compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_phy.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" +dev/ixgbe/ixgbe_osdep.c optional ix inet | ixv inet | ixgbe inet \ + compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_api.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_common.c optional ix inet | ixv inet | ixgbe inet \ Modified: stable/10/sys/dev/ixgbe/if_ix.c ============================================================================== --- stable/10/sys/dev/ixgbe/if_ix.c Thu Feb 11 15:27:14 2016 (r295523) +++ stable/10/sys/dev/ixgbe/if_ix.c Thu Feb 11 16:16:10 2016 (r295524) @@ -46,14 +46,10 @@ #endif /********************************************************************* - * Set this to one to display debug statistics - *********************************************************************/ -int ixgbe_display_debug_stats = 0; - -/********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "3.1.0"; +char ixgbe_driver_version[] = "3.1.13-k"; + /********************************************************************* * PCI Device ID Table @@ -94,9 +90,11 @@ static ixgbe_vendor_info_t ixgbe_vendor_ {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T1, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550T, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550T1, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_KR, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_KX4, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_10G_T, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_SFP, 0, 0, 0}, /* required last entry */ {0, 0, 0, 0, 0} }; @@ -130,7 +128,7 @@ static void ixgbe_media_status(struc static int ixgbe_media_change(struct ifnet *); static void ixgbe_identify_hardware(struct adapter *); static int ixgbe_allocate_pci_resources(struct adapter *); -static void ixgbe_get_slot_info(struct ixgbe_hw *); +static void ixgbe_get_slot_info(struct adapter *); static int ixgbe_allocate_msix(struct adapter *); static int ixgbe_allocate_legacy(struct adapter *); static int ixgbe_setup_msix(struct adapter *); @@ -141,7 +139,6 @@ static void ixgbe_config_gpie(struct ada static void ixgbe_config_dmac(struct adapter *); static void ixgbe_config_delay_values(struct adapter *); static void ixgbe_config_link(struct adapter *); -static void ixgbe_check_eee_support(struct adapter *); static void ixgbe_check_wol_support(struct adapter *); static int ixgbe_setup_low_power_mode(struct adapter *); static void ixgbe_rearm_queues(struct adapter *, u64); @@ -150,6 +147,7 @@ static void ixgbe_initialize_transmi static void ixgbe_initialize_receive_units(struct adapter *); static void ixgbe_enable_rx_drop(struct adapter *); static void ixgbe_disable_rx_drop(struct adapter *); +static void ixgbe_initialize_rss_mapping(struct adapter *); static void ixgbe_enable_intr(struct adapter *); static void ixgbe_disable_intr(struct adapter *); @@ -170,19 +168,24 @@ static void ixgbe_add_hw_stats(struc /* Sysctl handlers */ static void ixgbe_set_sysctl_value(struct adapter *, const char *, - const char *, int *, int); + const char *, int *, int); static int ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS); static int ixgbe_set_advertise(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_thermal_test(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_dmac(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_phy_temp(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_phy_overtemp_occurred(SYSCTL_HANDLER_ARGS); +#ifdef IXGBE_DEBUG +static int ixgbe_sysctl_power_state(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_print_rss_config(SYSCTL_HANDLER_ARGS); +#endif static int ixgbe_sysctl_wol_enable(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_wufc(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_eee_enable(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_eee_negotiated(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_eee_rx_lpi_status(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_eee_tx_lpi_status(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_eee_tx_lpi_delay(SYSCTL_HANDLER_ARGS); /* Support for pluggable optic modules */ static bool ixgbe_sfp_probe(struct adapter *); @@ -446,9 +449,13 @@ ixgbe_attach(device_t dev) /* Allocate, clear, and link in our adapter structure */ adapter = device_get_softc(dev); - adapter->dev = adapter->osdep.dev = dev; + adapter->dev = dev; hw = &adapter->hw; +#ifdef DEV_NETMAP + adapter->init_locked = ixgbe_init_locked; + adapter->stop_locked = ixgbe_stop; +#endif /* Core Lock Init*/ IXGBE_CORE_LOCK_INIT(adapter, device_get_nameunit(dev)); @@ -531,18 +538,18 @@ ixgbe_attach(device_t dev) adapter->sfp_probe = TRUE; error = 0; } else if (error == IXGBE_ERR_SFP_NOT_SUPPORTED) { - device_printf(dev,"Unsupported SFP+ module detected!\n"); + device_printf(dev, "Unsupported SFP+ module detected!\n"); error = EIO; goto err_late; } else if (error) { - device_printf(dev,"Unable to initialize the shared code\n"); + device_printf(dev, "Unable to initialize the shared code\n"); error = EIO; goto err_late; } /* Make sure we have a good EEPROM before we read from it */ if (ixgbe_validate_eeprom_checksum(&adapter->hw, &csum) < 0) { - device_printf(dev,"The EEPROM Checksum Is Not Valid\n"); + device_printf(dev, "The EEPROM Checksum Is Not Valid\n"); error = EIO; goto err_late; } @@ -552,24 +559,21 @@ ixgbe_attach(device_t dev) case IXGBE_ERR_EEPROM_VERSION: device_printf(dev, "This device is a pre-production adapter/" "LOM. Please be aware there may be issues associated " - "with your hardware.\n If you are experiencing problems " + "with your hardware.\nIf you are experiencing problems " "please contact your Intel or hardware representative " "who provided you with this hardware.\n"); break; case IXGBE_ERR_SFP_NOT_SUPPORTED: - device_printf(dev,"Unsupported SFP+ Module\n"); + device_printf(dev, "Unsupported SFP+ Module\n"); error = EIO; goto err_late; case IXGBE_ERR_SFP_NOT_PRESENT: - device_printf(dev,"No SFP+ Module found\n"); + device_printf(dev, "No SFP+ Module found\n"); /* falls thru */ default: break; } - /* Detect and set physical type */ - ixgbe_setup_optics(adapter); - if ((adapter->msix > 1) && (ixgbe_enable_msix)) error = ixgbe_allocate_msix(adapter); else @@ -591,11 +595,12 @@ ixgbe_attach(device_t dev) ixgbe_unregister_vlan, adapter, EVENTHANDLER_PRI_FIRST); /* Check PCIE slot type/speed/width */ - ixgbe_get_slot_info(hw); - + ixgbe_get_slot_info(adapter); - /* Set an initial default flow control value */ + /* Set an initial default flow control & dmac value */ adapter->fc = ixgbe_fc_full; + adapter->dmac = 0; + adapter->eee_enabled = 0; #ifdef PCI_IOV if ((hw->mac.type != ixgbe_mac_82598EB) && (adapter->msix > 1)) { @@ -621,7 +626,6 @@ ixgbe_attach(device_t dev) /* Check for certain supported features */ ixgbe_check_wol_support(adapter); - ixgbe_check_eee_support(adapter); /* Add sysctls */ ixgbe_add_device_sysctls(adapter); @@ -682,6 +686,7 @@ ixgbe_detach(device_t dev) } #endif /* PCI_IOV */ + ether_ifdetach(adapter->ifp); /* Stop the adapter */ IXGBE_CORE_LOCK(adapter); ixgbe_setup_low_power_mode(adapter); @@ -723,7 +728,6 @@ ixgbe_detach(device_t dev) if (adapter->vlan_detach != NULL) EVENTHANDLER_DEREGISTER(vlan_unconfig, adapter->vlan_detach); - ether_ifdetach(adapter->ifp); callout_drain(&adapter->timer); #ifdef DEV_NETMAP netmap_detach(adapter->ifp); @@ -778,10 +782,6 @@ ixgbe_suspend(device_t dev) error = ixgbe_setup_low_power_mode(adapter); - /* Save state and power down */ - pci_save_state(dev); - pci_set_powerstate(dev, PCI_POWERSTATE_D3); - IXGBE_CORE_UNLOCK(adapter); return (error); @@ -799,9 +799,6 @@ ixgbe_resume(device_t dev) IXGBE_CORE_LOCK(adapter); - pci_set_powerstate(dev, PCI_POWERSTATE_D0); - pci_restore_state(dev); - /* Read & clear WUS register */ wus = IXGBE_READ_REG(hw, IXGBE_WUS); if (wus) @@ -820,7 +817,6 @@ ixgbe_resume(device_t dev) IXGBE_CORE_UNLOCK(adapter); - INIT_DEBUGOUT("ixgbe_resume: end"); return (0); } @@ -864,7 +860,7 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c ifp->if_flags |= IFF_UP; if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) ixgbe_init(adapter); -#if defined(INET) +#ifdef INET if (!(ifp->if_flags & IFF_NOARP)) arp_ifinit(ifp, ifa); #endif @@ -922,10 +918,21 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c break; case SIOCSIFCAP: { - int mask = ifr->ifr_reqcap ^ ifp->if_capenable; IOCTL_DEBUGOUT("ioctl: SIOCSIFCAP (Set Capabilities)"); - if (mask & IFCAP_HWCSUM) - ifp->if_capenable ^= IFCAP_HWCSUM; + + int mask = ifr->ifr_reqcap ^ ifp->if_capenable; + if (!mask) + break; + + /* HW cannot turn these on/off separately */ + if (mask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) { + ifp->if_capenable ^= IFCAP_RXCSUM; + ifp->if_capenable ^= IFCAP_RXCSUM_IPV6; + } + if (mask & IFCAP_TXCSUM) + ifp->if_capenable ^= IFCAP_TXCSUM; + if (mask & IFCAP_TXCSUM_IPV6) + ifp->if_capenable ^= IFCAP_TXCSUM_IPV6; if (mask & IFCAP_TSO4) ifp->if_capenable ^= IFCAP_TSO4; if (mask & IFCAP_TSO6) @@ -938,6 +945,7 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c ifp->if_capenable ^= IFCAP_VLAN_HWFILTER; if (mask & IFCAP_VLAN_HWTSO) ifp->if_capenable ^= IFCAP_VLAN_HWTSO; + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { IXGBE_CORE_LOCK(adapter); ixgbe_init_locked(adapter); @@ -981,6 +989,42 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c return (error); } +/* + * Set the various hardware offload abilities. + * + * This takes the ifnet's if_capenable flags (e.g. set by the user using + * ifconfig) and indicates to the OS via the ifnet's if_hwassist field what + * mbuf offload flags the driver will understand. + */ +static void +ixgbe_set_if_hwassist(struct adapter *adapter) +{ + struct ifnet *ifp = adapter->ifp; + + ifp->if_hwassist = 0; +#if __FreeBSD_version >= 1000000 + if (ifp->if_capenable & IFCAP_TSO4) + ifp->if_hwassist |= CSUM_IP_TSO; + if (ifp->if_capenable & IFCAP_TSO6) + ifp->if_hwassist |= CSUM_IP6_TSO; + if (ifp->if_capenable & IFCAP_TXCSUM) + ifp->if_hwassist |= (CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP | + CSUM_IP_SCTP); + if (ifp->if_capenable & IFCAP_TXCSUM_IPV6) + ifp->if_hwassist |= (CSUM_IP6_UDP | CSUM_IP6_TCP | + CSUM_IP6_SCTP); +#else + if (ifp->if_capenable & IFCAP_TSO) + ifp->if_hwassist |= CSUM_TSO; + if (ifp->if_capenable & IFCAP_TXCSUM) { + ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP); + struct ixgbe_hw *hw = &adapter->hw; + if (hw->mac.type != ixgbe_mac_82598EB) + ifp->if_hwassist |= CSUM_SCTP; + } +#endif +} + /********************************************************************* * Init entry point * @@ -1003,6 +1047,7 @@ ixgbe_init_locked(struct adapter *adapte struct rx_ring *rxr; u32 txdctl, mhadd; u32 rxdctl, rxctrl; + int err = 0; #ifdef PCI_IOV enum ixgbe_iov_mode mode; #endif @@ -1031,17 +1076,8 @@ ixgbe_init_locked(struct adapter *adapte ixgbe_set_rar(hw, 0, hw->mac.addr, adapter->pool, 1); hw->addr_ctrl.rar_used_count = 1; - /* Set the various hardware offload abilities */ - ifp->if_hwassist = 0; - if (ifp->if_capenable & IFCAP_TSO) - ifp->if_hwassist |= CSUM_TSO; - if (ifp->if_capenable & IFCAP_TXCSUM) { - ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP); -#if __FreeBSD_version >= 800000 - if (hw->mac.type != ixgbe_mac_82598EB) - ifp->if_hwassist |= CSUM_SCTP; -#endif - } + /* Set hardware offload abilities from ifnet flags */ + ixgbe_set_if_hwassist(adapter); /* Prepare transmit descriptors and buffers */ if (ixgbe_setup_transmit_structures(adapter)) { @@ -1059,10 +1095,7 @@ ixgbe_init_locked(struct adapter *adapte /* Setup Multicast table */ ixgbe_set_multi(adapter); - /* - ** Determine the correct mbuf pool - ** for doing jumbo frames - */ + /* Determine the correct mbuf pool, based on frame size */ if (adapter->max_frame_size <= MCLBYTES) adapter->rx_mbuf_sz = MCLBYTES; else @@ -1198,7 +1231,7 @@ ixgbe_init_locked(struct adapter *adapte * need to be kick-started */ if (hw->phy.type == ixgbe_phy_none) { - int err = hw->phy.ops.identify(hw); + err = hw->phy.ops.identify(hw); if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { device_printf(dev, "Unsupported SFP+ module type was detected.\n"); @@ -1210,7 +1243,11 @@ ixgbe_init_locked(struct adapter *adapte IXGBE_WRITE_REG(hw, IXGBE_EITR(adapter->vector), IXGBE_LINK_ITR); /* Configure Energy Efficient Ethernet for supported devices */ - ixgbe_setup_eee(hw, adapter->eee_enabled); + if (hw->mac.ops.setup_eee) { + err = hw->mac.ops.setup_eee(hw, adapter->eee_enabled); + if (err) + device_printf(dev, "Error setting up EEE: %d\n", err); + } /* Config/Enable Link */ ixgbe_config_link(adapter); @@ -1280,7 +1317,7 @@ ixgbe_config_gpie(struct adapter *adapte /* * Thermal Failure Detection (X540) - * Link Detection (X557) + * Link Detection (X552 SFP+, X552/X557-AT) */ if (hw->mac.type == ixgbe_mac_X540 || hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP || @@ -1588,6 +1625,9 @@ ixgbe_msix_link(void *arg) ++adapter->link_irq; + /* Pause other interrupts */ + IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_EIMC_OTHER); + /* First get the cause */ reg_eicr = IXGBE_READ_REG(hw, IXGBE_EICS); /* Be sure the queue bits are not cleared */ @@ -1596,8 +1636,10 @@ ixgbe_msix_link(void *arg) IXGBE_WRITE_REG(hw, IXGBE_EICR, reg_eicr); /* Link status change */ - if (reg_eicr & IXGBE_EICR_LSC) + if (reg_eicr & IXGBE_EICR_LSC) { + IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_EIMC_LSC); taskqueue_enqueue(adapter->tq, &adapter->link_task); + } if (adapter->hw.mac.type != ixgbe_mac_82598EB) { #ifdef IXGBE_FDIR @@ -1611,14 +1653,14 @@ ixgbe_msix_link(void *arg) } else #endif if (reg_eicr & IXGBE_EICR_ECC) { - device_printf(adapter->dev, "\nCRITICAL: ECC ERROR!! " + device_printf(adapter->dev, "CRITICAL: ECC ERROR!! " "Please Reboot!!\n"); IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_ECC); } /* Check for over temp condition */ if (reg_eicr & IXGBE_EICR_TS) { - device_printf(adapter->dev, "\nCRITICAL: OVER TEMP!! " + device_printf(adapter->dev, "CRITICAL: OVER TEMP!! " "PHY IS SHUT DOWN!!\n"); device_printf(adapter->dev, "System shutdown required!\n"); IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_TS); @@ -1660,6 +1702,7 @@ ixgbe_msix_link(void *arg) taskqueue_enqueue(adapter->tq, &adapter->phy_task); } + /* Re-enable other interrupts */ IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, IXGBE_EIMS_OTHER); return; } @@ -1753,6 +1796,7 @@ ixgbe_media_status(struct ifnet * ifp, s ** XXX: These need to use the proper media types once ** they're added. */ +#ifndef IFM_ETH_XTYPE if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KR) switch (adapter->link_speed) { case IXGBE_LINK_SPEED_10GB_FULL: @@ -1778,6 +1822,33 @@ ixgbe_media_status(struct ifnet * ifp, s ifmr->ifm_active |= IFM_1000_CX | IFM_FDX; break; } +#else + if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KR) + switch (adapter->link_speed) { + case IXGBE_LINK_SPEED_10GB_FULL: + ifmr->ifm_active |= IFM_10G_KR | IFM_FDX; + break; + case IXGBE_LINK_SPEED_2_5GB_FULL: + ifmr->ifm_active |= IFM_2500_KX | IFM_FDX; + break; + case IXGBE_LINK_SPEED_1GB_FULL: + ifmr->ifm_active |= IFM_1000_KX | IFM_FDX; + break; + } + else if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KX4 + || layer & IXGBE_PHYSICAL_LAYER_1000BASE_KX) + switch (adapter->link_speed) { + case IXGBE_LINK_SPEED_10GB_FULL: + ifmr->ifm_active |= IFM_10G_KX4 | IFM_FDX; + break; + case IXGBE_LINK_SPEED_2_5GB_FULL: + ifmr->ifm_active |= IFM_2500_KX | IFM_FDX; + break; + case IXGBE_LINK_SPEED_1GB_FULL: + ifmr->ifm_active |= IFM_1000_KX | IFM_FDX; + break; + } +#endif /* If nothing is recognized... */ if (IFM_SUBTYPE(ifmr->ifm_active) == 0) @@ -1820,13 +1891,14 @@ ixgbe_media_change(struct ifnet * ifp) return (EINVAL); if (hw->phy.media_type == ixgbe_media_type_backplane) - return (EPERM); + return (ENODEV); /* ** We don't actually need to check against the supported ** media types of the adapter; ifmedia will take care of ** that for us. */ +#ifndef IFM_ETH_XTYPE switch (IFM_SUBTYPE(ifm->ifm_media)) { case IFM_AUTO: case IFM_10G_T: @@ -1852,6 +1924,33 @@ ixgbe_media_change(struct ifnet * ifp) default: goto invalid; } +#else + switch (IFM_SUBTYPE(ifm->ifm_media)) { + case IFM_AUTO: + case IFM_10G_T: + speed |= IXGBE_LINK_SPEED_100_FULL; + case IFM_10G_LRM: + case IFM_10G_KR: + case IFM_10G_LR: + case IFM_10G_KX4: + speed |= IXGBE_LINK_SPEED_1GB_FULL; + case IFM_10G_TWINAX: + speed |= IXGBE_LINK_SPEED_10GB_FULL; + break; + case IFM_1000_T: + speed |= IXGBE_LINK_SPEED_100_FULL; + case IFM_1000_LX: + case IFM_1000_SX: + case IFM_1000_KX: + speed |= IXGBE_LINK_SPEED_1GB_FULL; + break; + case IFM_100_TX: + speed |= IXGBE_LINK_SPEED_100_FULL; + break; + default: + goto invalid; + } +#endif hw->mac.autotry_restart = TRUE; hw->mac.ops.setup_link(hw, speed, TRUE); @@ -2392,7 +2491,7 @@ ixgbe_allocate_msix(struct adapter *adap return (error); } #if __FreeBSD_version >= 800504 - bus_describe_intr(dev, que->res, que->tag, "que %d", i); + bus_describe_intr(dev, que->res, que->tag, "q%d", i); #endif que->msix = vector; adapter->active_queues |= (u64)(1 << que->msix); @@ -2443,8 +2542,8 @@ ixgbe_allocate_msix(struct adapter *adap device_get_nameunit(adapter->dev), cpu_id); #else - taskqueue_start_threads(&que->tq, 1, PI_NET, "%s que", - device_get_nameunit(adapter->dev)); + taskqueue_start_threads(&que->tq, 1, PI_NET, "%s:q%d", + device_get_nameunit(adapter->dev), i); #endif } @@ -2522,7 +2621,7 @@ ixgbe_setup_msix(struct adapter *adapter } /* Figure out a reasonable auto config value */ - queues = (mp_ncpus > (msgs-1)) ? (msgs-1) : mp_ncpus; + queues = (mp_ncpus > (msgs - 1)) ? (msgs - 1) : mp_ncpus; #ifdef RSS /* If we're doing RSS, clamp at the number of RSS buckets */ @@ -2532,6 +2631,9 @@ ixgbe_setup_msix(struct adapter *adapter if (ixgbe_num_queues != 0) queues = ixgbe_num_queues; + /* Set max queues to 8 when autoconfiguring */ + else if ((ixgbe_num_queues == 0) && (queues > 8)) + queues = 8; /* reflect correct sysctl value */ ixgbe_num_queues = queues; @@ -2568,12 +2670,12 @@ msi: rid, adapter->msix_mem); adapter->msix_mem = NULL; } - msgs = 1; - if (pci_alloc_msi(dev, &msgs) == 0) { - device_printf(adapter->dev,"Using an MSI interrupt\n"); + msgs = 1; + if (pci_alloc_msi(dev, &msgs) == 0) { + device_printf(adapter->dev, "Using an MSI interrupt\n"); return (msgs); } - device_printf(adapter->dev,"Using a Legacy interrupt\n"); + device_printf(adapter->dev, "Using a Legacy interrupt\n"); return (0); } @@ -2589,22 +2691,24 @@ ixgbe_allocate_pci_resources(struct adap &rid, RF_ACTIVE); if (!(adapter->pci_mem)) { - device_printf(dev,"Unable to allocate bus resource: memory\n"); + device_printf(dev, "Unable to allocate bus resource: memory\n"); return (ENXIO); } + /* Save bus_space values for READ/WRITE_REG macros */ adapter->osdep.mem_bus_space_tag = rman_get_bustag(adapter->pci_mem); adapter->osdep.mem_bus_space_handle = rman_get_bushandle(adapter->pci_mem); + /* Set hw values for shared code */ adapter->hw.hw_addr = (u8 *) &adapter->osdep.mem_bus_space_handle; + adapter->hw.back = adapter; - /* Legacy defaults */ + /* Default to 1 queue if MSI-X setup fails */ adapter->num_queues = 1; - adapter->hw.back = &adapter->osdep; /* - ** Now setup MSI or MSI/X, should + ** Now setup MSI or MSI-X, should ** return us the number of supported ** vectors. (Will be 1 for MSI) */ @@ -2729,13 +2833,22 @@ ixgbe_setup_interface(device_t dev, stru */ ifp->if_hdrlen = sizeof(struct ether_vlan_header); - ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_TSO | IFCAP_VLAN_HWCSUM; - ifp->if_capabilities |= IFCAP_JUMBO_MTU; - ifp->if_capabilities |= IFCAP_LRO; - ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING + /* Set capability flags */ + ifp->if_capabilities |= IFCAP_RXCSUM + | IFCAP_TXCSUM + | IFCAP_RXCSUM_IPV6 + | IFCAP_TXCSUM_IPV6 + | IFCAP_TSO4 + | IFCAP_TSO6 + | IFCAP_LRO + | IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWTSO + | IFCAP_VLAN_HWCSUM + | IFCAP_JUMBO_MTU | IFCAP_VLAN_MTU | IFCAP_HWSTATS; + + /* Enable the above capabilities by default */ ifp->if_capenable = ifp->if_capabilities; /* @@ -2755,9 +2868,10 @@ ixgbe_setup_interface(device_t dev, stru ifmedia_init(&adapter->media, IFM_IMASK, ixgbe_media_change, ixgbe_media_status); + adapter->phy_layer = ixgbe_get_supported_physical_layer(&adapter->hw); ixgbe_add_media_types(adapter); - /* Autoselect media by default */ + /* Set autoselect media by default */ ifmedia_set(&adapter->media, IFM_ETHER | IFM_AUTO); return (0); @@ -2770,7 +2884,7 @@ ixgbe_add_media_types(struct adapter *ad device_t dev = adapter->dev; int layer; - layer = adapter->phy_layer = ixgbe_get_supported_physical_layer(hw); + layer = adapter->phy_layer; /* Media types with matching FreeBSD media defines */ if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_T) @@ -2784,20 +2898,28 @@ ixgbe_add_media_types(struct adapter *ad layer & IXGBE_PHYSICAL_LAYER_SFP_ACTIVE_DA) ifmedia_add(&adapter->media, IFM_ETHER | IFM_10G_TWINAX, 0, NULL); - if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_LR) + if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_LR) { ifmedia_add(&adapter->media, IFM_ETHER | IFM_10G_LR, 0, NULL); - if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_SR) + if (hw->phy.multispeed_fiber) + ifmedia_add(&adapter->media, IFM_ETHER | IFM_1000_LX, 0, NULL); + } + if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_SR) { ifmedia_add(&adapter->media, IFM_ETHER | IFM_10G_SR, 0, NULL); + if (hw->phy.multispeed_fiber) + ifmedia_add(&adapter->media, IFM_ETHER | IFM_1000_SX, 0, NULL); + } else if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_SX) + ifmedia_add(&adapter->media, IFM_ETHER | IFM_1000_SX, 0, NULL); if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_CX4) ifmedia_add(&adapter->media, IFM_ETHER | IFM_10G_CX4, 0, NULL); - if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_SX) - ifmedia_add(&adapter->media, IFM_ETHER | IFM_1000_SX, 0, NULL); - /* - ** Other (no matching FreeBSD media type): - ** To workaround this, we'll assign these completely - ** inappropriate media types. - */ +#ifdef IFM_ETH_XTYPE + if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KR) + ifmedia_add(&adapter->media, IFM_ETHER | IFM_10G_KR, 0, NULL); + if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KX4) + ifmedia_add(&adapter->media, IFM_ETHER | IFM_10G_KX4, 0, NULL); + if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_KX) + ifmedia_add(&adapter->media, IFM_ETHER | IFM_1000_KX, 0, NULL); +#else if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KR) { device_printf(dev, "Media supported: 10GbaseKR\n"); device_printf(dev, "10GbaseKR mapped to 10GbaseSR\n"); @@ -2813,10 +2935,9 @@ ixgbe_add_media_types(struct adapter *ad device_printf(dev, "1000baseKX mapped to 1000baseCX\n"); ifmedia_add(&adapter->media, IFM_ETHER | IFM_1000_CX, 0, NULL); } - if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_BX) { - /* Someday, someone will care about you... */ +#endif + if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_BX) device_printf(dev, "Media supported: 1000baseBX\n"); - } if (hw->device_id == IXGBE_DEV_ID_82598AT) { ifmedia_add(&adapter->media, @@ -2838,12 +2959,7 @@ ixgbe_config_link(struct adapter *adapte sfp = ixgbe_is_sfp(hw); if (sfp) { - if (hw->phy.multispeed_fiber) { - hw->mac.ops.setup_sfp(hw); - ixgbe_enable_tx_laser(hw); - taskqueue_enqueue(adapter->tq, &adapter->msf_task); - } else - taskqueue_enqueue(adapter->tq, &adapter->mod_task); + taskqueue_enqueue(adapter->tq, &adapter->mod_task); } else { if (hw->mac.ops.check_link) err = ixgbe_check_link(hw, &adapter->link_speed, @@ -2877,7 +2993,6 @@ ixgbe_initialize_transmit_units(struct a struct ixgbe_hw *hw = &adapter->hw; /* Setup the Base and Length of the Tx Descriptor Ring */ - for (int i = 0; i < adapter->num_queues; i++, txr++) { u64 tdba = txr->txdma.dma_paddr; u32 txctrl = 0; @@ -2897,12 +3012,15 @@ ixgbe_initialize_transmit_units(struct a txr->tail = IXGBE_TDT(j); /* Disable Head Writeback */ + /* + * Note: for X550 series devices, these registers are actually + * prefixed with TPH_ isntead of DCA_, but the addresses and + * fields remain the same. + */ switch (hw->mac.type) { case ixgbe_mac_82598EB: txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL(j)); break; - case ixgbe_mac_82599EB: - case ixgbe_mac_X540: default: txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL_82599(j)); break; @@ -2912,8 +3030,6 @@ ixgbe_initialize_transmit_units(struct a case ixgbe_mac_82598EB: IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL(j), txctrl); break; - case ixgbe_mac_82599EB: - case ixgbe_mac_X540: default: IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL_82599(j), txctrl); break; @@ -2946,7 +3062,7 @@ ixgbe_initialize_transmit_units(struct a } static void -ixgbe_initialise_rss_mapping(struct adapter *adapter) +ixgbe_initialize_rss_mapping(struct adapter *adapter) { struct ixgbe_hw *hw = &adapter->hw; u32 reta = 0, mrqc, rss_key[10]; @@ -3081,7 +3197,6 @@ ixgbe_initialize_receive_units(struct ad u32 bufsz, fctrl, srrctl, rxcsum; u32 hlreg; - /* * Make sure receives are disabled while * setting up the descriptor ring @@ -3146,11 +3261,11 @@ ixgbe_initialize_receive_units(struct ad srrctl &= ~IXGBE_SRRCTL_DROP_EN; } - IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(i), srrctl); + IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(j), srrctl); /* Setup the HW Rx Head and Tail Descriptor Pointers */ - IXGBE_WRITE_REG(hw, IXGBE_RDH(i), 0); - IXGBE_WRITE_REG(hw, IXGBE_RDT(i), 0); + IXGBE_WRITE_REG(hw, IXGBE_RDH(j), 0); + IXGBE_WRITE_REG(hw, IXGBE_RDT(j), 0); /* Set the driver rx tail address */ rxr->tail = IXGBE_RDT(rxr->me); @@ -3166,7 +3281,7 @@ ixgbe_initialize_receive_units(struct ad rxcsum = IXGBE_READ_REG(hw, IXGBE_RXCSUM); - ixgbe_initialise_rss_mapping(adapter); + ixgbe_initialize_rss_mapping(adapter); if (adapter->num_queues > 1) { /* RSS and RX IPP Checksum are mutually exclusive */ @@ -3176,6 +3291,7 @@ ixgbe_initialize_receive_units(struct ad if (ifp->if_capenable & IFCAP_RXCSUM) rxcsum |= IXGBE_RXCSUM_PCSD; + /* This is useful for calculating UDP/IP fragment checksums */ if (!(rxcsum & IXGBE_RXCSUM_PCSD)) rxcsum |= IXGBE_RXCSUM_IPPCSE; @@ -3397,9 +3513,10 @@ ixgbe_disable_intr(struct adapter *adapt ** the slot this adapter is plugged into. */ static void -ixgbe_get_slot_info(struct ixgbe_hw *hw) +ixgbe_get_slot_info(struct adapter *adapter) { - device_t dev = ((struct ixgbe_osdep *)hw->back)->dev; + device_t dev = adapter->dev; + struct ixgbe_hw *hw = &adapter->hw; struct ixgbe_mac_info *mac = &hw->mac; u16 link; u32 offset; @@ -3606,12 +3723,12 @@ ixgbe_sfp_probe(struct adapter *adapter) goto out; ret = hw->phy.ops.reset(hw); if (ret == IXGBE_ERR_SFP_NOT_SUPPORTED) { - device_printf(dev,"Unsupported SFP+ module detected!"); - printf(" Reload driver with supported module.\n"); + device_printf(dev, "Unsupported SFP+ module detected!"); + device_printf(dev, "Reload driver with supported module.\n"); adapter->sfp_probe = FALSE; goto out; } else - device_printf(dev,"SFP+ module detected!\n"); + device_printf(dev, "SFP+ module detected!\n"); /* We now have supported optics */ adapter->sfp_probe = FALSE; /* Set the optics type so system reports correctly */ @@ -3630,10 +3747,14 @@ static void ixgbe_handle_link(void *context, int pending) { struct adapter *adapter = context; + struct ixgbe_hw *hw = &adapter->hw; - ixgbe_check_link(&adapter->hw, + ixgbe_check_link(hw, &adapter->link_speed, &adapter->link_up, 0); ixgbe_update_link_status(adapter); + + /* Re-enable link interrupts */ + IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EIMS_LSC); } /* @@ -3644,23 +3765,66 @@ ixgbe_handle_mod(void *context, int pend { struct adapter *adapter = context; struct ixgbe_hw *hw = &adapter->hw; + enum ixgbe_phy_type orig_type = hw->phy.type; device_t dev = adapter->dev; u32 err; + IXGBE_CORE_LOCK(adapter); + + /* Check to see if the PHY type changed */ + if (hw->phy.ops.identify) { + hw->phy.type = ixgbe_phy_unknown; + hw->phy.ops.identify(hw); + } + + if (hw->phy.type != orig_type) { + device_printf(dev, "Detected phy_type %d\n", hw->phy.type); + + if (hw->phy.type == ixgbe_phy_none) { + hw->phy.sfp_type = ixgbe_sfp_type_unknown; + goto out; + } + + /* Try to do the initialization that was skipped before */ + if (hw->phy.ops.init) + hw->phy.ops.init(hw); + if (hw->phy.ops.reset) + hw->phy.ops.reset(hw); + } + err = hw->phy.ops.identify_sfp(hw); if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { device_printf(dev, "Unsupported SFP+ module type was detected.\n"); - return; + goto out; } err = hw->mac.ops.setup_sfp(hw); if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { device_printf(dev, "Setup failure - unsupported SFP+ module type.\n"); - return; + goto out; } - taskqueue_enqueue(adapter->tq, &adapter->msf_task); + if (hw->phy.multispeed_fiber) + taskqueue_enqueue(adapter->tq, &adapter->msf_task); +out: + /* Update media type */ + switch (hw->mac.ops.get_media_type(hw)) { + case ixgbe_media_type_fiber: + adapter->optics = IFM_10G_SR; + break; + case ixgbe_media_type_copper: + adapter->optics = IFM_10G_TWINAX; + break; + case ixgbe_media_type_cx4: + adapter->optics = IFM_10G_CX4; + break; + default: + adapter->optics = 0; + break; + } + + IXGBE_CORE_UNLOCK(adapter); return; } @@ -3675,13 +3839,10 @@ ixgbe_handle_msf(void *context, int pend struct ixgbe_hw *hw = &adapter->hw; u32 autoneg; bool negotiate; - int err; - err = hw->phy.ops.identify_sfp(hw); - if (!err) { - ixgbe_setup_optics(adapter); - INIT_DEBUGOUT1("ixgbe_sfp_probe: flags: %X\n", adapter->optics); - } + IXGBE_CORE_LOCK(adapter); + /* get_supported_phy_layer will call hw->phy.ops.identify_sfp() */ + adapter->phy_layer = ixgbe_get_supported_physical_layer(hw); autoneg = hw->phy.autoneg_advertised; if ((!autoneg) && (hw->mac.ops.get_link_capabilities)) @@ -3689,8 +3850,10 @@ ixgbe_handle_msf(void *context, int pend if (hw->mac.ops.setup_link) hw->mac.ops.setup_link(hw, autoneg, TRUE); + /* Adjust media types shown in ifconfig */ ifmedia_removeall(&adapter->media); ixgbe_add_media_types(adapter); + IXGBE_CORE_UNLOCK(adapter); return; } @@ -3768,18 +3931,6 @@ ixgbe_config_dmac(struct adapter *adapte } /* - * Checks whether the adapter supports Energy Efficient Ethernet - * or not, based on device ID. - */ -static void -ixgbe_check_eee_support(struct adapter *adapter) -{ - struct ixgbe_hw *hw = &adapter->hw; - - adapter->eee_enabled = !!(hw->mac.ops.setup_eee); -} - -/* * Checks whether the adapter's ports are capable of * Wake On LAN by reading the adapter's NVM. * @@ -3797,8 +3948,8 @@ ixgbe_check_wol_support(struct adapter * ixgbe_get_device_caps(hw, &dev_caps); if ((dev_caps & IXGBE_DEVICE_CAPS_WOL_PORT0_1) || ((dev_caps & IXGBE_DEVICE_CAPS_WOL_PORT0) && - hw->bus.func == 0)) - adapter->wol_support = hw->wol_enabled = 1; + hw->bus.func == 0)) + adapter->wol_support = hw->wol_enabled = 1; /* Save initial wake up filter configuration */ adapter->wufc = IXGBE_READ_REG(hw, IXGBE_WUFC); @@ -4145,14 +4296,24 @@ ixgbe_add_device_sysctls(struct adapter CTLTYPE_INT | CTLFLAG_RW, adapter, 0, ixgbe_sysctl_thermal_test, "I", "Thermal Test"); - /* for X550 devices */ +#ifdef IXGBE_DEBUG + /* testing sysctls (for all devices) */ + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "power_state", + CTLTYPE_INT | CTLFLAG_RW, adapter, 0, + ixgbe_sysctl_power_state, "I", "PCI Power State"); + + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "print_rss_config", + CTLTYPE_STRING | CTLFLAG_RD, adapter, 0, + ixgbe_sysctl_print_rss_config, "A", "Prints RSS Configuration"); +#endif + /* for X550 series devices */ if (hw->mac.type >= ixgbe_mac_X550) SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "dmac", CTLTYPE_INT | CTLFLAG_RW, adapter, 0, ixgbe_sysctl_dmac, "I", "DMA Coalesce"); - /* for X550T and X550EM backplane devices */ - if (hw->mac.ops.setup_eee) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Feb 11 16:35:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 761D5AA41B9; Thu, 11 Feb 2016 16:35:17 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 49F37DFD; Thu, 11 Feb 2016 16:35:17 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BGZGAv031941; Thu, 11 Feb 2016 16:35:16 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BGZGTs031940; Thu, 11 Feb 2016 16:35:16 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201602111635.u1BGZGTs031940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 11 Feb 2016 16:35:16 +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: r295525 - stable/10/sys/dev/ixgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 16:35:17 -0000 Author: sbruno Date: Thu Feb 11 16:35:16 2016 New Revision: 295525 URL: https://svnweb.freebsd.org/changeset/base/295525 Log: Revert sysctl description change introduced in r295008 to correctly reflect the maximum number of queues supported (8) by this driver. Submitted by: jwd Reviewed by: erj Approved by: re (gjb) Sponsored by: Intel Corporation and Limelight Networks Modified: stable/10/sys/dev/ixgbe/if_ix.c Modified: stable/10/sys/dev/ixgbe/if_ix.c ============================================================================== --- stable/10/sys/dev/ixgbe/if_ix.c Thu Feb 11 16:16:10 2016 (r295524) +++ stable/10/sys/dev/ixgbe/if_ix.c Thu Feb 11 16:35:16 2016 (r295525) @@ -320,7 +320,8 @@ SYSCTL_INT(_hw_ix, OID_AUTO, enable_msix static int ixgbe_num_queues = 0; TUNABLE_INT("hw.ix.num_queues", &ixgbe_num_queues); SYSCTL_INT(_hw_ix, OID_AUTO, num_queues, CTLFLAG_RDTUN, &ixgbe_num_queues, 0, - "Number of queues to configure, 0 indicates autoconfigure"); + "Number of queues to configure up to a mximum of 8," + "0 indicates autoconfigure"); /* ** Number of TX descriptors per ring, From owner-svn-src-all@freebsd.org Thu Feb 11 16:39:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9741AAA4390; Thu, 11 Feb 2016 16:39:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 75401FC2; Thu, 11 Feb 2016 16:39:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BGdVT2032130; Thu, 11 Feb 2016 16:39:31 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BGdVT7032125; Thu, 11 Feb 2016 16:39:31 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201602111639.u1BGdVT7032125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 11 Feb 2016 16:39: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: r295526 - in stable/10/sys/dev/sfxge: . common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 16:39:32 -0000 Author: arybchik Date: Thu Feb 11 16:39:30 2016 New Revision: 295526 URL: https://svnweb.freebsd.org/changeset/base/295526 Log: MFC r295467 sfxge: implement SIOCGI2C to read information from phy modules The IOCTL is used by 'ifconfig -v' to show SFP+/QSFP+ information including inventory information and dianostics (temperature, light levels, voltage etc). Reviewed by: gnn,melifaro Approved by: re (gjb) Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/efx.h stable/10/sys/dev/sfxge/common/efx_mcdi.c stable/10/sys/dev/sfxge/common/efx_mcdi.h stable/10/sys/dev/sfxge/common/efx_phy.c stable/10/sys/dev/sfxge/sfxge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx.h Thu Feb 11 16:35:16 2016 (r295525) +++ stable/10/sys/dev/sfxge/common/efx.h Thu Feb 11 16:39:30 2016 (r295526) @@ -879,6 +879,14 @@ efx_phy_media_type_get( __in efx_nic_t *enp, __out efx_phy_media_type_t *typep); +extern efx_rc_t +efx_phy_module_get_info( + __in efx_nic_t *enp, + __in uint8_t dev_addr, + __in uint8_t offset, + __in uint8_t len, + __out_bcount(len) uint8_t *data); + #if EFSYS_OPT_PHY_STATS /* START MKCONFIG GENERATED PhyHeaderStatsBlock 30ed56ad501f8e36 */ Modified: stable/10/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_mcdi.c Thu Feb 11 16:35:16 2016 (r295525) +++ stable/10/sys/dev/sfxge/common/efx_mcdi.c Thu Feb 11 16:39:30 2016 (r295526) @@ -2078,5 +2078,217 @@ fail1: return (rc); } +/* + * Size of media information page in accordance with SFF-8472 and SFF-8436. + * It is used in MCDI interface as well. + */ +#define EFX_PHY_MEDIA_INFO_PAGE_SIZE 0x80 + +static __checkReturn efx_rc_t +efx_mcdi_get_phy_media_info( + __in efx_nic_t *enp, + __in uint32_t mcdi_page, + __in uint8_t offset, + __in uint8_t len, + __out_bcount(len) uint8_t *data) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_GET_PHY_MEDIA_INFO_IN_LEN, + MC_CMD_GET_PHY_MEDIA_INFO_OUT_LEN( + EFX_PHY_MEDIA_INFO_PAGE_SIZE))]; + efx_rc_t rc; + + EFSYS_ASSERT((uint32_t)offset + len <= EFX_PHY_MEDIA_INFO_PAGE_SIZE); + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_GET_PHY_MEDIA_INFO; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_GET_PHY_MEDIA_INFO_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = + MC_CMD_GET_PHY_MEDIA_INFO_OUT_LEN(EFX_PHY_MEDIA_INFO_PAGE_SIZE); + + MCDI_IN_SET_DWORD(req, GET_PHY_MEDIA_INFO_IN_PAGE, mcdi_page); + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (req.emr_out_length_used != + MC_CMD_GET_PHY_MEDIA_INFO_OUT_LEN(EFX_PHY_MEDIA_INFO_PAGE_SIZE)) { + rc = EMSGSIZE; + goto fail2; + } + + if (MCDI_OUT_DWORD(req, GET_PHY_MEDIA_INFO_OUT_DATALEN) != + EFX_PHY_MEDIA_INFO_PAGE_SIZE) { + rc = EIO; + goto fail3; + } + + memcpy(data, + MCDI_OUT2(req, uint8_t, GET_PHY_MEDIA_INFO_OUT_DATA) + offset, + len); + + return (0); + +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +/* + * 2-wire device address of the base information in accordance with SFF-8472 + * Diagnostic Monitoring Interface for Optical Transceivers section + * 4 Memory Organization. + */ +#define EFX_PHY_MEDIA_INFO_DEV_ADDR_SFP_BASE 0xA0 + +/* + * 2-wire device address of the digital diagnostics monitoring interface + * in accordance with SFF-8472 Diagnostic Monitoring Interface for Optical + * Transceivers section 4 Memory Organization. + */ +#define EFX_PHY_MEDIA_INFO_DEV_ADDR_SFP_DDM 0xA2 + +/* + * Hard wired 2-wire device address for QSFP+ in accordance with SFF-8436 + * QSFP+ 10 Gbs 4X PLUGGABLE TRANSCEIVER section 7.4 Device Addressing and + * Operation. + */ +#define EFX_PHY_MEDIA_INFO_DEV_ADDR_QSFP 0xA0 + + __checkReturn efx_rc_t +efx_mcdi_phy_module_get_info( + __in efx_nic_t *enp, + __in uint8_t dev_addr, + __in uint8_t offset, + __in uint8_t len, + __out_bcount(len) uint8_t *data) +{ + efx_port_t *epp = &(enp->en_port); + efx_rc_t rc; + uint32_t mcdi_lower_page; + uint32_t mcdi_upper_page; + + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); + + /* + * Map device address to MC_CMD_GET_PHY_MEDIA_INFO pages. + * Offset plus length interface allows to access page 0 only. + * I.e. non-zero upper pages are not accessible. + * See SFF-8472 section 4 Memory Organization and SFF-8436 section 7.6 + * QSFP+ Memory Map for details on how information is structured + * and accessible. + */ + switch (epp->ep_fixed_port_type) { + case EFX_PHY_MEDIA_SFP_PLUS: + /* + * In accordance with SFF-8472 Diagnostic Monitoring + * Interface for Optical Transceivers section 4 Memory + * Organization two 2-wire addresses are defined. + */ + switch (dev_addr) { + /* Base information */ + case EFX_PHY_MEDIA_INFO_DEV_ADDR_SFP_BASE: + /* + * MCDI page 0 should be used to access lower + * page 0 (0x00 - 0x7f) at the device address 0xA0. + */ + mcdi_lower_page = 0; + /* + * MCDI page 1 should be used to access upper + * page 0 (0x80 - 0xff) at the device address 0xA0. + */ + mcdi_upper_page = 1; + break; + /* Diagnostics */ + case EFX_PHY_MEDIA_INFO_DEV_ADDR_SFP_DDM: + /* + * MCDI page 2 should be used to access lower + * page 0 (0x00 - 0x7f) at the device address 0xA2. + */ + mcdi_lower_page = 2; + /* + * MCDI page 3 should be used to access upper + * page 0 (0x80 - 0xff) at the device address 0xA2. + */ + mcdi_upper_page = 3; + break; + default: + rc = ENOTSUP; + goto fail1; + } + break; + case EFX_PHY_MEDIA_QSFP_PLUS: + switch (dev_addr) { + case EFX_PHY_MEDIA_INFO_DEV_ADDR_QSFP: + /* + * MCDI page -1 should be used to access lower page 0 + * (0x00 - 0x7f). + */ + mcdi_lower_page = (uint32_t)-1; + /* + * MCDI page 0 should be used to access upper page 0 + * (0x80h - 0xff). + */ + mcdi_upper_page = 0; + break; + default: + rc = ENOTSUP; + goto fail1; + } + break; + default: + rc = ENOTSUP; + goto fail1; + } + + if (offset < EFX_PHY_MEDIA_INFO_PAGE_SIZE) { + uint8_t read_len = + MIN(len, EFX_PHY_MEDIA_INFO_PAGE_SIZE - offset); + + rc = efx_mcdi_get_phy_media_info(enp, + mcdi_lower_page, offset, read_len, data); + if (rc != 0) + goto fail2; + + data += read_len; + len -= read_len; + + offset = 0; + } else { + offset -= EFX_PHY_MEDIA_INFO_PAGE_SIZE; + } + + if (len > 0) { + EFSYS_ASSERT3U(len, <=, EFX_PHY_MEDIA_INFO_PAGE_SIZE); + EFSYS_ASSERT3U(offset, <, EFX_PHY_MEDIA_INFO_PAGE_SIZE); + + rc = efx_mcdi_get_phy_media_info(enp, + mcdi_upper_page, offset, len, data); + if (rc != 0) + goto fail3; + } + + return (0); + +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} #endif /* EFSYS_OPT_MCDI */ Modified: stable/10/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_mcdi.h Thu Feb 11 16:35:16 2016 (r295525) +++ stable/10/sys/dev/sfxge/common/efx_mcdi.h Thu Feb 11 16:39:30 2016 (r295526) @@ -228,6 +228,14 @@ efx_mcdi_get_loopback_modes( __in efx_nic_t *enp); #endif /* EFSYS_OPT_LOOPBACK */ +extern __checkReturn efx_rc_t +efx_mcdi_phy_module_get_info( + __in efx_nic_t *enp, + __in uint8_t dev_addr, + __in uint8_t offset, + __in uint8_t len, + __out_bcount(len) uint8_t *data); + #define MCDI_IN(_emr, _type, _ofst) \ ((_type *)((_emr).emr_in_buf + (_ofst))) Modified: stable/10/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_phy.c Thu Feb 11 16:35:16 2016 (r295525) +++ stable/10/sys/dev/sfxge/common/efx_phy.c Thu Feb 11 16:39:30 2016 (r295526) @@ -560,6 +560,38 @@ efx_phy_media_type_get( *typep = epp->ep_fixed_port_type; } + __checkReturn efx_rc_t +efx_phy_module_get_info( + __in efx_nic_t *enp, + __in uint8_t dev_addr, + __in uint8_t offset, + __in uint8_t len, + __out_bcount(len) uint8_t *data) +{ + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT(data != NULL); + + if ((uint32_t)offset + len > 0xff) { + rc = EINVAL; + goto fail1; + } + + if ((rc = efx_mcdi_phy_module_get_info(enp, dev_addr, + offset, len, data)) != 0) + goto fail2; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + #if EFSYS_OPT_PHY_STATS #if EFSYS_OPT_NAMES Modified: stable/10/sys/dev/sfxge/sfxge.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.c Thu Feb 11 16:35:16 2016 (r295525) +++ stable/10/sys/dev/sfxge/sfxge.c Thu Feb 11 16:39:30 2016 (r295526) @@ -507,6 +507,30 @@ sfxge_if_ioctl(struct ifnet *ifp, unsign case SIOCGIFMEDIA: error = ifmedia_ioctl(ifp, ifr, &sc->media, command); break; +#ifdef SIOCGI2C + case SIOCGI2C: + { + struct ifi2creq i2c; + + error = copyin(ifr->ifr_data, &i2c, sizeof(i2c)); + if (error != 0) + break; + + if (i2c.len > sizeof(i2c.data)) { + error = EINVAL; + break; + } + + SFXGE_ADAPTER_LOCK(sc); + error = efx_phy_module_get_info(sc->enp, i2c.dev_addr, + i2c.offset, i2c.len, + &i2c.data[0]); + SFXGE_ADAPTER_UNLOCK(sc); + if (error == 0) + error = copyout(&i2c, ifr->ifr_data, sizeof(i2c)); + break; + } +#endif case SIOCGPRIVATE_0: error = priv_check(curthread, PRIV_DRIVER); if (error != 0) From owner-svn-src-all@freebsd.org Thu Feb 11 16:43:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F48EAA463E; Thu, 11 Feb 2016 16:43:24 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 41121132E; Thu, 11 Feb 2016 16:43:24 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BGhNhJ034865; Thu, 11 Feb 2016 16:43:23 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BGhN54034864; Thu, 11 Feb 2016 16:43:23 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602111643.u1BGhN54034864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 11 Feb 2016 16:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295527 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 16:43:24 -0000 Author: andrew Date: Thu Feb 11 16:43:23 2016 New Revision: 295527 URL: https://svnweb.freebsd.org/changeset/base/295527 Log: Include the correct header to get a phandle_t needed by ofw_bus_if.h. While here only include opt_platform.h once. Sponsored by: ABT Systems Ltd Modified: head/sys/mips/mips/nexus.c Modified: head/sys/mips/mips/nexus.c ============================================================================== --- head/sys/mips/mips/nexus.c Thu Feb 11 16:39:30 2016 (r295526) +++ head/sys/mips/mips/nexus.c Thu Feb 11 16:43:23 2016 (r295527) @@ -64,10 +64,8 @@ __FBSDID("$FreeBSD$"); #include #endif -#include "opt_platform.h" - #ifdef FDT -#include +#include #include "ofw_bus_if.h" #endif From owner-svn-src-all@freebsd.org Thu Feb 11 16:47:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58010AA47A6 for ; Thu, 11 Feb 2016 16:47:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ig0-x233.google.com (mail-ig0-x233.google.com [IPv6:2607:f8b0:4001:c05::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 28BA415BB for ; Thu, 11 Feb 2016 16:47:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ig0-x233.google.com with SMTP id 5so40643144igt.0 for ; Thu, 11 Feb 2016 08:47:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=mot0Rcd4g+lAfmKiCJFEXccWbhuIsoUFlLB2gG5VZrI=; b=ffljmO7IaH6z06wENKBSzWRy1rWp/Eq3mDNxQ7ynt4nR4f/KmKjI/Y/YuCJ8zw0xo/ utFLOSrGhGdqur4h3Y/XxzxaWjZZi+kAkhW4Wf6PKLur9Mo3nhWlDZK+fhbl8mZbVewS 5jPceCTrBgXxcufAixvlTYgEc9EMxaEt8Xz4QtBat7xt0xPyT8VZO+w37G3fEnohtaIA 5X5nHEi42W12hrz/jE9t2AvOU6r3TvrX46ZCLikMm3OcVuCyg0QCLvWjX43jc0oz7txw ve0oV2rCyv4OSzUzfTcUdetSyK7jgBOgJkNcZKs+23iQbit9L6eU7Ux0wgh6n1QZ2oYO iMBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=mot0Rcd4g+lAfmKiCJFEXccWbhuIsoUFlLB2gG5VZrI=; b=XDf0AkMyHPN4gqka0INV7FSK30wLGNLUhaMbAiYViCsZDPjj+E/m1mPpqIuCuSTyOH Xn2hy3hsCz2i7SSkXH9YdOkBralXzZBp1kvXfQ0C1Gp/+G6vpT+2hPptl2Qnuxf792hC GHyQfNFEgN+oXj/zK5j7e5YLfHDTFpGIRXytAC+5il4FYnn6yMzMkEwwTYDUL37qZofl g8IDpRKZuja+8wTxQPYsUP60Cj2scasEDUDnCjRX0fELHfHh7z53fWMhbaIuhAXfOyY7 1FmEL7ihXXeA87orIsCEmAKktrkyRv3691LFiAaWesqlcGRoQdDTAJHrdP+RCl6LaUU8 JqeQ== X-Gm-Message-State: AG10YOQraOCnWkqEM8KsA4ZDADBz8lLsrq8zOdE0/0pH361Z7PE8S7RDC0Ucy9qsPsip0nJqqGe6w8F7j0IhsQ== MIME-Version: 1.0 X-Received: by 10.50.109.137 with SMTP id hs9mr17640414igb.55.1455209234451; Thu, 11 Feb 2016 08:47:14 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.79.67.193 with HTTP; Thu, 11 Feb 2016 08:47:14 -0800 (PST) X-Originating-IP: [69.53.245.22] In-Reply-To: <56BB5280.5060609@FreeBSD.org> References: <201601191533.u0JFXSxf037804@repo.freebsd.org> <56BAE4BC.9000105@selasky.org> <56BB5280.5060609@FreeBSD.org> Date: Thu, 11 Feb 2016 09:47:14 -0700 X-Google-Sender-Auth: Bcjh4YPa9Qxx-6UZoq7HzvIPip0 Message-ID: Subject: Re: svn commit: r294327 - in head/sys: dev/cxgb dev/cxgbe dev/e1000 dev/hyperv/netvsc dev/ixgbe dev/mxge netinet sys From: Warner Losh To: Pedro Giffuni Cc: Hans Petter Selasky , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 16:47:15 -0000 On Wed, Feb 10, 2016 at 8:08 AM, Pedro Giffuni wrote: > Hello; > > El 10/02/2016 a las 02:20, Hans Petter Selasky escribi=C3=B3: > >> On 01/19/16 17:09, Ryan Stone wrote: >> >>> On Tue, Jan 19, 2016 at 10:33 AM, Hans Petter Selasky < >>> hselasky@freebsd.org> >>> wrote: >>> >>> >>>> + qsort(lc->lro_mbuf_data, lc->lro_mbuf_count, sizeof(struct mbu= f >>>> *), >>>> + &tcp_lro_mbuf_compare_header); >>>> >>>> >>> In the worst case, qsort() can take O(n**2) time and consume O(n) stack >>> space. Is there a DOS concern here? >>> >>> >> Hi, >> >> Our FreeBSD qsort() routine has been specifically modified to not exhibi= t >> the so-called QuickSort worst case behaviour of O(N**2) sorting time. Th= is >> is not documented in our source code, but here: >> >> http://cs.fit.edu/~pkc/classes/writing/samples/bentley93engineering.pdf >> >> So I think DOS w.r.t O(N**2) is not a valid consern. >> >> Thank you for your input Ryan. >> >> BTW: >> >> Drew Gallatin has tested our qsort() v.s. my mergesort() and found that: >> >> "It looks like mergesort is nearly 2x as expensive. (4.7% vs 2.5%)" >> >> > FWIW, our libc qsort() has an additional enhancement: > > http://svnweb.freebsd.org/base?view=3Drevision&revision=3D279663 > > In my measurements qsort(3) was now always faster than mergesort(3). If it is faster, is there any good reason to maintain both qsort and mergesort in the kernel then? Warner From owner-svn-src-all@freebsd.org Thu Feb 11 16:50:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4313AA4949 for ; Thu, 11 Feb 2016 16:50:58 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ig0-x22f.google.com (mail-ig0-x22f.google.com [IPv6:2607:f8b0:4001:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DB8219D3 for ; Thu, 11 Feb 2016 16:50:58 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ig0-x22f.google.com with SMTP id 5so40727278igt.0 for ; Thu, 11 Feb 2016 08:50:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=5A9djazAb2GMigjXT7XHsN1JfkEqJFq9uBCLpREetlc=; b=sTaqD2aMoST16QRfUOeVPBs7o5A5ivaJIjA5b3cWZrZyQyO2V19RqwZ3656lx/Dl4x HG7v/WpRFkANJvuVhhDdGoQej/nFBBWlDtaTybgxlfeJ4FUVgYUAakGtZzRYsZHIszFm o/6etrT5lmwojK1O8P9+aWumzI9nzY3Ryulo2bluluu3blnChfAFy/v1+55FvRDxY5Go WeCx5+UEOQFfojh9ahPpmgbR6+H5CcIRWUrcsazWMAsuVX0vT2H+DdpHh85h/JJAGDYI J91vAn2ZqJo+n02GY8j+gka0Ctm/ickboLHpZPUxWKqth8JbvDx6uWf+h8b+ZGCwUSIe k0wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=5A9djazAb2GMigjXT7XHsN1JfkEqJFq9uBCLpREetlc=; b=lQVDMU+adqy0W0VjUKXZQQpGm03rKmFPNj3j2tGQuQNCviNVtY95LxFZs6JctRiE44 XmNmdt7O6E+k8nXR1zQ+vM7jy0fJxDorHkJfVS02pQp4v/LMNDbEDhMoBN84CMdUj4Jd ZwhaQ+k7Ji3IvJoV9oIIUZ30eqKrLv8/9rUry14VRpLYQCxky199VY0K5exbryAzS1AT aPyK8YtnQKXWJA5ePfc1RlVIZ1Z4Kk/wik44XmcXrRF0Gy9WiCwyvkWvcmpc+vYwhvT1 y+aClkFKkCHQ5P1jrOQMfID3ttqUxBd0jlueauP88D4cLIVySDF8MwA5MAGlHslIPg+D xRqA== X-Gm-Message-State: AG10YOTpuNyNhH19DjR4pSHDozpdHOD2q2O5hkmufpzvOUfKQzFyGEjI7aX0l6I4Ao2jxoIpHySz4xwikQgFkg== MIME-Version: 1.0 X-Received: by 10.50.80.14 with SMTP id n14mr17621446igx.85.1455209457811; Thu, 11 Feb 2016 08:50:57 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.79.67.193 with HTTP; Thu, 11 Feb 2016 08:50:57 -0800 (PST) X-Originating-IP: [69.53.245.22] In-Reply-To: <20160210104344.493c5ab9@zapp.Home> References: <201602100443.u1A4h80W000230@repo.freebsd.org> <20160210104344.493c5ab9@zapp.Home> Date: Thu, 11 Feb 2016 09:50:57 -0700 X-Google-Sender-Auth: 4zCS6z13B9WdC6jkDBrtoBZ7rsc Message-ID: Subject: Re: svn commit: r295459 - in head/sys: arm/include sys From: Warner Losh To: Andrew Turner Cc: Adrian Chadd , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 16:50:58 -0000 On Wed, Feb 10, 2016 at 3:43 AM, Andrew Turner wrote: > On Wed, 10 Feb 2016 04:43:08 +0000 (UTC) > Adrian Chadd wrote: > > > Author: adrian > > Date: Wed Feb 10 04:43:08 2016 > > New Revision: 295459 > > URL: https://svnweb.freebsd.org/changeset/base/295459 > > > > Log: > > Break out the shared bits of the arm intrng definitions into > > sys/intr.h; leave the machine dependent bits in sys/arm/. > > > > This is in preparation for MIPS INTRNG work. > > > > Submitted by: Stanislav Galabov > ... > > Added: head/sys/sys/intr.h > > > ============================================================================== > > --- /dev/null 00:00:00 1970 (empty, because file is > > newly added) +++ head/sys/sys/intr.h Wed Feb 10 04:43:08 > > 2016 (r295459) @@ -0,0 +1,130 @@ > > +/* $NetBSD: intr.h,v 1.7 2003/06/16 20:01:00 thorpej Exp > > $ */ + > > +/*- > > + * Copyright (c) 1997 Mark Brinicombe. > > + * All rights reserved. > > Is this still the case? It seems all the code in this file was written > for intrng and not by Mark Brinicombe. > More generally, we should look to see if any of the original Brinicombe code survives or not in each of the files that we've taken, copied and modified. While I like Mark (used to work with him), if there's none of his original code left, it will help with license regulariszation if we can remove him where he's not relevant. The same applies to many other folks as well, btw. But think kind of work is, at the best of times, thankless. Warner From owner-svn-src-all@freebsd.org Thu Feb 11 16:54:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B28ABAA4BE2; Thu, 11 Feb 2016 16:54:25 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 74DB91C78; Thu, 11 Feb 2016 16:54:25 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BGsOCL037843; Thu, 11 Feb 2016 16:54:24 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BGsNaD037836; Thu, 11 Feb 2016 16:54:23 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201602111654.u1BGsNaD037836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 11 Feb 2016 16:54: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: r295528 - stable/10/sys/dev/ixgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 16:54:25 -0000 Author: smh Date: Thu Feb 11 16:54:23 2016 New Revision: 295528 URL: https://svnweb.freebsd.org/changeset/base/295528 Log: MFC r294734, r295093 & r295094 ixgbe fixes MFC r294734 Fix ixgbe compliation with DBG 1 MFC r295093 Configure ixgbe phy & gbic power MFC r295094 Fix ixgbe flow control autoneg reporting Approved by: re (marius) Sponsored by: Multiplay Modified: stable/10/sys/dev/ixgbe/if_ix.c stable/10/sys/dev/ixgbe/ixgbe_common.c stable/10/sys/dev/ixgbe/ixgbe_osdep.h stable/10/sys/dev/ixgbe/ixgbe_phy.c stable/10/sys/dev/ixgbe/ixgbe_type.h stable/10/sys/dev/ixgbe/ixgbe_x540.c stable/10/sys/dev/ixgbe/ixgbe_x550.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ixgbe/if_ix.c ============================================================================== --- stable/10/sys/dev/ixgbe/if_ix.c Thu Feb 11 16:43:23 2016 (r295527) +++ stable/10/sys/dev/ixgbe/if_ix.c Thu Feb 11 16:54:23 2016 (r295528) @@ -582,6 +582,12 @@ ixgbe_attach(device_t dev) if (error) goto err_late; + /* Enable the optics for 82599 SFP+ fiber */ + ixgbe_enable_tx_laser(hw); + + /* Enable power to the phy. */ + ixgbe_set_phy_power(hw, TRUE); + /* Setup OS specific network interface */ if (ixgbe_setup_interface(dev, adapter) != 0) goto err_late; @@ -1250,6 +1256,9 @@ ixgbe_init_locked(struct adapter *adapte device_printf(dev, "Error setting up EEE: %d\n", err); } + /* Enable power to the phy. */ + ixgbe_set_phy_power(hw, TRUE); + /* Config/Enable Link */ ixgbe_config_link(adapter); @@ -3970,6 +3979,9 @@ ixgbe_setup_low_power_mode(struct adapte mtx_assert(&adapter->core_mtx, MA_OWNED); + if (!hw->wol_enabled) + ixgbe_set_phy_power(hw, FALSE); + /* Limit power management flow to X550EM baseT */ if (hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T && hw->phy.ops.enter_lplu) { Modified: stable/10/sys/dev/ixgbe/ixgbe_common.c ============================================================================== --- stable/10/sys/dev/ixgbe/ixgbe_common.c Thu Feb 11 16:43:23 2016 (r295527) +++ stable/10/sys/dev/ixgbe/ixgbe_common.c Thu Feb 11 16:54:23 2016 (r295528) @@ -199,9 +199,12 @@ bool ixgbe_device_supports_autoneg_fc(st break; } - ERROR_REPORT2(IXGBE_ERROR_UNSUPPORTED, + if (!supported) { + ERROR_REPORT2(IXGBE_ERROR_UNSUPPORTED, "Device %x does not support flow control autoneg", hw->device_id); + } + return supported; } Modified: stable/10/sys/dev/ixgbe/ixgbe_osdep.h ============================================================================== --- stable/10/sys/dev/ixgbe/ixgbe_osdep.h Thu Feb 11 16:43:23 2016 (r295527) +++ stable/10/sys/dev/ixgbe/ixgbe_osdep.h Thu Feb 11 16:54:23 2016 (r295528) @@ -57,6 +57,15 @@ #define ASSERT(x) if(!(x)) panic("IXGBE: x") #define EWARN(H, W, S) printf(W) +enum { + IXGBE_ERROR_SOFTWARE, + IXGBE_ERROR_POLLING, + IXGBE_ERROR_INVALID_STATE, + IXGBE_ERROR_UNSUPPORTED, + IXGBE_ERROR_ARGUMENT, + IXGBE_ERROR_CAUTION, +}; + /* The happy-fun DELAY macro is defined in /usr/src/sys/i386/include/clock.h */ #define usec_delay(x) DELAY(x) #define msec_delay(x) DELAY(1000*(x)) @@ -73,9 +82,23 @@ #define DEBUGOUT5(S,A,B,C,D,E) printf(S "\n",A,B,C,D,E) #define DEBUGOUT6(S,A,B,C,D,E,F) printf(S "\n",A,B,C,D,E,F) #define DEBUGOUT7(S,A,B,C,D,E,F,G) printf(S "\n",A,B,C,D,E,F,G) - #define ERROR_REPORT1(S,A) printf(S "\n",A) - #define ERROR_REPORT2(S,A,B) printf(S "\n",A,B) - #define ERROR_REPORT3(S,A,B,C) printf(S "\n",A,B,C) + #define ERROR_REPORT1 ERROR_REPORT + #define ERROR_REPORT2 ERROR_REPORT + #define ERROR_REPORT3 ERROR_REPORT + #define ERROR_REPORT(level, format, arg...) do { \ + switch (level) { \ + case IXGBE_ERROR_SOFTWARE: \ + case IXGBE_ERROR_CAUTION: \ + case IXGBE_ERROR_POLLING: \ + case IXGBE_ERROR_INVALID_STATE: \ + case IXGBE_ERROR_UNSUPPORTED: \ + case IXGBE_ERROR_ARGUMENT: \ + device_printf(ixgbe_dev_from_hw(hw), format, ## arg); \ + break; \ + default: \ + break; \ + } \ + } while (0) #else #define DEBUGOUT(S) #define DEBUGOUT1(S,A) Modified: stable/10/sys/dev/ixgbe/ixgbe_phy.c ============================================================================== --- stable/10/sys/dev/ixgbe/ixgbe_phy.c Thu Feb 11 16:43:23 2016 (r295527) +++ stable/10/sys/dev/ixgbe/ixgbe_phy.c Thu Feb 11 16:54:23 2016 (r295528) @@ -2734,6 +2734,9 @@ s32 ixgbe_set_copper_phy_power(struct ix u32 status; u16 reg; + if (!on && ixgbe_mng_present(hw)) + return 0; + status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_VENDOR_SPECIFIC_1_CONTROL, IXGBE_MDIO_VENDOR_SPECIFIC_1_DEV_TYPE, ®); Modified: stable/10/sys/dev/ixgbe/ixgbe_type.h ============================================================================== --- stable/10/sys/dev/ixgbe/ixgbe_type.h Thu Feb 11 16:43:23 2016 (r295527) +++ stable/10/sys/dev/ixgbe/ixgbe_type.h Thu Feb 11 16:54:23 2016 (r295528) @@ -1479,7 +1479,10 @@ struct ixgbe_dmac_config { #define IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_MASK 0xFF01 /* int chip-wide mask */ #define IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_FLAG 0xFC01 /* int chip-wide mask */ #define IXGBE_MDIO_GLOBAL_ALARM_1 0xCC00 /* Global alarm 1 */ +#define IXGBE_MDIO_GLOBAL_ALM_1_DEV_FAULT 0x0010 /* device fault */ #define IXGBE_MDIO_GLOBAL_ALM_1_HI_TMP_FAIL 0x4000 /* high temp failure */ +#define IXGBE_MDIO_GLOBAL_FAULT_MSG 0xC850 /* Global Fault Message */ +#define IXGBE_MDIO_GLOBAL_FAULT_MSG_HI_TMP 0x8007 /* high temp failure */ #define IXGBE_MDIO_GLOBAL_INT_MASK 0xD400 /* Global int mask */ #define IXGBE_MDIO_GLOBAL_AN_VEN_ALM_INT_EN 0x1000 /* autoneg vendor alarm int enable */ #define IXGBE_MDIO_GLOBAL_ALARM_1_INT 0x4 /* int in Global alarm 1 */ Modified: stable/10/sys/dev/ixgbe/ixgbe_x540.c ============================================================================== --- stable/10/sys/dev/ixgbe/ixgbe_x540.c Thu Feb 11 16:43:23 2016 (r295527) +++ stable/10/sys/dev/ixgbe/ixgbe_x540.c Thu Feb 11 16:54:23 2016 (r295528) @@ -82,8 +82,7 @@ s32 ixgbe_init_ops_X540(struct ixgbe_hw /* PHY */ phy->ops.init = ixgbe_init_phy_ops_generic; phy->ops.reset = NULL; - if (!ixgbe_mng_present(hw)) - phy->ops.set_phy_power = ixgbe_set_copper_phy_power; + phy->ops.set_phy_power = ixgbe_set_copper_phy_power; /* MAC */ mac->ops.reset_hw = ixgbe_reset_hw_X540; Modified: stable/10/sys/dev/ixgbe/ixgbe_x550.c ============================================================================== --- stable/10/sys/dev/ixgbe/ixgbe_x550.c Thu Feb 11 16:43:23 2016 (r295527) +++ stable/10/sys/dev/ixgbe/ixgbe_x550.c Thu Feb 11 16:54:23 2016 (r295528) @@ -965,7 +965,7 @@ void ixgbe_restore_mdd_vf_X550(struct ix num_qs = 4; /* 32 VFs / pools */ bitmask = 0x0000000F; break; - default: /* 64 VFs / pools */ + default: /* 64 VFs / pools */ num_qs = 2; bitmask = 0x00000003; break; @@ -1264,7 +1264,7 @@ static s32 ixgbe_get_lasi_ext_t_x550em(s IXGBE_MDIO_GLOBAL_ALARM_1_INT))) return status; - /* High temperature failure alarm triggered */ + /* Global alarm triggered */ status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_ALARM_1, IXGBE_MDIO_VENDOR_SPECIFIC_1_DEV_TYPE, ®); @@ -1277,6 +1277,21 @@ static s32 ixgbe_get_lasi_ext_t_x550em(s /* power down the PHY in case the PHY FW didn't already */ ixgbe_set_copper_phy_power(hw, FALSE); return IXGBE_ERR_OVERTEMP; + } else if (reg & IXGBE_MDIO_GLOBAL_ALM_1_DEV_FAULT) { + /* device fault alarm triggered */ + status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_FAULT_MSG, + IXGBE_MDIO_VENDOR_SPECIFIC_1_DEV_TYPE, + ®); + + if (status != IXGBE_SUCCESS) + return status; + + /* if device fault was due to high temp alarm handle and exit */ + if (reg == IXGBE_MDIO_GLOBAL_FAULT_MSG_HI_TMP) { + /* power down the PHY in case the PHY FW didn't */ + ixgbe_set_copper_phy_power(hw, FALSE); + return IXGBE_ERR_OVERTEMP; + } } /* Vendor alarm 2 triggered */ From owner-svn-src-all@freebsd.org Thu Feb 11 16:55:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E71BAA4CAE; Thu, 11 Feb 2016 16:55:06 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id EEB701DE2; Thu, 11 Feb 2016 16:55:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 4E224D67146; Fri, 12 Feb 2016 03:54:57 +1100 (AEDT) Date: Fri, 12 Feb 2016 03:54:55 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Pedro F. Giffuni" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295523 - head/sys/fs/ext2fs In-Reply-To: <201602111527.u1BFRFMe011283@repo.freebsd.org> Message-ID: <20160212030505.C1943@besplex.bde.org> References: <201602111527.u1BFRFMe011283@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=PfoC/XVd c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=XoNei6wmGbNNJ5Xpwj4A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 16:55:06 -0000 On Thu, 11 Feb 2016, Pedro F. Giffuni wrote: > Log: > Ext4: Use boolean type instead of '0' and '1' > > There are precedents of uses of bool in the kernel and > it is incorrect style to use integers as replacement for > a boolean type. This is all backwards. It is correct style to use integers to represent booleans. There are precedents for breaking this style by using the bool type, but not many in fs code: In all of /sys/fs/*, there were just 12 lines of declarations that use 'bool'. All of these were in autofs. Now there are 13 such lines (1 more in ext2fs). 1 use is especially useless and especially unlikely to be all uses of booleans. /sys/fs/nfsclient uses boolean_t in 1 whole line. boolean_t is an old spelling of 'bool'. It is a Mach type for representing booleans in /sys/vm. I used to like such typedefs 20-30 years ago (mine was spelled bool_t) and made the mistake of using the Mach type elsewhere in the kernel. The use in nfsclient is actually correct. It is used to hold the result of a vm function which returns boolean_t. /sys/fs/nfsserver uses bool_t in 1 whole line. bool_t is is like boolean_t except in is Sun(?) type for reprenting booleans in rpc. It use is again correct -- it is used to hold the result of an rpc function that returns bool_t. /sys/fs/tmpfs the Mach spelling on 5 lines. These uses are to sks for small pessimizations, but inlining and -O usually gives the same object code as using integers. The values start as flags which are naturally represented as integers and are tested by expressions of the form (de->td_cookie & FLAG). These simple flags tests are obfuscated using function calls. The functions return boolean_t, so must convert to a logical expression. They do this correctly. Then the compiler should optimize away all the obfuscations and pessimizations to give the same object code as if you wrote the tests directly. ffs and zfs provided perhaps better examples. /sys/cddl uses boolean_t on 102 lines. It isn't clear what this type is. compat/opensolaris/sys/types.h seems to use the FreeBSD kernel boolean_t in the kernel, but in userland it uses 2 different enum types depending on options. These types are incompatible so this depends on magic to work. /sys/cddl also uses bool_t twice, once each for rpc and nvpair. /sys/cddl never uses C99 bool. ffs used to use a very pure KNF style with integers and no typedefs, but it now uses C99 bool on 4 lines. These uses are correct. Bruce From owner-svn-src-all@freebsd.org Thu Feb 11 17:07:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0F81AA5243; Thu, 11 Feb 2016 17:07:20 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 6A34F362; Thu, 11 Feb 2016 17:07:20 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BH7J3B040819; Thu, 11 Feb 2016 17:07:19 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BH7JIw040816; Thu, 11 Feb 2016 17:07:19 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201602111707.u1BH7JIw040816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 11 Feb 2016 17:07:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295529 - in head/sys: net netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 17:07:20 -0000 Author: dteske Date: Thu Feb 11 17:07:19 2016 New Revision: 295529 URL: https://svnweb.freebsd.org/changeset/base/295529 Log: Merge SVN r295220 (bz) from projects/vnet/ Fix a panic that occurs when a vnet interface is unavailable at the time the vnet jail referencing said interface is stopped. Sponsored by: FIS Global, Inc. Modified: head/sys/net/route.c head/sys/netinet/in_rmx.c head/sys/netinet6/in6_rmx.c Directory Properties: head/ (props changed) head/sys/ (props changed) Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Thu Feb 11 16:54:23 2016 (r295528) +++ head/sys/net/route.c Thu Feb 11 17:07:19 2016 (r295529) @@ -353,10 +353,24 @@ rt_table_init(int offset) return (rh); } +static int +rt_freeentry(struct radix_node *rn, void *arg) +{ + struct radix_head * const rnh = arg; + struct radix_node *x; + + x = (struct radix_node *)rn_delete(rn + 2, NULL, rnh); + if (x != NULL) + R_Free(x); + return (0); +} + void rt_table_destroy(struct rib_head *rh) { + rn_walktree(&rh->rmhead.head, rt_freeentry, &rh->rmhead.head); + /* Assume table is already empty */ rw_destroy(&rh->rib_lock); free(rh, M_RTABLE); Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Thu Feb 11 16:54:23 2016 (r295528) +++ head/sys/netinet/in_rmx.c Thu Feb 11 17:07:19 2016 (r295529) @@ -133,7 +133,8 @@ int in_detachhead(void **head, int off) { - return (rn_detachhead(head)); + rt_table_destroy((struct rib_head *)(*head)); + return (1); } #endif Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Thu Feb 11 16:54:23 2016 (r295528) +++ head/sys/netinet6/in6_rmx.c Thu Feb 11 17:07:19 2016 (r295529) @@ -237,7 +237,9 @@ in6_detachhead(void **head, int off) { callout_drain(&V_rtq_mtutimer); - return (rn_detachhead(head)); + rt_table_destroy((struct rib_head *)(*head)); + + return (1); } #endif From owner-svn-src-all@freebsd.org Thu Feb 11 17:25:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55BD3AA5B73; Thu, 11 Feb 2016 17:25:14 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 2364B1154; Thu, 11 Feb 2016 17:25:14 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BHPD3M046911; Thu, 11 Feb 2016 17:25:13 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BHPCTZ046900; Thu, 11 Feb 2016 17:25:12 GMT (envelope-from des@FreeBSD.org) Message-Id: <201602111725.u1BHPCTZ046900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Thu, 11 Feb 2016 17:25:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295530 - in vendor/unbound/dist: . doc services util validator X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 17:25:14 -0000 Author: des Date: Thu Feb 11 17:25:12 2016 New Revision: 295530 URL: https://svnweb.freebsd.org/changeset/base/295530 Log: Apply upstream r3619, r3620, r3621: add insecure-lan-zone option Added: vendor/unbound/dist/util/as112.c vendor/unbound/dist/util/as112.h Modified: vendor/unbound/dist/Makefile.in vendor/unbound/dist/doc/example.conf.in vendor/unbound/dist/doc/unbound.conf.5.in vendor/unbound/dist/services/localzone.c vendor/unbound/dist/util/config_file.c vendor/unbound/dist/util/config_file.h vendor/unbound/dist/util/configlexer.lex vendor/unbound/dist/util/configparser.y vendor/unbound/dist/validator/val_anchor.c Modified: vendor/unbound/dist/Makefile.in ============================================================================== --- vendor/unbound/dist/Makefile.in Thu Feb 11 17:07:19 2016 (r295529) +++ vendor/unbound/dist/Makefile.in Thu Feb 11 17:25:12 2016 (r295530) @@ -95,7 +95,7 @@ PYUNBOUND_SRC= # libunbound_wrap.lo if python libunbound wrapper enabled. PYUNBOUND_OBJ=@PYUNBOUND_OBJ@ COMMON_SRC=services/cache/dns.c services/cache/infra.c services/cache/rrset.c \ -util/data/dname.c util/data/msgencode.c util/data/msgparse.c \ +util/as112.c util/data/dname.c util/data/msgencode.c util/data/msgparse.c \ util/data/msgreply.c util/data/packed_rrset.c iterator/iterator.c \ iterator/iter_delegpt.c iterator/iter_donotq.c iterator/iter_fwd.c \ iterator/iter_hints.c iterator/iter_priv.c iterator/iter_resptype.c \ @@ -113,7 +113,7 @@ validator/val_neg.c validator/val_nsec3. validator/val_secalgo.c validator/val_sigcrypt.c \ validator/val_utils.c dns64/dns64.c $(CHECKLOCK_SRC) $(DNSTAP_SRC) COMMON_OBJ_WITHOUT_NETCALL=dns.lo infra.lo rrset.lo dname.lo msgencode.lo \ -msgparse.lo msgreply.lo packed_rrset.lo iterator.lo iter_delegpt.lo \ +as112.lo msgparse.lo msgreply.lo packed_rrset.lo iterator.lo iter_delegpt.lo \ iter_donotq.lo iter_fwd.lo iter_hints.lo iter_priv.lo iter_resptype.lo \ iter_scrub.lo iter_utils.lo localzone.lo mesh.lo modstack.lo \ outbound_list.lo alloc.lo config_file.lo configlexer.lo configparser.lo \ @@ -595,6 +595,7 @@ depend: rm -f $(DEPEND_TMP) $(DEPEND_TMP2) # Dependencies +as112.lo as112.o: $(srcdir)/util/as112.c $(srcdir)/util/as112.h dns.lo dns.o: $(srcdir)/services/cache/dns.c config.h $(srcdir)/iterator/iter_delegpt.h $(srcdir)/util/log.h \ $(srcdir)/validator/val_nsec.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/services/cache/dns.h $(srcdir)/util/data/msgreply.h \ @@ -702,7 +703,7 @@ localzone.lo localzone.o: $(srcdir)/serv $(srcdir)/sldns/sbuffer.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/util/data/dname.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgencode.h \ $(srcdir)/util/net_help.h $(srcdir)/util/netevent.h $(srcdir)/util/data/msgreply.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/util/as112.h mesh.lo mesh.o: $(srcdir)/services/mesh.c config.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/netevent.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/util/log.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h \ @@ -821,7 +822,7 @@ val_anchor.lo val_anchor.o: $(srcdir)/va $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_sigcrypt.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/validator/autotrust.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/net_help.h $(srcdir)/util/config_file.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/str2wire.h + $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/str2wire.h $(srcdir)/util/as112.h validator.lo validator.o: $(srcdir)/validator/validator.c config.h $(srcdir)/validator/validator.h \ $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ Modified: vendor/unbound/dist/doc/example.conf.in ============================================================================== --- vendor/unbound/dist/doc/example.conf.in Thu Feb 11 17:07:19 2016 (r295529) +++ vendor/unbound/dist/doc/example.conf.in Thu Feb 11 17:25:12 2016 (r295530) @@ -508,13 +508,17 @@ server: # local-zone: "8.b.d.0.1.0.0.2.ip6.arpa." nodefault # And for 64.100.in-addr.arpa. to 127.100.in-addr.arpa. - # if unbound is running service for the local host then it is useful + # If unbound is running service for the local host then it is useful # to perform lan-wide lookups to the upstream, and unblock the # long list of local-zones above. If this unbound is a dns server # for a network of computers, disabled is better and stops information # leakage of local lan information. # unblock-lan-zones: no + # The insecure-lan-zones option disables validation for + # these zones, as if they were all listed as domain-insecure. + # insecure-lan-zones: no + # a number of locally served zones can be configured. # local-zone: # local-data: "" Modified: vendor/unbound/dist/doc/unbound.conf.5.in ============================================================================== --- vendor/unbound/dist/doc/unbound.conf.5.in Thu Feb 11 17:07:19 2016 (r295529) +++ vendor/unbound/dist/doc/unbound.conf.5.in Thu Feb 11 17:25:12 2016 (r295530) @@ -841,6 +841,11 @@ as a (DHCP-) DNS network resolver for a lookups should be filtered (RFC compliance), this also stops potential data leakage about the local network to the upstream DNS servers. .TP +.B insecure\-lan\-zones: \fI +Default is disabled. If enabled, then reverse lookups in private +address space are not validated. This is usually required whenever +\fIunblock\-lan\-zones\fR is used. +.TP .B local\-zone: \fI Configure a local zone. The type determines the answer to give if there is no match from local\-data. The types are deny, refuse, static, Modified: vendor/unbound/dist/services/localzone.c ============================================================================== --- vendor/unbound/dist/services/localzone.c Thu Feb 11 17:07:19 2016 (r295529) +++ vendor/unbound/dist/services/localzone.c Thu Feb 11 17:25:12 2016 (r295530) @@ -51,6 +51,7 @@ #include "util/netevent.h" #include "util/data/msgreply.h" #include "util/data/msgparse.h" +#include "util/as112.h" struct local_zones* local_zones_create(void) @@ -592,6 +593,7 @@ static int lz_enter_defaults(struct local_zones* zones, struct config_file* cfg) { struct local_zone* z; + const char** zstr; /* this list of zones is from RFC 6303 */ @@ -654,110 +656,14 @@ lz_enter_defaults(struct local_zones* zo lock_rw_unlock(&z->lock); } - /* if unblock lan-zones, then do not add the zones below. - * we do add the zones above, about 127.0.0.1, because localhost is - * not on the lan. */ - if(cfg->unblock_lan_zones) - return 1; - - /* block LAN level zones */ - if ( !add_as112_default(zones, cfg, "10.in-addr.arpa.") || - !add_as112_default(zones, cfg, "16.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "17.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "18.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "19.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "20.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "21.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "22.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "23.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "24.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "25.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "26.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "27.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "28.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "29.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "30.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "31.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "168.192.in-addr.arpa.") || - !add_as112_default(zones, cfg, "0.in-addr.arpa.") || - !add_as112_default(zones, cfg, "64.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "65.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "66.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "67.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "68.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "69.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "70.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "71.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "72.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "73.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "74.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "75.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "76.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "77.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "78.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "79.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "80.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "81.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "82.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "83.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "84.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "85.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "86.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "87.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "88.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "89.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "90.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "91.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "92.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "93.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "94.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "95.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "96.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "97.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "98.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "99.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "100.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "101.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "102.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "103.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "104.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "105.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "106.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "107.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "108.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "109.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "110.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "111.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "112.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "113.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "114.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "115.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "116.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "117.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "118.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "119.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "120.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "121.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "122.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "123.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "124.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "125.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "126.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "127.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "254.169.in-addr.arpa.") || - !add_as112_default(zones, cfg, "2.0.192.in-addr.arpa.") || - !add_as112_default(zones, cfg, "100.51.198.in-addr.arpa.") || - !add_as112_default(zones, cfg, "113.0.203.in-addr.arpa.") || - !add_as112_default(zones, cfg, "255.255.255.255.in-addr.arpa.") || - !add_as112_default(zones, cfg, "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa.") || - !add_as112_default(zones, cfg, "d.f.ip6.arpa.") || - !add_as112_default(zones, cfg, "8.e.f.ip6.arpa.") || - !add_as112_default(zones, cfg, "9.e.f.ip6.arpa.") || - !add_as112_default(zones, cfg, "a.e.f.ip6.arpa.") || - !add_as112_default(zones, cfg, "b.e.f.ip6.arpa.") || - !add_as112_default(zones, cfg, "8.b.d.0.1.0.0.2.ip6.arpa.")) { - log_err("out of memory adding default zone"); - return 0; + /* block AS112 zones, unless asked not to */ + if(!cfg->unblock_lan_zones) { + for(zstr = as112_zones; *zstr; zstr++) { + if(!add_as112_default(zones, cfg, *zstr)) { + log_err("out of memory adding default zone"); + return 0; + } + } } return 1; } Added: vendor/unbound/dist/util/as112.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/unbound/dist/util/as112.c Thu Feb 11 17:25:12 2016 (r295530) @@ -0,0 +1,143 @@ +/* + * util/as112.c - list of local zones. + * + * Copyright (c) 2007, NLnet Labs. All rights reserved. + * + * This software is open source. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * Neither the name of the NLNET LABS nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * \file + * + * This file provides a list of lan zones. + */ + +#include "util/as112.h" + +static const char* as112_zone_array[] = { + "10.in-addr.arpa.", + "16.172.in-addr.arpa.", + "17.172.in-addr.arpa.", + "18.172.in-addr.arpa.", + "19.172.in-addr.arpa.", + "20.172.in-addr.arpa.", + "21.172.in-addr.arpa.", + "22.172.in-addr.arpa.", + "23.172.in-addr.arpa.", + "24.172.in-addr.arpa.", + "25.172.in-addr.arpa.", + "26.172.in-addr.arpa.", + "27.172.in-addr.arpa.", + "28.172.in-addr.arpa.", + "29.172.in-addr.arpa.", + "30.172.in-addr.arpa.", + "31.172.in-addr.arpa.", + "168.192.in-addr.arpa.", + "0.in-addr.arpa.", + "64.100.in-addr.arpa.", + "65.100.in-addr.arpa.", + "66.100.in-addr.arpa.", + "67.100.in-addr.arpa.", + "68.100.in-addr.arpa.", + "69.100.in-addr.arpa.", + "70.100.in-addr.arpa.", + "71.100.in-addr.arpa.", + "72.100.in-addr.arpa.", + "73.100.in-addr.arpa.", + "74.100.in-addr.arpa.", + "75.100.in-addr.arpa.", + "76.100.in-addr.arpa.", + "77.100.in-addr.arpa.", + "78.100.in-addr.arpa.", + "79.100.in-addr.arpa.", + "80.100.in-addr.arpa.", + "81.100.in-addr.arpa.", + "82.100.in-addr.arpa.", + "83.100.in-addr.arpa.", + "84.100.in-addr.arpa.", + "85.100.in-addr.arpa.", + "86.100.in-addr.arpa.", + "87.100.in-addr.arpa.", + "88.100.in-addr.arpa.", + "89.100.in-addr.arpa.", + "90.100.in-addr.arpa.", + "91.100.in-addr.arpa.", + "92.100.in-addr.arpa.", + "93.100.in-addr.arpa.", + "94.100.in-addr.arpa.", + "95.100.in-addr.arpa.", + "96.100.in-addr.arpa.", + "97.100.in-addr.arpa.", + "98.100.in-addr.arpa.", + "99.100.in-addr.arpa.", + "100.100.in-addr.arpa.", + "101.100.in-addr.arpa.", + "102.100.in-addr.arpa.", + "103.100.in-addr.arpa.", + "104.100.in-addr.arpa.", + "105.100.in-addr.arpa.", + "106.100.in-addr.arpa.", + "107.100.in-addr.arpa.", + "108.100.in-addr.arpa.", + "109.100.in-addr.arpa.", + "110.100.in-addr.arpa.", + "111.100.in-addr.arpa.", + "112.100.in-addr.arpa.", + "113.100.in-addr.arpa.", + "114.100.in-addr.arpa.", + "115.100.in-addr.arpa.", + "116.100.in-addr.arpa.", + "117.100.in-addr.arpa.", + "118.100.in-addr.arpa.", + "119.100.in-addr.arpa.", + "120.100.in-addr.arpa.", + "121.100.in-addr.arpa.", + "122.100.in-addr.arpa.", + "123.100.in-addr.arpa.", + "124.100.in-addr.arpa.", + "125.100.in-addr.arpa.", + "126.100.in-addr.arpa.", + "127.100.in-addr.arpa.", + "254.169.in-addr.arpa.", + "2.0.192.in-addr.arpa.", + "100.51.198.in-addr.arpa.", + "113.0.203.in-addr.arpa.", + "255.255.255.255.in-addr.arpa.", + "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa.", + "d.f.ip6.arpa.", + "8.e.f.ip6.arpa.", + "9.e.f.ip6.arpa.", + "a.e.f.ip6.arpa.", + "b.e.f.ip6.arpa.", + "8.b.d.0.1.0.0.2.ip6.arpa.", + 0 +}; + +const char** as112_zones = as112_zone_array; Added: vendor/unbound/dist/util/as112.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/unbound/dist/util/as112.h Thu Feb 11 17:25:12 2016 (r295530) @@ -0,0 +1,57 @@ +/* + * util/as112.c - list of local zones. + * + * Copyright (c) 2007, NLnet Labs. All rights reserved. + * + * This software is open source. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * Neither the name of the NLNET LABS nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * \file + * + * This file provides a list of lan zones + */ + +#ifndef UTIL_AS112_H +#define UTIL_AS112_H + +/** + * Array of text-format domain names of the AS112 zones. + * The array ends with NULL. "AS112" is a service on the internet that + * that this array is named after. The names in this list (or some of them) + * are null-routed by this service to avoid load on central servers caused by + * mistaken lookups for local content on the global internet. + * + * This is the list of names that unbound should not normally be sending + * on towards the internet, because they are local-use. + */ +extern const char** as112_zones; + +#endif Modified: vendor/unbound/dist/util/config_file.c ============================================================================== --- vendor/unbound/dist/util/config_file.c Thu Feb 11 17:07:19 2016 (r295529) +++ vendor/unbound/dist/util/config_file.c Thu Feb 11 17:25:12 2016 (r295530) @@ -210,6 +210,7 @@ config_create(void) cfg->local_zones_nodefault = NULL; cfg->local_data = NULL; cfg->unblock_lan_zones = 0; + cfg->insecure_lan_zones = 0; cfg->python_script = NULL; cfg->remote_control_enable = 0; cfg->control_ifs = NULL; @@ -458,6 +459,7 @@ int config_set_option(struct config_file else S_YNO("rrset-roundrobin:", rrset_roundrobin) else S_STRLIST("local-data:", local_data) else S_YNO("unblock-lan-zones:", unblock_lan_zones) + else S_YNO("insecure-lan-zones:", insecure_lan_zones) else S_YNO("control-enable:", remote_control_enable) else S_STRLIST("control-interface:", control_ifs) else S_NUMBER_NONZERO("control-port:", control_port) @@ -739,6 +741,7 @@ config_get_option(struct config_file* cf else O_YNO(opt, "minimal-responses", minimal_responses) else O_YNO(opt, "rrset-roundrobin", rrset_roundrobin) else O_YNO(opt, "unblock-lan-zones", unblock_lan_zones) + else O_YNO(opt, "insecure-lan-zones", insecure_lan_zones) else O_DEC(opt, "max-udp-size", max_udp_size) else O_STR(opt, "python-script", python_script) else O_DEC(opt, "ratelimit", ratelimit) Modified: vendor/unbound/dist/util/config_file.h ============================================================================== --- vendor/unbound/dist/util/config_file.h Thu Feb 11 17:07:19 2016 (r295529) +++ vendor/unbound/dist/util/config_file.h Thu Feb 11 17:25:12 2016 (r295530) @@ -285,8 +285,10 @@ struct config_file { struct config_strlist* local_zones_nodefault; /** local data RRs configured */ struct config_strlist* local_data; - /** unblock lan zones (reverse lookups for 10/8 and so on) */ + /** unblock lan zones (reverse lookups for AS112 zones) */ int unblock_lan_zones; + /** insecure lan zones (don't validate AS112 zones) */ + int insecure_lan_zones; /** remote control section. enable toggle. */ int remote_control_enable; Modified: vendor/unbound/dist/util/configlexer.lex ============================================================================== --- vendor/unbound/dist/util/configlexer.lex Thu Feb 11 17:07:19 2016 (r295529) +++ vendor/unbound/dist/util/configlexer.lex Thu Feb 11 17:25:12 2016 (r295530) @@ -319,6 +319,7 @@ local-zone{COLON} { YDVAR(2, VAR_LOCAL_ local-data{COLON} { YDVAR(1, VAR_LOCAL_DATA) } local-data-ptr{COLON} { YDVAR(1, VAR_LOCAL_DATA_PTR) } unblock-lan-zones{COLON} { YDVAR(1, VAR_UNBLOCK_LAN_ZONES) } +insecure-lan-zones{COLON} { YDVAR(1, VAR_INSECURE_LAN_ZONES) } statistics-interval{COLON} { YDVAR(1, VAR_STATISTICS_INTERVAL) } statistics-cumulative{COLON} { YDVAR(1, VAR_STATISTICS_CUMULATIVE) } extended-statistics{COLON} { YDVAR(1, VAR_EXTENDED_STATISTICS) } Modified: vendor/unbound/dist/util/configparser.y ============================================================================== --- vendor/unbound/dist/util/configparser.y Thu Feb 11 17:07:19 2016 (r295529) +++ vendor/unbound/dist/util/configparser.y Thu Feb 11 17:25:12 2016 (r295530) @@ -106,7 +106,8 @@ extern struct config_parser_state* cfg_p %token VAR_IGNORE_CD_FLAG VAR_LOG_QUERIES VAR_TCP_UPSTREAM VAR_SSL_UPSTREAM %token VAR_SSL_SERVICE_KEY VAR_SSL_SERVICE_PEM VAR_SSL_PORT VAR_FORWARD_FIRST %token VAR_STUB_FIRST VAR_MINIMAL_RESPONSES VAR_RRSET_ROUNDROBIN -%token VAR_MAX_UDP_SIZE VAR_DELAY_CLOSE VAR_UNBLOCK_LAN_ZONES +%token VAR_MAX_UDP_SIZE VAR_DELAY_CLOSE +%token VAR_UNBLOCK_LAN_ZONES VAR_INSECURE_LAN_ZONES %token VAR_INFRA_CACHE_MIN_RTT %token VAR_DNS64_PREFIX VAR_DNS64_SYNTHALL %token VAR_DNSTAP VAR_DNSTAP_ENABLE VAR_DNSTAP_SOCKET_PATH @@ -180,7 +181,8 @@ content_server: server_num_threads | ser server_log_queries | server_tcp_upstream | server_ssl_upstream | server_ssl_service_key | server_ssl_service_pem | server_ssl_port | server_minimal_responses | server_rrset_roundrobin | server_max_udp_size | - server_so_reuseport | server_delay_close | server_unblock_lan_zones | + server_so_reuseport | server_delay_close | + server_unblock_lan_zones | server_insecure_lan_zones | server_dns64_prefix | server_dns64_synthall | server_infra_cache_min_rtt | server_harden_algo_downgrade | server_ip_transparent | server_ratelimit | server_ratelimit_slabs | @@ -722,6 +724,16 @@ server_unblock_lan_zones: VAR_UNBLOCK_LA free($2); } ; +server_insecure_lan_zones: VAR_INSECURE_LAN_ZONES STRING_ARG + { + OUTYY(("P(server_insecure_lan_zones:%s)\n", $2)); + if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->insecure_lan_zones = + (strcmp($2, "yes")==0); + free($2); + } + ; server_rrset_cache_size: VAR_RRSET_CACHE_SIZE STRING_ARG { OUTYY(("P(server_rrset_cache_size:%s)\n", $2)); Modified: vendor/unbound/dist/validator/val_anchor.c ============================================================================== --- vendor/unbound/dist/validator/val_anchor.c Thu Feb 11 17:07:19 2016 (r295529) +++ vendor/unbound/dist/validator/val_anchor.c Thu Feb 11 17:25:12 2016 (r295530) @@ -48,6 +48,7 @@ #include "util/log.h" #include "util/net_help.h" #include "util/config_file.h" +#include "util/as112.h" #include "sldns/sbuffer.h" #include "sldns/rrdef.h" #include "sldns/str2wire.h" @@ -1044,8 +1045,18 @@ int anchors_apply_cfg(struct val_anchors* anchors, struct config_file* cfg) { struct config_strlist* f; + const char** zstr; char* nm; sldns_buffer* parsebuf = sldns_buffer_new(65535); + if(cfg->insecure_lan_zones) { + for(zstr = as112_zones; *zstr; zstr++) { + if(!anchor_insert_insecure(anchors, *zstr)) { + log_err("error in insecure-lan-zones: %s", *zstr); + sldns_buffer_free(parsebuf); + return 0; + } + } + } for(f = cfg->domain_insecure; f; f = f->next) { if(!f->str || f->str[0] == 0) /* empty "" */ continue; From owner-svn-src-all@freebsd.org Thu Feb 11 17:31:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5174AA5E10; Thu, 11 Feb 2016 17:31:18 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 7304E13A5; Thu, 11 Feb 2016 17:31:18 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BHVHlM047776; Thu, 11 Feb 2016 17:31:17 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BHVHXI047775; Thu, 11 Feb 2016 17:31:17 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201602111731.u1BHVHXI047775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 11 Feb 2016 17:31: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: r295531 - stable/10/sys/boot/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 17:31:18 -0000 Author: smh Date: Thu Feb 11 17:31:17 2016 New Revision: 295531 URL: https://svnweb.freebsd.org/changeset/base/295531 Log: MFC r295356 (Partial) Fix EFI platform build failures on arm.armeb Approved by: re (marius) Sponsored by: Multiplay Modified: stable/10/sys/boot/common/load_elf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/common/load_elf.c ============================================================================== --- stable/10/sys/boot/common/load_elf.c Thu Feb 11 17:25:12 2016 (r295530) +++ stable/10/sys/boot/common/load_elf.c Thu Feb 11 17:31:17 2016 (r295531) @@ -856,7 +856,7 @@ __elfN(parse_modmetadata)(struct preload error = __elfN(reloc_ptr)(fp, ef, v, &md, sizeof(md)); if (error == EOPNOTSUPP) { md.md_cval += ef->off; - md.md_data = (void *)((uintptr_t)md.md_data + ef->off); + md.md_data = (void *)((uintptr_t)md.md_data + (uintptr_t)ef->off); } else if (error != 0) return (error); #endif From owner-svn-src-all@freebsd.org Thu Feb 11 17:32:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3255FAA5EA6; Thu, 11 Feb 2016 17:32:43 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 DF869180F; Thu, 11 Feb 2016 17:32:42 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BHWfjx049803; Thu, 11 Feb 2016 17:32:41 GMT (envelope-from jimharris@FreeBSD.org) Received: (from jimharris@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BHWfFo049802; Thu, 11 Feb 2016 17:32:41 GMT (envelope-from jimharris@FreeBSD.org) Message-Id: <201602111732.u1BHWfFo049802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jimharris set sender to jimharris@FreeBSD.org using -f From: Jim Harris Date: Thu, 11 Feb 2016 17:32:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295532 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 17:32:43 -0000 Author: jimharris Date: Thu Feb 11 17:32:41 2016 New Revision: 295532 URL: https://svnweb.freebsd.org/changeset/base/295532 Log: nvme: avoid duplicate SET_NUM_QUEUES commands nvme(4) issues a SET_NUM_QUEUES command during device initialization to ensure enough I/O queues exists for each of the MSI-X vectors we have allocated. The SET_NUM_QUEUES command is then issued again during nvme_ctrlr_start(), to ensure that is properly set after any controller reset. At least one NVMe drive exists which fails this second SET_NUM_QUEUES command during device initialization. So change nvme_ctrlr_start() to only issue its SET_NUM_QUEUES command when it is coming out of a reset - avoiding the duplicate SET_NUM_QUEUES during device initialization. Reported by: gallatin MFC after: 3 days Sponsored by: Intel Modified: head/sys/dev/nvme/nvme_ctrlr.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Thu Feb 11 17:31:17 2016 (r295531) +++ head/sys/dev/nvme/nvme_ctrlr.c Thu Feb 11 17:32:41 2016 (r295532) @@ -725,15 +725,17 @@ nvme_ctrlr_start(void *ctrlr_arg) * explicit specify how many queues it will use. This value should * never change between resets, so panic if somehow that does happen. */ - old_num_io_queues = ctrlr->num_io_queues; - if (nvme_ctrlr_set_num_qpairs(ctrlr) != 0) { - nvme_ctrlr_fail(ctrlr); - return; - } + if (ctrlr->is_resetting) { + old_num_io_queues = ctrlr->num_io_queues; + if (nvme_ctrlr_set_num_qpairs(ctrlr) != 0) { + nvme_ctrlr_fail(ctrlr); + return; + } - if (old_num_io_queues != ctrlr->num_io_queues) { - panic("num_io_queues changed from %u to %u", old_num_io_queues, - ctrlr->num_io_queues); + if (old_num_io_queues != ctrlr->num_io_queues) { + panic("num_io_queues changed from %u to %u", + old_num_io_queues, ctrlr->num_io_queues); + } } if (nvme_ctrlr_create_qpairs(ctrlr) != 0) { From owner-svn-src-all@freebsd.org Thu Feb 11 17:33:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80915AA5F59; Thu, 11 Feb 2016 17:33:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 38AC319D7; Thu, 11 Feb 2016 17:33:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BHXub0049917; Thu, 11 Feb 2016 17:33:56 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BHXuhk049913; Thu, 11 Feb 2016 17:33:56 GMT (envelope-from des@FreeBSD.org) Message-Id: <201602111733.u1BHXuhk049913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Thu, 11 Feb 2016 17:33:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295533 - in head: . tools/build/mk usr.sbin/unbound/control X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 17:33:57 -0000 Author: des Date: Thu Feb 11 17:33:55 2016 New Revision: 295533 URL: https://svnweb.freebsd.org/changeset/base/295533 Log: Remove unbound-contrl-setup since we use a local control socket which does not require keys. MFC after: 3 days Relnotes: yes Modified: head/ObsoleteFiles.inc head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.sbin/unbound/control/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Feb 11 17:32:41 2016 (r295532) +++ head/ObsoleteFiles.inc Thu Feb 11 17:33:55 2016 (r295533) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20160211: Remove obsolete unbound-control-setup +OLD_FILES+=usr/sbin/unbound-control-setup # 20160116: Update mandoc to cvs snapshot 20160116 OLD_FILES+=usr/share/mdocml/example.style.css OLD_FILES+=usr/share/mdocml/style.css Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Thu Feb 11 17:32:41 2016 (r295532) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Thu Feb 11 17:33:55 2016 (r295533) @@ -7970,7 +7970,6 @@ OLD_FILES+=usr/sbin/unbound OLD_FILES+=usr/sbin/unbound-anchor OLD_FILES+=usr/sbin/unbound-checkconf OLD_FILES+=usr/sbin/unbound-control -OLD_FILES+=usr/sbin/unbound-control-setup OLD_FILES+=usr/share/man/man5/unbound.conf.5.gz OLD_FILES+=usr/share/man/man8/unbound-anchor.8.gz OLD_FILES+=usr/share/man/man8/unbound-checkconf.8.gz Modified: head/usr.sbin/unbound/control/Makefile ============================================================================== --- head/usr.sbin/unbound/control/Makefile Thu Feb 11 17:32:41 2016 (r295532) +++ head/usr.sbin/unbound/control/Makefile Thu Feb 11 17:33:55 2016 (r295533) @@ -7,7 +7,6 @@ UNBOUNDDIR= ${.CURDIR}/../../../contrib/ .PATH: ${UNBOUNDDIR} ${UNBOUNDDIR}/smallapp ${UNBOUNDDIR}/doc PROG= unbound-control -SCRIPTS= unbound-control-setup.sh SRCS= unbound-control.c worker_cb.c CFLAGS= -I${UNBOUNDDIR} -I${LDNSDIR} LIBADD= unbound crypto ssl pthread From owner-svn-src-all@freebsd.org Thu Feb 11 17:34:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12246AA5FBD; Thu, 11 Feb 2016 17:34:28 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 C7B461B39; Thu, 11 Feb 2016 17:34:27 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BHYQRX049997; Thu, 11 Feb 2016 17:34:26 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BHYQ0K049994; Thu, 11 Feb 2016 17:34:26 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201602111734.u1BHYQ0K049994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 11 Feb 2016 17:34:26 +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: r295534 - stable/10/sys/dev/ixgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 17:34:28 -0000 Author: smh Date: Thu Feb 11 17:34:26 2016 New Revision: 295534 URL: https://svnweb.freebsd.org/changeset/base/295534 Log: MFC r294795 ixgbe sysctl hardware defaults Approved by: re (marius) Sponsored by: Multiplay Modified: stable/10/sys/dev/ixgbe/if_ix.c stable/10/sys/dev/ixgbe/ixgbe.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ixgbe/if_ix.c ============================================================================== --- stable/10/sys/dev/ixgbe/if_ix.c Thu Feb 11 17:33:55 2016 (r295533) +++ stable/10/sys/dev/ixgbe/if_ix.c Thu Feb 11 17:34:26 2016 (r295534) @@ -165,12 +165,14 @@ static void ixgbe_unregister_vlan(void * static void ixgbe_add_device_sysctls(struct adapter *); static void ixgbe_add_hw_stats(struct adapter *); +static int ixgbe_set_flowcntl(struct adapter *, int); +static int ixgbe_set_advertise(struct adapter *, int); /* Sysctl handlers */ static void ixgbe_set_sysctl_value(struct adapter *, const char *, const char *, int *, int); -static int ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS); -static int ixgbe_set_advertise(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_flowcntl(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_advertise(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_thermal_test(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_dmac(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_phy_temp(SYSCTL_HANDLER_ARGS); @@ -293,6 +295,16 @@ SYSCTL_INT(_hw_ix, OID_AUTO, tx_process_ "Maximum number of sent packets to process at a time," "-1 means unlimited"); +/* Flow control setting, default to full */ +static int ixgbe_flow_control = ixgbe_fc_full; +SYSCTL_INT(_hw_ix, OID_AUTO, flow_control, CTLFLAG_RDTUN, + &ixgbe_flow_control, 0, "Default flow control used for all adapters"); + +/* Advertise Speed, default to 0 (auto) */ +static int ixgbe_advertise_speed = 0; +SYSCTL_INT(_hw_ix, OID_AUTO, advertise_speed, CTLFLAG_RDTUN, + &ixgbe_advertise_speed, 0, "Default advertised speed for all adapters"); + /* ** Smart speed setting, default to on ** this only works as a compile option @@ -575,6 +587,11 @@ ixgbe_attach(device_t dev) break; } + /* hw.ix defaults init */ + ixgbe_set_advertise(adapter, ixgbe_advertise_speed); + ixgbe_set_flowcntl(adapter, ixgbe_flow_control); + adapter->enable_aim = ixgbe_enable_aim; + if ((adapter->msix > 1) && (ixgbe_enable_msix)) error = ixgbe_allocate_msix(adapter); else @@ -1569,7 +1586,7 @@ ixgbe_msix_que(void *arg) /* Do AIM now? */ - if (ixgbe_enable_aim == FALSE) + if (adapter->enable_aim == FALSE) goto no_calc; /* ** Do Adaptive Interrupt Moderation: @@ -4295,7 +4312,7 @@ ixgbe_add_device_sysctls(struct adapter /* Sysctls for all devices */ SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "fc", CTLTYPE_INT | CTLFLAG_RW, adapter, 0, - ixgbe_set_flowcntl, "I", IXGBE_SYSCTL_DESC_SET_FC); + ixgbe_sysctl_flowcntl, "I", IXGBE_SYSCTL_DESC_SET_FC); SYSCTL_ADD_INT(ctx, child, OID_AUTO, "enable_aim", CTLFLAG_RW, @@ -4303,7 +4320,7 @@ ixgbe_add_device_sysctls(struct adapter SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "advertise_speed", CTLTYPE_INT | CTLFLAG_RW, adapter, 0, - ixgbe_set_advertise, "I", IXGBE_SYSCTL_DESC_ADV_SPEED); + ixgbe_sysctl_advertise, "I", IXGBE_SYSCTL_DESC_ADV_SPEED); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "thermal_test", CTLTYPE_INT | CTLFLAG_RW, adapter, 0, @@ -4668,41 +4685,51 @@ ixgbe_set_sysctl_value(struct adapter *a ** 3 - full */ static int -ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS) +ixgbe_sysctl_flowcntl(SYSCTL_HANDLER_ARGS) { - int error, last; - struct adapter *adapter = (struct adapter *) arg1; + int error, fc; + struct adapter *adapter; + + adapter = (struct adapter *) arg1; + fc = adapter->fc; - last = adapter->fc; - error = sysctl_handle_int(oidp, &adapter->fc, 0, req); + error = sysctl_handle_int(oidp, &fc, 0, req); if ((error) || (req->newptr == NULL)) return (error); /* Don't bother if it's not changed */ - if (adapter->fc == last) + if (adapter->fc == fc) return (0); - switch (adapter->fc) { - case ixgbe_fc_rx_pause: - case ixgbe_fc_tx_pause: - case ixgbe_fc_full: - adapter->hw.fc.requested_mode = adapter->fc; - if (adapter->num_queues > 1) - ixgbe_disable_rx_drop(adapter); - break; - case ixgbe_fc_none: - adapter->hw.fc.requested_mode = ixgbe_fc_none; - if (adapter->num_queues > 1) - ixgbe_enable_rx_drop(adapter); - break; - default: - adapter->fc = last; - return (EINVAL); + return ixgbe_set_flowcntl(adapter, fc); +} + + +static int +ixgbe_set_flowcntl(struct adapter *adapter, int fc) +{ + + switch (fc) { + case ixgbe_fc_rx_pause: + case ixgbe_fc_tx_pause: + case ixgbe_fc_full: + adapter->hw.fc.requested_mode = adapter->fc; + if (adapter->num_queues > 1) + ixgbe_disable_rx_drop(adapter); + break; + case ixgbe_fc_none: + adapter->hw.fc.requested_mode = ixgbe_fc_none; + if (adapter->num_queues > 1) + ixgbe_enable_rx_drop(adapter); + break; + default: + return (EINVAL); } + adapter->fc = fc; /* Don't autoneg if forcing a value */ adapter->hw.fc.disable_fc_autoneg = TRUE; ixgbe_fc_enable(&adapter->hw); - return error; + return (0); } /* @@ -4713,31 +4740,39 @@ ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS) ** 0x4 - advertise 10G */ static int -ixgbe_set_advertise(SYSCTL_HANDLER_ARGS) +ixgbe_sysctl_advertise(SYSCTL_HANDLER_ARGS) { - int error = 0, requested; - struct adapter *adapter; - device_t dev; - struct ixgbe_hw *hw; - ixgbe_link_speed speed = 0; + int error, advertise; + struct adapter *adapter; adapter = (struct adapter *) arg1; - dev = adapter->dev; - hw = &adapter->hw; + advertise = adapter->advertise; - requested = adapter->advertise; - error = sysctl_handle_int(oidp, &requested, 0, req); + error = sysctl_handle_int(oidp, &advertise, 0, req); if ((error) || (req->newptr == NULL)) return (error); + /* Checks to validate new value */ + if (adapter->advertise == advertise) /* no change */ + return (0); + + return ixgbe_set_advertise(adapter, advertise); +} + +static int +ixgbe_set_advertise(struct adapter *adapter, int advertise) +{ + device_t dev; + struct ixgbe_hw *hw; + ixgbe_link_speed speed; + + hw = &adapter->hw; + dev = adapter->dev; + /* No speed changes for backplane media */ if (hw->phy.media_type == ixgbe_media_type_backplane) return (ENODEV); - /* Checks to validate new value */ - if (adapter->advertise == requested) /* no change */ - return (0); - if (!((hw->phy.media_type == ixgbe_media_type_copper) || (hw->phy.multispeed_fiber))) { device_printf(dev, @@ -4746,13 +4781,13 @@ ixgbe_set_advertise(SYSCTL_HANDLER_ARGS) return (EINVAL); } - if (requested < 0x1 || requested > 0x7) { + if (advertise < 0x1 || advertise > 0x7) { device_printf(dev, "Invalid advertised speed; valid modes are 0x1 through 0x7\n"); return (EINVAL); } - if ((requested & 0x1) + if ((advertise & 0x1) && (hw->mac.type != ixgbe_mac_X540) && (hw->mac.type != ixgbe_mac_X550)) { device_printf(dev, "Set Advertise: 100Mb on X540/X550 only\n"); @@ -4760,18 +4795,19 @@ ixgbe_set_advertise(SYSCTL_HANDLER_ARGS) } /* Set new value and report new advertised mode */ - if (requested & 0x1) + speed = 0; + if (advertise & 0x1) speed |= IXGBE_LINK_SPEED_100_FULL; - if (requested & 0x2) + if (advertise & 0x2) speed |= IXGBE_LINK_SPEED_1GB_FULL; - if (requested & 0x4) + if (advertise & 0x4) speed |= IXGBE_LINK_SPEED_10GB_FULL; + adapter->advertise = advertise; hw->mac.autotry_restart = TRUE; hw->mac.ops.setup_link(hw, speed, TRUE); - adapter->advertise = requested; - return (error); + return (0); } /* Modified: stable/10/sys/dev/ixgbe/ixgbe.h ============================================================================== --- stable/10/sys/dev/ixgbe/ixgbe.h Thu Feb 11 17:33:55 2016 (r295533) +++ stable/10/sys/dev/ixgbe/ixgbe.h Thu Feb 11 17:34:26 2016 (r295534) @@ -497,6 +497,7 @@ struct adapter { u32 optics; u32 fc; /* local flow ctrl setting */ int advertise; /* link speeds */ + bool enable_aim; /* adaptive interrupt moderation */ bool link_active; u16 max_frame_size; u16 num_segs; From owner-svn-src-all@freebsd.org Thu Feb 11 17:37:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AB49AA40A6; Thu, 11 Feb 2016 17:37:05 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 013BA1CDB; Thu, 11 Feb 2016 17:37:04 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BHb4Xe050152; Thu, 11 Feb 2016 17:37:04 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BHb2Cd050137; Thu, 11 Feb 2016 17:37:02 GMT (envelope-from des@FreeBSD.org) Message-Id: <201602111737.u1BHb2Cd050137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Thu, 11 Feb 2016 17:37:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295535 - in head: contrib/unbound contrib/unbound/doc contrib/unbound/services contrib/unbound/util contrib/unbound/validator lib/libunbound usr.sbin/unbound/local-setup X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 17:37:05 -0000 Author: des Date: Thu Feb 11 17:37:02 2016 New Revision: 295535 URL: https://svnweb.freebsd.org/changeset/base/295535 Log: Use the new insecure-lan-zones option instead of listing each AS112 zone separately. MFC after: 3 days Added: head/contrib/unbound/util/as112.c - copied unchanged from r295530, vendor/unbound/dist/util/as112.c head/contrib/unbound/util/as112.h - copied unchanged from r295530, vendor/unbound/dist/util/as112.h Modified: head/contrib/unbound/Makefile.in head/contrib/unbound/doc/example.conf head/contrib/unbound/doc/example.conf.in head/contrib/unbound/doc/unbound.conf.5 head/contrib/unbound/doc/unbound.conf.5.in head/contrib/unbound/services/localzone.c head/contrib/unbound/util/config_file.c head/contrib/unbound/util/config_file.h head/contrib/unbound/util/configlexer.lex head/contrib/unbound/util/configparser.y head/contrib/unbound/validator/val_anchor.c head/lib/libunbound/Makefile head/usr.sbin/unbound/local-setup/local-unbound-setup.sh Directory Properties: head/contrib/unbound/ (props changed) Modified: head/contrib/unbound/Makefile.in ============================================================================== --- head/contrib/unbound/Makefile.in Thu Feb 11 17:34:26 2016 (r295534) +++ head/contrib/unbound/Makefile.in Thu Feb 11 17:37:02 2016 (r295535) @@ -95,7 +95,7 @@ PYUNBOUND_SRC= # libunbound_wrap.lo if python libunbound wrapper enabled. PYUNBOUND_OBJ=@PYUNBOUND_OBJ@ COMMON_SRC=services/cache/dns.c services/cache/infra.c services/cache/rrset.c \ -util/data/dname.c util/data/msgencode.c util/data/msgparse.c \ +util/as112.c util/data/dname.c util/data/msgencode.c util/data/msgparse.c \ util/data/msgreply.c util/data/packed_rrset.c iterator/iterator.c \ iterator/iter_delegpt.c iterator/iter_donotq.c iterator/iter_fwd.c \ iterator/iter_hints.c iterator/iter_priv.c iterator/iter_resptype.c \ @@ -113,7 +113,7 @@ validator/val_neg.c validator/val_nsec3. validator/val_secalgo.c validator/val_sigcrypt.c \ validator/val_utils.c dns64/dns64.c $(CHECKLOCK_SRC) $(DNSTAP_SRC) COMMON_OBJ_WITHOUT_NETCALL=dns.lo infra.lo rrset.lo dname.lo msgencode.lo \ -msgparse.lo msgreply.lo packed_rrset.lo iterator.lo iter_delegpt.lo \ +as112.lo msgparse.lo msgreply.lo packed_rrset.lo iterator.lo iter_delegpt.lo \ iter_donotq.lo iter_fwd.lo iter_hints.lo iter_priv.lo iter_resptype.lo \ iter_scrub.lo iter_utils.lo localzone.lo mesh.lo modstack.lo \ outbound_list.lo alloc.lo config_file.lo configlexer.lo configparser.lo \ @@ -595,6 +595,7 @@ depend: rm -f $(DEPEND_TMP) $(DEPEND_TMP2) # Dependencies +as112.lo as112.o: $(srcdir)/util/as112.c $(srcdir)/util/as112.h dns.lo dns.o: $(srcdir)/services/cache/dns.c config.h $(srcdir)/iterator/iter_delegpt.h $(srcdir)/util/log.h \ $(srcdir)/validator/val_nsec.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/services/cache/dns.h $(srcdir)/util/data/msgreply.h \ @@ -702,7 +703,7 @@ localzone.lo localzone.o: $(srcdir)/serv $(srcdir)/sldns/sbuffer.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/util/data/dname.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgencode.h \ $(srcdir)/util/net_help.h $(srcdir)/util/netevent.h $(srcdir)/util/data/msgreply.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/util/as112.h mesh.lo mesh.o: $(srcdir)/services/mesh.c config.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/netevent.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/util/log.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h \ @@ -821,7 +822,7 @@ val_anchor.lo val_anchor.o: $(srcdir)/va $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_sigcrypt.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/validator/autotrust.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/net_help.h $(srcdir)/util/config_file.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/str2wire.h + $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/str2wire.h $(srcdir)/util/as112.h validator.lo validator.o: $(srcdir)/validator/validator.c config.h $(srcdir)/validator/validator.h \ $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ Modified: head/contrib/unbound/doc/example.conf ============================================================================== --- head/contrib/unbound/doc/example.conf Thu Feb 11 17:34:26 2016 (r295534) +++ head/contrib/unbound/doc/example.conf Thu Feb 11 17:37:02 2016 (r295535) @@ -508,13 +508,17 @@ server: # local-zone: "8.b.d.0.1.0.0.2.ip6.arpa." nodefault # And for 64.100.in-addr.arpa. to 127.100.in-addr.arpa. - # if unbound is running service for the local host then it is useful + # If unbound is running service for the local host then it is useful # to perform lan-wide lookups to the upstream, and unblock the # long list of local-zones above. If this unbound is a dns server # for a network of computers, disabled is better and stops information # leakage of local lan information. # unblock-lan-zones: no + # The insecure-lan-zones option disables validation for + # these zones, as if they were all listed as domain-insecure. + # insecure-lan-zones: no + # a number of locally served zones can be configured. # local-zone: # local-data: "" Modified: head/contrib/unbound/doc/example.conf.in ============================================================================== --- head/contrib/unbound/doc/example.conf.in Thu Feb 11 17:34:26 2016 (r295534) +++ head/contrib/unbound/doc/example.conf.in Thu Feb 11 17:37:02 2016 (r295535) @@ -508,13 +508,17 @@ server: # local-zone: "8.b.d.0.1.0.0.2.ip6.arpa." nodefault # And for 64.100.in-addr.arpa. to 127.100.in-addr.arpa. - # if unbound is running service for the local host then it is useful + # If unbound is running service for the local host then it is useful # to perform lan-wide lookups to the upstream, and unblock the # long list of local-zones above. If this unbound is a dns server # for a network of computers, disabled is better and stops information # leakage of local lan information. # unblock-lan-zones: no + # The insecure-lan-zones option disables validation for + # these zones, as if they were all listed as domain-insecure. + # insecure-lan-zones: no + # a number of locally served zones can be configured. # local-zone: # local-data: "" Modified: head/contrib/unbound/doc/unbound.conf.5 ============================================================================== --- head/contrib/unbound/doc/unbound.conf.5 Thu Feb 11 17:34:26 2016 (r295534) +++ head/contrib/unbound/doc/unbound.conf.5 Thu Feb 11 17:37:02 2016 (r295535) @@ -841,6 +841,11 @@ as a (DHCP-) DNS network resolver for a lookups should be filtered (RFC compliance), this also stops potential data leakage about the local network to the upstream DNS servers. .TP +.B insecure\-lan\-zones: \fI +Default is disabled. If enabled, then reverse lookups in private +address space are not validated. This is usually required whenever +\fIunblock\-lan\-zones\fR is used. +.TP .B local\-zone: \fI Configure a local zone. The type determines the answer to give if there is no match from local\-data. The types are deny, refuse, static, Modified: head/contrib/unbound/doc/unbound.conf.5.in ============================================================================== --- head/contrib/unbound/doc/unbound.conf.5.in Thu Feb 11 17:34:26 2016 (r295534) +++ head/contrib/unbound/doc/unbound.conf.5.in Thu Feb 11 17:37:02 2016 (r295535) @@ -841,6 +841,11 @@ as a (DHCP-) DNS network resolver for a lookups should be filtered (RFC compliance), this also stops potential data leakage about the local network to the upstream DNS servers. .TP +.B insecure\-lan\-zones: \fI +Default is disabled. If enabled, then reverse lookups in private +address space are not validated. This is usually required whenever +\fIunblock\-lan\-zones\fR is used. +.TP .B local\-zone: \fI Configure a local zone. The type determines the answer to give if there is no match from local\-data. The types are deny, refuse, static, Modified: head/contrib/unbound/services/localzone.c ============================================================================== --- head/contrib/unbound/services/localzone.c Thu Feb 11 17:34:26 2016 (r295534) +++ head/contrib/unbound/services/localzone.c Thu Feb 11 17:37:02 2016 (r295535) @@ -51,6 +51,7 @@ #include "util/netevent.h" #include "util/data/msgreply.h" #include "util/data/msgparse.h" +#include "util/as112.h" struct local_zones* local_zones_create(void) @@ -592,6 +593,7 @@ static int lz_enter_defaults(struct local_zones* zones, struct config_file* cfg) { struct local_zone* z; + const char** zstr; /* this list of zones is from RFC 6303 */ @@ -654,110 +656,14 @@ lz_enter_defaults(struct local_zones* zo lock_rw_unlock(&z->lock); } - /* if unblock lan-zones, then do not add the zones below. - * we do add the zones above, about 127.0.0.1, because localhost is - * not on the lan. */ - if(cfg->unblock_lan_zones) - return 1; - - /* block LAN level zones */ - if ( !add_as112_default(zones, cfg, "10.in-addr.arpa.") || - !add_as112_default(zones, cfg, "16.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "17.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "18.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "19.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "20.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "21.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "22.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "23.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "24.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "25.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "26.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "27.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "28.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "29.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "30.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "31.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "168.192.in-addr.arpa.") || - !add_as112_default(zones, cfg, "0.in-addr.arpa.") || - !add_as112_default(zones, cfg, "64.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "65.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "66.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "67.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "68.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "69.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "70.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "71.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "72.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "73.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "74.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "75.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "76.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "77.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "78.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "79.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "80.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "81.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "82.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "83.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "84.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "85.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "86.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "87.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "88.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "89.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "90.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "91.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "92.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "93.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "94.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "95.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "96.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "97.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "98.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "99.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "100.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "101.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "102.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "103.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "104.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "105.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "106.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "107.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "108.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "109.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "110.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "111.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "112.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "113.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "114.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "115.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "116.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "117.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "118.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "119.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "120.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "121.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "122.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "123.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "124.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "125.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "126.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "127.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "254.169.in-addr.arpa.") || - !add_as112_default(zones, cfg, "2.0.192.in-addr.arpa.") || - !add_as112_default(zones, cfg, "100.51.198.in-addr.arpa.") || - !add_as112_default(zones, cfg, "113.0.203.in-addr.arpa.") || - !add_as112_default(zones, cfg, "255.255.255.255.in-addr.arpa.") || - !add_as112_default(zones, cfg, "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa.") || - !add_as112_default(zones, cfg, "d.f.ip6.arpa.") || - !add_as112_default(zones, cfg, "8.e.f.ip6.arpa.") || - !add_as112_default(zones, cfg, "9.e.f.ip6.arpa.") || - !add_as112_default(zones, cfg, "a.e.f.ip6.arpa.") || - !add_as112_default(zones, cfg, "b.e.f.ip6.arpa.") || - !add_as112_default(zones, cfg, "8.b.d.0.1.0.0.2.ip6.arpa.")) { - log_err("out of memory adding default zone"); - return 0; + /* block AS112 zones, unless asked not to */ + if(!cfg->unblock_lan_zones) { + for(zstr = as112_zones; *zstr; zstr++) { + if(!add_as112_default(zones, cfg, *zstr)) { + log_err("out of memory adding default zone"); + return 0; + } + } } return 1; } Copied: head/contrib/unbound/util/as112.c (from r295530, vendor/unbound/dist/util/as112.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/unbound/util/as112.c Thu Feb 11 17:37:02 2016 (r295535, copy of r295530, vendor/unbound/dist/util/as112.c) @@ -0,0 +1,143 @@ +/* + * util/as112.c - list of local zones. + * + * Copyright (c) 2007, NLnet Labs. All rights reserved. + * + * This software is open source. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * Neither the name of the NLNET LABS nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * \file + * + * This file provides a list of lan zones. + */ + +#include "util/as112.h" + +static const char* as112_zone_array[] = { + "10.in-addr.arpa.", + "16.172.in-addr.arpa.", + "17.172.in-addr.arpa.", + "18.172.in-addr.arpa.", + "19.172.in-addr.arpa.", + "20.172.in-addr.arpa.", + "21.172.in-addr.arpa.", + "22.172.in-addr.arpa.", + "23.172.in-addr.arpa.", + "24.172.in-addr.arpa.", + "25.172.in-addr.arpa.", + "26.172.in-addr.arpa.", + "27.172.in-addr.arpa.", + "28.172.in-addr.arpa.", + "29.172.in-addr.arpa.", + "30.172.in-addr.arpa.", + "31.172.in-addr.arpa.", + "168.192.in-addr.arpa.", + "0.in-addr.arpa.", + "64.100.in-addr.arpa.", + "65.100.in-addr.arpa.", + "66.100.in-addr.arpa.", + "67.100.in-addr.arpa.", + "68.100.in-addr.arpa.", + "69.100.in-addr.arpa.", + "70.100.in-addr.arpa.", + "71.100.in-addr.arpa.", + "72.100.in-addr.arpa.", + "73.100.in-addr.arpa.", + "74.100.in-addr.arpa.", + "75.100.in-addr.arpa.", + "76.100.in-addr.arpa.", + "77.100.in-addr.arpa.", + "78.100.in-addr.arpa.", + "79.100.in-addr.arpa.", + "80.100.in-addr.arpa.", + "81.100.in-addr.arpa.", + "82.100.in-addr.arpa.", + "83.100.in-addr.arpa.", + "84.100.in-addr.arpa.", + "85.100.in-addr.arpa.", + "86.100.in-addr.arpa.", + "87.100.in-addr.arpa.", + "88.100.in-addr.arpa.", + "89.100.in-addr.arpa.", + "90.100.in-addr.arpa.", + "91.100.in-addr.arpa.", + "92.100.in-addr.arpa.", + "93.100.in-addr.arpa.", + "94.100.in-addr.arpa.", + "95.100.in-addr.arpa.", + "96.100.in-addr.arpa.", + "97.100.in-addr.arpa.", + "98.100.in-addr.arpa.", + "99.100.in-addr.arpa.", + "100.100.in-addr.arpa.", + "101.100.in-addr.arpa.", + "102.100.in-addr.arpa.", + "103.100.in-addr.arpa.", + "104.100.in-addr.arpa.", + "105.100.in-addr.arpa.", + "106.100.in-addr.arpa.", + "107.100.in-addr.arpa.", + "108.100.in-addr.arpa.", + "109.100.in-addr.arpa.", + "110.100.in-addr.arpa.", + "111.100.in-addr.arpa.", + "112.100.in-addr.arpa.", + "113.100.in-addr.arpa.", + "114.100.in-addr.arpa.", + "115.100.in-addr.arpa.", + "116.100.in-addr.arpa.", + "117.100.in-addr.arpa.", + "118.100.in-addr.arpa.", + "119.100.in-addr.arpa.", + "120.100.in-addr.arpa.", + "121.100.in-addr.arpa.", + "122.100.in-addr.arpa.", + "123.100.in-addr.arpa.", + "124.100.in-addr.arpa.", + "125.100.in-addr.arpa.", + "126.100.in-addr.arpa.", + "127.100.in-addr.arpa.", + "254.169.in-addr.arpa.", + "2.0.192.in-addr.arpa.", + "100.51.198.in-addr.arpa.", + "113.0.203.in-addr.arpa.", + "255.255.255.255.in-addr.arpa.", + "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa.", + "d.f.ip6.arpa.", + "8.e.f.ip6.arpa.", + "9.e.f.ip6.arpa.", + "a.e.f.ip6.arpa.", + "b.e.f.ip6.arpa.", + "8.b.d.0.1.0.0.2.ip6.arpa.", + 0 +}; + +const char** as112_zones = as112_zone_array; Copied: head/contrib/unbound/util/as112.h (from r295530, vendor/unbound/dist/util/as112.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/unbound/util/as112.h Thu Feb 11 17:37:02 2016 (r295535, copy of r295530, vendor/unbound/dist/util/as112.h) @@ -0,0 +1,57 @@ +/* + * util/as112.c - list of local zones. + * + * Copyright (c) 2007, NLnet Labs. All rights reserved. + * + * This software is open source. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * Neither the name of the NLNET LABS nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * \file + * + * This file provides a list of lan zones + */ + +#ifndef UTIL_AS112_H +#define UTIL_AS112_H + +/** + * Array of text-format domain names of the AS112 zones. + * The array ends with NULL. "AS112" is a service on the internet that + * that this array is named after. The names in this list (or some of them) + * are null-routed by this service to avoid load on central servers caused by + * mistaken lookups for local content on the global internet. + * + * This is the list of names that unbound should not normally be sending + * on towards the internet, because they are local-use. + */ +extern const char** as112_zones; + +#endif Modified: head/contrib/unbound/util/config_file.c ============================================================================== --- head/contrib/unbound/util/config_file.c Thu Feb 11 17:34:26 2016 (r295534) +++ head/contrib/unbound/util/config_file.c Thu Feb 11 17:37:02 2016 (r295535) @@ -210,6 +210,7 @@ config_create(void) cfg->local_zones_nodefault = NULL; cfg->local_data = NULL; cfg->unblock_lan_zones = 0; + cfg->insecure_lan_zones = 0; cfg->python_script = NULL; cfg->remote_control_enable = 0; cfg->control_ifs = NULL; @@ -458,6 +459,7 @@ int config_set_option(struct config_file else S_YNO("rrset-roundrobin:", rrset_roundrobin) else S_STRLIST("local-data:", local_data) else S_YNO("unblock-lan-zones:", unblock_lan_zones) + else S_YNO("insecure-lan-zones:", insecure_lan_zones) else S_YNO("control-enable:", remote_control_enable) else S_STRLIST("control-interface:", control_ifs) else S_NUMBER_NONZERO("control-port:", control_port) @@ -739,6 +741,7 @@ config_get_option(struct config_file* cf else O_YNO(opt, "minimal-responses", minimal_responses) else O_YNO(opt, "rrset-roundrobin", rrset_roundrobin) else O_YNO(opt, "unblock-lan-zones", unblock_lan_zones) + else O_YNO(opt, "insecure-lan-zones", insecure_lan_zones) else O_DEC(opt, "max-udp-size", max_udp_size) else O_STR(opt, "python-script", python_script) else O_DEC(opt, "ratelimit", ratelimit) Modified: head/contrib/unbound/util/config_file.h ============================================================================== --- head/contrib/unbound/util/config_file.h Thu Feb 11 17:34:26 2016 (r295534) +++ head/contrib/unbound/util/config_file.h Thu Feb 11 17:37:02 2016 (r295535) @@ -285,8 +285,10 @@ struct config_file { struct config_strlist* local_zones_nodefault; /** local data RRs configured */ struct config_strlist* local_data; - /** unblock lan zones (reverse lookups for 10/8 and so on) */ + /** unblock lan zones (reverse lookups for AS112 zones) */ int unblock_lan_zones; + /** insecure lan zones (don't validate AS112 zones) */ + int insecure_lan_zones; /** remote control section. enable toggle. */ int remote_control_enable; Modified: head/contrib/unbound/util/configlexer.lex ============================================================================== --- head/contrib/unbound/util/configlexer.lex Thu Feb 11 17:34:26 2016 (r295534) +++ head/contrib/unbound/util/configlexer.lex Thu Feb 11 17:37:02 2016 (r295535) @@ -321,6 +321,7 @@ local-zone{COLON} { YDVAR(2, VAR_LOCAL_ local-data{COLON} { YDVAR(1, VAR_LOCAL_DATA) } local-data-ptr{COLON} { YDVAR(1, VAR_LOCAL_DATA_PTR) } unblock-lan-zones{COLON} { YDVAR(1, VAR_UNBLOCK_LAN_ZONES) } +insecure-lan-zones{COLON} { YDVAR(1, VAR_INSECURE_LAN_ZONES) } statistics-interval{COLON} { YDVAR(1, VAR_STATISTICS_INTERVAL) } statistics-cumulative{COLON} { YDVAR(1, VAR_STATISTICS_CUMULATIVE) } extended-statistics{COLON} { YDVAR(1, VAR_EXTENDED_STATISTICS) } Modified: head/contrib/unbound/util/configparser.y ============================================================================== --- head/contrib/unbound/util/configparser.y Thu Feb 11 17:34:26 2016 (r295534) +++ head/contrib/unbound/util/configparser.y Thu Feb 11 17:37:02 2016 (r295535) @@ -106,7 +106,8 @@ extern struct config_parser_state* cfg_p %token VAR_IGNORE_CD_FLAG VAR_LOG_QUERIES VAR_TCP_UPSTREAM VAR_SSL_UPSTREAM %token VAR_SSL_SERVICE_KEY VAR_SSL_SERVICE_PEM VAR_SSL_PORT VAR_FORWARD_FIRST %token VAR_STUB_FIRST VAR_MINIMAL_RESPONSES VAR_RRSET_ROUNDROBIN -%token VAR_MAX_UDP_SIZE VAR_DELAY_CLOSE VAR_UNBLOCK_LAN_ZONES +%token VAR_MAX_UDP_SIZE VAR_DELAY_CLOSE +%token VAR_UNBLOCK_LAN_ZONES VAR_INSECURE_LAN_ZONES %token VAR_INFRA_CACHE_MIN_RTT %token VAR_DNS64_PREFIX VAR_DNS64_SYNTHALL %token VAR_DNSTAP VAR_DNSTAP_ENABLE VAR_DNSTAP_SOCKET_PATH @@ -180,7 +181,8 @@ content_server: server_num_threads | ser server_log_queries | server_tcp_upstream | server_ssl_upstream | server_ssl_service_key | server_ssl_service_pem | server_ssl_port | server_minimal_responses | server_rrset_roundrobin | server_max_udp_size | - server_so_reuseport | server_delay_close | server_unblock_lan_zones | + server_so_reuseport | server_delay_close | + server_unblock_lan_zones | server_insecure_lan_zones | server_dns64_prefix | server_dns64_synthall | server_infra_cache_min_rtt | server_harden_algo_downgrade | server_ip_transparent | server_ratelimit | server_ratelimit_slabs | @@ -722,6 +724,16 @@ server_unblock_lan_zones: VAR_UNBLOCK_LA free($2); } ; +server_insecure_lan_zones: VAR_INSECURE_LAN_ZONES STRING_ARG + { + OUTYY(("P(server_insecure_lan_zones:%s)\n", $2)); + if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->insecure_lan_zones = + (strcmp($2, "yes")==0); + free($2); + } + ; server_rrset_cache_size: VAR_RRSET_CACHE_SIZE STRING_ARG { OUTYY(("P(server_rrset_cache_size:%s)\n", $2)); Modified: head/contrib/unbound/validator/val_anchor.c ============================================================================== --- head/contrib/unbound/validator/val_anchor.c Thu Feb 11 17:34:26 2016 (r295534) +++ head/contrib/unbound/validator/val_anchor.c Thu Feb 11 17:37:02 2016 (r295535) @@ -48,6 +48,7 @@ #include "util/log.h" #include "util/net_help.h" #include "util/config_file.h" +#include "util/as112.h" #include "sldns/sbuffer.h" #include "sldns/rrdef.h" #include "sldns/str2wire.h" @@ -1044,8 +1045,18 @@ int anchors_apply_cfg(struct val_anchors* anchors, struct config_file* cfg) { struct config_strlist* f; + const char** zstr; char* nm; sldns_buffer* parsebuf = sldns_buffer_new(65535); + if(cfg->insecure_lan_zones) { + for(zstr = as112_zones; *zstr; zstr++) { + if(!anchor_insert_insecure(anchors, *zstr)) { + log_err("error in insecure-lan-zones: %s", *zstr); + sldns_buffer_free(parsebuf); + return 0; + } + } + } for(f = cfg->domain_insecure; f; f = f->next) { if(!f->str || f->str[0] == 0) /* empty "" */ continue; Modified: head/lib/libunbound/Makefile ============================================================================== --- head/lib/libunbound/Makefile Thu Feb 11 17:34:26 2016 (r295534) +++ head/lib/libunbound/Makefile Thu Feb 11 17:37:02 2016 (r295535) @@ -12,7 +12,7 @@ PRIVATELIB= CFLAGS= -I${UNBOUNDDIR} -I${LDNSDIR} -I${.OBJDIR} -SRCS= alloc.c autotrust.c config_file.c configlexer.l configparser.y \ +SRCS= alloc.c as112.c autotrust.c config_file.c configlexer.l configparser.y \ context.c dname.c dns.c dns64.c dnstree.c fptr_wlist.c infra.c \ iter_delegpt.c iter_donotq.c iter_fwd.c iter_hints.c iter_priv.c \ iter_resptype.c iter_scrub.c iter_utils.c iterator.c keyraw.c \ Modified: head/usr.sbin/unbound/local-setup/local-unbound-setup.sh ============================================================================== --- head/usr.sbin/unbound/local-setup/local-unbound-setup.sh Thu Feb 11 17:34:26 2016 (r295534) +++ head/usr.sbin/unbound/local-setup/local-unbound-setup.sh Thu Feb 11 17:37:02 2016 (r295535) @@ -210,31 +210,7 @@ gen_lanzones_conf() { echo "server:" echo " # Unblock reverse lookups for LAN addresses" echo " unblock-lan-zones: yes" - echo " domain-insecure: 10.in-addr.arpa." - echo " domain-insecure: 127.in-addr.arpa." - echo " domain-insecure: 16.172.in-addr.arpa." - echo " domain-insecure: 17.172.in-addr.arpa." - echo " domain-insecure: 18.172.in-addr.arpa." - echo " domain-insecure: 19.172.in-addr.arpa." - echo " domain-insecure: 20.172.in-addr.arpa." - echo " domain-insecure: 21.172.in-addr.arpa." - echo " domain-insecure: 22.172.in-addr.arpa." - echo " domain-insecure: 23.172.in-addr.arpa." - echo " domain-insecure: 24.172.in-addr.arpa." - echo " domain-insecure: 25.172.in-addr.arpa." - echo " domain-insecure: 26.172.in-addr.arpa." - echo " domain-insecure: 27.172.in-addr.arpa." - echo " domain-insecure: 28.172.in-addr.arpa." - echo " domain-insecure: 29.172.in-addr.arpa." - echo " domain-insecure: 30.172.in-addr.arpa." - echo " domain-insecure: 31.172.in-addr.arpa." - echo " domain-insecure: 168.192.in-addr.arpa." - echo " domain-insecure: 254.169.in-addr.arpa." - echo " domain-insecure: d.f.ip6.arpa." - echo " domain-insecure: 8.e.ip6.arpa." - echo " domain-insecure: 9.e.ip6.arpa." - echo " domain-insecure: a.e.ip6.arpa." - echo " domain-insecure: b.e.ip6.arpa." + echo " insecure-lan-zones: yes" } # From owner-svn-src-all@freebsd.org Thu Feb 11 17:43:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D9C6AA4475; Thu, 11 Feb 2016 17:43:26 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A93EE269; Thu, 11 Feb 2016 17:43:25 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-wm0-x22f.google.com with SMTP id g62so79249826wme.0; Thu, 11 Feb 2016 09:43:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=9BCkpgLaYnPb5t10KDHYPFzCUXSyY4WKyQ9iPNgXees=; b=HI8P2ww3yG9UYPZ3Dbg6mZ/R9eO2yGdEqPFr4GJf+q4JN8WZtmkRtSBv9I1YiKNNub Xd2Myl1wnW9GUIDs/6G8+oZdgOqiEp8MqYgF8IxFwJywFQpJjDBUj46pigb/mQZAiaqp 7IlQukGBsfBfNvopu7NveFPr1kva4VBNgI3erfKrBkMt6LEfJ+mMpDUH5DH4bbb2fAEa cwg/uFGmZdyeY/BGVDUgNMPVkgpA8uWWW1ey4yBOSrdcjx0kYykqa1DXLyKRY/jeVoFM 6Lfz8tF7ehpyQ+4rABa93R8lkUqyeJempvgvC9Aq3w68dxnGsdVPP7YzY8sYlF5rTdO9 6JOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=9BCkpgLaYnPb5t10KDHYPFzCUXSyY4WKyQ9iPNgXees=; b=KqFsGhR0vbpWQj90q4oWPr7P6O9IqwJFeuoKBsWiPQckmvFhRYdeZDx/zB1/VlaBmD s8ab9Ln7Ofq/6LPkJsSFV6B5MnOTo6kxBhXCR/BLHg4Zbn+e00pEW1K7IBA1q4lXs4sQ /zygWqLG3oAgp7htOGMX1KJ1thn9wvAXrHifeh2fa2cXYbcwI02Bwtw21TBpoFWpNBOA jXh7ir88+TMVHiozxPQOEf9YT5cjrs6Dk4SZifUH6pFsUnRK7kkQfWwle3Q2fmD/RRsX BuQRs8ivVEypP9uj2FNoNW0z+BHIn+km2yELdTcau9VXb+EmmIu4Wgq6V0oCrRQkVXoN ra0Q== X-Gm-Message-State: AG10YORv2p9EQG2a7XvbpxaVPMg4CXvi+SVMGslkgpAlFmdZiW0gxwZp4elron/Y/G4LTMLevSThXRxFutl3Lw== MIME-Version: 1.0 X-Received: by 10.194.22.101 with SMTP id c5mr53453002wjf.151.1455212604230; Thu, 11 Feb 2016 09:43:24 -0800 (PST) Received: by 10.27.170.11 with HTTP; Thu, 11 Feb 2016 09:43:24 -0800 (PST) In-Reply-To: References: <201601191533.u0JFXSxf037804@repo.freebsd.org> <56BAE4BC.9000105@selasky.org> <56BB5280.5060609@FreeBSD.org> Date: Thu, 11 Feb 2016 11:43:24 -0600 Message-ID: Subject: Re: svn commit: r294327 - in head/sys: dev/cxgb dev/cxgbe dev/e1000 dev/hyperv/netvsc dev/ixgbe dev/mxge netinet sys From: Benjamin Kaduk To: Warner Losh Cc: Pedro Giffuni , Hans Petter Selasky , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ryan Stone Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 17:43:26 -0000 On Thu, Feb 11, 2016 at 10:47 AM, Warner Losh wrote: > On Wed, Feb 10, 2016 at 8:08 AM, Pedro Giffuni wrote: > > > If it is faster, is there any good reason to maintain both qsort and > mergesort > in the kernel then? > qsort is not stable; mergesort is. (It's a shame that glibc didn't pick up mergesort.) -Ben From owner-svn-src-all@freebsd.org Thu Feb 11 17:48:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B963AA468B; Thu, 11 Feb 2016 17:48:16 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 3F214680; Thu, 11 Feb 2016 17:48:16 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BHmF0Y053239; Thu, 11 Feb 2016 17:48:15 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BHmF9v053238; Thu, 11 Feb 2016 17:48:15 GMT (envelope-from des@FreeBSD.org) Message-Id: <201602111748.u1BHmF9v053238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Thu, 11 Feb 2016 17:48:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295536 - head/lib/libfetch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 17:48:16 -0000 Author: des Date: Thu Feb 11 17:48:15 2016 New Revision: 295536 URL: https://svnweb.freebsd.org/changeset/base/295536 Log: Fix double-free error: r289419 moved all error handling in http_connect() to the end of the function, but did not remove a fetch_close() call which was made redundant by the one in the shared error-handling code. PR: 206774 Submitted by: Christian Heckendorf MFC after: 3 days Modified: head/lib/libfetch/http.c Modified: head/lib/libfetch/http.c ============================================================================== --- head/lib/libfetch/http.c Thu Feb 11 17:37:02 2016 (r295535) +++ head/lib/libfetch/http.c Thu Feb 11 17:48:15 2016 (r295536) @@ -1435,7 +1435,6 @@ http_connect(struct url *URL, struct url } if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && fetch_ssl(conn, URL, verbose) == -1) { - fetch_close(conn); /* grrr */ errno = EAUTH; fetch_syserr(); From owner-svn-src-all@freebsd.org Thu Feb 11 17:55:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 216B5AA49AB; Thu, 11 Feb 2016 17:55:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 E7239ACA; Thu, 11 Feb 2016 17:55:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BHtHAE056130; Thu, 11 Feb 2016 17:55:17 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BHtHen056128; Thu, 11 Feb 2016 17:55:17 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201602111755.u1BHtHen056128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 11 Feb 2016 17:55: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: r295537 - in stable/10: lib/libdevctl usr.sbin/devctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 17:55:19 -0000 Author: jhb Date: Thu Feb 11 17:55:17 2016 New Revision: 295537 URL: https://svnweb.freebsd.org/changeset/base/295537 Log: MFC 295174: - Note that devctl(8) will appear in 10.3 first. - Add missing devctl_set_driver entry to namelist in devlist(3). Approved by: re (gjb) Modified: stable/10/lib/libdevctl/devctl.3 stable/10/usr.sbin/devctl/devctl.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libdevctl/devctl.3 ============================================================================== --- stable/10/lib/libdevctl/devctl.3 Thu Feb 11 17:48:15 2016 (r295536) +++ stable/10/lib/libdevctl/devctl.3 Thu Feb 11 17:55:17 2016 (r295537) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 26, 2014 +.Dd February 2, 2016 .Dt DEVCTL 3 .Os .Sh NAME @@ -33,7 +33,8 @@ .Nm devctl_attach , .Nm devctl_detach , .Nm devctl_disable , -.Nm devctl_enable +.Nm devctl_enable , +.Nm devctl_set_driver .Nd device control library .Sh LIBRARY .Lb libdevctl @@ -251,4 +252,4 @@ The new device driver failed to attach. The .Nm library first appeared in -.Fx 11.0 . +.Fx 10.3 . Modified: stable/10/usr.sbin/devctl/devctl.8 ============================================================================== --- stable/10/usr.sbin/devctl/devctl.8 Thu Feb 11 17:48:15 2016 (r295536) +++ stable/10/usr.sbin/devctl/devctl.8 Thu Feb 11 17:55:17 2016 (r295537) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 5, 2015 +.Dd February 2, 2016 .Dt DEVCTL 8 .Os .Sh NAME @@ -123,4 +123,4 @@ the device will not be changed. The .Nm utility first appeared in -.Fx 11.0 . +.Fx 10.3 . From owner-svn-src-all@freebsd.org Thu Feb 11 17:56:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42FDEAA4A64; Thu, 11 Feb 2016 17:56:11 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 F0431C40; Thu, 11 Feb 2016 17:56:10 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BHuAG1056202; Thu, 11 Feb 2016 17:56:10 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BHu910056199; Thu, 11 Feb 2016 17:56:09 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201602111756.u1BHu910056199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 11 Feb 2016 17:56: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: r295538 - in stable/10/sys/boot: efi efi/libefi ia64/efi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 17:56:11 -0000 Author: smh Date: Thu Feb 11 17:56:09 2016 New Revision: 295538 URL: https://svnweb.freebsd.org/changeset/base/295538 Log: Fix ia64 build failures in EFI platform The MFC of the recent EFI work to stable/10 caused build breakage under ia64. It was not apparent that there was EFI code outside the EFI tree as this is not the case in HEAD, however in stable/10 there is for ia64. This change does the following: * Re-enables libefi for ia64 under gcc. * Adds the ignore for unsupported pragma's when building libefi for ia64. * Adds the missing parameter to efi_handle_lookup in the ia64 loader. This is a direct commit as ia64 is no longer supported after 10.x Approved by: re (marius) Sponsored by: Multiplay Modified: stable/10/sys/boot/efi/Makefile stable/10/sys/boot/efi/libefi/Makefile stable/10/sys/boot/ia64/efi/main.c Modified: stable/10/sys/boot/efi/Makefile ============================================================================== --- stable/10/sys/boot/efi/Makefile Thu Feb 11 17:55:17 2016 (r295537) +++ stable/10/sys/boot/efi/Makefile Thu Feb 11 17:56:09 2016 (r295538) @@ -11,5 +11,9 @@ SUBDIR+= libefi loader boot1 .endif # ${COMPILER_TYPE} != "gcc" +.if ${MACHINE_CPUARCH} == "ia64" +SUBDIR+= libefi +.endif + .include Modified: stable/10/sys/boot/efi/libefi/Makefile ============================================================================== --- stable/10/sys/boot/efi/libefi/Makefile Thu Feb 11 17:55:17 2016 (r295537) +++ stable/10/sys/boot/efi/libefi/Makefile Thu Feb 11 17:56:09 2016 (r295538) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= efi INTERNALLIB= WARNS?= 2 @@ -7,6 +9,10 @@ WARNS?= 2 SRCS= delay.c efi_console.c efinet.c efipart.c errno.c handles.c \ libefi.c time.c +.if ${MACHINE_CPUARCH} == "ia64" +IGNORE_PRAGMA= 1 +.endif + .if ${MACHINE_ARCH} == "amd64" CFLAGS+= -fPIC -mno-red-zone .endif Modified: stable/10/sys/boot/ia64/efi/main.c ============================================================================== --- stable/10/sys/boot/ia64/efi/main.c Thu Feb 11 17:55:17 2016 (r295537) +++ stable/10/sys/boot/ia64/efi/main.c Thu Feb 11 17:56:09 2016 (r295538) @@ -179,7 +179,8 @@ main(int argc, CHAR16 *argv[]) BS->HandleProtocol(IH, &imgid, (VOID**)&img); bzero(&currdev, sizeof(currdev)); - efi_handle_lookup(img->DeviceHandle, &currdev.d_dev, &currdev.d_unit); + efi_handle_lookup(img->DeviceHandle, &currdev.d_dev, + &currdev.d_unit, NULL); currdev.d_type = currdev.d_dev->dv_type; env_setenv("loaddev", EV_VOLATILE, ia64_fmtdev(&currdev), env_noset, From owner-svn-src-all@freebsd.org Thu Feb 11 17:57:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4229DAA4B8A; Thu, 11 Feb 2016 17:57:44 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 ED1E0DC4; Thu, 11 Feb 2016 17:57:43 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BHvgkM056312; Thu, 11 Feb 2016 17:57:42 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BHvgdd056311; Thu, 11 Feb 2016 17:57:42 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201602111757.u1BHvgdd056311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 11 Feb 2016 17:57:42 +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: r295539 - stable/10/sys/boot/efi/boot1 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 17:57:44 -0000 Author: smh Date: Thu Feb 11 17:57:42 2016 New Revision: 295539 URL: https://svnweb.freebsd.org/changeset/base/295539 Log: MFC r294768: Process /boot/config and /boot.config during EFI boot Approved by: re (marius) Sponsored by: Multiplay Modified: stable/10/sys/boot/efi/boot1/boot1.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/boot1/boot1.c ============================================================================== --- stable/10/sys/boot/efi/boot1/boot1.c Thu Feb 11 17:56:09 2016 (r295538) +++ stable/10/sys/boot/efi/boot1/boot1.c Thu Feb 11 17:57:42 2016 (r295539) @@ -91,13 +91,41 @@ Free(void *buf, const char *file __unuse void try_load(const boot_module_t *mod) { - size_t bufsize; + size_t bufsize, cmdsize; void *buf; + char *cmd; dev_info_t *dev; EFI_HANDLE loaderhandle; EFI_LOADED_IMAGE *loaded_image; EFI_STATUS status; + /* + * Read in and parse the command line from /boot.config or /boot/config, + * if present. We'll pass it the next stage via a simple ASCII + * string. loader.efi has a hack for ASCII strings, so we'll use that to + * keep the size down here. We only try to read the alternate file if + * we get EFI_NOT_FOUND because all other errors mean that the boot_module + * had troubles with the filesystem. We could return early, but we'll let + * loading the actual kernel sort all that out. Since these files are + * optional, we don't report errors in trying to read them. + */ + cmd = NULL; + cmdsize = 0; + status = mod->load(PATH_DOTCONFIG, &dev, &buf, &bufsize); + if (status == EFI_NOT_FOUND) + status = mod->load(PATH_CONFIG, &dev, &buf, &bufsize); + if (status == EFI_SUCCESS) { + cmdsize = bufsize + 1; + cmd = malloc(cmdsize); + if (cmd == NULL) { + free(buf); + return; + } + memcpy(cmd, buf, bufsize); + cmd[bufsize] = '\0'; + free(buf); + } + status = mod->load(PATH_LOADER_EFI, &dev, &buf, &bufsize); if (status == EFI_NOT_FOUND) return; @@ -115,6 +143,9 @@ try_load(const boot_module_t *mod) return; } + if (cmd != NULL) + printf(" command args: %s\n", cmd); + if ((status = bs->HandleProtocol(loaderhandle, &LoadedImageGUID, (VOID**)&loaded_image)) != EFI_SUCCESS) { printf("Failed to query LoadedImage provided by %s (%lu)\n", @@ -123,11 +154,16 @@ try_load(const boot_module_t *mod) } loaded_image->DeviceHandle = dev->devhandle; + loaded_image->LoadOptionsSize = cmdsize; + loaded_image->LoadOptions = cmd; if ((status = bs->StartImage(loaderhandle, NULL, NULL)) != EFI_SUCCESS) { printf("Failed to start image provided by %s (%lu)\n", mod->name, EFI_ERROR_CODE(status)); + free(cmd); + loaded_image->LoadOptionsSize = 0; + loaded_image->LoadOptions = NULL; return; } } From owner-svn-src-all@freebsd.org Thu Feb 11 18:01:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B113AA4E4B; Thu, 11 Feb 2016 18:01:12 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 3EF58FC7; Thu, 11 Feb 2016 18:01:12 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BI1BCo059067; Thu, 11 Feb 2016 18:01:11 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BI1AhG059055; Thu, 11 Feb 2016 18:01:10 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602111801.u1BI1AhG059055@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 11 Feb 2016 18:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295540 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 18:01:12 -0000 Author: andrew Date: Thu Feb 11 18:01:10 2016 New Revision: 295540 URL: https://svnweb.freebsd.org/changeset/base/295540 Log: Enable ARM_INTRNG on all kernel configs where we use the Generic Interrupt Controller. Sponsored by: ABT Systems Ltd Modified: head/sys/arm/conf/ALPINE head/sys/arm/conf/ARMADA38X head/sys/arm/conf/EXYNOS5.common head/sys/arm/conf/ODROIDC1 head/sys/arm/conf/PANDABOARD head/sys/arm/conf/RK3188 head/sys/arm/conf/SOCKIT.common head/sys/arm/conf/VIRT head/sys/arm/conf/VSATV102 head/sys/arm/conf/VYBRID head/sys/arm/conf/ZEDBOARD Modified: head/sys/arm/conf/ALPINE ============================================================================== --- head/sys/arm/conf/ALPINE Thu Feb 11 17:57:42 2016 (r295539) +++ head/sys/arm/conf/ALPINE Thu Feb 11 18:01:10 2016 (r295540) @@ -37,6 +37,7 @@ options DDB #Enable the kernel debugg # Interrupt controller device gic +options ARM_INTRNG # Pseudo devices device loop Modified: head/sys/arm/conf/ARMADA38X ============================================================================== --- head/sys/arm/conf/ARMADA38X Thu Feb 11 17:57:42 2016 (r295539) +++ head/sys/arm/conf/ARMADA38X Thu Feb 11 18:01:10 2016 (r295540) @@ -62,6 +62,7 @@ device pci # Interrupt controllers device gic +options ARM_INTRNG # Timers device mpcore_timer Modified: head/sys/arm/conf/EXYNOS5.common ============================================================================== --- head/sys/arm/conf/EXYNOS5.common Thu Feb 11 17:57:42 2016 (r295539) +++ head/sys/arm/conf/EXYNOS5.common Thu Feb 11 18:01:10 2016 (r295540) @@ -87,6 +87,8 @@ device dwmmc # Interrupt controller device gic +options ARM_INTRNG + # ARM Generic Timer device generic_timer Modified: head/sys/arm/conf/ODROIDC1 ============================================================================== --- head/sys/arm/conf/ODROIDC1 Thu Feb 11 17:57:42 2016 (r295539) +++ head/sys/arm/conf/ODROIDC1 Thu Feb 11 18:01:10 2016 (r295540) @@ -26,6 +26,7 @@ options SMP # Enable multiple cores # Interrupt controller device gic +options ARM_INTRNG options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=odroidc1.dts Modified: head/sys/arm/conf/PANDABOARD ============================================================================== --- head/sys/arm/conf/PANDABOARD Thu Feb 11 17:57:42 2016 (r295539) +++ head/sys/arm/conf/PANDABOARD Thu Feb 11 18:01:10 2016 (r295540) @@ -30,8 +30,6 @@ hints "PANDABOARD.hints" include "std.armv6" include "../ti/omap4/pandaboard/std.pandaboard" -options ARM_INTRNG # new interrupt framework - options HZ=100 options SCHED_ULE # ULE scheduler options PLATFORM @@ -62,6 +60,8 @@ options DDB # Enable the kernel debug device fdt_pinctrl # Interrupt controller device gic +options ARM_INTRNG + # ARM MPCore timer device mpcore_timer Modified: head/sys/arm/conf/RK3188 ============================================================================== --- head/sys/arm/conf/RK3188 Thu Feb 11 17:57:42 2016 (r295539) +++ head/sys/arm/conf/RK3188 Thu Feb 11 18:01:10 2016 (r295540) @@ -47,6 +47,8 @@ options ROOTDEVNAME=\"ufs:/dev/mmcsd0\" # Interrupt controller device gic +options ARM_INTRNG + # ARM MPCore timer device mpcore_timer Modified: head/sys/arm/conf/SOCKIT.common ============================================================================== --- head/sys/arm/conf/SOCKIT.common Thu Feb 11 17:57:42 2016 (r295539) +++ head/sys/arm/conf/SOCKIT.common Thu Feb 11 18:01:10 2016 (r295540) @@ -53,6 +53,8 @@ options INVARIANT_SUPPORT # Extra sanit # Interrupt controller device gic +options ARM_INTRNG + # ARM MPCore timer device mpcore_timer Modified: head/sys/arm/conf/VIRT ============================================================================== --- head/sys/arm/conf/VIRT Thu Feb 11 17:57:42 2016 (r295539) +++ head/sys/arm/conf/VIRT Thu Feb 11 18:01:10 2016 (r295540) @@ -46,6 +46,8 @@ options INVARIANT_SUPPORT # Extra sanit # Interrupt controller device gic +options ARM_INTRNG + # ARM Generic Timer device generic_timer Modified: head/sys/arm/conf/VSATV102 ============================================================================== --- head/sys/arm/conf/VSATV102 Thu Feb 11 17:57:42 2016 (r295539) +++ head/sys/arm/conf/VSATV102 Thu Feb 11 18:01:10 2016 (r295540) @@ -26,6 +26,7 @@ options SMP # Enable multiple cores # Interrupt controller device gic +options ARM_INTRNG options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=vsatv102-m6.dts Modified: head/sys/arm/conf/VYBRID ============================================================================== --- head/sys/arm/conf/VYBRID Thu Feb 11 17:57:42 2016 (r295539) +++ head/sys/arm/conf/VYBRID Thu Feb 11 18:01:10 2016 (r295540) @@ -62,6 +62,8 @@ options NO_SWAPPING # Interrupt controller device gic +options ARM_INTRNG + # ARM MPCore timer device mpcore_timer Modified: head/sys/arm/conf/ZEDBOARD ============================================================================== --- head/sys/arm/conf/ZEDBOARD Thu Feb 11 17:57:42 2016 (r295539) +++ head/sys/arm/conf/ZEDBOARD Thu Feb 11 18:01:10 2016 (r295540) @@ -52,6 +52,8 @@ options ROOTDEVNAME=\"ufs:mmcsd0s2a\" # Interrupt controller device gic +options ARM_INTRNG + # Cache controller device pl310 # PL310 L2 cache controller # ARM MPCore timer From owner-svn-src-all@freebsd.org Thu Feb 11 18:35:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40EDFAA5E80; Thu, 11 Feb 2016 18:35:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 142A4F9; Thu, 11 Feb 2016 18:35:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BIZlSV067793; Thu, 11 Feb 2016 18:35:47 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BIZlIT067792; Thu, 11 Feb 2016 18:35:47 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201602111835.u1BIZlIT067792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 11 Feb 2016 18:35:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295541 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 18:35:48 -0000 Author: tuexen Date: Thu Feb 11 18:35:46 2016 New Revision: 295541 URL: https://svnweb.freebsd.org/changeset/base/295541 Log: Use 4 spaces instead of a tab. Modified: head/sys/netinet/sctp_sysctl.c Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Thu Feb 11 18:01:10 2016 (r295540) +++ head/sys/netinet/sctp_sysctl.c Thu Feb 11 18:35:46 2016 (r295541) @@ -426,11 +426,11 @@ sctp_sysctl_handle_assoclist(SYSCTL_HAND xinpcb.maxqlen = 0; } else { xinpcb.qlen = so->so_qlen; - xinpcb.qlen_old = so->so_qlen > USHRT_MAX ? - USHRT_MAX : (uint16_t) so->so_qlen; + xinpcb.qlen_old = so->so_qlen > USHRT_MAX ? + USHRT_MAX : (uint16_t) so->so_qlen; xinpcb.maxqlen = so->so_qlimit; - xinpcb.maxqlen_old = so->so_qlimit > USHRT_MAX ? - USHRT_MAX : (uint16_t) so->so_qlimit; + xinpcb.maxqlen_old = so->so_qlimit > USHRT_MAX ? + USHRT_MAX : (uint16_t) so->so_qlimit; } SCTP_INP_INCR_REF(inp); SCTP_INP_RUNLOCK(inp); From owner-svn-src-all@freebsd.org Thu Feb 11 18:37:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E6CCAA5F1D; Thu, 11 Feb 2016 18:37:04 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 4BB522E8; Thu, 11 Feb 2016 18:37:04 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BIb3r8067885; Thu, 11 Feb 2016 18:37:03 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BIb3Yh067883; Thu, 11 Feb 2016 18:37:03 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201602111837.u1BIb3Yh067883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 11 Feb 2016 18:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295542 - head/share/examples/jails X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 18:37:04 -0000 Author: dteske Date: Thu Feb 11 18:37:02 2016 New Revision: 295542 URL: https://svnweb.freebsd.org/changeset/base/295542 Log: Add example VIMAGE config required by vnet jails Added: head/share/examples/jails/VIMAGE (contents, props changed) Modified: head/share/examples/jails/README Modified: head/share/examples/jails/README ============================================================================== --- head/share/examples/jails/README Thu Feb 11 18:35:46 2016 (r295541) +++ head/share/examples/jails/README Thu Feb 11 18:37:02 2016 (r295542) @@ -1,5 +1,13 @@ # $FreeBSD$ +The below 4 samples require a VIMAGE enabled kernel: + + # (as root) + $ cp VIMAGE /usr/src/sys/amd64/conf/ + $ cd /usr/src + $ make KERNCONF=VIMAGE kernel + $ reboot + Sample 1: jail.conf(5) $ cp jib jng /usr/sbin/ Added: head/share/examples/jails/VIMAGE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/jails/VIMAGE Thu Feb 11 18:37:02 2016 (r295542) @@ -0,0 +1,59 @@ +# $FreeBSD$ + +################################################################################ +######################### VIMAGE KERNEL CONFIGURATION ########################## +################################################################################ + +#################### Inheritance + +# +# Inherit from, and override `GENERIC' +# +include GENERIC # Base configuration file +ident VIMAGE # Kernel name + +################################################################################ +##################### ENABLE NON-INHERITED OPTIONS/DEVICES ##################### +################################################################################ + +#################### Non-GENERIC options + +# +# Network Virtualization for Jails +# +options VIMAGE # vnet paravirtualization + +# +# Netgraph based bridging for vnet jails +# NB: Not strictly necessary; will load automatically via KLD when needed +# +options NETGRAPH # netgraph(4) system +options NETGRAPH_BRIDGE # ng_bridge(4) +options NETGRAPH_EIFACE # ng_eiface(4) +options NETGRAPH_ETHER # ng_ether(4) +options NETGRAPH_SOCKET # ng_socket(4) + +#################### Non-GENERIC devices + +# +# if_bridge based bridging for vnet jails +# NB: Not strictly necessary; will load automatically via KLD when needed +# +device epair # epair(4) +device if_bridge # if_bridge(4) + +################################################################################ +################ DISABLE UNNECESSARY INHERITED OPTIONS/DEVICES ################ +################################################################################ + +#################### Disable select inherited options + +# none + +#################### Disable select inherited devices + +# none + +################################################################################ +# END +################################################################################ From owner-svn-src-all@freebsd.org Thu Feb 11 19:01:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79784AA6C82 for ; Thu, 11 Feb 2016 19:01:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm12-vm0.bullet.mail.bf1.yahoo.com (nm12-vm0.bullet.mail.bf1.yahoo.com [98.139.213.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3474A17A7 for ; Thu, 11 Feb 2016 19:01:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1455216961; bh=4KXPsko9wGHwyuTl07pI17AAVMsVG+n5F2A7DWUnQ5w=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=A2B06Ps6XpMuEKOeyJm8Yz+GLgs6rbOWaLQKEqT6N1vvBL+1VfdFukqOkoB/iIKU3mXEkOLMF751ldNLvurMcOjhOQ80++Fu6cedF272G70lZQSXJWRBH3tSXIskBzLeXNUaLSjDu3NHrsCTCHHbtgHqjyvcgkFg0rHSDM9K0z+zjC3Ewo6KCIa4iUzn0rpUMf2O23IPlwO008KC/wNDzkga3vbCTS+xN8AF9cYly/Qabo60fF8Zeo13Fc8y/UA4WDL2yT/Iqel+4rhjv+hQBPmuaD+FJhP2JX/5b6VCwiGODgjkJlZeUnPJKzIyRUkEypZscn+pnLuwzCHPddHGwA== Received: from [98.139.170.180] by nm12.bullet.mail.bf1.yahoo.com with NNFMP; 11 Feb 2016 18:56:01 -0000 Received: from [98.139.211.194] by tm23.bullet.mail.bf1.yahoo.com with NNFMP; 11 Feb 2016 18:56:01 -0000 Received: from [127.0.0.1] by smtp203.mail.bf1.yahoo.com with NNFMP; 11 Feb 2016 18:56:01 -0000 X-Yahoo-Newman-Id: 466356.20803.bm@smtp203.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: .iZi1_cVM1k9QNqfXxZPkKjLtZ9TajZFR_cKPl0KHtOzCPJ L9ZAAi6ASlSCV5rzf9IJKtmFazegCk0zxBxWtr0cyPACwEeHXbtWRofBeQZq Uzuo3xHYGvABq_H5xfVcgnIevN1lPRFQ1sohD7Hxscp6QuYZkdhGtmg71E56 byuWDhIPAmS4EZlz1aA4sA.m3RBRjOziVapXYBX23P5O28ud4nSKhnbdXlYn b.qtAGIW10onmevrdiN7VP4fDXsd66DZ4OOKtvvuChq7qCB2irhmIaO_kh_b Svg49OW3c9U7DBtoOvvVMnUP.4Wh6s30Skbxb56T5b.AMVsYrfHNtGQZ10Ze HdJy2iXoQcIWbe8Mf_NFtz8RxakMlop2CHokuLv4qpbZ7TwT1qzXpZAkAiox zt.iTIIfLPR0pPIwB1GC_hOUp5Y4OfayDhcLJzseS1.iN3heQwe2D.yc4ys5 2F5xMEhH0.Fnn6S1u.DqpLRIAdwR1Zp2PuwukzBOPN4F8rhbKiyfIRljYYdr 2O7klw0pRwa6NJzz.Vu1xL6eXOmwyLAqQ X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r295523 - head/sys/fs/ext2fs To: Bruce Evans References: <201602111527.u1BFRFMe011283@repo.freebsd.org> <20160212030505.C1943@besplex.bde.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: <56BCD950.6090803@FreeBSD.org> Date: Thu, 11 Feb 2016 13:56:16 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160212030505.C1943@besplex.bde.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 19:01:31 -0000 On 02/11/16 11:54, Bruce Evans wrote: > On Thu, 11 Feb 2016, Pedro F. Giffuni wrote: > >> Log: >> Ext4: Use boolean type instead of '0' and '1' >> >> There are precedents of uses of bool in the kernel and >> it is incorrect style to use integers as replacement for >> a boolean type. > > This is all backwards. > > It is correct style to use integers to represent booleans. > We had this same discussion for ddb. You didn't agree there either though. > There are precedents for breaking this style by using the > bool type, but not many in fs code: > This line of code (from ext2_bmap.c): if (path.ep_is_sparse) is correct only of ep_is_sparse is boolean. If it is an int it has to be rewritten as: if (path.ep_is_sparse != 0) I chose to keep it boolean. > In all of /sys/fs/*, there were just 12 lines of declarations > that use 'bool'. All of these were in autofs. Now there are > 13 such lines (1 more in ext2fs). 1 use is especially useless > and especially unlikely to be all uses of booleans. > The age of the code matters. Ext2 has a lot of code copy/pasted from UFS and it is useful to keep it similar. The ext4 code is new, I don't expect to maintain the exact style unless it's documented as part of style(9). Pedro. From owner-svn-src-all@freebsd.org Thu Feb 11 19:06:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41C14AA6E33 for ; Thu, 11 Feb 2016 19:06:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm3-vm0.bullet.mail.bf1.yahoo.com (nm3-vm0.bullet.mail.bf1.yahoo.com [98.139.212.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1FD51A85 for ; Thu, 11 Feb 2016 19:06:21 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1455217574; bh=U5wZNBCcnHJsrOxiQx0nLOFEoYND7bdxpbCKFB1AzFE=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=lZzA2gSTJYZda4aFn+1k93HF2XOpM7qp6jXEMGH8VtLnEpjZGs2G62sTD/Tw8ItYj/BdZ22Jyii4T2odH4VSOEIfH0+1655uOnxGGtnUdkedCZnJi1qzrSm3Q4jAdlShINwil8qld4VK6iPL30H2XuuFmmS6r0yrOkvoVGT6H58SExTeVPa5LLOz8KmY+kN5E4t8xfv35Ao1TppXQOnuFsg/E9e2Y8a8wBeokUY/kgzmRQP0i3QJxIBO8K+Q9C3aMoywUpQXJBfcSPWunPsmeAyMndMzGp4SiV+3xuOU9bckIh7Kh0RTjzIrQ83LARs58cIuzpZP4T2vwVM8+L0KVQ== Received: from [66.196.81.170] by nm3.bullet.mail.bf1.yahoo.com with NNFMP; 11 Feb 2016 19:06:14 -0000 Received: from [98.139.211.200] by tm16.bullet.mail.bf1.yahoo.com with NNFMP; 11 Feb 2016 19:06:14 -0000 Received: from [127.0.0.1] by smtp209.mail.bf1.yahoo.com with NNFMP; 11 Feb 2016 19:06:10 -0000 X-Yahoo-Newman-Id: 914600.44526.bm@smtp209.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: OTUcLf4VM1kGLT_9rhskKKhYf6MPrbaritSepFlw6sfx_tW 9Uckwxpd7wboT.tkARKB9VxqlwgQE55WBokChZb1xNkygeEisC0jRmmV74e. L3F4NjuV2j7MBS.os0.pxDq7nBSkzdoLFWVXXacpgxE3u3z5cUzVWlff01TQ AFVHAeFcyvez2s1cpuUnW2Du7FlQxx4D0O9k8K.h2nNUnDK5dzlkUeJVxZwk Zu9Np8WQ3HbFRD36nz4VLsQFJDDvIY16EZp5Rlux6JSKe4wPu0LfXSwLyc9C KtphJAy5_DJW9vfSvcZk_kIf_34FU2QZ5TxXS8WveUU7aC2GUIWeihhsluYb 2WE8zQbu2oOqDIswi6bCqLBm9K5mlbmeElgdSkBx8pD3wEkulRuMpbB8jz4Q ou4wnYDRg1NL2uMTUYr2uA.q3zsw6axMni_GWZIep0ZsCssDEI0Akm2juSO3 kcia2ir6K0xF9TEi2yLc0qmySkX8d4XsCekAhRnP5Vi9Lki5IjBYHrHF8jBi LUI68jhXg0_zRWTZ_ElmsaCKpec44j0n3 X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r294327 - in head/sys: dev/cxgb dev/cxgbe dev/e1000 dev/hyperv/netvsc dev/ixgbe dev/mxge netinet sys To: Warner Losh References: <201601191533.u0JFXSxf037804@repo.freebsd.org> <56BAE4BC.9000105@selasky.org> <56BB5280.5060609@FreeBSD.org> Cc: Hans Petter Selasky , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Pedro Giffuni Message-ID: <56BCDBB1.9000202@FreeBSD.org> Date: Thu, 11 Feb 2016 14:06:25 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 19:06:22 -0000 On 02/11/16 11:47, Warner Losh wrote: > > > On Wed, Feb 10, 2016 at 8:08 AM, Pedro Giffuni > > FWIW, our libc qsort() has an additional enhancement: > > http://svnweb.freebsd.org/base?view=revision&revision=279663 > > In my measurements qsort(3) was now always faster than mergesort(3). > > > If it is faster, is there any good reason to maintain both qsort and > mergesort in the kernel then? > I don't know, that happened ages ago, way before I was around ;). The late enhancement is only in the libc qsort and the code is likely to be different in other ways (is it recursive? .. haven't looked). I think I saw some comments somewhere about degenerate cases that affect our version of qsort, but the performance is known to be very good[1]. Pedro. [1] http://calmerthanyouare.org/2013/05/31/qsort-shootout.html From owner-svn-src-all@freebsd.org Thu Feb 11 21:28:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BC81AA55AE; Thu, 11 Feb 2016 21:28:36 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 36D60A76; Thu, 11 Feb 2016 21:28:36 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BLSZ1t017776; Thu, 11 Feb 2016 21:28:35 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BLSZ0p017774; Thu, 11 Feb 2016 21:28:35 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201602112128.u1BLSZ0p017774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 11 Feb 2016 21:28:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295546 - head/share/examples/jails X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 21:28:36 -0000 Author: dteske Date: Thu Feb 11 21:28:34 2016 New Revision: 295546 URL: https://svnweb.freebsd.org/changeset/base/295546 Log: Centralize MAC derivation formula Modified: head/share/examples/jails/jib head/share/examples/jails/jng Modified: head/share/examples/jails/jib ============================================================================== --- head/share/examples/jails/jib Thu Feb 11 20:16:11 2016 (r295545) +++ head/share/examples/jails/jib Thu Feb 11 21:28:34 2016 (r295546) @@ -170,6 +170,91 @@ action_usage() exit $FAILURE } +derive_mac() +{ + local OPTIND=1 OPTARG __flag + local __mac_num= __make_pair= + while getopts 2n: __flag; do + case "$__flag" in + 2) __make_pair=1 ;; + n) __mac_num=${OPTARG%%[^0-9]*} ;; + esac + done + shift $(( $OPTIND - 1 )) + + if [ ! "$__mac_num" ]; then + eval __mac_num=\${_${iface}_num:--1} + __mac_num=$(( $__mac_num + 1 )) + eval _${iface}_num=\$__mac_num + fi + + local __iface="$1" __name="$2" __var_to_set="$3" __var_to_set_b="$4" + local __iface_devid __new_devid __num __new_devid_b + # + # Calculate MAC address derived from given iface. + # + # The formula I'm using is ``NP:SS:SS:II:II:II'' where: + # + N denotes 4 bits used as a counter to support branching + # each parent interface up to 15 times under the same jail + # name (see S below). + # + P denotes the special nibble whose value, if one of + # 2, 6, A, or E (but usually 2) denotes a privately + # administered MAC address (while remaining routable). + # + S denotes 16 bits, the sum(1) value of the jail name. + # + I denotes bits that are inherited from parent interface. + # + # The S bits are a CRC-16 checksum of NAME, allowing the jail + # to change link numbers in ng_bridge(4) without affecting the + # MAC address. Meanwhile, if... + # + the jail NAME changes (e.g., it was duplicated and given + # a new name with no other changes) + # + the underlying network interface changes + # + the jail is moved to another host + # the MAC address will be recalculated to a new, similarly + # unique value preventing conflict. + # + __iface_devid=$( ifconfig $__iface ether | awk '/ether/,$0=$2' ) + __new_devid=${__iface_devid#??:??:??} + # :II:II:II => S:II:II:II + __num=$( set -- `echo -n "$__name" | sum` && echo $1 ) + __new_devid=$( printf %x $(( $__num & 15 )) )$__new_devid + # S:II:II:II => :SS:II:II:II + __num=$(( $__num >> 4 )) + __new_devid=:$( printf %x $(( $__num & 15 )) )$__new_devid + # :SS:II:II:II => S:SS:II:II:II + __num=$(( $__num >> 4 )) + __new_devid=$( printf %x $(( $__num & 15 )) )$__new_devid + # S:SS:II:II:II => :SS:SS:II:II:II + __new_devid=:$( printf %x $(( $__num & 15 )) )$__new_devid + # :SS:SS:II:II:II => P:SS:SS:II:II:II + case "$__iface_devid" in + ?2:*) __new_devid=a$__new_devid __new_devid_b=e$__new_devid ;; + ?[Ee]:*) __new_devid=2$__new_devid __new_devid_b=6$__new_devid ;; + *) __new_devid=2$__new_devid __new_devid_b=e$__new_devid + esac + # P:SS:SS:II:II:II => NP:SS:SS:II:II:II + __new_devid=$( printf %x $(( $__mac_num & 15 )) )$__new_devid + __new_devid_b=$( printf %x $(( $__mac_num & 15 )) )$__new_devid_b + + # + # Return derivative MAC address(es) + # + if [ "$__make_pair" ]; then + if [ "$__var_to_set" -a "$__var_to_set_b" ]; then + eval $__var_to_set=\$__new_devid + eval $__var_to_set_b=\$__new_devid_b + else + echo $__new_devid $__new_devid_b + fi + else + if [ "$__var_to_set" ]; then + eval $__var_to_set=\$__new_devid + else + echo $__new_devid + fi + fi +} + mustberoot_to_continue() { if [ "$( id -u )" -ne 0 ]; then @@ -198,8 +283,7 @@ jib_addm() mustberoot_to_continue - local iface iface_devid eiface_devid - local eiface_devid_a eiface_devid_b + local iface eiface_devid_a eiface_devid_b local new num quad i=0 for iface in $*; do @@ -231,79 +315,7 @@ jib_addm() # 6. Set the MAC address of the new interface using a sensible # algorithm to prevent conflicts on the network. # - # The formula I'm using is ``NP:SS:SS:II:II:II'' where: - # + N denotes 4 bits used as a counter to support branching - # each parent interface up to 15 times under the same jail - # name (see S below). - # + P denotes the special nibble whose value, if one of - # 2, 6, A, or E (but usually 2) denotes a privately - # administered MAC address (while remaining routable). - # + S denotes 16 bits, the sum(1) value of the jail name. - # + I denotes bits that are inherited from parent interface. - # - # The S bits are a CRC-16 checksum of NAME, allowing the jail - # to change the epair(4) generation order without affecting the - # MAC address. Meanwhile, if... - # + the jail NAME changes (e.g., it was duplicated and given - # a new name with no other changes) - # + the underlying network interface changes - # + the jail is moved to another host - # the MAC address will be recalculated to a new, similarly - # unique value preventing conflict. - # - iface_devid=$( ifconfig $iface ether | awk '/ether/,$0=$2' ) - eiface_devid=${iface_devid#??:??:??} - num=$( set -- `echo -n $name | sum` && echo $1 ) - quad=$(( $num & 15 )) - case "$quad" in - 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; - 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; - esac - eiface_devid=$quad$eiface_devid - num=$(( $num >> 4 )) - quad=$(( $num & 15 )) - case "$quad" in - 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; - 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; - esac - eiface_devid=$quad$eiface_devid - num=$(( $num >> 4 )) - quad=$(( $num & 15 )) - case "$quad" in - 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; - 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; - esac - eiface_devid=$quad:$eiface_devid - num=$(( $num >> 4 )) - quad=$(( $num & 15 )) - case "$quad" in - 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; - 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; - esac - case "$iface_devid" in - ?[Ee]:*) - eiface_devid_a=2:$quad$eiface_devid - eiface_devid_b=6:$quad$eiface_devid - ;; - *) - eiface_devid_a=2:$quad$eiface_devid - eiface_devid_b=e:$quad$eiface_devid - esac - eval num=\$_${iface}_num - if [ "$num" ]; then - num=$(( $num + 1 )) - eval _${iface}_num=$num - else - num=0 - local _${iface}_num=$num - fi - quad=$(( $num & 15 )) - case "$quad" in - 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; - 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; - esac - eiface_devid_a=$quad$eiface_devid_a - eiface_devid_b=$quad$eiface_devid_b + derive_mac -2 $iface "$name" eiface_devid_a eiface_devid_b ifconfig "e${i}a_$name" ether $eiface_devid_a > /dev/null 2>&1 ifconfig "e${i}b_$name" ether $eiface_devid_b > /dev/null 2>&1 Modified: head/share/examples/jails/jng ============================================================================== --- head/share/examples/jails/jng Thu Feb 11 20:16:11 2016 (r295545) +++ head/share/examples/jails/jng Thu Feb 11 21:28:34 2016 (r295546) @@ -172,6 +172,91 @@ action_usage() exit $FAILURE } +derive_mac() +{ + local OPTIND=1 OPTARG __flag + local __mac_num= __make_pair= + while getopts 2n: __flag; do + case "$__flag" in + 2) __make_pair=1 ;; + n) __mac_num=${OPTARG%%[^0-9]*} ;; + esac + done + shift $(( $OPTIND - 1 )) + + if [ ! "$__mac_num" ]; then + eval __mac_num=\${_${iface}_num:--1} + __mac_num=$(( $__mac_num + 1 )) + eval _${iface}_num=\$__mac_num + fi + + local __iface="$1" __name="$2" __var_to_set="$3" __var_to_set_b="$4" + local __iface_devid __new_devid __num __new_devid_b + # + # Calculate MAC address derived from given iface. + # + # The formula I'm using is ``NP:SS:SS:II:II:II'' where: + # + N denotes 4 bits used as a counter to support branching + # each parent interface up to 15 times under the same jail + # name (see S below). + # + P denotes the special nibble whose value, if one of + # 2, 6, A, or E (but usually 2) denotes a privately + # administered MAC address (while remaining routable). + # + S denotes 16 bits, the sum(1) value of the jail name. + # + I denotes bits that are inherited from parent interface. + # + # The S bits are a CRC-16 checksum of NAME, allowing the jail + # to change link numbers in ng_bridge(4) without affecting the + # MAC address. Meanwhile, if... + # + the jail NAME changes (e.g., it was duplicated and given + # a new name with no other changes) + # + the underlying network interface changes + # + the jail is moved to another host + # the MAC address will be recalculated to a new, similarly + # unique value preventing conflict. + # + __iface_devid=$( ifconfig $__iface ether | awk '/ether/,$0=$2' ) + __new_devid=${__iface_devid#??:??:??} + # :II:II:II => S:II:II:II + __num=$( set -- `echo -n "$__name" | sum` && echo $1 ) + __new_devid=$( printf %x $(( $__num & 15 )) )$__new_devid + # S:II:II:II => :SS:II:II:II + __num=$(( $__num >> 4 )) + __new_devid=:$( printf %x $(( $__num & 15 )) )$__new_devid + # :SS:II:II:II => S:SS:II:II:II + __num=$(( $__num >> 4 )) + __new_devid=$( printf %x $(( $__num & 15 )) )$__new_devid + # S:SS:II:II:II => :SS:SS:II:II:II + __new_devid=:$( printf %x $(( $__num & 15 )) )$__new_devid + # :SS:SS:II:II:II => P:SS:SS:II:II:II + case "$__iface_devid" in + ?2:*) __new_devid=a$__new_devid __new_devid_b=e$__new_devid ;; + ?[Ee]:*) __new_devid=2$__new_devid __new_devid_b=6$__new_devid ;; + *) __new_devid=2$__new_devid __new_devid_b=e$__new_devid + esac + # P:SS:SS:II:II:II => NP:SS:SS:II:II:II + __new_devid=$( printf %x $(( $__mac_num & 15 )) )$__new_devid + __new_devid_b=$( printf %x $(( $__mac_num & 15 )) )$__new_devid_b + + # + # Return derivative MAC address(es) + # + if [ "$__make_pair" ]; then + if [ "$__var_to_set" -a "$__var_to_set_b" ]; then + eval $__var_to_set=\$__new_devid + eval $__var_to_set_b=\$__new_devid_b + else + echo $__new_devid $__new_devid_b + fi + else + if [ "$__var_to_set" ]; then + eval $__var_to_set=\$__new_devid + else + echo $__new_devid + fi + fi +} + mustberoot_to_continue() { if [ "$( id -u )" -ne 0 ]; then @@ -201,7 +286,7 @@ jng_bridge() mustberoot_to_continue - local iface iface_devid eiface eiface_devid + local iface eiface eiface_devid local new num quad i=0 for iface in $*; do @@ -262,74 +347,8 @@ jng_bridge() # 6. Set the MAC address of the new interface using a sensible # algorithm to prevent conflicts on the network. # - # The formula I'm using is ``NP:SS:SS:II:II:II'' where: - # + N denotes 4 bits used as a counter to support branching - # each parent interface up to 15 times under the same jail - # name (see S below). - # + P denotes the special nibble whose value, if one of - # 2, 6, A, or E (but usually 2) denotes a privately - # administered MAC address (while remaining routable). - # + S denotes 16 bits, the sum(1) value of the jail name. - # + I denotes bits that are inherited from parent interface. - # - # The S bits are a CRC-16 checksum of NAME, allowing the jail - # to change link numbers in ng_bridge(4) without affecting the - # MAC address. Meanwhile, if... - # + the jail NAME changes (e.g., it was duplicated and given - # a new name with no other changes) - # + the underlying network interface changes - # + the jail is moved to another host - # the MAC address will be recalculated to a new, similarly - # unique value preventing conflict. - # - iface_devid=$( ifconfig $iface ether | awk '/ether/,$0=$2' ) - eiface_devid=${iface_devid#??:??:??} - num=$( set -- `echo -n $name | sum` && echo $1 ) - quad=$(( $num & 15 )) - case "$quad" in - 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; - 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; - esac - eiface_devid=$quad$eiface_devid - num=$(( $num >> 4 )) - quad=$(( $num & 15 )) - case "$quad" in - 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; - 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; - esac - eiface_devid=$quad$eiface_devid - num=$(( $num >> 4 )) - quad=$(( $num & 15 )) - case "$quad" in - 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; - 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; - esac - eiface_devid=$quad:$eiface_devid - num=$(( $num >> 4 )) - quad=$(( $num & 15 )) - case "$quad" in - 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; - 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; - esac - case "$iface_devid" in - ?2:*) eiface_devid=a:$quad$eiface_devid ;; - *) eiface_devid=2:$quad$eiface_devid - esac - eval num=\$_${iface}_num - if [ "$num" ]; then - num=$(( $num + 1 )) - eval _${iface}_num=$num - else - num=0 - local _${iface}_num=$num - fi - quad=$(( $num & 15 )) - case "$quad" in - 10) quad=a ;; 11) quad=b ;; 12) quad=c ;; - 13) quad=d ;; 14) quad=e ;; 15) quad=f ;; - esac - eiface_devid=$quad$eiface_devid - ifconfig $eiface ether $eiface_devid > /dev/null 2>&1 + derive_mac $iface "$name" eiface_devid + ifconfig $eiface ether $eiface_devid i=$(( $i + 1 )) # on to next ng{i}_name done # for iface From owner-svn-src-all@freebsd.org Thu Feb 11 21:32:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25CBDAA5872; Thu, 11 Feb 2016 21:32:25 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 E4108E6F; Thu, 11 Feb 2016 21:32:24 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BLWOeV020502; Thu, 11 Feb 2016 21:32:24 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BLWN8b020499; Thu, 11 Feb 2016 21:32:23 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201602112132.u1BLWN8b020499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 11 Feb 2016 21:32:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295547 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 21:32:25 -0000 Author: glebius Date: Thu Feb 11 21:32:23 2016 New Revision: 295547 URL: https://svnweb.freebsd.org/changeset/base/295547 Log: o Gather all mbuf(9) allocation functions into kern_mbuf.c, and all mbuf(9) manipulation functions into uipc_mbuf.c. This looks like the initial intent, but had diffused in the last decade. o Gather all declarations in mbuf.h in one place and sort them. o Uninline m_clget() and m_cljget(). There are no functional changes in this patch. The patch comes from a larger version, where all mbuf(9) allocation was uninlined, which allowed to make mbuf(9) UMA zones private to kern_mbuf.c. The performance impact of the total uninlining is still unclear, so we are holding on now with larger version. Together with: melifaro, olivier Modified: head/sys/kern/kern_mbuf.c head/sys/kern/uipc_mbuf.c head/sys/sys/mbuf.h Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Thu Feb 11 21:28:34 2016 (r295546) +++ head/sys/kern/kern_mbuf.c Thu Feb 11 21:32:23 2016 (r295547) @@ -44,8 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include #include @@ -284,7 +282,6 @@ static void mb_dtor_clust(void *, int, v static void mb_dtor_pack(void *, int, void *); static int mb_zinit_pack(void *, int, int); static void mb_zfini_pack(void *, int); - static void mb_reclaim(uma_zone_t, int); static void *mbuf_jumbo_alloc(uma_zone_t, vm_size_t, uint8_t *, int); @@ -644,24 +641,6 @@ mb_ctor_pack(void *mem, int size, void * return (error); } -int -m_pkthdr_init(struct mbuf *m, int how) -{ -#ifdef MAC - int error; -#endif - m->m_data = m->m_pktdat; - bzero(&m->m_pkthdr, sizeof(m->m_pkthdr)); -#ifdef MAC - /* If the label init fails, fail the alloc */ - error = mac_mbuf_init(m, how); - if (error) - return (error); -#endif - - return (0); -} - /* * This is the protocol drain routine. Called by UMA whenever any of the * mbuf zones is closed to its limit. @@ -683,3 +662,323 @@ mb_reclaim(uma_zone_t zone __unused, int if (pr->pr_drain != NULL) (*pr->pr_drain)(); } + +/* + * Clean up after mbufs with M_EXT storage attached to them if the + * reference count hits 1. + */ +void +mb_free_ext(struct mbuf *m) +{ + int freembuf; + + KASSERT(m->m_flags & M_EXT, ("%s: M_EXT not set on %p", __func__, m)); + + /* + * Check if the header is embedded in the cluster. + */ + freembuf = (m->m_flags & M_NOFREE) ? 0 : 1; + + switch (m->m_ext.ext_type) { + case EXT_SFBUF: + sf_ext_free(m->m_ext.ext_arg1, m->m_ext.ext_arg2); + break; + case EXT_SFBUF_NOCACHE: + sf_ext_free_nocache(m->m_ext.ext_arg1, m->m_ext.ext_arg2); + break; + default: + KASSERT(m->m_ext.ext_cnt != NULL, + ("%s: no refcounting pointer on %p", __func__, m)); + /* + * Free attached storage if this mbuf is the only + * reference to it. + */ + if (*(m->m_ext.ext_cnt) != 1) { + if (atomic_fetchadd_int(m->m_ext.ext_cnt, -1) != 1) + break; + } + + switch (m->m_ext.ext_type) { + case EXT_PACKET: /* The packet zone is special. */ + if (*(m->m_ext.ext_cnt) == 0) + *(m->m_ext.ext_cnt) = 1; + uma_zfree(zone_pack, m); + return; /* Job done. */ + case EXT_CLUSTER: + uma_zfree(zone_clust, m->m_ext.ext_buf); + break; + case EXT_JUMBOP: + uma_zfree(zone_jumbop, m->m_ext.ext_buf); + break; + case EXT_JUMBO9: + uma_zfree(zone_jumbo9, m->m_ext.ext_buf); + break; + case EXT_JUMBO16: + uma_zfree(zone_jumbo16, m->m_ext.ext_buf); + break; + case EXT_NET_DRV: + case EXT_MOD_TYPE: + case EXT_DISPOSABLE: + *(m->m_ext.ext_cnt) = 0; + uma_zfree(zone_ext_refcnt, __DEVOLATILE(u_int *, + m->m_ext.ext_cnt)); + /* FALLTHROUGH */ + case EXT_EXTREF: + KASSERT(m->m_ext.ext_free != NULL, + ("%s: ext_free not set", __func__)); + (*(m->m_ext.ext_free))(m, m->m_ext.ext_arg1, + m->m_ext.ext_arg2); + break; + default: + KASSERT(m->m_ext.ext_type == 0, + ("%s: unknown ext_type", __func__)); + } + } + + if (freembuf) + uma_zfree(zone_mbuf, m); +} + +/* + * Official mbuf(9) allocation KPI for stack and drivers: + * + * m_get() - a single mbuf without any attachments, sys/mbuf.h. + * m_gethdr() - a single mbuf initialized as M_PKTHDR, sys/mbuf.h. + * m_getcl() - an mbuf + 2k cluster, sys/mbuf.h. + * m_clget() - attach cluster to already allocated mbuf. + * m_cljget() - attach jumbo cluster to already allocated mbuf. + * m_get2() - allocate minimum mbuf that would fit size argument. + * m_getm2() - allocate a chain of mbufs/clusters. + * m_extadd() - attach external cluster to mbuf. + * + * m_free() - free single mbuf with its tags and ext, sys/mbuf.h. + * m_freem() - free chain of mbufs. + */ + +int +m_clget(struct mbuf *m, int how) +{ + + KASSERT((m->m_flags & M_EXT) == 0, ("%s: mbuf %p has M_EXT", + __func__, m)); + m->m_ext.ext_buf = (char *)NULL; + uma_zalloc_arg(zone_clust, m, how); + /* + * On a cluster allocation failure, drain the packet zone and retry, + * we might be able to loosen a few clusters up on the drain. + */ + if ((how & M_NOWAIT) && (m->m_ext.ext_buf == NULL)) { + zone_drain(zone_pack); + uma_zalloc_arg(zone_clust, m, how); + } + return (m->m_flags & M_EXT); +} + +/* + * m_cljget() is different from m_clget() as it can allocate clusters without + * attaching them to an mbuf. In that case the return value is the pointer + * to the cluster of the requested size. If an mbuf was specified, it gets + * the cluster attached to it and the return value can be safely ignored. + * For size it takes MCLBYTES, MJUMPAGESIZE, MJUM9BYTES, MJUM16BYTES. + */ +void * +m_cljget(struct mbuf *m, int how, int size) +{ + uma_zone_t zone; + + if (m != NULL) { + KASSERT((m->m_flags & M_EXT) == 0, ("%s: mbuf %p has M_EXT", + __func__, m)); + m->m_ext.ext_buf = NULL; + } + + zone = m_getzone(size); + return (uma_zalloc_arg(zone, m, how)); +} + +/* + * m_get2() allocates minimum mbuf that would fit "size" argument. + */ +struct mbuf * +m_get2(int size, int how, short type, int flags) +{ + struct mb_args args; + struct mbuf *m, *n; + + args.flags = flags; + args.type = type; + + if (size <= MHLEN || (size <= MLEN && (flags & M_PKTHDR) == 0)) + return (uma_zalloc_arg(zone_mbuf, &args, how)); + if (size <= MCLBYTES) + return (uma_zalloc_arg(zone_pack, &args, how)); + + if (size > MJUMPAGESIZE) + return (NULL); + + m = uma_zalloc_arg(zone_mbuf, &args, how); + if (m == NULL) + return (NULL); + + n = uma_zalloc_arg(zone_jumbop, m, how); + if (n == NULL) { + uma_zfree(zone_mbuf, m); + return (NULL); + } + + return (m); +} + +/* + * m_getjcl() returns an mbuf with a cluster of the specified size attached. + * For size it takes MCLBYTES, MJUMPAGESIZE, MJUM9BYTES, MJUM16BYTES. + */ +struct mbuf * +m_getjcl(int how, short type, int flags, int size) +{ + struct mb_args args; + struct mbuf *m, *n; + uma_zone_t zone; + + if (size == MCLBYTES) + return m_getcl(how, type, flags); + + args.flags = flags; + args.type = type; + + m = uma_zalloc_arg(zone_mbuf, &args, how); + if (m == NULL) + return (NULL); + + zone = m_getzone(size); + n = uma_zalloc_arg(zone, m, how); + if (n == NULL) { + uma_zfree(zone_mbuf, m); + return (NULL); + } + return (m); +} + +/* + * Allocate a given length worth of mbufs and/or clusters (whatever fits + * best) and return a pointer to the top of the allocated chain. If an + * existing mbuf chain is provided, then we will append the new chain + * to the existing one but still return the top of the newly allocated + * chain. + */ +struct mbuf * +m_getm2(struct mbuf *m, int len, int how, short type, int flags) +{ + struct mbuf *mb, *nm = NULL, *mtail = NULL; + + KASSERT(len >= 0, ("%s: len is < 0", __func__)); + + /* Validate flags. */ + flags &= (M_PKTHDR | M_EOR); + + /* Packet header mbuf must be first in chain. */ + if ((flags & M_PKTHDR) && m != NULL) + flags &= ~M_PKTHDR; + + /* Loop and append maximum sized mbufs to the chain tail. */ + while (len > 0) { + if (len > MCLBYTES) + mb = m_getjcl(how, type, (flags & M_PKTHDR), + MJUMPAGESIZE); + else if (len >= MINCLSIZE) + mb = m_getcl(how, type, (flags & M_PKTHDR)); + else if (flags & M_PKTHDR) + mb = m_gethdr(how, type); + else + mb = m_get(how, type); + + /* Fail the whole operation if one mbuf can't be allocated. */ + if (mb == NULL) { + if (nm != NULL) + m_freem(nm); + return (NULL); + } + + /* Book keeping. */ + len -= M_SIZE(mb); + if (mtail != NULL) + mtail->m_next = mb; + else + nm = mb; + mtail = mb; + flags &= ~M_PKTHDR; /* Only valid on the first mbuf. */ + } + if (flags & M_EOR) + mtail->m_flags |= M_EOR; /* Only valid on the last mbuf. */ + + /* If mbuf was supplied, append new chain to the end of it. */ + if (m != NULL) { + for (mtail = m; mtail->m_next != NULL; mtail = mtail->m_next) + ; + mtail->m_next = nm; + mtail->m_flags &= ~M_EOR; + } else + m = nm; + + return (m); +} + +/*- + * Configure a provided mbuf to refer to the provided external storage + * buffer and setup a reference count for said buffer. If the setting + * up of the reference count fails, the M_EXT bit will not be set. If + * successfull, the M_EXT bit is set in the mbuf's flags. + * + * Arguments: + * mb The existing mbuf to which to attach the provided buffer. + * buf The address of the provided external storage buffer. + * size The size of the provided buffer. + * freef A pointer to a routine that is responsible for freeing the + * provided external storage buffer. + * args A pointer to an argument structure (of any type) to be passed + * to the provided freef routine (may be NULL). + * flags Any other flags to be passed to the provided mbuf. + * type The type that the external storage buffer should be + * labeled with. + * + * Returns: + * Nothing. + */ +int +m_extadd(struct mbuf *mb, caddr_t buf, u_int size, + void (*freef)(struct mbuf *, void *, void *), void *arg1, void *arg2, + int flags, int type, int wait) +{ + KASSERT(type != EXT_CLUSTER, ("%s: EXT_CLUSTER not allowed", __func__)); + + if (type != EXT_EXTREF) + mb->m_ext.ext_cnt = uma_zalloc(zone_ext_refcnt, wait); + + if (mb->m_ext.ext_cnt == NULL) + return (ENOMEM); + + *(mb->m_ext.ext_cnt) = 1; + mb->m_flags |= (M_EXT | flags); + mb->m_ext.ext_buf = buf; + mb->m_data = mb->m_ext.ext_buf; + mb->m_ext.ext_size = size; + mb->m_ext.ext_free = freef; + mb->m_ext.ext_arg1 = arg1; + mb->m_ext.ext_arg2 = arg2; + mb->m_ext.ext_type = type; + mb->m_ext.ext_flags = 0; + + return (0); +} + +/* + * Free an entire chain of mbufs and associated external buffers, if + * applicable. + */ +void +m_freem(struct mbuf *mb) +{ + + while (mb != NULL) + mb = m_free(mb); +} Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Thu Feb 11 21:28:34 2016 (r295546) +++ head/sys/kern/uipc_mbuf.c Thu Feb 11 21:32:23 2016 (r295547) @@ -48,6 +48,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + int max_linkhdr; int max_protohdr; int max_hdr; @@ -132,269 +134,6 @@ CTASSERT(sizeof(m_assertbuf.m_stailqpkt) #endif /* - * m_get2() allocates minimum mbuf that would fit "size" argument. - */ -struct mbuf * -m_get2(int size, int how, short type, int flags) -{ - struct mb_args args; - struct mbuf *m, *n; - - args.flags = flags; - args.type = type; - - if (size <= MHLEN || (size <= MLEN && (flags & M_PKTHDR) == 0)) - return (uma_zalloc_arg(zone_mbuf, &args, how)); - if (size <= MCLBYTES) - return (uma_zalloc_arg(zone_pack, &args, how)); - - if (size > MJUMPAGESIZE) - return (NULL); - - m = uma_zalloc_arg(zone_mbuf, &args, how); - if (m == NULL) - return (NULL); - - n = uma_zalloc_arg(zone_jumbop, m, how); - if (n == NULL) { - uma_zfree(zone_mbuf, m); - return (NULL); - } - - return (m); -} - -/* - * m_getjcl() returns an mbuf with a cluster of the specified size attached. - * For size it takes MCLBYTES, MJUMPAGESIZE, MJUM9BYTES, MJUM16BYTES. - */ -struct mbuf * -m_getjcl(int how, short type, int flags, int size) -{ - struct mb_args args; - struct mbuf *m, *n; - uma_zone_t zone; - - if (size == MCLBYTES) - return m_getcl(how, type, flags); - - args.flags = flags; - args.type = type; - - m = uma_zalloc_arg(zone_mbuf, &args, how); - if (m == NULL) - return (NULL); - - zone = m_getzone(size); - n = uma_zalloc_arg(zone, m, how); - if (n == NULL) { - uma_zfree(zone_mbuf, m); - return (NULL); - } - return (m); -} - -/* - * Allocate a given length worth of mbufs and/or clusters (whatever fits - * best) and return a pointer to the top of the allocated chain. If an - * existing mbuf chain is provided, then we will append the new chain - * to the existing one but still return the top of the newly allocated - * chain. - */ -struct mbuf * -m_getm2(struct mbuf *m, int len, int how, short type, int flags) -{ - struct mbuf *mb, *nm = NULL, *mtail = NULL; - - KASSERT(len >= 0, ("%s: len is < 0", __func__)); - - /* Validate flags. */ - flags &= (M_PKTHDR | M_EOR); - - /* Packet header mbuf must be first in chain. */ - if ((flags & M_PKTHDR) && m != NULL) - flags &= ~M_PKTHDR; - - /* Loop and append maximum sized mbufs to the chain tail. */ - while (len > 0) { - if (len > MCLBYTES) - mb = m_getjcl(how, type, (flags & M_PKTHDR), - MJUMPAGESIZE); - else if (len >= MINCLSIZE) - mb = m_getcl(how, type, (flags & M_PKTHDR)); - else if (flags & M_PKTHDR) - mb = m_gethdr(how, type); - else - mb = m_get(how, type); - - /* Fail the whole operation if one mbuf can't be allocated. */ - if (mb == NULL) { - if (nm != NULL) - m_freem(nm); - return (NULL); - } - - /* Book keeping. */ - len -= M_SIZE(mb); - if (mtail != NULL) - mtail->m_next = mb; - else - nm = mb; - mtail = mb; - flags &= ~M_PKTHDR; /* Only valid on the first mbuf. */ - } - if (flags & M_EOR) - mtail->m_flags |= M_EOR; /* Only valid on the last mbuf. */ - - /* If mbuf was supplied, append new chain to the end of it. */ - if (m != NULL) { - for (mtail = m; mtail->m_next != NULL; mtail = mtail->m_next) - ; - mtail->m_next = nm; - mtail->m_flags &= ~M_EOR; - } else - m = nm; - - return (m); -} - -/* - * Free an entire chain of mbufs and associated external buffers, if - * applicable. - */ -void -m_freem(struct mbuf *mb) -{ - - while (mb != NULL) - mb = m_free(mb); -} - -/*- - * Configure a provided mbuf to refer to the provided external storage - * buffer and setup a reference count for said buffer. If the setting - * up of the reference count fails, the M_EXT bit will not be set. If - * successfull, the M_EXT bit is set in the mbuf's flags. - * - * Arguments: - * mb The existing mbuf to which to attach the provided buffer. - * buf The address of the provided external storage buffer. - * size The size of the provided buffer. - * freef A pointer to a routine that is responsible for freeing the - * provided external storage buffer. - * args A pointer to an argument structure (of any type) to be passed - * to the provided freef routine (may be NULL). - * flags Any other flags to be passed to the provided mbuf. - * type The type that the external storage buffer should be - * labeled with. - * - * Returns: - * Nothing. - */ -int -m_extadd(struct mbuf *mb, caddr_t buf, u_int size, - void (*freef)(struct mbuf *, void *, void *), void *arg1, void *arg2, - int flags, int type, int wait) -{ - KASSERT(type != EXT_CLUSTER, ("%s: EXT_CLUSTER not allowed", __func__)); - - if (type != EXT_EXTREF) - mb->m_ext.ext_cnt = uma_zalloc(zone_ext_refcnt, wait); - - if (mb->m_ext.ext_cnt == NULL) - return (ENOMEM); - - *(mb->m_ext.ext_cnt) = 1; - mb->m_flags |= (M_EXT | flags); - mb->m_ext.ext_buf = buf; - mb->m_data = mb->m_ext.ext_buf; - mb->m_ext.ext_size = size; - mb->m_ext.ext_free = freef; - mb->m_ext.ext_arg1 = arg1; - mb->m_ext.ext_arg2 = arg2; - mb->m_ext.ext_type = type; - mb->m_ext.ext_flags = 0; - - return (0); -} - -/* - * Non-directly-exported function to clean up after mbufs with M_EXT - * storage attached to them if the reference count hits 1. - */ -void -mb_free_ext(struct mbuf *m) -{ - int freembuf; - - KASSERT(m->m_flags & M_EXT, ("%s: M_EXT not set on %p", __func__, m)); - - /* - * Check if the header is embedded in the cluster. - */ - freembuf = (m->m_flags & M_NOFREE) ? 0 : 1; - - switch (m->m_ext.ext_type) { - case EXT_SFBUF: - sf_ext_free(m->m_ext.ext_arg1, m->m_ext.ext_arg2); - break; - case EXT_SFBUF_NOCACHE: - sf_ext_free_nocache(m->m_ext.ext_arg1, m->m_ext.ext_arg2); - break; - default: - KASSERT(m->m_ext.ext_cnt != NULL, - ("%s: no refcounting pointer on %p", __func__, m)); - /* - * Free attached storage if this mbuf is the only - * reference to it. - */ - if (*(m->m_ext.ext_cnt) != 1) { - if (atomic_fetchadd_int(m->m_ext.ext_cnt, -1) != 1) - break; - } - - switch (m->m_ext.ext_type) { - case EXT_PACKET: /* The packet zone is special. */ - if (*(m->m_ext.ext_cnt) == 0) - *(m->m_ext.ext_cnt) = 1; - uma_zfree(zone_pack, m); - return; /* Job done. */ - case EXT_CLUSTER: - uma_zfree(zone_clust, m->m_ext.ext_buf); - break; - case EXT_JUMBOP: - uma_zfree(zone_jumbop, m->m_ext.ext_buf); - break; - case EXT_JUMBO9: - uma_zfree(zone_jumbo9, m->m_ext.ext_buf); - break; - case EXT_JUMBO16: - uma_zfree(zone_jumbo16, m->m_ext.ext_buf); - break; - case EXT_NET_DRV: - case EXT_MOD_TYPE: - case EXT_DISPOSABLE: - *(m->m_ext.ext_cnt) = 0; - uma_zfree(zone_ext_refcnt, __DEVOLATILE(u_int *, - m->m_ext.ext_cnt)); - /* FALLTHROUGH */ - case EXT_EXTREF: - KASSERT(m->m_ext.ext_free != NULL, - ("%s: ext_free not set", __func__)); - (*(m->m_ext.ext_free))(m, m->m_ext.ext_arg1, - m->m_ext.ext_arg2); - break; - default: - KASSERT(m->m_ext.ext_type == 0, - ("%s: unknown ext_type", __func__)); - } - } - - if (freembuf) - uma_zfree(zone_mbuf, m); -} - -/* * Attach the cluster from *m to *n, set up m_ext in *n * and bump the refcount of the cluster. */ @@ -534,6 +273,26 @@ m_sanity(struct mbuf *m0, int sanitize) #undef M_SANITY_ACTION } +/* + * Non-inlined part of m_init(). + */ +int +m_pkthdr_init(struct mbuf *m, int how) +{ +#ifdef MAC + int error; +#endif + m->m_data = m->m_pktdat; + bzero(&m->m_pkthdr, sizeof(m->m_pkthdr)); +#ifdef MAC + /* If the label init fails, fail the alloc */ + error = mac_mbuf_init(m, how); + if (error) + return (error); +#endif + + return (0); +} /* * "Move" mbuf pkthdr from "from" to "to". Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Thu Feb 11 21:28:34 2016 (r295546) +++ head/sys/sys/mbuf.h Thu Feb 11 21:32:23 2016 (r295547) @@ -528,7 +528,50 @@ extern uma_zone_t zone_ext_refcnt; void mb_dupcl(struct mbuf *, const struct mbuf *); void mb_free_ext(struct mbuf *); +void m_adj(struct mbuf *, int); +int m_apply(struct mbuf *, int, int, + int (*)(void *, void *, u_int), void *); +int m_append(struct mbuf *, int, c_caddr_t); +void m_cat(struct mbuf *, struct mbuf *); +void m_catpkt(struct mbuf *, struct mbuf *); +int m_clget(struct mbuf *m, int how); +void *m_cljget(struct mbuf *m, int how, int size); +struct mbuf *m_collapse(struct mbuf *, int, int); +void m_copyback(struct mbuf *, int, int, c_caddr_t); +void m_copydata(const struct mbuf *, int, int, caddr_t); +struct mbuf *m_copym(const struct mbuf *, int, int, int); +struct mbuf *m_copypacket(struct mbuf *, int); +void m_copy_pkthdr(struct mbuf *, struct mbuf *); +struct mbuf *m_copyup(struct mbuf *, int, int); +struct mbuf *m_defrag(struct mbuf *, int); +void m_demote_pkthdr(struct mbuf *); +void m_demote(struct mbuf *, int, int); +struct mbuf *m_devget(char *, int, int, struct ifnet *, + void (*)(char *, caddr_t, u_int)); +struct mbuf *m_dup(const struct mbuf *, int); +int m_dup_pkthdr(struct mbuf *, const struct mbuf *, int); +int m_extadd(struct mbuf *, caddr_t, u_int, + void (*)(struct mbuf *, void *, void *), void *, void *, + int, int, int); +u_int m_fixhdr(struct mbuf *); +struct mbuf *m_fragment(struct mbuf *, int, int); +void m_freem(struct mbuf *); +struct mbuf *m_get2(int, int, short, int); +struct mbuf *m_getjcl(int, short, int, int); +struct mbuf *m_getm2(struct mbuf *, int, int, short, int); +struct mbuf *m_getptr(struct mbuf *, int, int *); +u_int m_length(struct mbuf *, struct mbuf **); +int m_mbuftouio(struct uio *, struct mbuf *, int); +void m_move_pkthdr(struct mbuf *, struct mbuf *); int m_pkthdr_init(struct mbuf *, int); +struct mbuf *m_prepend(struct mbuf *, int, int); +void m_print(const struct mbuf *, int); +struct mbuf *m_pulldown(struct mbuf *, int, int, int *); +struct mbuf *m_pullup(struct mbuf *, int); +int m_sanity(struct mbuf *, int); +struct mbuf *m_split(struct mbuf *, int, int); +struct mbuf *m_uiotombuf(struct uio *, int, int, int, int); +struct mbuf *m_unshare(struct mbuf *, int); static __inline int m_gettype(int size) @@ -666,47 +709,6 @@ m_getcl(int how, short type, int flags) return (uma_zalloc_arg(zone_pack, &args, how)); } -static __inline int -m_clget(struct mbuf *m, int how) -{ - - KASSERT((m->m_flags & M_EXT) == 0, ("%s: mbuf %p has M_EXT", - __func__, m)); - m->m_ext.ext_buf = (char *)NULL; - uma_zalloc_arg(zone_clust, m, how); - /* - * On a cluster allocation failure, drain the packet zone and retry, - * we might be able to loosen a few clusters up on the drain. - */ - if ((how & M_NOWAIT) && (m->m_ext.ext_buf == NULL)) { - zone_drain(zone_pack); - uma_zalloc_arg(zone_clust, m, how); - } - return (m->m_flags & M_EXT); -} - -/* - * m_cljget() is different from m_clget() as it can allocate clusters without - * attaching them to an mbuf. In that case the return value is the pointer - * to the cluster of the requested size. If an mbuf was specified, it gets - * the cluster attached to it and the return value can be safely ignored. - * For size it takes MCLBYTES, MJUMPAGESIZE, MJUM9BYTES, MJUM16BYTES. - */ -static __inline void * -m_cljget(struct mbuf *m, int how, int size) -{ - uma_zone_t zone; - - if (m != NULL) { - KASSERT((m->m_flags & M_EXT) == 0, ("%s: mbuf %p has M_EXT", - __func__, m)); - m->m_ext.ext_buf = NULL; - } - - zone = m_getzone(size); - return (uma_zalloc_arg(zone, m, how)); -} - static __inline void m_cljset(struct mbuf *m, void *cl, int type) { @@ -924,50 +926,6 @@ extern int max_linkhdr; /* Largest link extern int max_protohdr; /* Largest protocol header */ extern int nmbclusters; /* Maximum number of clusters */ -struct uio; - -void m_adj(struct mbuf *, int); -int m_apply(struct mbuf *, int, int, - int (*)(void *, void *, u_int), void *); -int m_append(struct mbuf *, int, c_caddr_t); -void m_cat(struct mbuf *, struct mbuf *); -void m_catpkt(struct mbuf *, struct mbuf *); -int m_extadd(struct mbuf *, caddr_t, u_int, - void (*)(struct mbuf *, void *, void *), void *, void *, - int, int, int); -struct mbuf *m_collapse(struct mbuf *, int, int); -void m_copyback(struct mbuf *, int, int, c_caddr_t); -void m_copydata(const struct mbuf *, int, int, caddr_t); -struct mbuf *m_copym(const struct mbuf *, int, int, int); -struct mbuf *m_copypacket(struct mbuf *, int); -void m_copy_pkthdr(struct mbuf *, struct mbuf *); -struct mbuf *m_copyup(struct mbuf *, int, int); -struct mbuf *m_defrag(struct mbuf *, int); -void m_demote_pkthdr(struct mbuf *); -void m_demote(struct mbuf *, int, int); -struct mbuf *m_devget(char *, int, int, struct ifnet *, - void (*)(char *, caddr_t, u_int)); -struct mbuf *m_dup(const struct mbuf *, int); -int m_dup_pkthdr(struct mbuf *, const struct mbuf *, int); -u_int m_fixhdr(struct mbuf *); -struct mbuf *m_fragment(struct mbuf *, int, int); -void m_freem(struct mbuf *); -struct mbuf *m_get2(int, int, short, int); -struct mbuf *m_getjcl(int, short, int, int); -struct mbuf *m_getm2(struct mbuf *, int, int, short, int); -struct mbuf *m_getptr(struct mbuf *, int, int *); -u_int m_length(struct mbuf *, struct mbuf **); -int m_mbuftouio(struct uio *, struct mbuf *, int); -void m_move_pkthdr(struct mbuf *, struct mbuf *); -struct mbuf *m_prepend(struct mbuf *, int, int); -void m_print(const struct mbuf *, int); -struct mbuf *m_pulldown(struct mbuf *, int, int, int *); -struct mbuf *m_pullup(struct mbuf *, int); -int m_sanity(struct mbuf *, int); -struct mbuf *m_split(struct mbuf *, int, int); -struct mbuf *m_uiotombuf(struct uio *, int, int, int, int); -struct mbuf *m_unshare(struct mbuf *, int); - /*- * Network packets may have annotations attached by affixing a list of * "packet tags" to the pkthdr structure. Packet tags are dynamically From owner-svn-src-all@freebsd.org Thu Feb 11 22:10:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B963AA6788; Thu, 11 Feb 2016 22:10:56 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 113931F04; Thu, 11 Feb 2016 22:10:55 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BMAtTp029386; Thu, 11 Feb 2016 22:10:55 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BMAtgc029385; Thu, 11 Feb 2016 22:10:55 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201602112210.u1BMAtgc029385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 11 Feb 2016 22:10:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295548 - head/share/examples/jails X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 22:10:56 -0000 Author: dteske Date: Thu Feb 11 22:10:54 2016 New Revision: 295548 URL: https://svnweb.freebsd.org/changeset/base/295548 Log: Add support for bridging iwn(4) based wlan(4) Documented in iwn(4), "Only one virtual interface may be configured at any time." However, netgraph with a cloned MAC address is able to communicate over an ng_eiface attached to an ng_bridge linked to the wlan(4) interface. While here, introduce syntax to specify the MAC address is to be cloned if the named interface begins with equals [=]. Modified: head/share/examples/jails/jng Modified: head/share/examples/jails/jng ============================================================================== --- head/share/examples/jails/jng Thu Feb 11 21:32:23 2016 (r295547) +++ head/share/examples/jails/jng Thu Feb 11 22:10:54 2016 (r295548) @@ -265,7 +265,7 @@ mustberoot_to_continue() fi } -jng_bridge_usage="bridge [-b BRIDGE_NAME] NAME interface0 [interface1 ...]" +jng_bridge_usage="bridge [-b BRIDGE_NAME] NAME [=]iface0 [[=]iface1 ...]" jng_bridge_descr="Create ng0_NAME [ng1_NAME ...]" jng_bridge() { @@ -286,10 +286,15 @@ jng_bridge() mustberoot_to_continue - local iface eiface eiface_devid - local new num quad i=0 + local iface parent eiface eiface_devid + local new clone_mac num quad i=0 for iface in $*; do + clone_mac= + case "$iface" in + =*) iface=${iface#=} clone_mac=1 ;; + esac + # 0. Make sure the interface doesn't exist already eiface=ng${i}_$name ngctl msg "$eiface:" getifname > /dev/null 2>&1 && continue @@ -347,7 +352,23 @@ jng_bridge() # 6. Set the MAC address of the new interface using a sensible # algorithm to prevent conflicts on the network. # - derive_mac $iface "$name" eiface_devid + case "$iface" in + wlan[0-9]*) + parent=$( sysctl -n net.wlan.${iface#wlan}.%parent ) + case "$parent" in + iwn[0-9]*) + # iwn(4) supports only 1 virtual net at a time + # NB: Cloning MAC allows new interface to work + clone_mac=1 ;; + esac + esac + if [ "$clone_mac" ]; then + eiface_devid=$( + ifconfig $iface ether | awk '/ether/,$0=$2' + ) + else + derive_mac $iface "$name" eiface_devid + fi ifconfig $eiface ether $eiface_devid i=$(( $i + 1 )) # on to next ng{i}_name From owner-svn-src-all@freebsd.org Thu Feb 11 22:29:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DB7BAA6ECA; Thu, 11 Feb 2016 22:29:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 31674B2C; Thu, 11 Feb 2016 22:29:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BMTd9Q035092; Thu, 11 Feb 2016 22:29:39 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BMTdS9035091; Thu, 11 Feb 2016 22:29:39 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201602112229.u1BMTdS9035091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 11 Feb 2016 22:29:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295549 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 22:29:40 -0000 Author: tuexen Date: Thu Feb 11 22:29:39 2016 New Revision: 295549 URL: https://svnweb.freebsd.org/changeset/base/295549 Log: Loopback addresses are 127.0.0.0/8, not 127.0.0.1/32. MFC after: 1 week Modified: head/sys/netinet/sctp_constants.h Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Thu Feb 11 22:10:54 2016 (r295548) +++ head/sys/netinet/sctp_constants.h Thu Feb 11 22:29:39 2016 (r295549) @@ -978,10 +978,7 @@ __FBSDID("$FreeBSD$"); (((uint8_t *)&(a)->s_addr)[1] == 168))) #define IN4_ISLOOPBACK_ADDRESS(a) \ - ((((uint8_t *)&(a)->s_addr)[0] == 127) && \ - (((uint8_t *)&(a)->s_addr)[1] == 0) && \ - (((uint8_t *)&(a)->s_addr)[2] == 0) && \ - (((uint8_t *)&(a)->s_addr)[3] == 1)) + (((uint8_t *)&(a)->s_addr)[0] == 127) #define IN4_ISLINKLOCAL_ADDRESS(a) \ ((((uint8_t *)&(a)->s_addr)[0] == 169) && \ From owner-svn-src-all@freebsd.org Thu Feb 11 22:33:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 821B5AA41DB; Thu, 11 Feb 2016 22:33:49 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 5259DF8A; Thu, 11 Feb 2016 22:33:49 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BMXmrt037844; Thu, 11 Feb 2016 22:33:48 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BMXlNk037838; Thu, 11 Feb 2016 22:33:47 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201602112233.u1BMXlNk037838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 11 Feb 2016 22:33: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: r295550 - in stable/10/sys/boot/efi: boot1 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 22:33:49 -0000 Author: smh Date: Thu Feb 11 22:33:47 2016 New Revision: 295550 URL: https://svnweb.freebsd.org/changeset/base/295550 Log: MFC r295320, r295356 (Partial) Fix EFI multi device boot support Approved by: re (marius) Sponsored by: Multiplay Modified: stable/10/sys/boot/efi/boot1/boot1.c stable/10/sys/boot/efi/boot1/boot_module.h stable/10/sys/boot/efi/boot1/ufs_module.c stable/10/sys/boot/efi/boot1/zfs_module.c stable/10/sys/boot/efi/include/efidevp.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/boot1/boot1.c ============================================================================== --- stable/10/sys/boot/efi/boot1/boot1.c Thu Feb 11 22:29:39 2016 (r295549) +++ stable/10/sys/boot/efi/boot1/boot1.c Thu Feb 11 22:33:47 2016 (r295550) @@ -50,9 +50,6 @@ static const boot_module_t *boot_modules void putchar(int c); EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE* Xsystab); -static void try_load(const boot_module_t* mod); -static EFI_STATUS probe_handle(EFI_HANDLE h); - EFI_SYSTEM_TABLE *systab; EFI_BOOT_SERVICES *bs; static EFI_HANDLE *image; @@ -85,20 +82,300 @@ Free(void *buf, const char *file __unuse } /* - * This function only returns if it fails to load the kernel. If it - * succeeds, it simply boots the kernel. + * nodes_match returns TRUE if the imgpath isn't NULL and the nodes match, + * FALSE otherwise. */ -void -try_load(const boot_module_t *mod) +static BOOLEAN +nodes_match(EFI_DEVICE_PATH *imgpath, EFI_DEVICE_PATH *devpath) +{ + int len; + + if (imgpath == NULL || imgpath->Type != devpath->Type || + imgpath->SubType != devpath->SubType) + return (FALSE); + + len = DevicePathNodeLength(imgpath); + if (len != DevicePathNodeLength(devpath)) + return (FALSE); + + return (memcmp(imgpath, devpath, (size_t)len) == 0); +} + +/* + * device_paths_match returns TRUE if the imgpath isn't NULL and all nodes + * in imgpath and devpath match up to their respect occurances of a media + * node, FALSE otherwise. + */ +static BOOLEAN +device_paths_match(EFI_DEVICE_PATH *imgpath, EFI_DEVICE_PATH *devpath) { - size_t bufsize, cmdsize; - void *buf; + + if (imgpath == NULL) + return (FALSE); + + while (!IsDevicePathEnd(imgpath) && !IsDevicePathEnd(devpath)) { + if (IsDevicePathType(imgpath, MEDIA_DEVICE_PATH) && + IsDevicePathType(devpath, MEDIA_DEVICE_PATH)) + return (TRUE); + + if (!nodes_match(imgpath, devpath)) + return (FALSE); + + imgpath = NextDevicePathNode(imgpath); + devpath = NextDevicePathNode(devpath); + } + + return (FALSE); +} + +/* + * devpath_last returns the last non-path end node in devpath. + */ +static EFI_DEVICE_PATH * +devpath_last(EFI_DEVICE_PATH *devpath) +{ + + while (!IsDevicePathEnd(NextDevicePathNode(devpath))) + devpath = NextDevicePathNode(devpath); + + return (devpath); +} + +/* + * devpath_node_str is a basic output method for a devpath node which + * only understands a subset of the available sub types. + * + * If we switch to UEFI 2.x then we should update it to use: + * EFI_DEVICE_PATH_TO_TEXT_PROTOCOL. + */ +static int +devpath_node_str(char *buf, size_t size, EFI_DEVICE_PATH *devpath) +{ + + switch (devpath->Type) { + case MESSAGING_DEVICE_PATH: + switch (devpath->SubType) { + case MSG_ATAPI_DP: { + ATAPI_DEVICE_PATH *atapi; + + atapi = (ATAPI_DEVICE_PATH *)(void *)devpath; + return snprintf(buf, size, "ata(%s,%s,0x%x)", + (atapi->PrimarySecondary == 1) ? "Sec" : "Pri", + (atapi->SlaveMaster == 1) ? "Slave" : "Master", + atapi->Lun); + } + case MSG_USB_DP: { + USB_DEVICE_PATH *usb; + + usb = (USB_DEVICE_PATH *)devpath; + return snprintf(buf, size, "usb(0x%02x,0x%02x)", + usb->ParentPortNumber, usb->InterfaceNumber); + } + case MSG_SCSI_DP: { + SCSI_DEVICE_PATH *scsi; + + scsi = (SCSI_DEVICE_PATH *)(void *)devpath; + return snprintf(buf, size, "scsi(0x%02x,0x%02x)", + scsi->Pun, scsi->Lun); + } + case MSG_SATA_DP: { + SATA_DEVICE_PATH *sata; + + sata = (SATA_DEVICE_PATH *)(void *)devpath; + return snprintf(buf, size, "sata(0x%x,0x%x,0x%x)", + sata->HBAPortNumber, sata->PortMultiplierPortNumber, + sata->Lun); + } + default: + return snprintf(buf, size, "msg(0x%02x)", + devpath->SubType); + } + break; + case HARDWARE_DEVICE_PATH: + switch (devpath->SubType) { + case HW_PCI_DP: { + PCI_DEVICE_PATH *pci; + + pci = (PCI_DEVICE_PATH *)devpath; + return snprintf(buf, size, "pci(0x%02x,0x%02x)", + pci->Device, pci->Function); + } + default: + return snprintf(buf, size, "hw(0x%02x)", + devpath->SubType); + } + break; + case ACPI_DEVICE_PATH: { + ACPI_HID_DEVICE_PATH *acpi; + + acpi = (ACPI_HID_DEVICE_PATH *)(void *)devpath; + if ((acpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { + switch (EISA_ID_TO_NUM(acpi->HID)) { + case 0x0a03: + return snprintf(buf, size, "pciroot(0x%x)", + acpi->UID); + case 0x0a08: + return snprintf(buf, size, "pcieroot(0x%x)", + acpi->UID); + case 0x0604: + return snprintf(buf, size, "floppy(0x%x)", + acpi->UID); + case 0x0301: + return snprintf(buf, size, "keyboard(0x%x)", + acpi->UID); + case 0x0501: + return snprintf(buf, size, "serial(0x%x)", + acpi->UID); + case 0x0401: + return snprintf(buf, size, "parallelport(0x%x)", + acpi->UID); + default: + return snprintf(buf, size, "acpi(pnp%04x,0x%x)", + EISA_ID_TO_NUM(acpi->HID), acpi->UID); + } + } + + return snprintf(buf, size, "acpi(0x%08x,0x%x)", acpi->HID, + acpi->UID); + } + case MEDIA_DEVICE_PATH: + switch (devpath->SubType) { + case MEDIA_CDROM_DP: { + CDROM_DEVICE_PATH *cdrom; + + cdrom = (CDROM_DEVICE_PATH *)(void *)devpath; + return snprintf(buf, size, "cdrom(%x)", + cdrom->BootEntry); + } + case MEDIA_HARDDRIVE_DP: { + HARDDRIVE_DEVICE_PATH *hd; + + hd = (HARDDRIVE_DEVICE_PATH *)(void *)devpath; + return snprintf(buf, size, "hd(%x)", + hd->PartitionNumber); + } + default: + return snprintf(buf, size, "media(0x%02x)", + devpath->SubType); + } + case BBS_DEVICE_PATH: + return snprintf(buf, size, "bbs(0x%02x)", devpath->SubType); + case END_DEVICE_PATH_TYPE: + return (0); + } + + return snprintf(buf, size, "type(0x%02x, 0x%02x)", devpath->Type, + devpath->SubType); +} + +/* + * devpath_strlcat appends a text description of devpath to buf but not more + * than size - 1 characters followed by NUL-terminator. + */ +int +devpath_strlcat(char *buf, size_t size, EFI_DEVICE_PATH *devpath) +{ + size_t len, used; + const char *sep; + + sep = ""; + used = 0; + while (!IsDevicePathEnd(devpath)) { + len = snprintf(buf, size - used, "%s", sep); + used += len; + if (used > size) + return (used); + buf += len; + + len = devpath_node_str(buf, size - used, devpath); + used += len; + if (used > size) + return (used); + buf += len; + devpath = NextDevicePathNode(devpath); + sep = ":"; + } + + return (used); +} + +/* + * devpath_str is convenience method which returns the text description of + * devpath using a static buffer, so it isn't thread safe! + */ +char * +devpath_str(EFI_DEVICE_PATH *devpath) +{ + static char buf[256]; + + devpath_strlcat(buf, sizeof(buf), devpath); + + return buf; +} + +/* + * load_loader attempts to load the loader image data. + * + * It tries each module and its respective devices, identified by mod->probe, + * in order until a successful load occurs at which point it returns EFI_SUCCESS + * and EFI_NOT_FOUND otherwise. + * + * Only devices which have preferred matching the preferred parameter are tried. + */ +static EFI_STATUS +load_loader(const boot_module_t **modp, dev_info_t **devinfop, void **bufp, + size_t *bufsize, BOOLEAN preferred) +{ + UINTN i; + dev_info_t *dev; + const boot_module_t *mod; + + for (i = 0; i < NUM_BOOT_MODULES; i++) { + if (boot_modules[i] == NULL) + continue; + mod = boot_modules[i]; + for (dev = mod->devices(); dev != NULL; dev = dev->next) { + if (dev->preferred != preferred) + continue; + + if (mod->load(PATH_LOADER_EFI, dev, bufp, bufsize) == + EFI_SUCCESS) { + *devinfop = dev; + *modp = mod; + return (EFI_SUCCESS); + } + } + } + + return (EFI_NOT_FOUND); +} + +/* + * try_boot only returns if it fails to load the loader. If it succeeds + * it simply boots, otherwise it returns the status of last EFI call. + */ +static EFI_STATUS +try_boot() +{ + size_t bufsize, loadersize, cmdsize; + void *buf, *loaderbuf; char *cmd; dev_info_t *dev; + const boot_module_t *mod; EFI_HANDLE loaderhandle; EFI_LOADED_IMAGE *loaded_image; EFI_STATUS status; + status = load_loader(&mod, &dev, &loaderbuf, &loadersize, TRUE); + if (status != EFI_SUCCESS) { + status = load_loader(&mod, &dev, &loaderbuf, &loadersize, + FALSE); + if (status != EFI_SUCCESS) { + printf("Failed to load '%s'\n", PATH_LOADER_EFI); + return (status); + } + } + /* * Read in and parse the command line from /boot.config or /boot/config, * if present. We'll pass it the next stage via a simple ASCII @@ -111,67 +388,183 @@ try_load(const boot_module_t *mod) */ cmd = NULL; cmdsize = 0; - status = mod->load(PATH_DOTCONFIG, &dev, &buf, &bufsize); + status = mod->load(PATH_DOTCONFIG, dev, &buf, &bufsize); if (status == EFI_NOT_FOUND) - status = mod->load(PATH_CONFIG, &dev, &buf, &bufsize); + status = mod->load(PATH_CONFIG, dev, &buf, &bufsize); if (status == EFI_SUCCESS) { cmdsize = bufsize + 1; cmd = malloc(cmdsize); - if (cmd == NULL) { - free(buf); - return; - } + if (cmd == NULL) + goto errout; memcpy(cmd, buf, bufsize); cmd[bufsize] = '\0'; free(buf); + buf = NULL; } - status = mod->load(PATH_LOADER_EFI, &dev, &buf, &bufsize); - if (status == EFI_NOT_FOUND) - return; - - if (status != EFI_SUCCESS) { - printf("%s failed to load %s (%lu)\n", mod->name, - PATH_LOADER_EFI, EFI_ERROR_CODE(status)); - return; - } - - if ((status = bs->LoadImage(TRUE, image, dev->devpath, buf, bufsize, - &loaderhandle)) != EFI_SUCCESS) { + if ((status = bs->LoadImage(TRUE, image, devpath_last(dev->devpath), + loaderbuf, loadersize, &loaderhandle)) != EFI_SUCCESS) { printf("Failed to load image provided by %s, size: %zu, (%lu)\n", mod->name, bufsize, EFI_ERROR_CODE(status)); - return; + goto errout; } - if (cmd != NULL) - printf(" command args: %s\n", cmd); - if ((status = bs->HandleProtocol(loaderhandle, &LoadedImageGUID, (VOID**)&loaded_image)) != EFI_SUCCESS) { printf("Failed to query LoadedImage provided by %s (%lu)\n", mod->name, EFI_ERROR_CODE(status)); - return; + goto errout; } + if (cmd != NULL) + printf(" command args: %s\n", cmd); + loaded_image->DeviceHandle = dev->devhandle; loaded_image->LoadOptionsSize = cmdsize; loaded_image->LoadOptions = cmd; + DPRINTF("Starting '%s' in 5 seconds...", PATH_LOADER_EFI); + DSTALL(1000000); + DPRINTF("."); + DSTALL(1000000); + DPRINTF("."); + DSTALL(1000000); + DPRINTF("."); + DSTALL(1000000); + DPRINTF("."); + DSTALL(1000000); + DPRINTF(".\n"); + if ((status = bs->StartImage(loaderhandle, NULL, NULL)) != EFI_SUCCESS) { printf("Failed to start image provided by %s (%lu)\n", mod->name, EFI_ERROR_CODE(status)); - free(cmd); loaded_image->LoadOptionsSize = 0; loaded_image->LoadOptions = NULL; - return; } + +errout: + if (cmd != NULL) + free(cmd); + if (buf != NULL) + free(buf); + if (loaderbuf != NULL) + free(loaderbuf); + + return (status); +} + +/* + * probe_handle determines if the passed handle represents a logical partition + * if it does it uses each module in order to probe it and if successful it + * returns EFI_SUCCESS. + */ +static EFI_STATUS +probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath, BOOLEAN *preferred) +{ + dev_info_t *devinfo; + EFI_BLOCK_IO *blkio; + EFI_DEVICE_PATH *devpath; + EFI_STATUS status; + UINTN i; + + /* Figure out if we're dealing with an actual partition. */ + status = bs->HandleProtocol(h, &DevicePathGUID, (void **)&devpath); + if (status == EFI_UNSUPPORTED) + return (status); + + if (status != EFI_SUCCESS) { + DPRINTF("\nFailed to query DevicePath (%lu)\n", + EFI_ERROR_CODE(status)); + return (status); + } + + DPRINTF("probing: %s\n", devpath_str(devpath)); + + status = bs->HandleProtocol(h, &BlockIoProtocolGUID, (void **)&blkio); + if (status == EFI_UNSUPPORTED) + return (status); + + if (status != EFI_SUCCESS) { + DPRINTF("\nFailed to query BlockIoProtocol (%lu)\n", + EFI_ERROR_CODE(status)); + return (status); + } + + if (!blkio->Media->LogicalPartition) + return (EFI_UNSUPPORTED); + + *preferred = device_paths_match(imgpath, devpath); + + /* Run through each module, see if it can load this partition */ + for (i = 0; i < NUM_BOOT_MODULES; i++) { + if (boot_modules[i] == NULL) + continue; + + if ((status = bs->AllocatePool(EfiLoaderData, + sizeof(*devinfo), (void **)&devinfo)) != + EFI_SUCCESS) { + DPRINTF("\nFailed to allocate devinfo (%lu)\n", + EFI_ERROR_CODE(status)); + continue; + } + devinfo->dev = blkio; + devinfo->devpath = devpath; + devinfo->devhandle = h; + devinfo->devdata = NULL; + devinfo->preferred = *preferred; + devinfo->next = NULL; + + status = boot_modules[i]->probe(devinfo); + if (status == EFI_SUCCESS) + return (EFI_SUCCESS); + (void)bs->FreePool(devinfo); + } + + return (EFI_UNSUPPORTED); +} + +/* + * probe_handle_status calls probe_handle and outputs the returned status + * of the call. + */ +static void +probe_handle_status(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath) +{ + EFI_STATUS status; + BOOLEAN preferred; + + status = probe_handle(h, imgpath, &preferred); + + DPRINTF("probe: "); + switch (status) { + case EFI_UNSUPPORTED: + printf("."); + DPRINTF(" not supported\n"); + break; + case EFI_SUCCESS: + if (preferred) { + printf("%c", '*'); + DPRINTF(" supported (preferred)\n"); + } else { + printf("%c", '+'); + DPRINTF(" supported\n"); + } + break; + default: + printf("x"); + DPRINTF(" error (%lu)\n", EFI_ERROR_CODE(status)); + break; + } + DSTALL(500000); } EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) { EFI_HANDLE *handles; + EFI_LOADED_IMAGE *img; + EFI_DEVICE_PATH *imgpath; EFI_STATUS status; EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl = NULL; SIMPLE_TEXT_OUTPUT_INTERFACE *conout = NULL; @@ -254,20 +647,22 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_T /* Scan all partitions, probing with all modules. */ nhandles = hsize / sizeof(*handles); printf(" Probing %zu block devices...", nhandles); - for (i = 0; i < nhandles; i++) { - status = probe_handle(handles[i]); - switch (status) { - case EFI_UNSUPPORTED: - printf("."); - break; - case EFI_SUCCESS: - printf("+"); - break; - default: - printf("x"); - break; - } + DPRINTF("\n"); + + /* Determine the devpath of our image so we can prefer it. */ + status = bs->HandleProtocol(image, &LoadedImageGUID, (VOID**)&img); + imgpath = NULL; + if (status == EFI_SUCCESS) { + status = bs->HandleProtocol(img->DeviceHandle, &DevicePathGUID, + (void **)&imgpath); + if (status != EFI_SUCCESS) + DPRINTF("Failed to get image DevicePath (%lu)\n", + EFI_ERROR_CODE(status)); + DPRINTF("boot1 imagepath: %s\n", devpath_str(imgpath)); } + + for (i = 0; i < nhandles; i++) + probe_handle_status(handles[i], imgpath); printf(" done\n"); /* Status summary. */ @@ -278,78 +673,15 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_T } } - /* Select a partition to boot by trying each module in order. */ - for (i = 0; i < NUM_BOOT_MODULES; i++) - if (boot_modules[i] != NULL) - try_load(boot_modules[i]); + try_boot(); /* If we get here, we're out of luck... */ panic("No bootable partitions found!"); } -static EFI_STATUS -probe_handle(EFI_HANDLE h) -{ - dev_info_t *devinfo; - EFI_BLOCK_IO *blkio; - EFI_DEVICE_PATH *devpath; - EFI_STATUS status; - UINTN i; - - /* Figure out if we're dealing with an actual partition. */ - status = bs->HandleProtocol(h, &DevicePathGUID, (void **)&devpath); - if (status == EFI_UNSUPPORTED) - return (status); - - if (status != EFI_SUCCESS) { - DPRINTF("\nFailed to query DevicePath (%lu)\n", - EFI_ERROR_CODE(status)); - return (status); - } - - while (!IsDevicePathEnd(NextDevicePathNode(devpath))) - devpath = NextDevicePathNode(devpath); - - status = bs->HandleProtocol(h, &BlockIoProtocolGUID, (void **)&blkio); - if (status == EFI_UNSUPPORTED) - return (status); - - if (status != EFI_SUCCESS) { - DPRINTF("\nFailed to query BlockIoProtocol (%lu)\n", - EFI_ERROR_CODE(status)); - return (status); - } - - if (!blkio->Media->LogicalPartition) - return (EFI_UNSUPPORTED); - - /* Run through each module, see if it can load this partition */ - for (i = 0; i < NUM_BOOT_MODULES; i++) { - if (boot_modules[i] == NULL) - continue; - - if ((status = bs->AllocatePool(EfiLoaderData, - sizeof(*devinfo), (void **)&devinfo)) != - EFI_SUCCESS) { - DPRINTF("\nFailed to allocate devinfo (%lu)\n", - EFI_ERROR_CODE(status)); - continue; - } - devinfo->dev = blkio; - devinfo->devpath = devpath; - devinfo->devhandle = h; - devinfo->devdata = NULL; - devinfo->next = NULL; - - status = boot_modules[i]->probe(devinfo); - if (status == EFI_SUCCESS) - return (EFI_SUCCESS); - (void)bs->FreePool(devinfo); - } - - return (EFI_UNSUPPORTED); -} - +/* + * add_device adds a device to the passed devinfo list. + */ void add_device(dev_info_t **devinfop, dev_info_t *devinfo) { Modified: stable/10/sys/boot/efi/boot1/boot_module.h ============================================================================== --- stable/10/sys/boot/efi/boot1/boot_module.h Thu Feb 11 22:29:39 2016 (r295549) +++ stable/10/sys/boot/efi/boot1/boot_module.h Thu Feb 11 22:33:47 2016 (r295550) @@ -36,9 +36,11 @@ #include #ifdef EFI_DEBUG -#define DPRINTF(fmt, ...) printf(fmt, __VA_ARGS__) +#define DPRINTF(fmt, args...) printf(fmt, ##args) +#define DSTALL(d) bs->Stall(d) #else #define DPRINTF(fmt, ...) {} +#define DSTALL(d) {} #endif /* EFI device info */ @@ -48,6 +50,7 @@ typedef struct dev_info EFI_DEVICE_PATH *devpath; EFI_HANDLE *devhandle; void *devdata; + BOOLEAN preferred; struct dev_info *next; } dev_info_t; @@ -75,19 +78,21 @@ typedef struct boot_module_t /* * load should select the best out of a set of devices that probe - * indicated were loadable and load it. + * indicated were loadable and load the specified file. * * Return codes: * EFI_SUCCESS = The module can handle the device. * EFI_NOT_FOUND = The module can not handle the device. * Other = The module encountered an error. */ - EFI_STATUS (*load)(const char *loader_path, dev_info_t **devinfo, + EFI_STATUS (*load)(const char *filepath, dev_info_t *devinfo, void **buf, size_t *bufsize); /* status outputs information about the probed devices. */ void (*status)(); + /* valid devices as found by probe. */ + dev_info_t *(*devices)(); } boot_module_t; /* Standard boot modules. */ @@ -107,4 +112,6 @@ extern int vsnprintf(char *str, size_t s extern EFI_SYSTEM_TABLE *systab; extern EFI_BOOT_SERVICES *bs; +extern int devpath_strlcat(char *buf, size_t size, EFI_DEVICE_PATH *devpath); +extern char *devpath_str(EFI_DEVICE_PATH *devpath); #endif Modified: stable/10/sys/boot/efi/boot1/ufs_module.c ============================================================================== --- stable/10/sys/boot/efi/boot1/ufs_module.c Thu Feb 11 22:29:39 2016 (r295549) +++ stable/10/sys/boot/efi/boot1/ufs_module.c Thu Feb 11 22:33:47 2016 (r295550) @@ -93,7 +93,7 @@ probe(dev_info_t* dev) } static EFI_STATUS -try_load(dev_info_t *dev, const char *loader_path, void **bufp, size_t *bufsize) +load(const char *filepath, dev_info_t *dev, void **bufp, size_t *bufsize) { ufs_ino_t ino; EFI_STATUS status; @@ -101,59 +101,46 @@ try_load(dev_info_t *dev, const char *lo ssize_t read; void *buf; - if (init_dev(dev) < 0) + DPRINTF("Loading '%s' from %s\n", filepath, devpath_str(dev->devpath)); + + if (init_dev(dev) < 0) { + DPRINTF("Failed to init device\n"); return (EFI_UNSUPPORTED); + } - if ((ino = lookup(loader_path)) == 0) + if ((ino = lookup(filepath)) == 0) { + DPRINTF("Failed to lookup '%s' (file not found?)\n", filepath); return (EFI_NOT_FOUND); + } if (fsread_size(ino, NULL, 0, &size) < 0 || size <= 0) { - printf("Failed to read size of '%s' ino: %d\n", loader_path, - ino); + printf("Failed to read size of '%s' ino: %d\n", filepath, ino); return (EFI_INVALID_PARAMETER); } if ((status = bs->AllocatePool(EfiLoaderData, size, &buf)) != EFI_SUCCESS) { - printf("Failed to allocate read buffer (%lu)\n", - EFI_ERROR_CODE(status)); + printf("Failed to allocate read buffer %zu for '%s' (%lu)\n", + size, filepath, EFI_ERROR_CODE(status)); return (status); } read = fsread(ino, buf, size); if ((size_t)read != size) { - printf("Failed to read '%s' (%zd != %zu)\n", loader_path, read, + printf("Failed to read '%s' (%zd != %zu)\n", filepath, read, size); (void)bs->FreePool(buf); return (EFI_INVALID_PARAMETER); } + DPRINTF("Load complete\n"); + *bufp = buf; *bufsize = size; return (EFI_SUCCESS); } -static EFI_STATUS -load(const char *loader_path, dev_info_t **devinfop, void **buf, - size_t *bufsize) -{ - dev_info_t *dev; - EFI_STATUS status; - - for (dev = devices; dev != NULL; dev = dev->next) { - status = try_load(dev, loader_path, buf, bufsize); - if (status == EFI_SUCCESS) { - *devinfop = dev; - return (EFI_SUCCESS); - } else if (status != EFI_NOT_FOUND) { - return (status); - } - } - - return (EFI_NOT_FOUND); -} - static void status() { @@ -176,10 +163,18 @@ status() } } +static dev_info_t * +_devices() +{ + + return (devices); +} + const boot_module_t ufs_module = { .name = "UFS", .probe = probe, .load = load, - .status = status + .status = status, + .devices = _devices }; Modified: stable/10/sys/boot/efi/boot1/zfs_module.c ============================================================================== --- stable/10/sys/boot/efi/boot1/zfs_module.c Thu Feb 11 22:29:39 2016 (r295549) +++ stable/10/sys/boot/efi/boot1/zfs_module.c Thu Feb 11 22:33:47 2016 (r295550) @@ -91,7 +91,7 @@ probe(dev_info_t *dev) } static EFI_STATUS -try_load(dev_info_t *devinfo, const char *loader_path, void **bufp, size_t *bufsize) +load(const char *filepath, dev_info_t *devinfo, void **bufp, size_t *bufsize) { spa_t *spa; struct zfsmount zfsmount; @@ -102,32 +102,41 @@ try_load(dev_info_t *devinfo, const char EFI_STATUS status; spa = devinfo->devdata; - if (zfs_spa_init(spa) != 0) { - /* Init failed, don't report this loudly. */ + + DPRINTF("load: '%s' spa: '%s', devpath: %s\n", filepath, spa->spa_name, + devpath_str(devinfo->devpath)); + + if ((err = zfs_spa_init(spa)) != 0) { + DPRINTF("Failed to load pool '%s' (%d)\n", spa->spa_name, err); return (EFI_NOT_FOUND); } - if (zfs_mount(spa, 0, &zfsmount) != 0) { - /* Mount failed, don't report this loudly. */ + if ((err = zfs_mount(spa, 0, &zfsmount)) != 0) { + DPRINTF("Failed to mount pool '%s' (%d)\n", spa->spa_name, err); return (EFI_NOT_FOUND); } - if ((err = zfs_lookup(&zfsmount, loader_path, &dn)) != 0) { - printf("Failed to lookup %s on pool %s (%d)\n", loader_path, + if ((err = zfs_lookup(&zfsmount, filepath, &dn)) != 0) { + if (err == ENOENT) { + DPRINTF("Failed to find '%s' on pool '%s' (%d)\n", + filepath, spa->spa_name, err); + return (EFI_NOT_FOUND); + } + printf("Failed to lookup '%s' on pool '%s' (%d)\n", filepath, spa->spa_name, err); return (EFI_INVALID_PARAMETER); } if ((err = zfs_dnode_stat(spa, &dn, &st)) != 0) { - printf("Failed to lookup %s on pool %s (%d)\n", loader_path, + printf("Failed to stat '%s' on pool '%s' (%d)\n", filepath, spa->spa_name, err); return (EFI_INVALID_PARAMETER); } if ((status = bs->AllocatePool(EfiLoaderData, (UINTN)st.st_size, &buf)) != EFI_SUCCESS) { - printf("Failed to allocate load buffer for pool %s (%lu)\n", - spa->spa_name, EFI_ERROR_CODE(status)); + printf("Failed to allocate load buffer %zd for pool '%s' for '%s' " + "(%lu)\n", st.st_size, spa->spa_name, filepath, EFI_ERROR_CODE(status)); return (EFI_INVALID_PARAMETER); } @@ -144,26 +153,6 @@ try_load(dev_info_t *devinfo, const char return (EFI_SUCCESS); } -static EFI_STATUS -load(const char *loader_path, dev_info_t **devinfop, void **bufp, - size_t *bufsize) -{ - dev_info_t *devinfo; - EFI_STATUS status; - - for (devinfo = devices; devinfo != NULL; devinfo = devinfo->next) { - status = try_load(devinfo, loader_path, bufp, bufsize); - if (status == EFI_SUCCESS) { - *devinfop = devinfo; - return (EFI_SUCCESS); - } else if (status != EFI_NOT_FOUND) { - return (status); - } - } - - return (EFI_NOT_FOUND); -} - static void status() { @@ -189,11 +178,19 @@ init() zfs_init(); } +static dev_info_t * +_devices() +{ + + return (devices); +} + const boot_module_t zfs_module = { .name = "ZFS", .init = init, .probe = probe, .load = load, - .status = status + .status = status, + .devices = _devices }; Modified: stable/10/sys/boot/efi/include/efidevp.h ============================================================================== --- stable/10/sys/boot/efi/include/efidevp.h Thu Feb 11 22:29:39 2016 (r295549) +++ stable/10/sys/boot/efi/include/efidevp.h Thu Feb 11 22:33:47 2016 (r295550) @@ -40,9 +40,7 @@ typedef struct _EFI_DEVICE_PATH { #define EFI_DP_TYPE_MASK 0x7F #define EFI_DP_TYPE_UNPACKED 0x80 -//#define END_DEVICE_PATH_TYPE 0xff #define END_DEVICE_PATH_TYPE 0x7f -//#define END_DEVICE_PATH_TYPE_UNPACKED 0x7f #define END_ENTIRE_DEVICE_PATH_SUBTYPE 0xff #define END_INSTANCE_DEVICE_PATH_SUBTYPE 0x01 @@ -56,8 +54,8 @@ typedef struct _EFI_DEVICE_PATH { #define DevicePathSubType(a) ( (a)->SubType ) #define DevicePathNodeLength(a) ( ((a)->Length[0]) | ((a)->Length[1] << 8) ) #define NextDevicePathNode(a) ( (EFI_DEVICE_PATH *) ( ((UINT8 *) (a)) + DevicePathNodeLength(a))) -//#define IsDevicePathEndType(a) ( DevicePathType(a) == END_DEVICE_PATH_TYPE_UNPACKED ) -#define IsDevicePathEndType(a) ( DevicePathType(a) == END_DEVICE_PATH_TYPE ) +#define IsDevicePathType(a, t) ( DevicePathType(a) == t ) +#define IsDevicePathEndType(a) IsDevicePathType(a, END_DEVICE_PATH_TYPE) #define IsDevicePathEndSubType(a) ( (a)->SubType == END_ENTIRE_DEVICE_PATH_SUBTYPE ) #define IsDevicePathEnd(a) ( IsDevicePathEndType(a) && IsDevicePathEndSubType(a) ) #define IsDevicePathUnpacked(a) ( (a)->Type & EFI_DP_TYPE_UNPACKED ) @@ -285,6 +283,13 @@ typedef struct _UART_DEVICE_PATH { #define DEVICE_PATH_MESSAGING_VT_UTF8 \ { 0xad15a0d6, 0x8bec, 0x4acf, {0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88} } +#define MSG_SATA_DP 0x12 +typedef struct _SATA_DEVICE_PATH { + EFI_DEVICE_PATH Header; + UINT16 HBAPortNumber; + UINT16 PortMultiplierPortNumber; + UINT16 Lun; +} SATA_DEVICE_PATH; #define MEDIA_DEVICE_PATH 0x04 From owner-svn-src-all@freebsd.org Thu Feb 11 23:43:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 555F4AA634F; Thu, 11 Feb 2016 23:43:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 199DCFB1; Thu, 11 Feb 2016 23:43:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BNhSZh058252; Thu, 11 Feb 2016 23:43:28 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BNhSJA058250; Thu, 11 Feb 2016 23:43:28 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201602112343.u1BNhSJA058250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 11 Feb 2016 23:43: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: r295551 - in stable/10/sys/boot/efi: libefi loader X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 23:43:29 -0000 Author: imp Date: Thu Feb 11 23:43:27 2016 New Revision: 295551 URL: https://svnweb.freebsd.org/changeset/base/295551 Log: Merge from current r294767,294769,295408 r294767: Parse command line arguments in loader.fi r294769: Allow newlines to be treated as whitespace when parsing args r295408: Implement -P command line option in for EFI booting. Approved by: re@ (gjb@) Modified: stable/10/sys/boot/efi/libefi/libefi.c stable/10/sys/boot/efi/loader/main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/libefi/libefi.c ============================================================================== --- stable/10/sys/boot/efi/libefi/libefi.c Thu Feb 11 22:33:47 2016 (r295550) +++ stable/10/sys/boot/efi/libefi/libefi.c Thu Feb 11 23:43:27 2016 (r295551) @@ -44,7 +44,7 @@ static CHAR16 * arg_skipsep(CHAR16 *argp) { - while (*argp == ' ' || *argp == '\t') + while (*argp == ' ' || *argp == '\t' || *argp == '\n') argp++; return (argp); } @@ -53,7 +53,7 @@ static CHAR16 * arg_skipword(CHAR16 *argp) { - while (*argp && *argp != ' ' && *argp != '\t') + while (*argp && *argp != ' ' && *argp != '\t' && *argp != '\n') argp++; return (argp); } Modified: stable/10/sys/boot/efi/loader/main.c ============================================================================== --- stable/10/sys/boot/efi/loader/main.c Thu Feb 11 22:33:47 2016 (r295550) +++ stable/10/sys/boot/efi/loader/main.c Thu Feb 11 23:43:27 2016 (r295551) @@ -29,6 +29,8 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include #include #include @@ -63,6 +65,7 @@ EFI_GUID dxe = DXE_SERVICES_TABLE_GUID; EFI_GUID hoblist = HOB_LIST_TABLE_GUID; EFI_GUID memtype = MEMORY_TYPE_INFORMATION_TABLE_GUID; EFI_GUID debugimg = DEBUG_IMAGE_INFO_TABLE_GUID; +EFI_GUID inputid = SIMPLE_TEXT_INPUT_PROTOCOL; #ifdef EFI_ZFS_BOOT static void efi_zfs_probe(void); @@ -82,16 +85,108 @@ print_str16(const CHAR16 *str) printf("%c", (char)str[i]); } +static void +cp16to8(const CHAR16 *src, char *dst, size_t len) +{ + size_t i; + + for (i = 0; i < len && src[i]; i++) + dst[i] = (char)src[i]; +} + +static int +has_keyboard(void) +{ + EFI_STATUS status; + EFI_DEVICE_PATH *path; + EFI_HANDLE *hin, *hin_end, *walker; + UINTN sz; + int retval = 0; + + /* + * Find all the handles that support the SIMPLE_TEXT_INPUT_PROTOCOL and + * do the typical dance to get the right sized buffer. + */ + sz = 0; + hin = NULL; + status = BS->LocateHandle(ByProtocol, &inputid, 0, &sz, 0); + if (status == EFI_BUFFER_TOO_SMALL) { + hin = (EFI_HANDLE *)malloc(sz); + status = BS->LocateHandle(ByProtocol, &inputid, 0, &sz, + hin); + if (EFI_ERROR(status)) + free(hin); + } + if (EFI_ERROR(status)) + return retval; + + /* + * Look at each of the handles. If it supports the device path protocol, + * use it to get the device path for this handle. Then see if that + * device path matches either the USB device path for keyboards or the + * legacy device path for keyboards. + */ + hin_end = &hin[sz / sizeof(*hin)]; + for (walker = hin; walker < hin_end; walker++) { + status = BS->HandleProtocol(*walker, &devid, (VOID **)&path); + if (EFI_ERROR(status)) + continue; + + while (!IsDevicePathEnd(path)) { + /* + * Check for the ACPI keyboard node. All PNP3xx nodes + * are keyboards of different flavors. Note: It is + * unclear of there's always a keyboard node when + * there's a keyboard controller, or if there's only one + * when a keyboard is detected at boot. + */ + if (DevicePathType(path) == ACPI_DEVICE_PATH && + (DevicePathSubType(path) == ACPI_DP || + DevicePathSubType(path) == ACPI_EXTENDED_DP)) { + ACPI_HID_DEVICE_PATH *acpi; + + acpi = (ACPI_HID_DEVICE_PATH *)(void *)path; + if ((EISA_ID_TO_NUM(acpi->HID) & 0xff00) == 0x300 && + (acpi->HID & 0xffff) == PNP_EISA_ID_CONST) { + retval = 1; + goto out; + } + /* + * Check for USB keyboard node, if present. Unlike a + * PS/2 keyboard, these definitely only appear when + * connected to the system. + */ + } else if (DevicePathType(path) == MESSAGING_DEVICE_PATH && + DevicePathSubType(path) == MSG_USB_CLASS_DP) { + USB_CLASS_DEVICE_PATH *usb; + + usb = (USB_CLASS_DEVICE_PATH *)(void *)path; + if (usb->DeviceClass == 3 && /* HID */ + usb->DeviceSubClass == 1 && /* Boot devices */ + usb->DeviceProtocol == 1) { /* Boot keyboards */ + retval = 1; + goto out; + } + } + path = NextDevicePathNode(path); + } + } +out: + free(hin); + return retval; +} + EFI_STATUS main(int argc, CHAR16 *argv[]) { char var[128]; EFI_LOADED_IMAGE *img; EFI_GUID *guid; - int i, j, vargood, unit; + int i, j, vargood, unit, howto; struct devsw *dev; uint64_t pool_guid; UINTN k; + int has_kbd; archsw.arch_autoload = efi_autoload; archsw.arch_getdev = efi_getdev; @@ -103,6 +198,8 @@ main(int argc, CHAR16 *argv[]) archsw.arch_zfs_probe = efi_zfs_probe; #endif + has_kbd = has_keyboard(); + /* * XXX Chicken-and-egg problem; we want to have console output * early, but some console attributes may depend on reading from @@ -112,27 +209,101 @@ main(int argc, CHAR16 *argv[]) cons_probe(); /* + * Parse the args to set the console settings, etc + * boot1.efi passes these in, if it can read /boot.config or /boot/config + * or iPXE may be setup to pass these in. + * * Loop through the args, and for each one that contains an '=' that is * not the first character, add it to the environment. This allows * loader and kernel env vars to be passed on the command line. Convert * args from UCS-2 to ASCII (16 to 8 bit) as they are copied. */ + howto = 0; for (i = 1; i < argc; i++) { - vargood = 0; - for (j = 0; argv[i][j] != 0; j++) { - if (j == sizeof(var)) { - vargood = 0; - break; + if (argv[i][0] == '-') { + for (j = 1; argv[i][j] != 0; j++) { + int ch; + + ch = argv[i][j]; + switch (ch) { + case 'a': + howto |= RB_ASKNAME; + break; + case 'd': + howto |= RB_KDB; + break; + case 'D': + howto |= RB_MULTIPLE; + break; + case 'h': + howto |= RB_SERIAL; + break; + case 'm': + howto |= RB_MUTE; + break; + case 'p': + howto |= RB_PAUSE; + break; + case 'P': + if (!has_kbd) + howto |= RB_SERIAL | RB_MULTIPLE; + break; + case 'r': + howto |= RB_DFLTROOT; + break; + case 's': + howto |= RB_SINGLE; + break; + case 'S': + if (argv[i][j + 1] == 0) { + if (i + 1 == argc) { + setenv("comconsole_speed", "115200", 1); + } else { + cp16to8(&argv[i + 1][0], var, + sizeof(var)); + setenv("comconsole_speedspeed", var, 1); + } + i++; + break; + } else { + cp16to8(&argv[i][j + 1], var, + sizeof(var)); + setenv("comconsole_speed", var, 1); + break; + } + case 'v': + howto |= RB_VERBOSE; + break; + } + } + } else { + vargood = 0; + for (j = 0; argv[i][j] != 0; j++) { + if (j == sizeof(var)) { + vargood = 0; + break; + } + if (j > 0 && argv[i][j] == '=') + vargood = 1; + var[j] = (char)argv[i][j]; + } + if (vargood) { + var[j] = 0; + putenv(var); } - if (j > 0 && argv[i][j] == '=') - vargood = 1; - var[j] = (char)argv[i][j]; - } - if (vargood) { - var[j] = 0; - putenv(var); } } + for (i = 0; howto_names[i].ev != NULL; i++) + if (howto & howto_names[i].mask) + setenv(howto_names[i].ev, "YES", 1); + if (howto & RB_MULTIPLE) { + if (howto & RB_SERIAL) + setenv("console", "comconsole efi" , 1); + else + setenv("console", "efi comconsole" , 1); + } else if (howto & RB_SERIAL) { + setenv("console", "comconsole" , 1); + } if (efi_copy_init()) { printf("failed to allocate staging area\n"); From owner-svn-src-all@freebsd.org Fri Feb 12 00:03:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF9E3AA6CB6; Fri, 12 Feb 2016 00:03:40 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 9E0281BCE; Fri, 12 Feb 2016 00:03:40 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1C03d3Z064588; Fri, 12 Feb 2016 00:03:39 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1C03dW1064587; Fri, 12 Feb 2016 00:03:39 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201602120003.u1C03dW1064587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Fri, 12 Feb 2016 00:03: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: r295552 - stable/10/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 00:03:40 -0000 Author: marius Date: Fri Feb 12 00:03:39 2016 New Revision: 295552 URL: https://svnweb.freebsd.org/changeset/base/295552 Log: Update stable/10 to BETA2 in preparation for 10.3-BETA2 builds. Approved by: re (implicit) Modified: stable/10/sys/conf/newvers.sh Modified: stable/10/sys/conf/newvers.sh ============================================================================== --- stable/10/sys/conf/newvers.sh Thu Feb 11 23:43:27 2016 (r295551) +++ stable/10/sys/conf/newvers.sh Fri Feb 12 00:03:39 2016 (r295552) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.3" -BRANCH="BETA1" +BRANCH="BETA2" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Fri Feb 12 01:12:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9137DAA5DEF; Fri, 12 Feb 2016 01:12:45 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 6C39D1CB4; Fri, 12 Feb 2016 01:12:45 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1C1Ci4Y084752; Fri, 12 Feb 2016 01:12:44 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1C1CibJ084749; Fri, 12 Feb 2016 01:12:44 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201602120112.u1C1CibJ084749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Fri, 12 Feb 2016 01:12:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295553 - head/share/examples/jails X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 01:12:45 -0000 Author: dteske Date: Fri Feb 12 01:12:44 2016 New Revision: 295553 URL: https://svnweb.freebsd.org/changeset/base/295553 Log: Refactor conversion to hex Modified: head/share/examples/jails/jib head/share/examples/jails/jng Modified: head/share/examples/jails/jib ============================================================================== --- head/share/examples/jails/jib Fri Feb 12 00:03:39 2016 (r295552) +++ head/share/examples/jails/jib Fri Feb 12 01:12:44 2016 (r295553) @@ -214,25 +214,19 @@ derive_mac() # unique value preventing conflict. # __iface_devid=$( ifconfig $__iface ether | awk '/ether/,$0=$2' ) - __new_devid=${__iface_devid#??:??:??} - # :II:II:II => S:II:II:II + # ??:??:??:II:II:II + __new_devid=${__iface_devid#??:??:??} # => :II:II:II + # => :SS:SS:II:II:II __num=$( set -- `echo -n "$__name" | sum` && echo $1 ) - __new_devid=$( printf %x $(( $__num & 15 )) )$__new_devid - # S:II:II:II => :SS:II:II:II - __num=$(( $__num >> 4 )) - __new_devid=:$( printf %x $(( $__num & 15 )) )$__new_devid - # :SS:II:II:II => S:SS:II:II:II - __num=$(( $__num >> 4 )) - __new_devid=$( printf %x $(( $__num & 15 )) )$__new_devid - # S:SS:II:II:II => :SS:SS:II:II:II - __new_devid=:$( printf %x $(( $__num & 15 )) )$__new_devid - # :SS:SS:II:II:II => P:SS:SS:II:II:II + __new_devid=$( printf :%02x:%02x \ + $(( $__num >> 8 & 255 )) $(( $__num & 255 )) )$__new_devid + # => P:SS:SS:II:II:II case "$__iface_devid" in ?2:*) __new_devid=a$__new_devid __new_devid_b=e$__new_devid ;; ?[Ee]:*) __new_devid=2$__new_devid __new_devid_b=6$__new_devid ;; *) __new_devid=2$__new_devid __new_devid_b=e$__new_devid esac - # P:SS:SS:II:II:II => NP:SS:SS:II:II:II + # => NP:SS:SS:II:II:II __new_devid=$( printf %x $(( $__mac_num & 15 )) )$__new_devid __new_devid_b=$( printf %x $(( $__mac_num & 15 )) )$__new_devid_b Modified: head/share/examples/jails/jng ============================================================================== --- head/share/examples/jails/jng Fri Feb 12 00:03:39 2016 (r295552) +++ head/share/examples/jails/jng Fri Feb 12 01:12:44 2016 (r295553) @@ -216,25 +216,19 @@ derive_mac() # unique value preventing conflict. # __iface_devid=$( ifconfig $__iface ether | awk '/ether/,$0=$2' ) - __new_devid=${__iface_devid#??:??:??} - # :II:II:II => S:II:II:II + # ??:??:??:II:II:II + __new_devid=${__iface_devid#??:??:??} # => :II:II:II + # => :SS:SS:II:II:II __num=$( set -- `echo -n "$__name" | sum` && echo $1 ) - __new_devid=$( printf %x $(( $__num & 15 )) )$__new_devid - # S:II:II:II => :SS:II:II:II - __num=$(( $__num >> 4 )) - __new_devid=:$( printf %x $(( $__num & 15 )) )$__new_devid - # :SS:II:II:II => S:SS:II:II:II - __num=$(( $__num >> 4 )) - __new_devid=$( printf %x $(( $__num & 15 )) )$__new_devid - # S:SS:II:II:II => :SS:SS:II:II:II - __new_devid=:$( printf %x $(( $__num & 15 )) )$__new_devid - # :SS:SS:II:II:II => P:SS:SS:II:II:II + __new_devid=$( printf :%02x:%02x \ + $(( $__num >> 8 & 255 )) $(( $__num & 255 )) )$__new_devid + # => P:SS:SS:II:II:II case "$__iface_devid" in ?2:*) __new_devid=a$__new_devid __new_devid_b=e$__new_devid ;; ?[Ee]:*) __new_devid=2$__new_devid __new_devid_b=6$__new_devid ;; *) __new_devid=2$__new_devid __new_devid_b=e$__new_devid esac - # P:SS:SS:II:II:II => NP:SS:SS:II:II:II + # => NP:SS:SS:II:II:II __new_devid=$( printf %x $(( $__mac_num & 15 )) )$__new_devid __new_devid_b=$( printf %x $(( $__mac_num & 15 )) )$__new_devid_b From owner-svn-src-all@freebsd.org Fri Feb 12 01:41:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BC25AA680F; Fri, 12 Feb 2016 01:41:42 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 06D9B7EB; Fri, 12 Feb 2016 01:41:41 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1C1ffSA091328; Fri, 12 Feb 2016 01:41:41 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1C1feqG091326; Fri, 12 Feb 2016 01:41:40 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201602120141.u1C1feqG091326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Fri, 12 Feb 2016 01:41:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295554 - head/share/examples/jails X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 01:41:42 -0000 Author: dteske Date: Fri Feb 12 01:41:40 2016 New Revision: 295554 URL: https://svnweb.freebsd.org/changeset/base/295554 Log: Add syntax to disable MAC allocation Adding `!' before an interface name will disable MAC allocation, falling back to driver mechanics. Alternatively adding `=' before an interface name causes the MAC address to be cloned (for ng_bridge(4) back-end only). While here, disable the auto-detection of wlan* since this knocks the host off; requiring the host that defines the jail to explicitly enable this feature by preceding the interface with `='. Modified: head/share/examples/jails/jib head/share/examples/jails/jng Modified: head/share/examples/jails/jib ============================================================================== --- head/share/examples/jails/jib Fri Feb 12 01:12:44 2016 (r295553) +++ head/share/examples/jails/jib Fri Feb 12 01:41:40 2016 (r295554) @@ -257,7 +257,7 @@ mustberoot_to_continue() fi } -jib_addm_usage="addm [-b BRIDGE_NAME] NAME interface0 [interface1 ...]" +jib_addm_usage="addm [-b BRIDGE_NAME] NAME [!]iface0 [[!]iface1 ...]" jib_addm_descr="Creates e0b_NAME [e1b_NAME ...]" jib_addm() { @@ -278,9 +278,14 @@ jib_addm() mustberoot_to_continue local iface eiface_devid_a eiface_devid_b - local new num quad i=0 + local new no_derive num quad i=0 for iface in $*; do + no_derive= + case "$iface" in + !*) iface=${iface#!} no_derive=1 ;; + esac + # 1. Make sure the interface doesn't exist already ifconfig "e${i}a_$name" > /dev/null 2>&1 && continue @@ -309,9 +314,13 @@ jib_addm() # 6. Set the MAC address of the new interface using a sensible # algorithm to prevent conflicts on the network. # - derive_mac -2 $iface "$name" eiface_devid_a eiface_devid_b - ifconfig "e${i}a_$name" ether $eiface_devid_a > /dev/null 2>&1 - ifconfig "e${i}b_$name" ether $eiface_devid_b > /dev/null 2>&1 + eiface_devid_a= eiface_devid_b= + [ "$no_derive" ] || derive_mac -2 $iface "$name" \ + eiface_devid_a eiface_devid_b + if [ "$eiface_devid_a" -a "$eiface_devid_b" ]; then + ifconfig "e${i}a_$name" ether $eiface_devid_a + ifconfig "e${i}b_$name" ether $eiface_devid_b + fi > /dev/null 2>&1 i=$(( $i + 1 )) # on to next e{i}b_name done # for iface Modified: head/share/examples/jails/jng ============================================================================== --- head/share/examples/jails/jng Fri Feb 12 01:12:44 2016 (r295553) +++ head/share/examples/jails/jng Fri Feb 12 01:41:40 2016 (r295554) @@ -259,7 +259,7 @@ mustberoot_to_continue() fi } -jng_bridge_usage="bridge [-b BRIDGE_NAME] NAME [=]iface0 [[=]iface1 ...]" +jng_bridge_usage="bridge [-b BRIDGE_NAME] NAME [!|=]iface0 [[!|=]iface1 ...]" jng_bridge_descr="Create ng0_NAME [ng1_NAME ...]" jng_bridge() { @@ -281,12 +281,14 @@ jng_bridge() mustberoot_to_continue local iface parent eiface eiface_devid - local new clone_mac num quad i=0 + local new clone_mac no_derive num quad i=0 for iface in $*; do clone_mac= + no_derive= case "$iface" in =*) iface=${iface#=} clone_mac=1 ;; + !*) iface=${iface#!} no_derive=1 ;; esac # 0. Make sure the interface doesn't exist already @@ -346,24 +348,15 @@ jng_bridge() # 6. Set the MAC address of the new interface using a sensible # algorithm to prevent conflicts on the network. # - case "$iface" in - wlan[0-9]*) - parent=$( sysctl -n net.wlan.${iface#wlan}.%parent ) - case "$parent" in - iwn[0-9]*) - # iwn(4) supports only 1 virtual net at a time - # NB: Cloning MAC allows new interface to work - clone_mac=1 ;; - esac - esac + eiface_devid= if [ "$clone_mac" ]; then - eiface_devid=$( - ifconfig $iface ether | awk '/ether/,$0=$2' - ) - else + eiface_devid=$( ifconfig $iface ether | + awk '/ether/,$0=$2' ) + elif [ ! "$no_derive" ]; then derive_mac $iface "$name" eiface_devid fi - ifconfig $eiface ether $eiface_devid + [ "$eiface_devid" ] && + ifconfig $eiface ether $eiface_devid > /dev/null 2>&1 i=$(( $i + 1 )) # on to next ng{i}_name done # for iface From owner-svn-src-all@freebsd.org Fri Feb 12 02:50:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0109EAA5410; Fri, 12 Feb 2016 02:50:21 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pa0-x22a.google.com (mail-pa0-x22a.google.com [IPv6:2607:f8b0:400e:c03::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C45FC1F49; Fri, 12 Feb 2016 02:50:20 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pa0-x22a.google.com with SMTP id yy13so38890344pab.3; Thu, 11 Feb 2016 18:50:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:reply-to:subject:references:to:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=WCT76WxiadKCKzWoXMQIhvDu6yYiwZHn5WQBA1nFcwY=; b=pImO57Om/QpQbHSvcA9aj4h8GbCGg6b/3ZYYxobWJH/wkDZNnXITUrJFgYLQdA5Y5n vR0zlAHyo4u5SonwER1cr9r4+dwlXC/+dvZcAQsRQkokGijg7QHSjdpPb1ejFdmabKQi /LSTr2snzrxtWvy/2j/rrukcuNgcR0dq7Vx9Jf2r7nf7DMD4Jt0PY6ni+hxmf/zwwrsL wB6QLI9Avh9IXohw8u0OEgfnDvgbKc8LQNJ+PQN0q/khUOh26v0EMTB4b5RpYDQFnTnk 3Ao5Zl+I+8C9j4tpkg1Sbf/zZII4mkD42ivj8jR0hdnhi1KOUzgrZptdE3MHLlDQd7DF mChw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:reply-to:subject:references:to:from :message-id:date:user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=WCT76WxiadKCKzWoXMQIhvDu6yYiwZHn5WQBA1nFcwY=; b=RiQsnCbIufCEZtroih8DLZ9RXWKGHlMJPGQ90tgFsGiBnKbPMAxgjgGTXE3HCFabnr ksy06G/imSulIjE38ImB8ZdeJ3K0BCFjHtTD6c/IKmzV8jFf6gH+hTYxI8eATbv4sJ1B m+FQGiJCUPJJpHdumONmGf3RWsdmG3/OEAz0ejp0rgZzpewbfKH68GKMpYJ5iVBKiYIR 5Iu5TkiAsayZEQwoW4WhMZZVl7IyJ2boCf/o+SwHlJgHwUTKBqG6GjJt8YLnxhYxfrcV G6uERHzbXjbHlOzzShdCBWumBkonI2zLxbwrpVx4roym4qdFgGR6hhWj+xRGADsHai2c FNSw== X-Gm-Message-State: AG10YOTfEwyIk5Cj3B1QWt6Yl7leGd3LZECAnLwdOMxqF7/rSBXHgBO/M37J4QLpE3GndQ== X-Received: by 10.67.22.166 with SMTP id ht6mr72011224pad.9.1455245420357; Thu, 11 Feb 2016 18:50:20 -0800 (PST) Received: from ?IPv6:2001:44b8:31ae:7b01:34bd:622d:2bb0:1afb? (2001-44b8-31ae-7b01-34bd-622d-2bb0-1afb.static.ipv6.internode.on.net. [2001:44b8:31ae:7b01:34bd:622d:2bb0:1afb]) by smtp.gmail.com with ESMTPSA id n78sm15206246pfb.53.2016.02.11.18.50.17 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 11 Feb 2016 18:50:19 -0800 (PST) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r295529 - in head/sys: net netinet netinet6 References: <201602111707.u1BH7JIw040816@repo.freebsd.org> To: Devin Teske , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Kubilay Kocak Message-ID: <9afffb16-f65f-0ac7-fdb5-c92a1494a59e@FreeBSD.org> Date: Fri, 12 Feb 2016 13:50:09 +1100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201602111707.u1BH7JIw040816@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 02:50:21 -0000 On 12/02/2016 4:07 AM, Devin Teske wrote: > Author: dteske > Date: Thu Feb 11 17:07:19 2016 > New Revision: 295529 > URL: https://svnweb.freebsd.org/changeset/base/295529 > > Log: > Merge SVN r295220 (bz) from projects/vnet/ > > Fix a panic that occurs when a vnet interface is unavailable at the time the > vnet jail referencing said interface is stopped. > > Sponsored by: FIS Global, Inc. Was/is there a bugzilla issue for this? Also, MFC and/or re (10.3-R) candidate? > Modified: > head/sys/net/route.c > head/sys/netinet/in_rmx.c > head/sys/netinet6/in6_rmx.c > Directory Properties: > head/ (props changed) > head/sys/ (props changed) > > Modified: head/sys/net/route.c > ============================================================================== > --- head/sys/net/route.c Thu Feb 11 16:54:23 2016 (r295528) > +++ head/sys/net/route.c Thu Feb 11 17:07:19 2016 (r295529) > @@ -353,10 +353,24 @@ rt_table_init(int offset) > return (rh); > } > > +static int > +rt_freeentry(struct radix_node *rn, void *arg) > +{ > + struct radix_head * const rnh = arg; > + struct radix_node *x; > + > + x = (struct radix_node *)rn_delete(rn + 2, NULL, rnh); > + if (x != NULL) > + R_Free(x); > + return (0); > +} > + > void > rt_table_destroy(struct rib_head *rh) > { > > + rn_walktree(&rh->rmhead.head, rt_freeentry, &rh->rmhead.head); > + > /* Assume table is already empty */ > rw_destroy(&rh->rib_lock); > free(rh, M_RTABLE); > > Modified: head/sys/netinet/in_rmx.c > ============================================================================== > --- head/sys/netinet/in_rmx.c Thu Feb 11 16:54:23 2016 (r295528) > +++ head/sys/netinet/in_rmx.c Thu Feb 11 17:07:19 2016 (r295529) > @@ -133,7 +133,8 @@ int > in_detachhead(void **head, int off) > { > > - return (rn_detachhead(head)); > + rt_table_destroy((struct rib_head *)(*head)); > + return (1); > } > #endif > > > Modified: head/sys/netinet6/in6_rmx.c > ============================================================================== > --- head/sys/netinet6/in6_rmx.c Thu Feb 11 16:54:23 2016 (r295528) > +++ head/sys/netinet6/in6_rmx.c Thu Feb 11 17:07:19 2016 (r295529) > @@ -237,7 +237,9 @@ in6_detachhead(void **head, int off) > { > > callout_drain(&V_rtq_mtutimer); > - return (rn_detachhead(head)); > + rt_table_destroy((struct rib_head *)(*head)); > + > + return (1); > } > #endif > > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-all@freebsd.org Fri Feb 12 02:50:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73C77AA5540; Fri, 12 Feb 2016 02:50:37 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 448E812C; Fri, 12 Feb 2016 02:50:37 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1C2oaMR010765; Fri, 12 Feb 2016 02:50:36 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1C2oarf010764; Fri, 12 Feb 2016 02:50:36 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201602120250.u1C2oarf010764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Fri, 12 Feb 2016 02:50:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295555 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 02:50:37 -0000 Author: dteske Date: Fri Feb 12 02:50:36 2016 New Revision: 295555 URL: https://svnweb.freebsd.org/changeset/base/295555 Log: Interpret vnet_interface/vnet.interface as array Modified: head/etc/rc.d/jail Modified: head/etc/rc.d/jail ============================================================================== --- head/etc/rc.d/jail Fri Feb 12 01:41:40 2016 (r295554) +++ head/etc/rc.d/jail Fri Feb 12 02:50:36 2016 (r295555) @@ -33,7 +33,8 @@ need_dad_wait= # set it to $param. If not defined, $defval is used. # When $num is [0-9]*, ${jail_$jv_$name$num} are looked up and # $param is set by using +=. $num=0 is optional (params may start at 1). -# When $num is YN or NY, the value is interpret as boolean. +# When $num is YN or NY, the value is interpreted as boolean. +# When $num is @, the value is interpreted as an array separted by IFS. extract_var() { local i _jv _name _param _num _def _name1 _name2 @@ -78,6 +79,20 @@ extract_var() i=$(($i + 1)) done ;; + @) + _name1=jail_${_jv}_${_name} + _name2=jail_${_name} + eval _tmpargs=\"\${$_name1:-\${$_name2:-$_def}}\" + set -- $_tmpargs + if [ $# -gt 0 ]; then + echo -n " $_param = " + while [ $# -gt 1 ]; do + echo -n "\"$1\", " + shift + done + echo "\"$1\";" + fi + ;; *) _name1=jail_${_jv}_${_name} _name2=jail_${_name} @@ -190,7 +205,7 @@ parse_options() allow.raw_sockets NY YES else echo " vnet;" - extract_var $_jv vnet_interface vnet.interface - "" + extract_var $_jv vnet_interface vnet.interface @ "" fi echo " exec.clean;" From owner-svn-src-all@freebsd.org Fri Feb 12 02:53:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 109D0AA57AB; Fri, 12 Feb 2016 02:53:46 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 C52F7878; Fri, 12 Feb 2016 02:53:45 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1C2ribN013454; Fri, 12 Feb 2016 02:53:44 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1C2ridG013452; Fri, 12 Feb 2016 02:53:44 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201602120253.u1C2ridG013452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Fri, 12 Feb 2016 02:53:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295556 - head/share/examples/jails X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 02:53:46 -0000 Author: dteske Date: Fri Feb 12 02:53:44 2016 New Revision: 295556 URL: https://svnweb.freebsd.org/changeset/base/295556 Log: Comments and fix small bug Reduce differences between jib/jng and fix a bug that would prevent additional interfaces from being created if the first of many already existed (counter wasn't incremented before calling only continue). Modified: head/share/examples/jails/jib head/share/examples/jails/jng Modified: head/share/examples/jails/jib ============================================================================== --- head/share/examples/jails/jib Fri Feb 12 02:50:36 2016 (r295555) +++ head/share/examples/jails/jib Fri Feb 12 02:53:44 2016 (r295556) @@ -286,13 +286,16 @@ jib_addm() !*) iface=${iface#!} no_derive=1 ;; esac - # 1. Make sure the interface doesn't exist already - ifconfig "e${i}a_$name" > /dev/null 2>&1 && continue + # Make sure the interface doesn't exist already + if ifconfig "e${i}a_$name" > /dev/null 2>&1; then + i=$(( $i + 1 )) + continue + fi - # 2. Bring the interface up + # Bring the interface up ifconfig $iface up || return - # 3. Make sure the interface has been bridged + # Make sure the interface has been bridged if ! ifconfig "$iface$bridge" > /dev/null 2>&1; then new=$( ifconfig bridge create ) || return ifconfig $new addm $iface || return @@ -300,18 +303,18 @@ jib_addm() ifconfig "$iface$bridge" up || return fi - # 4. Create a new interface to the bridge + # Create a new interface to the bridge new=$( ifconfig epair create ) || return ifconfig "$iface$bridge" addm $new || return - # 5. Rename the new interface + # Rename the new interface ifconfig $new name "e${i}a_$name" || return ifconfig ${new%a}b name "e${i}b_$name" || return ifconfig "e${i}a_$name" up || return ifconfig "e${i}b_$name" up || return # - # 6. Set the MAC address of the new interface using a sensible + # Set the MAC address of the new interface using a sensible # algorithm to prevent conflicts on the network. # eiface_devid_a= eiface_devid_b= @@ -322,7 +325,7 @@ jib_addm() ifconfig "e${i}b_$name" ether $eiface_devid_b fi > /dev/null 2>&1 - i=$(( $i + 1 )) # on to next e{i}b_name + i=$(( $i + 1 )) done # for iface } Modified: head/share/examples/jails/jng ============================================================================== --- head/share/examples/jails/jng Fri Feb 12 02:50:36 2016 (r295555) +++ head/share/examples/jails/jng Fri Feb 12 02:53:44 2016 (r295556) @@ -291,18 +291,21 @@ jng_bridge() !*) iface=${iface#!} no_derive=1 ;; esac - # 0. Make sure the interface doesn't exist already + # Make sure the interface doesn't exist already eiface=ng${i}_$name - ngctl msg "$eiface:" getifname > /dev/null 2>&1 && continue + if ngctl msg "$eiface:" getifname > /dev/null 2>&1; then + i=$(( $i + 1 )) + continue + fi - # 1. Bring the interface up + # Bring the interface up ifconfig $iface up || return - # 2. Set promiscuous mode and don't overwrite src addr + # Set promiscuous mode and don't overwrite src addr ngctl msg $iface: setpromisc 1 || return ngctl msg $iface: setautosrc 0 || return - # 3. Make sure the interface has been bridged + # Make sure the interface has been bridged if ! ngctl info ${iface}bridge: > /dev/null 2>&1; then ngctl mkpeer $iface: bridge lower link0 || return ngctl connect $iface: $iface:lower upper link1 || @@ -310,7 +313,7 @@ jng_bridge() ngctl name $iface:lower ${iface}bridge || return fi - # 3.5. Optionally create a secondary bridge + # Optionally create a secondary bridge if [ "$bridge" != "bridge" ] && ! ngctl info "$iface$bridge:" > /dev/null 2>&1 then @@ -326,7 +329,7 @@ jng_bridge() return fi - # 4. Create a new interface to the bridge + # Create a new interface to the bridge num=2 while ngctl msg "$iface$bridge:" getstats $num > /dev/null 2>&1 do @@ -334,7 +337,7 @@ jng_bridge() done ngctl mkpeer "$iface$bridge:" eiface link$num ether || return - # 5. Rename the new interface + # Rename the new interface while [ ${#eiface} -gt 15 ]; do # OS limitation eiface=${eiface%?} done @@ -345,7 +348,7 @@ jng_bridge() ifconfig $eiface up || return # - # 6. Set the MAC address of the new interface using a sensible + # Set the MAC address of the new interface using a sensible # algorithm to prevent conflicts on the network. # eiface_devid= @@ -358,7 +361,7 @@ jng_bridge() [ "$eiface_devid" ] && ifconfig $eiface ether $eiface_devid > /dev/null 2>&1 - i=$(( $i + 1 )) # on to next ng{i}_name + i=$(( $i + 1 )) done # for iface } From owner-svn-src-all@freebsd.org Fri Feb 12 05:15:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17AB9AA154D; Fri, 12 Feb 2016 05:15:00 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 C3DA5E2C; Fri, 12 Feb 2016 05:14:59 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1C5EwfC053624; Fri, 12 Feb 2016 05:14:58 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1C5EwWt053622; Fri, 12 Feb 2016 05:14:58 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201602120514.u1C5EwWt053622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 12 Feb 2016 05:14:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295557 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 05:15:00 -0000 Author: mmel Date: Fri Feb 12 05:14:58 2016 New Revision: 295557 URL: https://svnweb.freebsd.org/changeset/base/295557 Log: UART: Fix spurious interrupts generated by ns8250 and lpc drivers: - don't enable transmitter empty interrupt before filling TX FIFO. - add missing uart_barrier() call in interrupt service routine Modified: head/sys/dev/uart/uart_dev_lpc.c head/sys/dev/uart/uart_dev_ns8250.c Modified: head/sys/dev/uart/uart_dev_lpc.c ============================================================================== --- head/sys/dev/uart/uart_dev_lpc.c Fri Feb 12 02:53:44 2016 (r295556) +++ head/sys/dev/uart/uart_dev_lpc.c Fri Feb 12 05:14:58 2016 (r295557) @@ -659,6 +659,7 @@ lpc_ns8250_bus_ipend(struct uart_softc * if (iir & IIR_TXRDY) { ipend |= SER_INT_TXIDLE; uart_setreg(bas, REG_IER, lpc_ns8250->ier); + uart_barrier(bas); } else ipend |= SER_INT_SIGCHG; } @@ -892,12 +893,12 @@ lpc_ns8250_bus_transmit(struct uart_soft uart_lock(sc->sc_hwmtx); while ((uart_getreg(bas, REG_LSR) & LSR_THRE) == 0) ; - uart_setreg(bas, REG_IER, lpc_ns8250->ier | IER_ETXRDY); - uart_barrier(bas); for (i = 0; i < sc->sc_txdatasz; i++) { uart_setreg(bas, REG_DATA, sc->sc_txbuf[i]); uart_barrier(bas); } + uart_setreg(bas, REG_IER, lpc_ns8250->ier | IER_ETXRDY); + uart_barrier(bas); sc->sc_txbusy = 1; uart_unlock(sc->sc_hwmtx); return (0); Modified: head/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- head/sys/dev/uart/uart_dev_ns8250.c Fri Feb 12 02:53:44 2016 (r295556) +++ head/sys/dev/uart/uart_dev_ns8250.c Fri Feb 12 05:14:58 2016 (r295557) @@ -708,6 +708,7 @@ ns8250_bus_ipend(struct uart_softc *sc) if (iir & IIR_TXRDY) { ipend |= SER_INT_TXIDLE; uart_setreg(bas, REG_IER, ns8250->ier); + uart_barrier(bas); } else ipend |= SER_INT_SIGCHG; } @@ -979,12 +980,12 @@ ns8250_bus_transmit(struct uart_softc *s uart_lock(sc->sc_hwmtx); while ((uart_getreg(bas, REG_LSR) & LSR_THRE) == 0) ; - uart_setreg(bas, REG_IER, ns8250->ier | IER_ETXRDY); - uart_barrier(bas); for (i = 0; i < sc->sc_txdatasz; i++) { uart_setreg(bas, REG_DATA, sc->sc_txbuf[i]); uart_barrier(bas); } + uart_setreg(bas, REG_IER, ns8250->ier | IER_ETXRDY); + uart_barrier(bas); if (broken_txfifo) ns8250_drain(bas, UART_DRAIN_TRANSMITTER); else From owner-svn-src-all@freebsd.org Fri Feb 12 07:20:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37B91AA5C76; Fri, 12 Feb 2016 07:20:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 068C91C43; Fri, 12 Feb 2016 07:20:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1C7Jxc8088071; Fri, 12 Feb 2016 07:19:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1C7Jxkj088070; Fri, 12 Feb 2016 07:19:59 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201602120719.u1C7Jxkj088070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 12 Feb 2016 07:19:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295558 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 07:20:01 -0000 Author: kib Date: Fri Feb 12 07:19:59 2016 New Revision: 295558 URL: https://svnweb.freebsd.org/changeset/base/295558 Log: Remove tautological cast. PR: 207068 Submitted by: joss.upton@yahoo.com MFC after: 2 weeks Modified: head/sys/dev/hwpmc/hwpmc_mod.c Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Fri Feb 12 05:14:58 2016 (r295557) +++ head/sys/dev/hwpmc/hwpmc_mod.c Fri Feb 12 07:19:59 2016 (r295558) @@ -1483,7 +1483,7 @@ pmc_process_csw_out(struct thread *td) * increasing monotonically, modulo a 64 * bit wraparound. */ - KASSERT((int64_t) tmp >= 0, + KASSERT(tmp >= 0, ("[pmc,%d] negative increment cpu=%d " "ri=%d newvalue=%jx saved=%jx " "incr=%jx", __LINE__, cpu, ri, From owner-svn-src-all@freebsd.org Fri Feb 12 07:20:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECC37AA5D1D; Fri, 12 Feb 2016 07:20:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 BDBEC1D9D; Fri, 12 Feb 2016 07:20:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1C7KR3e088161; Fri, 12 Feb 2016 07:20:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1C7KR19088160; Fri, 12 Feb 2016 07:20:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201602120720.u1C7KR19088160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 12 Feb 2016 07:20:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295559 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 07:20:29 -0000 Author: kib Date: Fri Feb 12 07:20:27 2016 New Revision: 295559 URL: https://svnweb.freebsd.org/changeset/base/295559 Log: Adjust the size of PMC_DEFAULT_DEBUG_FLAGS to match the size of the structure. PR: 207068 Submitted by: joss.upton@yahoo.com MFC after: 2 weeks Modified: head/sys/sys/pmc.h Modified: head/sys/sys/pmc.h ============================================================================== --- head/sys/sys/pmc.h Fri Feb 12 07:19:59 2016 (r295558) +++ head/sys/sys/pmc.h Fri Feb 12 07:20:27 2016 (r295559) @@ -1033,7 +1033,7 @@ extern struct pmc_debugflags pmc_debugfl #define KTR_PMC KTR_SUBSYS #define PMC_DEBUG_STRSIZE 128 -#define PMC_DEBUG_DEFAULT_FLAGS { 0, 0, 0, 0, 0, 0, 0, 0 } +#define PMC_DEBUG_DEFAULT_FLAGS { 0, 0, 0, 0, 0, 0, 0, 0, 0 } #define PMCDBG0(M, N, L, F) do { \ if (pmc_debugflags.pdb_ ## M & (1 << PMC_DEBUG_MIN_ ## N)) \ From owner-svn-src-all@freebsd.org Fri Feb 12 07:27:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 994D6AA6187; Fri, 12 Feb 2016 07:27:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 77D0633D; Fri, 12 Feb 2016 07:27:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1C7ROmL090989; Fri, 12 Feb 2016 07:27:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1C7ROYF090987; Fri, 12 Feb 2016 07:27:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201602120727.u1C7ROYF090987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 12 Feb 2016 07:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295560 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 07:27:25 -0000 Author: kib Date: Fri Feb 12 07:27:24 2016 New Revision: 295560 URL: https://svnweb.freebsd.org/changeset/base/295560 Log: If full width writes to the performance monitoring counters are supported, use full-width aliases MSRs for writes. This fixes the "[pmc,X] negative increment" assertion on the context switch when clipped counter value is sign-extended. Add definitions for the MSR IA32_PERF_CAPABILITIES needed to detect the feature. PR: 207068 Submitted by: joss.upton@yahoo.com MFC after: 2 weeks Modified: head/sys/dev/hwpmc/hwpmc_core.c head/sys/dev/hwpmc/hwpmc_core.h Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Fri Feb 12 07:20:27 2016 (r295559) +++ head/sys/dev/hwpmc/hwpmc_core.c Fri Feb 12 07:27:24 2016 (r295560) @@ -103,6 +103,7 @@ static int core_iaf_npmc; static int core_iap_width; static int core_iap_npmc; +static int core_iap_wroffset; static int core_pcpu_noop(struct pmc_mdep *md, int cpu) @@ -2473,7 +2474,7 @@ iap_read_pmc(int cpu, int ri, pmc_value_ *v = tmp & ((1ULL << core_iap_width) - 1); PMCDBG4(MDP,REA,1, "iap-read cpu=%d ri=%d msr=0x%x -> v=%jx", cpu, ri, - ri, *v); + IAP_PMC0 + ri, *v); return (0); } @@ -2605,19 +2606,20 @@ iap_write_pmc(int cpu, int ri, pmc_value ("[core,%d] cpu%d ri%d no configured PMC to stop", __LINE__, cpu, ri)); - PMCDBG4(MDP,WRI,1, "iap-write cpu=%d ri=%d msr=0x%x v=%jx", cpu, ri, - IAP_PMC0 + ri, v); - if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) v = iap_reload_count_to_perfctr_value(v); - /* - * Write the new value to the counter. The counter will be in - * a stopped state when the pcd_write() entry point is called. - */ + v &= (1ULL << core_iap_width) - 1; - wrmsr(IAP_PMC0 + ri, v & ((1ULL << core_iap_width) - 1)); + PMCDBG4(MDP,WRI,1, "iap-write cpu=%d ri=%d msr=0x%x v=%jx", cpu, ri, + IAP_PMC0 + ri, v); + /* + * Write the new value to the counter (or it's alias). The + * counter will be in a stopped state when the pcd_write() + * entry point is called. + */ + wrmsr(core_iap_wroffset + IAP_PMC0 + ri, v); return (0); } @@ -2700,7 +2702,7 @@ core_intr(int cpu, struct trapframe *tf) */ msr = rdmsr(IAP_EVSEL0 + ri) & ~IAP_EVSEL_MASK; wrmsr(IAP_EVSEL0 + ri, msr); - wrmsr(IAP_PMC0 + ri, v); + wrmsr(core_iap_wroffset + IAP_PMC0 + ri, v); if (error) continue; @@ -2814,7 +2816,7 @@ core2_intr(int cpu, struct trapframe *tf (uintmax_t) v); /* Reload sampling count. */ - wrmsr(IAP_PMC0 + n, v); + wrmsr(core_iap_wroffset + IAP_PMC0 + n, v); } /* @@ -2865,6 +2867,18 @@ pmc_core_initialize(struct pmc_mdep *md, return (EPROGMISMATCH); } + core_iap_wroffset = 0; + if (cpu_feature2 & CPUID2_PDCM) { + if (rdmsr(IA32_PERF_CAPABILITIES) & PERFCAP_FW_WRITE) { + PMCDBG0(MDP, INI, 1, + "core-init full-width write supported"); + core_iap_wroffset = IAP_A_PMC0 - IAP_PMC0; + } else + PMCDBG0(MDP, INI, 1, + "core-init full-width write NOT supported"); + } else + PMCDBG0(MDP, INI, 1, "core-init pdcm not supported"); + core_pmcmask = 0; /* Modified: head/sys/dev/hwpmc/hwpmc_core.h ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.h Fri Feb 12 07:20:27 2016 (r295559) +++ head/sys/dev/hwpmc/hwpmc_core.h Fri Feb 12 07:27:24 2016 (r295560) @@ -29,6 +29,14 @@ #ifndef _DEV_HWPMC_CORE_H_ #define _DEV_HWPMC_CORE_H_ 1 +#define IA32_PERF_CAPABILITIES 0x345 +#define PERFCAP_LBR_FORMAT 0x003f +#define PERFCAP_PEBS_TRAP 0x0040 +#define PERFCAP_PEBS_SAVEARCH 0x0080 +#define PERFCAP_PEBS_RECFORMAT 0x0f00 +#define PERFCAP_SMM_FREEZE 0x1000 +#define PERFCAP_FW_WRITE 0x2000 /* full width write aliases */ + /* * Fixed-function PMCs. */ @@ -101,6 +109,7 @@ struct pmc_md_iap_op_pmcallocate { */ #define IAP_PMC0 0x0C1 +#define IAP_A_PMC0 0x4C1 /* * IAP_EVSEL(n) is laid out in the following way. From owner-svn-src-all@freebsd.org Fri Feb 12 07:38:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3DC8AA6745; Fri, 12 Feb 2016 07:38:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 C055DAF8; Fri, 12 Feb 2016 07:38:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1C7cKai093964; Fri, 12 Feb 2016 07:38:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1C7cKpq093956; Fri, 12 Feb 2016 07:38:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201602120738.u1C7cKpq093956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 12 Feb 2016 07:38:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295561 - in head: include sys/mips/include sys/powerpc/include sys/sparc64/include sys/sys sys/x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 07:38:22 -0000 Author: kib Date: Fri Feb 12 07:38:19 2016 New Revision: 295561 URL: https://svnweb.freebsd.org/changeset/base/295561 Log: POSIX states that #include shall make both mcontext_t and ucontext_t available. Our code even has XXX comment about this. Add a bit of compliance by moving struct __ucontext definition into sys/_ucontext.h and including it into signal.h and sys/ucontext.h. Several machine/ucontext.h headers were changed to use namespace-safe types (like uint64_t->__uint64_t) to not depend on sys/types.h. struct __stack_t from sys/signal.h is made always visible in private namespace to satisfy sys/_ucontext.h requirements. Apparently mips _types.h pollutes global namespace with f_register_t type definition. This commit does not try to fix the issue. PR: 207079 Reported and tested by: Ting-Wei Lan Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Added: head/sys/sys/_ucontext.h - copied, changed from r295560, head/sys/sys/ucontext.h Modified: head/include/signal.h head/sys/mips/include/ucontext.h head/sys/powerpc/include/ucontext.h head/sys/sparc64/include/ucontext.h head/sys/sys/signal.h head/sys/sys/ucontext.h head/sys/x86/include/ucontext.h Modified: head/include/signal.h ============================================================================== --- head/include/signal.h Fri Feb 12 07:27:24 2016 (r295560) +++ head/include/signal.h Fri Feb 12 07:38:19 2016 (r295561) @@ -36,6 +36,8 @@ #include #include #include +#include +#include #if __BSD_VISIBLE /* @@ -114,7 +116,6 @@ void psignal(unsigned int, const char *) #if __BSD_VISIBLE int sigblock(int); -struct __ucontext; /* XXX spec requires a complete declaration. */ int sigreturn(const struct __ucontext *); int sigsetmask(int); int sigstack(const struct sigstack *, struct sigstack *); Modified: head/sys/mips/include/ucontext.h ============================================================================== --- head/sys/mips/include/ucontext.h Fri Feb 12 07:27:24 2016 (r295560) +++ head/sys/mips/include/ucontext.h Fri Feb 12 07:38:19 2016 (r295561) @@ -50,13 +50,13 @@ typedef struct __mcontext { * struct sigcontext and ucontext_t at the same time. */ int mc_onstack; /* sigstack state to restore */ - register_t mc_pc; /* pc at time of signal */ - register_t mc_regs[32]; /* processor regs 0 to 31 */ - register_t sr; /* status register */ - register_t mullo, mulhi; /* mullo and mulhi registers... */ + __register_t mc_pc; /* pc at time of signal */ + __register_t mc_regs[32]; /* processor regs 0 to 31 */ + __register_t sr; /* status register */ + __register_t mullo, mulhi; /* mullo and mulhi registers... */ int mc_fpused; /* fp has been used */ f_register_t mc_fpregs[33]; /* fp regs 0 to 31 and csr */ - register_t mc_fpc_eir; /* fp exception instruction reg */ + __register_t mc_fpc_eir; /* fp exception instruction reg */ void *mc_tls; /* pointer to TLS area */ int __spare__[8]; /* XXX reserved */ } mcontext_t; Modified: head/sys/powerpc/include/ucontext.h ============================================================================== --- head/sys/powerpc/include/ucontext.h Fri Feb 12 07:27:24 2016 (r295560) +++ head/sys/powerpc/include/ucontext.h Fri Feb 12 07:38:19 2016 (r295561) @@ -42,11 +42,11 @@ typedef struct __mcontext { #define _MC_AV_VALID 0x02 int mc_onstack; /* saved onstack flag */ int mc_len; /* sizeof(__mcontext) */ - uint64_t mc_avec[32*2]; /* vector register file */ - uint32_t mc_av[2]; - register_t mc_frame[42]; - uint64_t mc_fpreg[33]; - uint64_t mc_vsxfpreg[32]; /* low-order half of VSR0-31 */ + __uint64_t mc_avec[32*2]; /* vector register file */ + __uint32_t mc_av[2]; + __register_t mc_frame[42]; + __uint64_t mc_fpreg[33]; + __uint64_t mc_vsxfpreg[32]; /* low-order half of VSR0-31 */ } mcontext_t __aligned(16); #if defined(_KERNEL) && defined(__powerpc64__) Modified: head/sys/sparc64/include/ucontext.h ============================================================================== --- head/sys/sparc64/include/ucontext.h Fri Feb 12 07:27:24 2016 (r295560) +++ head/sys/sparc64/include/ucontext.h Fri Feb 12 07:38:19 2016 (r295561) @@ -33,11 +33,11 @@ #define _MACHINE_UCONTEXT_H_ struct __mcontext { - uint64_t mc_global[8]; - uint64_t mc_out[8]; - uint64_t mc_local[8]; - uint64_t mc_in[8]; - uint32_t mc_fp[64]; + __uint64_t mc_global[8]; + __uint64_t mc_out[8]; + __uint64_t mc_local[8]; + __uint64_t mc_in[8]; + __uint32_t mc_fp[64]; } __aligned(64); typedef struct __mcontext mcontext_t; Copied and modified: head/sys/sys/_ucontext.h (from r295560, head/sys/sys/ucontext.h) ============================================================================== --- head/sys/sys/ucontext.h Fri Feb 12 07:27:24 2016 (r295560, copy source) +++ head/sys/sys/_ucontext.h Fri Feb 12 07:38:19 2016 (r295561) @@ -28,11 +28,8 @@ * $FreeBSD$ */ -#ifndef _SYS_UCONTEXT_H_ -#define _SYS_UCONTEXT_H_ - -#include -#include +#ifndef _SYS__UCONTEXT_H_ +#define _SYS__UCONTEXT_H_ typedef struct __ucontext { /* @@ -43,64 +40,13 @@ typedef struct __ucontext { * support them both at the same time. * note: the union is not defined, though. */ - sigset_t uc_sigmask; + __sigset_t uc_sigmask; mcontext_t uc_mcontext; struct __ucontext *uc_link; - stack_t uc_stack; + struct __stack_t uc_stack; int uc_flags; -#define UCF_SWAPPED 0x00000001 /* Used by swapcontext(3). */ int __spare__[4]; } ucontext_t; -#if defined(_KERNEL) && defined(COMPAT_FREEBSD4) -#if defined(__i386__) -struct ucontext4 { - sigset_t uc_sigmask; - struct mcontext4 uc_mcontext; - struct ucontext4 *uc_link; - stack_t uc_stack; - int __spare__[8]; -}; -#else /* __i386__ */ -#define ucontext4 ucontext -#endif /* __i386__ */ -#endif /* _KERNEL */ - -#ifndef _KERNEL - -__BEGIN_DECLS - -int getcontext(ucontext_t *) __returns_twice; -ucontext_t *getcontextx(void); -int setcontext(const ucontext_t *); -void makecontext(ucontext_t *, void (*)(void), int, ...); -int signalcontext(ucontext_t *, int, __sighandler_t *); -int swapcontext(ucontext_t *, const ucontext_t *); - -#if __BSD_VISIBLE -int __getcontextx_size(void); -int __fillcontextx(char *ctx) __returns_twice; -int __fillcontextx2(char *ctx); -#endif - -__END_DECLS - -#else /* _KERNEL */ - -struct thread; - -/* - * Flags for get_mcontext(). The low order 4 bits (i.e a mask of 0x0f) are - * reserved for use by machine independent code. All other bits are for use - * by machine dependent code. - */ -#define GET_MC_CLEAR_RET 1 - -/* Machine-dependent functions: */ -int get_mcontext(struct thread *, mcontext_t *, int); -int set_mcontext(struct thread *, mcontext_t *); - -#endif /* !_KERNEL */ - -#endif /* !_SYS_UCONTEXT_H_ */ +#endif /* _SYS__UCONTEXT_H */ Modified: head/sys/sys/signal.h ============================================================================== --- head/sys/sys/signal.h Fri Feb 12 07:27:24 2016 (r295560) +++ head/sys/sys/signal.h Fri Feb 12 07:38:19 2016 (r295561) @@ -354,18 +354,10 @@ typedef void __siginfohandler_t(int, str #endif #if __XSI_VISIBLE -/* - * Structure used in sigaltstack call. - */ #if __BSD_VISIBLE -typedef struct sigaltstack { -#else -typedef struct { +#define __stack_t sigaltstack #endif - void *ss_sp; /* signal stack base */ - __size_t ss_size; /* signal stack length */ - int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */ -} stack_t; +typedef struct __stack_t stack_t; #define SS_ONSTACK 0x0001 /* take signal on alternate stack */ #define SS_DISABLE 0x0004 /* disable taking signals on alternate stack */ @@ -373,6 +365,17 @@ typedef struct { #define SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended stack size */ #endif +/* + * Structure used in sigaltstack call. Its definition is always + * needed for __ucontext. If __BSD_VISIBLE is defined, the structure + * tag is actually sigaltstack. + */ +struct __stack_t { + void *ss_sp; /* signal stack base */ + __size_t ss_size; /* signal stack length */ + int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */ +}; + #if __BSD_VISIBLE /* * 4.3 compatibility: Modified: head/sys/sys/ucontext.h ============================================================================== --- head/sys/sys/ucontext.h Fri Feb 12 07:27:24 2016 (r295560) +++ head/sys/sys/ucontext.h Fri Feb 12 07:38:19 2016 (r295561) @@ -33,25 +33,9 @@ #include #include +#include -typedef struct __ucontext { - /* - * Keep the order of the first two fields. Also, - * keep them the first two fields in the structure. - * This way we can have a union with struct - * sigcontext and ucontext_t. This allows us to - * support them both at the same time. - * note: the union is not defined, though. - */ - sigset_t uc_sigmask; - mcontext_t uc_mcontext; - - struct __ucontext *uc_link; - stack_t uc_stack; - int uc_flags; #define UCF_SWAPPED 0x00000001 /* Used by swapcontext(3). */ - int __spare__[4]; -} ucontext_t; #if defined(_KERNEL) && defined(COMPAT_FREEBSD4) #if defined(__i386__) Modified: head/sys/x86/include/ucontext.h ============================================================================== --- head/sys/x86/include/ucontext.h Fri Feb 12 07:27:24 2016 (r295560) +++ head/sys/x86/include/ucontext.h Fri Feb 12 07:38:19 2016 (r295561) @@ -162,4 +162,9 @@ typedef struct __mcontext { } mcontext_t; #endif /* __amd64__ */ +#ifdef __LINT__ +typedef struct __mcontext { +} mcontext_t; +#endif /* __LINT__ */ + #endif /* !_X86_UCONTEXT_H_ */ From owner-svn-src-all@freebsd.org Fri Feb 12 10:58:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FA23AA6A78; Fri, 12 Feb 2016 10:58:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 F156AB9E; Fri, 12 Feb 2016 10:58:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1CAwE1o051945; Fri, 12 Feb 2016 10:58:14 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1CAwEqI051944; Fri, 12 Feb 2016 10:58:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201602121058.u1CAwEqI051944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 12 Feb 2016 10:58:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295562 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 10:58:15 -0000 Author: mav Date: Fri Feb 12 10:58:13 2016 New Revision: 295562 URL: https://svnweb.freebsd.org/changeset/base/295562 Log: Don't check CmdSN for initial login request. This fixes connection errors for some initiators not starting CmdSN from zero. While there, fix wrong status details reported for couple errors. MFC after: 3 days Modified: head/usr.sbin/ctld/login.c Modified: head/usr.sbin/ctld/login.c ============================================================================== --- head/usr.sbin/ctld/login.c Fri Feb 12 07:38:19 2016 (r295561) +++ head/usr.sbin/ctld/login.c Fri Feb 12 10:58:13 2016 (r295562) @@ -126,15 +126,16 @@ login_receive(struct connection *conn, b log_errx(1, "received Login PDU with unsupported " "Version-min 0x%x", bhslr->bhslr_version_min); } - if (ISCSI_SNLT(ntohl(bhslr->bhslr_cmdsn), conn->conn_cmdsn)) { - login_send_error(request, 0x02, 0x05); + if (initial == false && + ISCSI_SNLT(ntohl(bhslr->bhslr_cmdsn), conn->conn_cmdsn)) { + login_send_error(request, 0x02, 0x00); log_errx(1, "received Login PDU with decreasing 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); + login_send_error(request, 0x02, 0x00); log_errx(1, "received Login PDU with wrong ExpStatSN: " "is %u, should be %u", ntohl(bhslr->bhslr_expstatsn), conn->conn_statsn); From owner-svn-src-all@freebsd.org Fri Feb 12 11:27:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5100EAA45FF for ; Fri, 12 Feb 2016 11:27:20 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E4A9C1798 for ; Fri, 12 Feb 2016 11:27:19 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm0-x232.google.com with SMTP id g62so58363140wme.0 for ; Fri, 12 Feb 2016 03:27:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=G6hlHGiHoXLRHDp6Lnr8p67aXO6JephlIDnduNG+mgA=; b=H6iEyDyc7KOejYIJTDcnQIQx1T+I8SY/kKSfhsbZ/joyGj8NX8Ox1cA8dBr1uq7XMY 3Z9CMeqVCnx3KXmEwBIHBDjPIaU1//eSexbBpST6lFhnqXpQ5fed9FSh8QXiD7xMYD41 07xfFDMnHQAXmsqPciA4XNIYUSaOpZyGz+YeYEayAk0JcBqDhDDDygeSlDuCfqhDZSys YF8ClCFGWx5uGBSdWi2zu667xf7eDxdhR7EXkGnCIlDiHHP/COoeFqF+DHGATChU/1qy T0MwCGYGD+nUpgllxAuz1A47zCtM7AiI8N1+71SzMc8vsXMC3rkjafS7WgPp+wk9XeSL 050A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=G6hlHGiHoXLRHDp6Lnr8p67aXO6JephlIDnduNG+mgA=; b=iXPRB//5A08vDuyt8+ExROM1qnYTfIyoxfHJv+RibUADidxS5Tavr8uCSHcM3V6gu5 UmHoX5JxhWDa1hGBMWbCgW/fYnv1ss+xHr6wh7dWTWqGEnSTlsaQ2hqIqX6vnIWYNFUK EIYA+Azikmq1ZlcSPFacbqlffoJqd9VoNWZsOXXj2EmaZSzaO7HDnI7YJiQP88qbZ5RN 1GFCMUfneCzZwaiVdBvf4xLu6HNMHoymFg+OcKVyy7llT1N1gGJ2Od+A7IVRRcf3IN2Q Kq5D/FSAVIsIv6Ybltu0qSWoI/WSCadaK9GnuiNtRLijtpMrNn7C5ud3cFKumbJJ0je9 DljA== X-Gm-Message-State: AG10YOSjoHLmQVSXq3Xj7tBcaWKzK2KNkIDSb0sQY9SPvxgToNK/x1S1FsRTAIMawaCY0wWv X-Received: by 10.194.61.73 with SMTP id n9mr1402443wjr.36.1455276438101; Fri, 12 Feb 2016 03:27:18 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id i10sm1939201wmf.14.2016.02.12.03.27.16 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 12 Feb 2016 03:27:16 -0800 (PST) Subject: Re: svn commit: r295525 - stable/10/sys/dev/ixgbe To: Sean Bruno , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org References: <201602111635.u1BGZGTs031940@repo.freebsd.org> From: Steven Hartland Message-ID: <56BDC194.6070001@multiplay.co.uk> Date: Fri, 12 Feb 2016 11:27:16 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <201602111635.u1BGZGTs031940@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 11:27:20 -0000 There's a typo here and the unreverted version is still present in head, was this the intention? Clearly the code does limit it to 8, so the old description is more correct, just needs the typo fixing, but I would have expected this to have been corrected in head first and then MFC'ed This was reported to me by Dmitry Luhtionov. Regards Steve On 11/02/2016 16:35, Sean Bruno wrote: > Author: sbruno > Date: Thu Feb 11 16:35:16 2016 > New Revision: 295525 > URL: https://svnweb.freebsd.org/changeset/base/295525 > > Log: > Revert sysctl description change introduced in r295008 to correctly > reflect the maximum number of queues supported (8) by this driver. > > Submitted by: jwd > Reviewed by: erj > Approved by: re (gjb) > Sponsored by: Intel Corporation and Limelight Networks > > Modified: > stable/10/sys/dev/ixgbe/if_ix.c > > Modified: stable/10/sys/dev/ixgbe/if_ix.c > ============================================================================== > --- stable/10/sys/dev/ixgbe/if_ix.c Thu Feb 11 16:16:10 2016 (r295524) > +++ stable/10/sys/dev/ixgbe/if_ix.c Thu Feb 11 16:35:16 2016 (r295525) > @@ -320,7 +320,8 @@ SYSCTL_INT(_hw_ix, OID_AUTO, enable_msix > static int ixgbe_num_queues = 0; > TUNABLE_INT("hw.ix.num_queues", &ixgbe_num_queues); > SYSCTL_INT(_hw_ix, OID_AUTO, num_queues, CTLFLAG_RDTUN, &ixgbe_num_queues, 0, > - "Number of queues to configure, 0 indicates autoconfigure"); > + "Number of queues to configure up to a mximum of 8," > + "0 indicates autoconfigure"); > > /* > ** Number of TX descriptors per ring, > From owner-svn-src-all@freebsd.org Fri Feb 12 11:34:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1BACAA4A5E for ; Fri, 12 Feb 2016 11:34:43 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 384921C1A for ; Fri, 12 Feb 2016 11:34:43 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x22a.google.com with SMTP id p63so16376908wmp.1 for ; Fri, 12 Feb 2016 03:34:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=HwXsvPB7Rb3rgyypG1J71Lbn/U/p74YsuMOJh63+Io0=; b=ov/rcv89tagtw+hu6Rl71WONdaL7n+22Gs4FDrEwcytBvAP8UrBsE/Xo0kaCzp54mT CkEiggCjiQLhfoLqWYQ6+qogNHLAozvw46Fl7o1t2rcEboKOJC2DkRsKiD+DYY6t+fk7 PzI6l34tEja+AD45zzNHWQ6vRDNGcD2QJ3mg6whXquKI20TwBX7Vz7ORHbL+c2zKQafw VCU+Z6sJGIpe3dL73+WA5TAu5TtgiNkHHciJHtCETd+W9O99Mz88oqrYvPz4Q5EIgewQ zElh6JCe4nyVzUTV4pE4flTrEO6j5UkwxFL5ctYoAd91d0K3cdFpFgRVZDgq/8Pk/aJ4 fcmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=HwXsvPB7Rb3rgyypG1J71Lbn/U/p74YsuMOJh63+Io0=; b=iF8Vf4pLv0+NFz8n/56BIhziefbXTm9yWSNQvIRA42jCzkBzCiLaJ3YMffCa4aX5Sw NrO+8Kv+++OG/aN1vTucSb7S8mFcK2vLp4fck2KLOtUBScxrLJYf8VCUVeeA4cvnMMG5 5FFfj7JYVsyV9H7ucwqt8M8b8L5YrNJgeH7bWMonns7gmsSLJ4MFJwc5k+sqKk7y4Ie/ XeinTdMfR16A6WKnokoMnLMBefKDhA4PiekgrUC0Q3e6zfEshfMvAJnBpTEgJwLN7S9h erqFiEVjuEntiXbTmCoZDuuZJDviYiuHiaF9aU1jvie+n39pWAXAyGp0NvphVvcORFIi +UoA== X-Gm-Message-State: AG10YOQkWdaU8W2qg9Px1/TxRLZImidB21ncvvHixT3/MXwQndmcMRWwbgxna8C3DRMn0aRtOioEpMA+gXjxIITj MIME-Version: 1.0 X-Received: by 10.194.186.232 with SMTP id fn8mr1122471wjc.93.1455276881744; Fri, 12 Feb 2016 03:34:41 -0800 (PST) Received: by 10.194.82.6 with HTTP; Fri, 12 Feb 2016 03:34:41 -0800 (PST) In-Reply-To: <201602051714.u15HEbRD088498@repo.freebsd.org> References: <201602051714.u15HEbRD088498@repo.freebsd.org> Date: Fri, 12 Feb 2016 12:34:41 +0100 Message-ID: Subject: Re: svn commit: r295323 - head/sys/dev/e1000 From: Oliver Pinter To: Eric Joyner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 11:34:43 -0000 On 2/5/16, Eric Joyner wrote: > Author: erj > Date: Fri Feb 5 17:14:37 2016 > New Revision: 295323 > URL: https://svnweb.freebsd.org/changeset/base/295323 > > Log: > Update em(4) to 7.6.1; update igb(4) to 2.5.3. > > Major changes: > > - Add i219/i219(2) hardware support. (Found on Skylake generation and > newer > chipsets.) > - Further to the last Skylake support diff, this one also includes > support for > the Lewisburg chipset (i219(3)). > > - Add a workaround to an igb hardware errata. > All 1G server products need to have IPv6 extension header parsing turned > off. > This should be listed in the specification updates for current 1G > server > products, e.g. for i350 it's errata #37 in this document: > > http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/ethernet-controller-i350-spec-update.pdf > > - Avoton (i354) PHY errata workaround added > > And a bunch of minor fixes, as well as #defines for things that the > current > em(4)/igb(4) drivers don't implement. > > Differential Revision: https://reviews.freebsd.org/D3162 > Reviewed by: sbruno, marius, gnn > Approved by: gnn > MFC after: 2 weeks Is there any chance to get this patch MFCd to 10-STABLE / 10.3-RELENG before the 10.3-RELESE released? > Sponsored by: Intel Corporation > > Modified: > head/sys/dev/e1000/e1000_80003es2lan.c > head/sys/dev/e1000/e1000_82540.c > head/sys/dev/e1000/e1000_82541.c > head/sys/dev/e1000/e1000_82542.c > head/sys/dev/e1000/e1000_82543.c > head/sys/dev/e1000/e1000_82571.h > head/sys/dev/e1000/e1000_82575.c > head/sys/dev/e1000/e1000_82575.h > head/sys/dev/e1000/e1000_api.c > head/sys/dev/e1000/e1000_defines.h > head/sys/dev/e1000/e1000_hw.h > head/sys/dev/e1000/e1000_i210.c > head/sys/dev/e1000/e1000_ich8lan.c > head/sys/dev/e1000/e1000_ich8lan.h > head/sys/dev/e1000/e1000_mac.h > head/sys/dev/e1000/e1000_mbx.c > head/sys/dev/e1000/e1000_nvm.h > head/sys/dev/e1000/e1000_osdep.h > head/sys/dev/e1000/e1000_phy.c > head/sys/dev/e1000/e1000_regs.h > head/sys/dev/e1000/if_em.c > head/sys/dev/e1000/if_em.h > head/sys/dev/e1000/if_igb.c > > Modified: head/sys/dev/e1000/e1000_80003es2lan.c > From owner-svn-src-all@freebsd.org Fri Feb 12 12:38:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F78FAA301C; Fri, 12 Feb 2016 12:38:06 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 07AA861D; Fri, 12 Feb 2016 12:38:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1CCc5hU081669; Fri, 12 Feb 2016 12:38:05 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1CCc5Ii081668; Fri, 12 Feb 2016 12:38:05 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602121238.u1CCc5Ii081668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 12 Feb 2016 12:38:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295563 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 12:38:06 -0000 Author: andrew Date: Fri Feb 12 12:38:04 2016 New Revision: 295563 URL: https://svnweb.freebsd.org/changeset/base/295563 Log: Only update curthread and curpcb after we have finished using the old values. If switching from a thread that used floating-point registers to a thread that is still running, but holding the blocked_lock lock we would switch the curthread to the new (running) thread, then call critical_enter. This will non-atomically increment td_critnest, and later call critical_exit to non-atomically decrement this value. This can happen at the same time as the new thread is still running on the old core, also calling these functions. In this case there will be a race between these non-atomic operations. This can be an issue as we could loose one of these operations leading to the value to not return to zero. If, later on, we then hit a data abort we check if the td_critnest is zero. If this check fails we will panic the kernel. This has been observed when running pcmstat on a Cavium ThunderX. The pcm thread will use the blocked_lock lock and there is a high chance userspace will use the floating-point registers. When, later on, pmcstat triggers a data abort we will hit this panic. The fix is to update these values after storing the floating-point state. This means we use the correct curthread while storing the state so it will not be an issue that the changes to td_critnest are non-atomic. Sponsored by: ABT Systems Ltd Modified: head/sys/arm64/arm64/swtch.S Modified: head/sys/arm64/arm64/swtch.S ============================================================================== --- head/sys/arm64/arm64/swtch.S Fri Feb 12 10:58:13 2016 (r295562) +++ head/sys/arm64/arm64/swtch.S Fri Feb 12 12:38:04 2016 (r295563) @@ -129,12 +129,6 @@ END(cpu_throw) * x3 to x7, x16 and x17 are caller saved */ ENTRY(cpu_switch) - /* Store the new curthread */ - str x1, [x18, #PC_CURTHREAD] - /* And the new pcb */ - ldr x4, [x1, #TD_PCB] - str x4, [x18, #PC_CURPCB] - /* * Save the old context. */ @@ -174,10 +168,14 @@ ENTRY(cpu_switch) mov x0, x19 #endif + /* Store the new curthread */ + str x1, [x18, #PC_CURTHREAD] + /* - * Restore the saved context. + * Restore the saved context and set it as curpcb. */ ldr x4, [x1, #TD_PCB] + str x4, [x18, #PC_CURPCB] /* * TODO: We may need to flush the cache here if switching From owner-svn-src-all@freebsd.org Fri Feb 12 13:57:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAD37AA6AE5; Fri, 12 Feb 2016 13:57:19 +0000 (UTC) (envelope-from br@bsdpad.com) Received: from bsdpad.com (xc1.bsdpad.com [195.154.136.64]) (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 911F01BCC; Fri, 12 Feb 2016 13:57:18 +0000 (UTC) (envelope-from br@bsdpad.com) Received: from localhost ([127.0.0.1] helo=bsdpad.com) by bsdpad.com with smtp (Exim 4.83 (FreeBSD)) (envelope-from ) id 1aUDfg-0008kz-V3; Fri, 12 Feb 2016 13:22:05 +0000 Received: by bsdpad.com (nbSMTP-1.00) for uid 1001 br@bsdpad.com; Fri, 12 Feb 2016 13:22:04 +0000 (GMT) Date: Fri, 12 Feb 2016 13:22:04 +0000 From: Ruslan Bukin To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295561 - in head: include sys/mips/include sys/powerpc/include sys/sparc64/include sys/sys sys/x86/include Message-ID: <20160212132204.GA33648@bsdpad.com> References: <201602120738.u1C7cKpq093956@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201602120738.u1C7cKpq093956@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 13:57:19 -0000 On RISC-V it fails with __uint128_t: struct fpregs { __uint128_t fp_x[32]; how to fix? Ruslan On Fri, Feb 12, 2016 at 07:38:20AM +0000, Konstantin Belousov wrote: > Author: kib > Date: Fri Feb 12 07:38:19 2016 > New Revision: 295561 > URL: https://svnweb.freebsd.org/changeset/base/295561 > > Log: > POSIX states that #include shall make both mcontext_t and > ucontext_t available. Our code even has XXX comment about this. > > Add a bit of compliance by moving struct __ucontext definition into > sys/_ucontext.h and including it into signal.h and sys/ucontext.h. > > Several machine/ucontext.h headers were changed to use namespace-safe > types (like uint64_t->__uint64_t) to not depend on sys/types.h. > struct __stack_t from sys/signal.h is made always visible in private > namespace to satisfy sys/_ucontext.h requirements. > > Apparently mips _types.h pollutes global namespace with f_register_t > type definition. This commit does not try to fix the issue. > > PR: 207079 > Reported and tested by: Ting-Wei Lan > Sponsored by: The FreeBSD Foundation > MFC after: 2 weeks > > Added: > head/sys/sys/_ucontext.h > - copied, changed from r295560, head/sys/sys/ucontext.h > Modified: > head/include/signal.h > head/sys/mips/include/ucontext.h > head/sys/powerpc/include/ucontext.h > head/sys/sparc64/include/ucontext.h > head/sys/sys/signal.h > head/sys/sys/ucontext.h > head/sys/x86/include/ucontext.h > > Modified: head/include/signal.h > ============================================================================== > --- head/include/signal.h Fri Feb 12 07:27:24 2016 (r295560) > +++ head/include/signal.h Fri Feb 12 07:38:19 2016 (r295561) > @@ -36,6 +36,8 @@ > #include > #include > #include > +#include > +#include > > #if __BSD_VISIBLE > /* > @@ -114,7 +116,6 @@ void psignal(unsigned int, const char *) > > #if __BSD_VISIBLE > int sigblock(int); > -struct __ucontext; /* XXX spec requires a complete declaration. */ > int sigreturn(const struct __ucontext *); > int sigsetmask(int); > int sigstack(const struct sigstack *, struct sigstack *); > > Modified: head/sys/mips/include/ucontext.h > ============================================================================== > --- head/sys/mips/include/ucontext.h Fri Feb 12 07:27:24 2016 (r295560) > +++ head/sys/mips/include/ucontext.h Fri Feb 12 07:38:19 2016 (r295561) > @@ -50,13 +50,13 @@ typedef struct __mcontext { > * struct sigcontext and ucontext_t at the same time. > */ > int mc_onstack; /* sigstack state to restore */ > - register_t mc_pc; /* pc at time of signal */ > - register_t mc_regs[32]; /* processor regs 0 to 31 */ > - register_t sr; /* status register */ > - register_t mullo, mulhi; /* mullo and mulhi registers... */ > + __register_t mc_pc; /* pc at time of signal */ > + __register_t mc_regs[32]; /* processor regs 0 to 31 */ > + __register_t sr; /* status register */ > + __register_t mullo, mulhi; /* mullo and mulhi registers... */ > int mc_fpused; /* fp has been used */ > f_register_t mc_fpregs[33]; /* fp regs 0 to 31 and csr */ > - register_t mc_fpc_eir; /* fp exception instruction reg */ > + __register_t mc_fpc_eir; /* fp exception instruction reg */ > void *mc_tls; /* pointer to TLS area */ > int __spare__[8]; /* XXX reserved */ > } mcontext_t; > > Modified: head/sys/powerpc/include/ucontext.h > ============================================================================== > --- head/sys/powerpc/include/ucontext.h Fri Feb 12 07:27:24 2016 (r295560) > +++ head/sys/powerpc/include/ucontext.h Fri Feb 12 07:38:19 2016 (r295561) > @@ -42,11 +42,11 @@ typedef struct __mcontext { > #define _MC_AV_VALID 0x02 > int mc_onstack; /* saved onstack flag */ > int mc_len; /* sizeof(__mcontext) */ > - uint64_t mc_avec[32*2]; /* vector register file */ > - uint32_t mc_av[2]; > - register_t mc_frame[42]; > - uint64_t mc_fpreg[33]; > - uint64_t mc_vsxfpreg[32]; /* low-order half of VSR0-31 */ > + __uint64_t mc_avec[32*2]; /* vector register file */ > + __uint32_t mc_av[2]; > + __register_t mc_frame[42]; > + __uint64_t mc_fpreg[33]; > + __uint64_t mc_vsxfpreg[32]; /* low-order half of VSR0-31 */ > } mcontext_t __aligned(16); > > #if defined(_KERNEL) && defined(__powerpc64__) > > Modified: head/sys/sparc64/include/ucontext.h > ============================================================================== > --- head/sys/sparc64/include/ucontext.h Fri Feb 12 07:27:24 2016 (r295560) > +++ head/sys/sparc64/include/ucontext.h Fri Feb 12 07:38:19 2016 (r295561) > @@ -33,11 +33,11 @@ > #define _MACHINE_UCONTEXT_H_ > > struct __mcontext { > - uint64_t mc_global[8]; > - uint64_t mc_out[8]; > - uint64_t mc_local[8]; > - uint64_t mc_in[8]; > - uint32_t mc_fp[64]; > + __uint64_t mc_global[8]; > + __uint64_t mc_out[8]; > + __uint64_t mc_local[8]; > + __uint64_t mc_in[8]; > + __uint32_t mc_fp[64]; > } __aligned(64); > > typedef struct __mcontext mcontext_t; > > Copied and modified: head/sys/sys/_ucontext.h (from r295560, head/sys/sys/ucontext.h) > ============================================================================== > --- head/sys/sys/ucontext.h Fri Feb 12 07:27:24 2016 (r295560, copy source) > +++ head/sys/sys/_ucontext.h Fri Feb 12 07:38:19 2016 (r295561) > @@ -28,11 +28,8 @@ > * $FreeBSD$ > */ > > -#ifndef _SYS_UCONTEXT_H_ > -#define _SYS_UCONTEXT_H_ > - > -#include > -#include > +#ifndef _SYS__UCONTEXT_H_ > +#define _SYS__UCONTEXT_H_ > > typedef struct __ucontext { > /* > @@ -43,64 +40,13 @@ typedef struct __ucontext { > * support them both at the same time. > * note: the union is not defined, though. > */ > - sigset_t uc_sigmask; > + __sigset_t uc_sigmask; > mcontext_t uc_mcontext; > > struct __ucontext *uc_link; > - stack_t uc_stack; > + struct __stack_t uc_stack; > int uc_flags; > -#define UCF_SWAPPED 0x00000001 /* Used by swapcontext(3). */ > int __spare__[4]; > } ucontext_t; > > -#if defined(_KERNEL) && defined(COMPAT_FREEBSD4) > -#if defined(__i386__) > -struct ucontext4 { > - sigset_t uc_sigmask; > - struct mcontext4 uc_mcontext; > - struct ucontext4 *uc_link; > - stack_t uc_stack; > - int __spare__[8]; > -}; > -#else /* __i386__ */ > -#define ucontext4 ucontext > -#endif /* __i386__ */ > -#endif /* _KERNEL */ > - > -#ifndef _KERNEL > - > -__BEGIN_DECLS > - > -int getcontext(ucontext_t *) __returns_twice; > -ucontext_t *getcontextx(void); > -int setcontext(const ucontext_t *); > -void makecontext(ucontext_t *, void (*)(void), int, ...); > -int signalcontext(ucontext_t *, int, __sighandler_t *); > -int swapcontext(ucontext_t *, const ucontext_t *); > - > -#if __BSD_VISIBLE > -int __getcontextx_size(void); > -int __fillcontextx(char *ctx) __returns_twice; > -int __fillcontextx2(char *ctx); > -#endif > - > -__END_DECLS > - > -#else /* _KERNEL */ > - > -struct thread; > - > -/* > - * Flags for get_mcontext(). The low order 4 bits (i.e a mask of 0x0f) are > - * reserved for use by machine independent code. All other bits are for use > - * by machine dependent code. > - */ > -#define GET_MC_CLEAR_RET 1 > - > -/* Machine-dependent functions: */ > -int get_mcontext(struct thread *, mcontext_t *, int); > -int set_mcontext(struct thread *, mcontext_t *); > - > -#endif /* !_KERNEL */ > - > -#endif /* !_SYS_UCONTEXT_H_ */ > +#endif /* _SYS__UCONTEXT_H */ > > Modified: head/sys/sys/signal.h > ============================================================================== > --- head/sys/sys/signal.h Fri Feb 12 07:27:24 2016 (r295560) > +++ head/sys/sys/signal.h Fri Feb 12 07:38:19 2016 (r295561) > @@ -354,18 +354,10 @@ typedef void __siginfohandler_t(int, str > #endif > > #if __XSI_VISIBLE > -/* > - * Structure used in sigaltstack call. > - */ > #if __BSD_VISIBLE > -typedef struct sigaltstack { > -#else > -typedef struct { > +#define __stack_t sigaltstack > #endif > - void *ss_sp; /* signal stack base */ > - __size_t ss_size; /* signal stack length */ > - int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */ > -} stack_t; > +typedef struct __stack_t stack_t; > > #define SS_ONSTACK 0x0001 /* take signal on alternate stack */ > #define SS_DISABLE 0x0004 /* disable taking signals on alternate stack */ > @@ -373,6 +365,17 @@ typedef struct { > #define SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended stack size */ > #endif > > +/* > + * Structure used in sigaltstack call. Its definition is always > + * needed for __ucontext. If __BSD_VISIBLE is defined, the structure > + * tag is actually sigaltstack. > + */ > +struct __stack_t { > + void *ss_sp; /* signal stack base */ > + __size_t ss_size; /* signal stack length */ > + int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */ > +}; > + > #if __BSD_VISIBLE > /* > * 4.3 compatibility: > > Modified: head/sys/sys/ucontext.h > ============================================================================== > --- head/sys/sys/ucontext.h Fri Feb 12 07:27:24 2016 (r295560) > +++ head/sys/sys/ucontext.h Fri Feb 12 07:38:19 2016 (r295561) > @@ -33,25 +33,9 @@ > > #include > #include > +#include > > -typedef struct __ucontext { > - /* > - * Keep the order of the first two fields. Also, > - * keep them the first two fields in the structure. > - * This way we can have a union with struct > - * sigcontext and ucontext_t. This allows us to > - * support them both at the same time. > - * note: the union is not defined, though. > - */ > - sigset_t uc_sigmask; > - mcontext_t uc_mcontext; > - > - struct __ucontext *uc_link; > - stack_t uc_stack; > - int uc_flags; > #define UCF_SWAPPED 0x00000001 /* Used by swapcontext(3). */ > - int __spare__[4]; > -} ucontext_t; > > #if defined(_KERNEL) && defined(COMPAT_FREEBSD4) > #if defined(__i386__) > > Modified: head/sys/x86/include/ucontext.h > ============================================================================== > --- head/sys/x86/include/ucontext.h Fri Feb 12 07:27:24 2016 (r295560) > +++ head/sys/x86/include/ucontext.h Fri Feb 12 07:38:19 2016 (r295561) > @@ -162,4 +162,9 @@ typedef struct __mcontext { > } mcontext_t; > #endif /* __amd64__ */ > > +#ifdef __LINT__ > +typedef struct __mcontext { > +} mcontext_t; > +#endif /* __LINT__ */ > + > #endif /* !_X86_UCONTEXT_H_ */ > From owner-svn-src-all@freebsd.org Fri Feb 12 14:09:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6025AA6066; Fri, 12 Feb 2016 14:09:06 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 61FAD65B; Fri, 12 Feb 2016 14:09:06 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 31F2C427A38; Sat, 13 Feb 2016 01:08:57 +1100 (AEDT) Date: Sat, 13 Feb 2016 01:08:55 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295561 - in head: include sys/mips/include sys/powerpc/include sys/sparc64/include sys/sys sys/x86/include In-Reply-To: <201602120738.u1C7cKpq093956@repo.freebsd.org> Message-ID: <20160212232717.P894@besplex.bde.org> References: <201602120738.u1C7cKpq093956@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=PfoC/XVd c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=kVPtpndFqo2daTyJ7XwA:9 a=KYDUXh1Pg-0WReiS:21 a=cs04WIf58lYJx0QY:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 14:09:06 -0000 On Fri, 12 Feb 2016, Konstantin Belousov wrote: > Log: > POSIX states that #include shall make both mcontext_t and > ucontext_t available. Our code even has XXX comment about this. Only newer versions of POSIX have this bug. In the 2001 version, the bug was limited to the XSI section. was limited to XSI too. Now, specified to be obsolescent, but it is further gone that that -- web searches find only old versions and its functions seem to be only specified without prototyps in the "Removed" section. The POSIX bug also reserves uc_* in . This is needed for exposing ucontext_t. POSIX has the bug that ucontext_t must be a struct to work, but is declared as a typedef. Structs cannot be very opaque since they expose struct members... > Add a bit of compliance by moving struct __ucontext definition into > sys/_ucontext.h and including it into signal.h and sys/ucontext.h. > > Several machine/ucontext.h headers were changed to use namespace-safe > types (like uint64_t->__uint64_t) to not depend on sys/types.h. > struct __stack_t from sys/signal.h is made always visible in private > namespace to satisfy sys/_ucontext.h requirements. > > Apparently mips _types.h pollutes global namespace with f_register_t > type definition. This commit does not try to fix the issue. However, mcontext_t is opaque, and mc_* is not reserved even in . In FreeBSD, mcontext_t is implemented as a struct so the names of its struct members now pollute even . It is a reasonable fix to abuse the reserved uc_ prefix in mcontext_t. mcontext_t is just the MD part of ucontext_t. Prefixes like uc_mc_ would express its nesting but are too long. > Modified: head/include/signal.h > ============================================================================== > --- head/include/signal.h Fri Feb 12 07:27:24 2016 (r295560) > +++ head/include/signal.h Fri Feb 12 07:38:19 2016 (r295561) > @@ -36,6 +36,8 @@ > #include > #include > #include > +#include > +#include This pollutes even the non-POSIX case with POSIX and FreeBSD names. The correct ifdefs for this are messy. No names should be added for non-POSIX and old versions of POSIX. 2001 POSIX needs an XSI ifdef. Later versions of POSIX don't need an ifdef. Normally it is better to hide the ifdefs in the included headers, but _ucontext.h should always provide ucontext_t and uc_*. > Modified: head/sys/mips/include/ucontext.h > ============================================================================== > --- head/sys/mips/include/ucontext.h Fri Feb 12 07:27:24 2016 (r295560) > +++ head/sys/mips/include/ucontext.h Fri Feb 12 07:38:19 2016 (r295561) > @@ -50,13 +50,13 @@ typedef struct __mcontext { > * struct sigcontext and ucontext_t at the same time. > */ > int mc_onstack; /* sigstack state to restore */ > - register_t mc_pc; /* pc at time of signal */ > - register_t mc_regs[32]; /* processor regs 0 to 31 */ > - register_t sr; /* status register */ > - register_t mullo, mulhi; /* mullo and mulhi registers... */ > + __register_t mc_pc; /* pc at time of signal */ > + __register_t mc_regs[32]; /* processor regs 0 to 31 */ > + __register_t sr; /* status register */ > + __register_t mullo, mulhi; /* mullo and mulhi registers... */ > int mc_fpused; /* fp has been used */ > f_register_t mc_fpregs[33]; /* fp regs 0 to 31 and csr */ > - register_t mc_fpc_eir; /* fp exception instruction reg */ > + __register_t mc_fpc_eir; /* fp exception instruction reg */ > void *mc_tls; /* pointer to TLS area */ > int __spare__[8]; /* XXX reserved */ > } mcontext_t; > These mc_* names always polluted but no one cared since it was an XSI extension. sr, mullo and mulhi have worse names. These names don't even use the same style as the others. They now pollute of course. __spare__ is bogusly named and has a banal comment. The names of spares should be in the normal (reserved) namespace for the struct. No namespace is reserved here, bug mc_spare would be no worse than the other mc_'s. i386 was missing all of these bugs except the mc_* pollution. > Copied and modified: head/sys/sys/_ucontext.h (from r295560, head/sys/sys/ucontext.h) sys/ucontext.h (== ) remains polluted. I point out its old bugs here since most of it is all quoted. > ============================================================================== > --- head/sys/sys/ucontext.h Fri Feb 12 07:27:24 2016 (r295560, copy source) > +++ head/sys/sys/_ucontext.h Fri Feb 12 07:38:19 2016 (r295561) > @@ -28,11 +28,8 @@ > * $FreeBSD$ > */ > > -#ifndef _SYS_UCONTEXT_H_ > -#define _SYS_UCONTEXT_H_ > - > -#include > -#include > +#ifndef _SYS__UCONTEXT_H_ > +#define _SYS__UCONTEXT_H_ > > typedef struct __ucontext { > /* > @@ -43,64 +40,13 @@ typedef struct __ucontext { > * support them both at the same time. > * note: the union is not defined, though. > */ > - sigset_t uc_sigmask; > + __sigset_t uc_sigmask; > mcontext_t uc_mcontext; > > struct __ucontext *uc_link; > - stack_t uc_stack; > + struct __stack_t uc_stack; > int uc_flags; > -#define UCF_SWAPPED 0x00000001 /* Used by swapcontext(3). */ UCF is in the application namespace. _UC doesn't seem to be used. mcontext.h is carfeful to use _MC. > int __spare__[4]; Bogus name. uc_spare is in the reserved namespace. > } ucontext_t; > [... names under _KERNEL not a problem] > -#ifndef _KERNEL > - > -__BEGIN_DECLS > - > -int getcontext(ucontext_t *) __returns_twice; > -ucontext_t *getcontextx(void); getcontextx isn't in old versions of POSIX. > -int setcontext(const ucontext_t *); > -void makecontext(ucontext_t *, void (*)(void), int, ...); > -int signalcontext(ucontext_t *, int, __sighandler_t *); signalcontext isn't in old versions of POSIX. > -int swapcontext(ucontext_t *, const ucontext_t *); None of these functions are in the current version of POSIX. They are all pollution except for XSI between about 2001 and 2008. > - > -#if __BSD_VISIBLE > -int __getcontextx_size(void); > -int __fillcontextx(char *ctx) __returns_twice; > -int __fillcontextx2(char *ctx); ctx is in the application namespace. > Modified: head/sys/sys/signal.h > ============================================================================== > --- head/sys/sys/signal.h Fri Feb 12 07:27:24 2016 (r295560) > +++ head/sys/sys/signal.h Fri Feb 12 07:38:19 2016 (r295561) > @@ -354,18 +354,10 @@ typedef void __siginfohandler_t(int, str > #endif > > #if __XSI_VISIBLE > -/* > - * Structure used in sigaltstack call. > - */ > #if __BSD_VISIBLE > -typedef struct sigaltstack { > -#else > -typedef struct { > +#define __stack_t sigaltstack > #endif > - void *ss_sp; /* signal stack base */ > - __size_t ss_size; /* signal stack length */ > - int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */ > -} stack_t; > +typedef struct __stack_t stack_t; This seems to have been broken even in the 2001 version. stack_t is declared unconditionally even there. ss_* isn't reserved but the 3 ss_* names are specified. This should be underer a 2001+ POSIX ifdef, not XSI. > > #define SS_ONSTACK 0x0001 /* take signal on alternate stack */ > #define SS_DISABLE 0x0004 /* disable taking signals on alternate stack */ > @@ -373,6 +365,17 @@ typedef struct { > #define SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended stack size */ > #endif The XSI ifdef seems to be correct for sigalttack, SS_* and *SIGSTKSZ. > > +/* > + * Structure used in sigaltstack call. Its definition is always > + * needed for __ucontext. If __BSD_VISIBLE is defined, the structure > + * tag is actually sigaltstack. > + */ > +struct __stack_t { > + void *ss_sp; /* signal stack base */ > + __size_t ss_size; /* signal stack length */ > + int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */ > +}; This is now broken since it is outside of all ifdefs. Its ss_* names are in the application namespace for the non-POSIX case and POSIX before about 2001. > Modified: head/sys/x86/include/ucontext.h > ============================================================================== > --- head/sys/x86/include/ucontext.h Fri Feb 12 07:27:24 2016 (r295560) > +++ head/sys/x86/include/ucontext.h Fri Feb 12 07:38:19 2016 (r295561) > @@ -162,4 +162,9 @@ typedef struct __mcontext { > } mcontext_t; > #endif /* __amd64__ */ > > +#ifdef __LINT__ > +typedef struct __mcontext { > +} mcontext_t; > +#endif /* __LINT__ */ > + > #endif /* !_X86_UCONTEXT_H_ */ Aren't you going to remove lint? :-) This looks just broken at first. It gives a a second declaration of the struct and if it is the only declaration then lint should still warn even more than compilers since an empty struct declaration is invalid in C (compilers need -pedantic to resemble C compilers, but lint should be strict by default). Then I rememebered that one of the lint bugs is that it uses -Wundef so __amd64__ and __i386__ are not defined so this is the only declaration for lint. I don't like the combined headers for x86, and this file is an especially good bad example. It consists of an __amd64__ ifdef and a __i386__ ifdef with nothing shared outside except the copyright notice and the idempotency ifdef. This gives the lint bug. Bruce From owner-svn-src-all@freebsd.org Fri Feb 12 14:14:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D48D9AA6337; Fri, 12 Feb 2016 14:14:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E5A4B9A; Fri, 12 Feb 2016 14:14:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u1CEDrEl030703 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 12 Feb 2016 16:13:53 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u1CEDrEl030703 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u1CEDrRq030702; Fri, 12 Feb 2016 16:13:53 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 12 Feb 2016 16:13:53 +0200 From: Konstantin Belousov To: Ruslan Bukin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295561 - in head: include sys/mips/include sys/powerpc/include sys/sparc64/include sys/sys sys/x86/include Message-ID: <20160212141353.GR91220@kib.kiev.ua> References: <201602120738.u1C7cKpq093956@repo.freebsd.org> <20160212132204.GA33648@bsdpad.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160212132204.GA33648@bsdpad.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 14:14:02 -0000 On Fri, Feb 12, 2016 at 01:22:04PM +0000, Ruslan Bukin wrote: > On RISC-V it fails with __uint128_t: > > struct fpregs { > __uint128_t fp_x[32]; > > how to fix? You did not copied the error. If my guess is correct, the issue is that __uint128_t typedef is not present in the riscv/include/_types.h. Either add the type there, or use e.g. __uint64_t fp_x[32][2]; for the member definition. BTW, uintmax_t on riscv is defined as uint64. P.S. Does it also mean that the tinderbox machines (AKA universe11*) do not have riscv toolchain installed ? I did run make tinderbox before the commit. From owner-svn-src-all@freebsd.org Fri Feb 12 14:29:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8D9EAA689F; Fri, 12 Feb 2016 14:29:15 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 9B84A1068; Fri, 12 Feb 2016 14:29:15 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1CETEZQ014518; Fri, 12 Feb 2016 14:29:14 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1CETEQp014517; Fri, 12 Feb 2016 14:29:14 GMT (envelope-from br@FreeBSD.org) Message-Id: <201602121429.u1CETEQp014517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 12 Feb 2016 14:29:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295564 - head/sys/riscv/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 14:29:15 -0000 Author: br Date: Fri Feb 12 14:29:14 2016 New Revision: 295564 URL: https://svnweb.freebsd.org/changeset/base/295564 Log: Use __uint64_t type for floating point registers as compiler don't know about __uint128_t yet. Discussed with: theraven, kib Modified: head/sys/riscv/include/ucontext.h Modified: head/sys/riscv/include/ucontext.h ============================================================================== --- head/sys/riscv/include/ucontext.h Fri Feb 12 12:38:04 2016 (r295563) +++ head/sys/riscv/include/ucontext.h Fri Feb 12 14:29:14 2016 (r295564) @@ -50,7 +50,7 @@ struct gpregs { }; struct fpregs { - __uint128_t fp_x[32]; + __uint64_t fp_x[64] __aligned(16); __uint64_t fp_fcsr; int fp_flags; int pad; From owner-svn-src-all@freebsd.org Fri Feb 12 14:31:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E586AA6A91; Fri, 12 Feb 2016 14:31:58 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) Received: from ppsw-43.csi.cam.ac.uk (ppsw-43.csi.cam.ac.uk [131.111.8.143]) (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 1D98C1777; Fri, 12 Feb 2016 14:31:57 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from xc1.bsdpad.com ([195.154.136.64]:24505) by ppsw-43.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.159]:587) with esmtpsa (LOGIN:rb743) (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1aUElB-00078c-p6 (Exim 4.86_36-e07b163) (return-path ); Fri, 12 Feb 2016 14:31:49 +0000 Date: Fri, 12 Feb 2016 14:18:22 +0000 From: Ruslan Bukin To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295561 - in head: include sys/mips/include sys/powerpc/include sys/sparc64/include sys/sys sys/x86/include Message-ID: <20160212141822.GA34266@bsdpad.com> References: <201602120738.u1C7cKpq093956@repo.freebsd.org> <20160212132204.GA33648@bsdpad.com> <20160212141353.GR91220@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160212141353.GR91220@kib.kiev.ua> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: "R. Bukin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 14:31:58 -0000 On Fri, Feb 12, 2016 at 04:13:53PM +0200, Konstantin Belousov wrote: > On Fri, Feb 12, 2016 at 01:22:04PM +0000, Ruslan Bukin wrote: > > On RISC-V it fails with __uint128_t: > > > > struct fpregs { > > __uint128_t fp_x[32]; > > > > how to fix? > You did not copied the error. sorry, the error was: ucontext.h(53): syntax error [249] (and nothing more) > > If my guess is correct, the issue is that __uint128_t typedef is not > present in the riscv/include/_types.h. Either add the type there, or > use e.g. __uint64_t fp_x[32][2]; for the member definition. > Ok, lets use __uint64_t yet (the same suggestion was from David Chisnall). > BTW, uintmax_t on riscv is defined as uint64. > > P.S. Does it also mean that the tinderbox machines (AKA universe11*) > do not have riscv toolchain installed ? I did run make tinderbox > before the commit. Yeah, we dont have packages for toolchain yet, so we can't install compiler on tinderbox machine. Ruslan From owner-svn-src-all@freebsd.org Fri Feb 12 14:36:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7404AAA6DF5; Fri, 12 Feb 2016 14:36:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE5B91B11; Fri, 12 Feb 2016 14:36:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u1CEaUJx036624 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 12 Feb 2016 16:36:30 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u1CEaUJx036624 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u1CEaUP8036623; Fri, 12 Feb 2016 16:36:30 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 12 Feb 2016 16:36:30 +0200 From: Konstantin Belousov To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295561 - in head: include sys/mips/include sys/powerpc/include sys/sparc64/include sys/sys sys/x86/include Message-ID: <20160212143630.GS91220@kib.kiev.ua> References: <201602120738.u1C7cKpq093956@repo.freebsd.org> <20160212232717.P894@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160212232717.P894@besplex.bde.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 14:36:44 -0000 On Sat, Feb 13, 2016 at 01:08:55AM +1100, Bruce Evans wrote: > On Fri, 12 Feb 2016, Konstantin Belousov wrote: > > > Log: > > POSIX states that #include shall make both mcontext_t and > > ucontext_t available. Our code even has XXX comment about this. > > Only newer versions of POSIX have this bug. In the 2001 version, the > bug was limited to the XSI section. was limited to XSI > too. Now, specified to be obsolescent, but it is further > gone that that -- web searches find only old versions and its functions > seem to be only specified without prototyps in the "Removed" section. > > The POSIX bug also reserves uc_* in . This is needed for > exposing ucontext_t. POSIX has the bug that ucontext_t must be a > struct to work, but is declared as a typedef. Structs cannot be very > opaque since they expose struct members... > > > Add a bit of compliance by moving struct __ucontext definition into > > sys/_ucontext.h and including it into signal.h and sys/ucontext.h. > > > > Several machine/ucontext.h headers were changed to use namespace-safe > > types (like uint64_t->__uint64_t) to not depend on sys/types.h. > > struct __stack_t from sys/signal.h is made always visible in private > > namespace to satisfy sys/_ucontext.h requirements. > > > > Apparently mips _types.h pollutes global namespace with f_register_t > > type definition. This commit does not try to fix the issue. > > However, mcontext_t is opaque, and mc_* is not reserved even in > . In FreeBSD, mcontext_t is implemented as a struct so the > names of its struct members now pollute even . It is a > reasonable fix to abuse the reserved uc_ prefix in mcontext_t. > mcontext_t is just the MD part of ucontext_t. Prefixes like uc_mc_ > would express its nesting but are too long. > > > Modified: head/include/signal.h > > ============================================================================== > > --- head/include/signal.h Fri Feb 12 07:27:24 2016 (r295560) > > +++ head/include/signal.h Fri Feb 12 07:38:19 2016 (r295561) > > @@ -36,6 +36,8 @@ > > #include > > #include > > #include > > +#include > > +#include > > This pollutes even the non-POSIX case with POSIX and FreeBSD names. > > The correct ifdefs for this are messy. No names should be added for > non-POSIX and old versions of POSIX. 2001 POSIX needs an XSI ifdef. Later > versions of POSIX don't need an ifdef. Normally it is better to hide > the ifdefs in the included headers, but _ucontext.h should always > provide ucontext_t and uc_*. Our non-POSIX namespace is strictly superset of the POSIX space. I would not hide {m,u}context_t from the default visibility, and this would defeat the goal of the change. > > > Modified: head/sys/mips/include/ucontext.h > > ============================================================================== > > --- head/sys/mips/include/ucontext.h Fri Feb 12 07:27:24 2016 (r295560) > > +++ head/sys/mips/include/ucontext.h Fri Feb 12 07:38:19 2016 (r295561) > > @@ -50,13 +50,13 @@ typedef struct __mcontext { > > * struct sigcontext and ucontext_t at the same time. > > */ > > int mc_onstack; /* sigstack state to restore */ > > - register_t mc_pc; /* pc at time of signal */ > > - register_t mc_regs[32]; /* processor regs 0 to 31 */ > > - register_t sr; /* status register */ > > - register_t mullo, mulhi; /* mullo and mulhi registers... */ > > + __register_t mc_pc; /* pc at time of signal */ > > + __register_t mc_regs[32]; /* processor regs 0 to 31 */ > > + __register_t sr; /* status register */ > > + __register_t mullo, mulhi; /* mullo and mulhi registers... */ > > int mc_fpused; /* fp has been used */ > > f_register_t mc_fpregs[33]; /* fp regs 0 to 31 and csr */ > > - register_t mc_fpc_eir; /* fp exception instruction reg */ > > + __register_t mc_fpc_eir; /* fp exception instruction reg */ > > void *mc_tls; /* pointer to TLS area */ > > int __spare__[8]; /* XXX reserved */ > > } mcontext_t; > > > > These mc_* names always polluted but no one cared since it > was an XSI extension. > > sr, mullo and mulhi have worse names. These names don't even use the > same style as the others. They now pollute of course. > > __spare__ is bogusly named and has a banal comment. The names of spares > should be in the normal (reserved) namespace for the struct. No namespace > is reserved here, bug mc_spare would be no worse than the other mc_'s. > > i386 was missing all of these bugs except the mc_* pollution. The members names for the structures are private per the structure namespace. The names of the members cannot pollute signal.h. > > > Copied and modified: head/sys/sys/_ucontext.h (from r295560, head/sys/sys/ucontext.h) > > sys/ucontext.h (== ) remains polluted. I point out its > old bugs here since most of it is all quoted. I am not sure what do you mean by 'quoted' (enough quotes ?). I carefully left everything not related to the ucontext_t definition out of sys/_ucontext.h. This way, there is no pollution of signal.h from the symbols you list below as contaminating. Since ucontext.h is not in POSIX, there is no compliance issues. > > > ============================================================================== > > --- head/sys/sys/ucontext.h Fri Feb 12 07:27:24 2016 (r295560, copy source) > > +++ head/sys/sys/_ucontext.h Fri Feb 12 07:38:19 2016 (r295561) > > @@ -28,11 +28,8 @@ > > * $FreeBSD$ > > */ > > > > -#ifndef _SYS_UCONTEXT_H_ > > -#define _SYS_UCONTEXT_H_ > > - > > -#include > > -#include > > +#ifndef _SYS__UCONTEXT_H_ > > +#define _SYS__UCONTEXT_H_ > > > > typedef struct __ucontext { > > /* > > @@ -43,64 +40,13 @@ typedef struct __ucontext { > > * support them both at the same time. > > * note: the union is not defined, though. > > */ > > - sigset_t uc_sigmask; > > + __sigset_t uc_sigmask; > > mcontext_t uc_mcontext; > > > > struct __ucontext *uc_link; > > - stack_t uc_stack; > > + struct __stack_t uc_stack; > > int uc_flags; > > -#define UCF_SWAPPED 0x00000001 /* Used by swapcontext(3). */ > > UCF is in the application namespace. _UC doesn't seem to be used. > mcontext.h is carfeful to use _MC. > > > int __spare__[4]; > > Bogus name. uc_spare is in the reserved namespace. > > > } ucontext_t; > > > [... names under _KERNEL not a problem] > > > -#ifndef _KERNEL > > - > > -__BEGIN_DECLS > > - > > -int getcontext(ucontext_t *) __returns_twice; > > -ucontext_t *getcontextx(void); > Nothing of the listed functions is in any POSIX header. > getcontextx isn't in old versions of POSIX. > > > -int setcontext(const ucontext_t *); > > -void makecontext(ucontext_t *, void (*)(void), int, ...); > > -int signalcontext(ucontext_t *, int, __sighandler_t *); > > signalcontext isn't in old versions of POSIX. > > > -int swapcontext(ucontext_t *, const ucontext_t *); > > None of these functions are in the current version of POSIX. They > are all pollution except for XSI between about 2001 and 2008. > > > - > > -#if __BSD_VISIBLE > > -int __getcontextx_size(void); > > -int __fillcontextx(char *ctx) __returns_twice; > > -int __fillcontextx2(char *ctx); > > ctx is in the application namespace. > > > Modified: head/sys/sys/signal.h > > ============================================================================== > > --- head/sys/sys/signal.h Fri Feb 12 07:27:24 2016 (r295560) > > +++ head/sys/sys/signal.h Fri Feb 12 07:38:19 2016 (r295561) > > @@ -354,18 +354,10 @@ typedef void __siginfohandler_t(int, str > > #endif > > > > #if __XSI_VISIBLE > > -/* > > - * Structure used in sigaltstack call. > > - */ > > #if __BSD_VISIBLE > > -typedef struct sigaltstack { > > -#else > > -typedef struct { > > +#define __stack_t sigaltstack > > #endif > > - void *ss_sp; /* signal stack base */ > > - __size_t ss_size; /* signal stack length */ > > - int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */ > > -} stack_t; > > +typedef struct __stack_t stack_t; > > This seems to have been broken even in the 2001 version. stack_t is > declared unconditionally even there. ss_* isn't reserved but the 3 ss_* > names are specified. > > This should be underer a 2001+ POSIX ifdef, not XSI. > > > > > #define SS_ONSTACK 0x0001 /* take signal on alternate stack */ > > #define SS_DISABLE 0x0004 /* disable taking signals on alternate stack */ > > @@ -373,6 +365,17 @@ typedef struct { > > #define SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended stack size */ > > #endif > > The XSI ifdef seems to be correct for sigalttack, SS_* and *SIGSTKSZ. > > > > > +/* > > + * Structure used in sigaltstack call. Its definition is always > > + * needed for __ucontext. If __BSD_VISIBLE is defined, the structure > > + * tag is actually sigaltstack. > > + */ > > +struct __stack_t { > > + void *ss_sp; /* signal stack base */ > > + __size_t ss_size; /* signal stack length */ > > + int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */ > > +}; > > This is now broken since it is outside of all ifdefs. Its ss_* names are > in the application namespace for the non-POSIX case and POSIX before about > 2001. It only consumes the __stack_t tag which is both in the implementation name space (__ prefix) and in the POSIX reserved namespace (_t suffix). > > > Modified: head/sys/x86/include/ucontext.h > > ============================================================================== > > --- head/sys/x86/include/ucontext.h Fri Feb 12 07:27:24 2016 (r295560) > > +++ head/sys/x86/include/ucontext.h Fri Feb 12 07:38:19 2016 (r295561) > > @@ -162,4 +162,9 @@ typedef struct __mcontext { > > } mcontext_t; > > #endif /* __amd64__ */ The x86 ucontext.h is very accurate in not conflicting with the application namespace, all constants are defined in implementation-reserved namespace (have _M prefix). I did not verified other arches, I only noted that MIPS has f_register_t bug. > > > > +#ifdef __LINT__ > > +typedef struct __mcontext { > > +} mcontext_t; > > +#endif /* __LINT__ */ > > + > > #endif /* !_X86_UCONTEXT_H_ */ > > Aren't you going to remove lint? :-) Yes, I am. But I did not wanted to commit this in a way which would make the lint removal a dependency of the commit. Also, I want this change to be mergeable to stable/10 (but I did not decided if I really want to do the merge). > > This looks just broken at first. It gives a a second declaration of > the struct and if it is the only declaration then lint should still warn > even more than compilers since an empty struct declaration is invalid in > C (compilers need -pedantic to resemble C compilers, but lint should be > strict by default). Then I rememebered that one of the lint bugs is that > it uses -Wundef so __amd64__ and __i386__ are not defined so this is the > only declaration for lint. Yes, exactly the -undef thing is what triggered my understanding that lint cannot be usefully used. > > I don't like the combined headers for x86, and this file is an especially > good bad example. It consists of an __amd64__ ifdef and a __i386__ ifdef > with nothing shared outside except the copyright notice and the > idempotency ifdef. This gives the lint bug. And I do like them. More, I consider -m32 feature that was completed by the merging, an essential feature of the modern OS on x86_64. From owner-svn-src-all@freebsd.org Fri Feb 12 14:41:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73234AA6035; Fri, 12 Feb 2016 14:41:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E82F91DFB; Fri, 12 Feb 2016 14:41:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u1CEfYL3037845 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 12 Feb 2016 16:41:34 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u1CEfYL3037845 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u1CEfYJN037844; Fri, 12 Feb 2016 16:41:34 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 12 Feb 2016 16:41:34 +0200 From: Konstantin Belousov To: Ruslan Bukin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295561 - in head: include sys/mips/include sys/powerpc/include sys/sparc64/include sys/sys sys/x86/include Message-ID: <20160212144134.GT91220@kib.kiev.ua> References: <201602120738.u1C7cKpq093956@repo.freebsd.org> <20160212132204.GA33648@bsdpad.com> <20160212141353.GR91220@kib.kiev.ua> <20160212141822.GA34266@bsdpad.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160212141822.GA34266@bsdpad.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 14:41:44 -0000 On Fri, Feb 12, 2016 at 02:18:22PM +0000, Ruslan Bukin wrote: > On Fri, Feb 12, 2016 at 04:13:53PM +0200, Konstantin Belousov wrote: > > On Fri, Feb 12, 2016 at 01:22:04PM +0000, Ruslan Bukin wrote: > > > On RISC-V it fails with __uint128_t: > > > > > > struct fpregs { > > > __uint128_t fp_x[32]; > > > > > > how to fix? > > You did not copied the error. > > sorry, the error was: > ucontext.h(53): syntax error [249] > > (and nothing more) At least you could also demonstrate the command which caused the error. > > > > > If my guess is correct, the issue is that __uint128_t typedef is not > > present in the riscv/include/_types.h. Either add the type there, or > > use e.g. __uint64_t fp_x[32][2]; for the member definition. > > > > Ok, lets use __uint64_t yet (the same suggestion was from David Chisnall). Ok. > > > BTW, uintmax_t on riscv is defined as uint64. > > > > P.S. Does it also mean that the tinderbox machines (AKA universe11*) > > do not have riscv toolchain installed ? I did run make tinderbox > > before the commit. > > Yeah, we dont have packages for toolchain yet, so we can't install compiler > on tinderbox machine. > > Ruslan From owner-svn-src-all@freebsd.org Fri Feb 12 14:49:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71C4FAA6490; Fri, 12 Feb 2016 14:49:20 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 3872B1479; Fri, 12 Feb 2016 14:49:19 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 2E927D460E6; Sat, 13 Feb 2016 01:49:12 +1100 (AEDT) Date: Sat, 13 Feb 2016 01:49:11 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ruslan Bukin cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295561 - in head: include sys/mips/include sys/powerpc/include sys/sparc64/include sys/sys sys/x86/include In-Reply-To: <20160212132204.GA33648@bsdpad.com> Message-ID: <20160213012520.C1210@besplex.bde.org> References: <201602120738.u1C7cKpq093956@repo.freebsd.org> <20160212132204.GA33648@bsdpad.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=PfoC/XVd c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=7bLXBn9CArC9h1mMC74A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 14:49:20 -0000 On Fri, 12 Feb 2016, Ruslan Bukin wrote: > On RISC-V it fails with __uint128_t: > > struct fpregs { > __uint128_t fp_x[32]; > > how to fix? This seems to be an old bug. __uint128_t shouldn't be used unless it is supported by . In old versions of FreeBSD, I used something like __attribute__(( ... __mode__(__XI__) ... )) for related problems with long long. Here __uint128_t is a compiler extension that is not very different from the attribute. This seems to be in arm64/ucontext.h, but the name there is spelled fp_q. arm64/ucontext.h has mounds of namespace errors. It uses the following names in the application namespace: gpregs, gp_* fpregs, fp_* mc_* (like other arches) Checking this for other arches: arm: Clean. It uses an excessive number of leading underscores (2) instead of none for things like gp_*. It spells __uint32_t verbosely as 'unsigned int. i386: Just the bogus name __spare__. The 2 trailing underscores don't even serve a technical purpose. mips: Mounds of namespace errors: sr, mullo, mulhi (2 instances) __spare__ (3 instances) Likely pollution from nested include of freebsd32_signal.h (doesn't seem to be kernel-only) SZREG UCTX_REG UCR_* powerpc, sparc64: OK except for mc_* after adding underscores to uint*_t and register_t. Both use some hackish #defines of struct member names. powerpc #define's mc_* so is more fragile; sparc64 #define's _mc_* instead, but uses the usual mc_* for the struct member names. x86: Clean except for mc_*. [Context lost to top posting] Bruce From owner-svn-src-all@freebsd.org Fri Feb 12 15:19:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B69BBAA6092; Fri, 12 Feb 2016 15:19:25 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 81BD681A; Fri, 12 Feb 2016 15:19:25 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id B98DCD48AAC; Sat, 13 Feb 2016 02:19:21 +1100 (AEDT) Date: Sat, 13 Feb 2016 02:19:21 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Ruslan Bukin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295561 - in head: include sys/mips/include sys/powerpc/include sys/sparc64/include sys/sys sys/x86/include In-Reply-To: <20160212141353.GR91220@kib.kiev.ua> Message-ID: <20160213020648.U1340@besplex.bde.org> References: <201602120738.u1C7cKpq093956@repo.freebsd.org> <20160212132204.GA33648@bsdpad.com> <20160212141353.GR91220@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=cK4dyQqN c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=Fm8B2VisaaHWX_q4ZgkA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 15:19:25 -0000 On Fri, 12 Feb 2016, Konstantin Belousov wrote: > On Fri, Feb 12, 2016 at 01:22:04PM +0000, Ruslan Bukin wrote: >> On RISC-V it fails with __uint128_t: >> >> struct fpregs { >> __uint128_t fp_x[32]; >> >> how to fix? > You did not copied the error. > > If my guess is correct, the issue is that __uint128_t typedef is not > present in the riscv/include/_types.h. Either add the type there, or > use e.g. __uint64_t fp_x[32][2]; for the member definition. __uint128_t is defined by newer compilers. Declaring it as a typedef would probably be a syntax error. > BTW, uintmax_t on riscv is defined as uint64. Same on all arches. Any normal use of __uintmax_t breaks uintmax_t since uintmax_t is supposed to be the largest integer type, but it is ony 64 bits on all supported arches, bu __uint128_t is larger. printf() doesn't support printing __uint128_t... Expansion of uintmax_t to make __uint128_t, __uint256_t, __uint512_t, ... more useful would mainly give bloat and break ABIs. > P.S. Does it also mean that the tinderbox machines (AKA universe11*) > do not have riscv toolchain installed ? I did run make tinderbox > before the commit. Well, I missed it and only saw __uint128_t in the arm header since riscv is too new for freefall to have it checked out, and I didn't rememeber that so I didn't look at another checkout. Looking at another checkout now shows the following namespace errors in riscv/include/ucontext.h (mostly the same as arm64): grpregs, gp_* fp_regs, fp_* pad (not the usual __spare__ bogusness. Such fields are closer to being padding than spares. Of course, padding can be used as spares.) Bruce From owner-svn-src-all@freebsd.org Fri Feb 12 15:32:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AF37AA66AA; Fri, 12 Feb 2016 15:32:13 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A8E410F0; Fri, 12 Feb 2016 15:32:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u1CFW6GS056614 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 12 Feb 2016 17:32:07 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u1CFW6GS056614 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u1CFW6VE056612; Fri, 12 Feb 2016 17:32:06 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 12 Feb 2016 17:32:06 +0200 From: Konstantin Belousov To: Bruce Evans Cc: Ruslan Bukin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295561 - in head: include sys/mips/include sys/powerpc/include sys/sparc64/include sys/sys sys/x86/include Message-ID: <20160212153206.GU91220@kib.kiev.ua> References: <201602120738.u1C7cKpq093956@repo.freebsd.org> <20160212132204.GA33648@bsdpad.com> <20160212141353.GR91220@kib.kiev.ua> <20160213020648.U1340@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160213020648.U1340@besplex.bde.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 15:32:13 -0000 On Sat, Feb 13, 2016 at 02:19:21AM +1100, Bruce Evans wrote: > On Fri, 12 Feb 2016, Konstantin Belousov wrote: > > > On Fri, Feb 12, 2016 at 01:22:04PM +0000, Ruslan Bukin wrote: > >> On RISC-V it fails with __uint128_t: > >> > >> struct fpregs { > >> __uint128_t fp_x[32]; > >> > >> how to fix? > > You did not copied the error. > > > > If my guess is correct, the issue is that __uint128_t typedef is not > > present in the riscv/include/_types.h. Either add the type there, or > > use e.g. __uint64_t fp_x[32][2]; for the member definition. > > __uint128_t is defined by newer compilers. Declaring it as a typedef > would probably be a syntax error. Might be, I was more interested in the aligned spec in the commit. And I do think that either [32][2] or even a definition of form struct __fp_reg { __uint64_t fp_lo; __uint64_t fp_hi; /* BTW, what endianess RISC-V has ? */ } __aligned(16); is better than what was committed. > > > BTW, uintmax_t on riscv is defined as uint64. > > Same on all arches. > > Any normal use of __uintmax_t breaks uintmax_t since uintmax_t is > supposed to be the largest integer type, but it is ony 64 bits on all > supported arches, bu __uint128_t is larger. printf() doesn't support > printing __uint128_t... > > Expansion of uintmax_t to make __uint128_t, __uint256_t, __uint512_t, ... > more useful would mainly give bloat and break ABIs. Thing is, there is no the RISC-V ABI yet, neither in the informal sense of the unwritten set of rules followed by the FreeBSD runtime system, nor as the psABI document. This was the reason for my question - we can change the type there. From owner-svn-src-all@freebsd.org Fri Feb 12 16:06:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60B3FAA6803; Fri, 12 Feb 2016 16:06:54 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x232.google.com (mail-io0-x232.google.com [IPv6:2607:f8b0:4001:c06::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37007A2D; Fri, 12 Feb 2016 16:06:54 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x232.google.com with SMTP id g203so70250215iof.2; Fri, 12 Feb 2016 08:06:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=8Cn3nZcAFvHodvMjO7XdUZTUrCmjpsfizVpBeBWbOkQ=; b=K2XdWp4+GE6Pxa5io71iRNYYysRgGpSHWQgDRfK/9/gzaj6CWsDcaskqaTTIG2aNn+ /Ll7pfGtwj4TSaCZIz9JkspaG3sQgLkIND2HyBMl696hjoQd9r8E4nYyrIEcbipRisip tVWexNi6AXm0gU3K0fJuPd9NHYEx/adx0VC/8KBIEotllb1xjCdaDtVboz7Hn+jIAp/S hGnwa7mu4jEI/LEIky+Z/m9Z2N4t/EjK5S4y0AhUdtgj/PvsN8e4nnmjRkqdMfb02tE5 ipY93I8xCo/35W2Fw3Qmly8yIqtm98vdjbqMaZmJe+B7mlb9t0cXy0K9ssO5z5JVBnDu juKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=8Cn3nZcAFvHodvMjO7XdUZTUrCmjpsfizVpBeBWbOkQ=; b=VKqyql4ffcn3wJ+EHWRMaBaxGhTr7Fatqaaa02FtX57xB/ENB0LsGE68U73LJfNQQu vWNbdzJBqKt0/GcoRM/XA0XLHJpiURnOWP+GJl8ty1JQhgtufwnCS2vod+bR98qXo+/7 +8OXgJHrVzWGY0/s2tC1wy/+LMXm84QIlXYT0PEVuzc4MScJt5pFP6SkYF1XgaavxyvN JF/Ir1VxA3s3MukOzs+5stkQe2MF0DE23pMUgPsclVFrmP5R52plkPhPKfRMv+23c/Pi GlCxexRD7jAG30/T/SUBqDYfvz2M2jbNJ5ZxgjfAkrI7TvXKVjcupCW9Ql4tLChtZnxn w9Bw== X-Gm-Message-State: AG10YOTELFA6dsIgVRlVu5VJEmOg7csutIGKwL98Q6ONBfyQhoNlvghkjv+KSA94BMFH3eoiitjWHTBu0QmG1w== MIME-Version: 1.0 X-Received: by 10.107.11.231 with SMTP id 100mr3533703iol.165.1455293213685; Fri, 12 Feb 2016 08:06:53 -0800 (PST) Received: by 10.36.14.19 with HTTP; Fri, 12 Feb 2016 08:06:53 -0800 (PST) In-Reply-To: <201602120727.u1C7ROYF090987@repo.freebsd.org> References: <201602120727.u1C7ROYF090987@repo.freebsd.org> Date: Fri, 12 Feb 2016 08:06:53 -0800 Message-ID: Subject: Re: svn commit: r295560 - head/sys/dev/hwpmc From: Adrian Chadd To: Konstantin Belousov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 16:06:54 -0000 Hah great catch! I always wondered about this! -a On 11 February 2016 at 23:27, Konstantin Belousov wrote: > Author: kib > Date: Fri Feb 12 07:27:24 2016 > New Revision: 295560 > URL: https://svnweb.freebsd.org/changeset/base/295560 > > Log: > If full width writes to the performance monitoring counters are > supported, use full-width aliases MSRs for writes. This fixes the > "[pmc,X] negative increment" assertion on the context switch when > clipped counter value is sign-extended. > > Add definitions for the MSR IA32_PERF_CAPABILITIES needed to detect > the feature. > > PR: 207068 > Submitted by: joss.upton@yahoo.com > MFC after: 2 weeks > > Modified: > head/sys/dev/hwpmc/hwpmc_core.c > head/sys/dev/hwpmc/hwpmc_core.h > > Modified: head/sys/dev/hwpmc/hwpmc_core.c > ============================================================================== > --- head/sys/dev/hwpmc/hwpmc_core.c Fri Feb 12 07:20:27 2016 (r295559) > +++ head/sys/dev/hwpmc/hwpmc_core.c Fri Feb 12 07:27:24 2016 (r295560) > @@ -103,6 +103,7 @@ static int core_iaf_npmc; > > static int core_iap_width; > static int core_iap_npmc; > +static int core_iap_wroffset; > > static int > core_pcpu_noop(struct pmc_mdep *md, int cpu) > @@ -2473,7 +2474,7 @@ iap_read_pmc(int cpu, int ri, pmc_value_ > *v = tmp & ((1ULL << core_iap_width) - 1); > > PMCDBG4(MDP,REA,1, "iap-read cpu=%d ri=%d msr=0x%x -> v=%jx", cpu, ri, > - ri, *v); > + IAP_PMC0 + ri, *v); > > return (0); > } > @@ -2605,19 +2606,20 @@ iap_write_pmc(int cpu, int ri, pmc_value > ("[core,%d] cpu%d ri%d no configured PMC to stop", __LINE__, > cpu, ri)); > > - PMCDBG4(MDP,WRI,1, "iap-write cpu=%d ri=%d msr=0x%x v=%jx", cpu, ri, > - IAP_PMC0 + ri, v); > - > if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) > v = iap_reload_count_to_perfctr_value(v); > > - /* > - * Write the new value to the counter. The counter will be in > - * a stopped state when the pcd_write() entry point is called. > - */ > + v &= (1ULL << core_iap_width) - 1; > > - wrmsr(IAP_PMC0 + ri, v & ((1ULL << core_iap_width) - 1)); > + PMCDBG4(MDP,WRI,1, "iap-write cpu=%d ri=%d msr=0x%x v=%jx", cpu, ri, > + IAP_PMC0 + ri, v); > > + /* > + * Write the new value to the counter (or it's alias). The > + * counter will be in a stopped state when the pcd_write() > + * entry point is called. > + */ > + wrmsr(core_iap_wroffset + IAP_PMC0 + ri, v); > return (0); > } > > @@ -2700,7 +2702,7 @@ core_intr(int cpu, struct trapframe *tf) > */ > msr = rdmsr(IAP_EVSEL0 + ri) & ~IAP_EVSEL_MASK; > wrmsr(IAP_EVSEL0 + ri, msr); > - wrmsr(IAP_PMC0 + ri, v); > + wrmsr(core_iap_wroffset + IAP_PMC0 + ri, v); > > if (error) > continue; > @@ -2814,7 +2816,7 @@ core2_intr(int cpu, struct trapframe *tf > (uintmax_t) v); > > /* Reload sampling count. */ > - wrmsr(IAP_PMC0 + n, v); > + wrmsr(core_iap_wroffset + IAP_PMC0 + n, v); > } > > /* > @@ -2865,6 +2867,18 @@ pmc_core_initialize(struct pmc_mdep *md, > return (EPROGMISMATCH); > } > > + core_iap_wroffset = 0; > + if (cpu_feature2 & CPUID2_PDCM) { > + if (rdmsr(IA32_PERF_CAPABILITIES) & PERFCAP_FW_WRITE) { > + PMCDBG0(MDP, INI, 1, > + "core-init full-width write supported"); > + core_iap_wroffset = IAP_A_PMC0 - IAP_PMC0; > + } else > + PMCDBG0(MDP, INI, 1, > + "core-init full-width write NOT supported"); > + } else > + PMCDBG0(MDP, INI, 1, "core-init pdcm not supported"); > + > core_pmcmask = 0; > > /* > > Modified: head/sys/dev/hwpmc/hwpmc_core.h > ============================================================================== > --- head/sys/dev/hwpmc/hwpmc_core.h Fri Feb 12 07:20:27 2016 (r295559) > +++ head/sys/dev/hwpmc/hwpmc_core.h Fri Feb 12 07:27:24 2016 (r295560) > @@ -29,6 +29,14 @@ > #ifndef _DEV_HWPMC_CORE_H_ > #define _DEV_HWPMC_CORE_H_ 1 > > +#define IA32_PERF_CAPABILITIES 0x345 > +#define PERFCAP_LBR_FORMAT 0x003f > +#define PERFCAP_PEBS_TRAP 0x0040 > +#define PERFCAP_PEBS_SAVEARCH 0x0080 > +#define PERFCAP_PEBS_RECFORMAT 0x0f00 > +#define PERFCAP_SMM_FREEZE 0x1000 > +#define PERFCAP_FW_WRITE 0x2000 /* full width write aliases */ > + > /* > * Fixed-function PMCs. > */ > @@ -101,6 +109,7 @@ struct pmc_md_iap_op_pmcallocate { > */ > > #define IAP_PMC0 0x0C1 > +#define IAP_A_PMC0 0x4C1 > > /* > * IAP_EVSEL(n) is laid out in the following way. > From owner-svn-src-all@freebsd.org Fri Feb 12 16:47:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E72A3AA6958; Fri, 12 Feb 2016 16:47:58 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "alchemy.franken.de", Issuer "alchemy.franken.de" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 813BA1D58; Fri, 12 Feb 2016 16:47:58 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.15.2/8.15.2/ALCHEMY.FRANKEN.DE) with ESMTPS id u1CGltaD055547 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 12 Feb 2016 17:47:55 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.15.2/8.15.2/Submit) id u1CGltAv055546; Fri, 12 Feb 2016 17:47:55 +0100 (CET) (envelope-from marius) Date: Fri, 12 Feb 2016 17:47:55 +0100 From: Marius Strobl To: Michal Meloun Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295557 - head/sys/dev/uart Message-ID: <20160212164755.GC4980@alchemy.franken.de> References: <201602120514.u1C5EwWt053622@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201602120514.u1C5EwWt053622@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (alchemy.franken.de [0.0.0.0]); Fri, 12 Feb 2016 17:47:55 +0100 (CET) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 16:47:59 -0000 On Fri, Feb 12, 2016 at 05:14:58AM +0000, Michal Meloun wrote: > Author: mmel > Date: Fri Feb 12 05:14:58 2016 > New Revision: 295557 > URL: https://svnweb.freebsd.org/changeset/base/295557 > > Log: > UART: Fix spurious interrupts generated by ns8250 and lpc drivers: > - don't enable transmitter empty interrupt before filling TX FIFO. Are you sure this doesn't create a race that leads to lost TX ready interrupts? For a single character, the TX FIFO very well may be empty again at the point in time IER_ETXRDY is enabled now. With the varying behavior of 8250/16x50 chips - some of which is documented in sio(4) - I'd expect there are many that no longer generate a TX ready at all with this change in place. In this case, receiving spurious interrupts (which ones? IIR_NOPEND? IIR_TXRDY?) with some devices appears to be the lesser evil. Marius From owner-svn-src-all@freebsd.org Fri Feb 12 16:56:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F57AAA6F68; Fri, 12 Feb 2016 16:56:45 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id D4A95174B; Fri, 12 Feb 2016 16:56:44 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 58603D4935C; Sat, 13 Feb 2016 03:56:42 +1100 (AEDT) Date: Sat, 13 Feb 2016 03:56:42 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295561 - in head: include sys/mips/include sys/powerpc/include sys/sparc64/include sys/sys sys/x86/include In-Reply-To: <20160212143630.GS91220@kib.kiev.ua> Message-ID: <20160213021939.S1340@besplex.bde.org> References: <201602120738.u1C7cKpq093956@repo.freebsd.org> <20160212232717.P894@besplex.bde.org> <20160212143630.GS91220@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=PfoC/XVd c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=VdO1sPvek9-flvt4mY4A:9 a=gyqZndm5bjYG79L7:21 a=HKfNxaPWd8Z5-L1v:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 16:56:45 -0000 On Fri, 12 Feb 2016, Konstantin Belousov wrote: > On Sat, Feb 13, 2016 at 01:08:55AM +1100, Bruce Evans wrote: >> On Fri, 12 Feb 2016, Konstantin Belousov wrote: > ... >>> Modified: head/include/signal.h >>> ============================================================================== >>> --- head/include/signal.h Fri Feb 12 07:27:24 2016 (r295560) >>> +++ head/include/signal.h Fri Feb 12 07:38:19 2016 (r295561) >>> @@ -36,6 +36,8 @@ >>> #include >>> #include >>> #include >>> +#include >>> +#include >> >> This pollutes even the non-POSIX case with POSIX and FreeBSD names. >> >> The correct ifdefs for this are messy. No names should be added for >> non-POSIX and old versions of POSIX. 2001 POSIX needs an XSI ifdef. Later >> versions of POSIX don't need an ifdef. Normally it is better to hide >> the ifdefs in the included headers, but _ucontext.h should always >> provide ucontext_t and uc_*. > Our non-POSIX namespace is strictly superset of the POSIX space. > I would not hide {m,u}context_t from the default visibility, and this > would defeat the goal of the change. Our Standard C namespace is a subset of the POSIX namespace. Most Standard C headers are (were) careful about this. There aren't many Standard C headers or versions of Standard C or large variations in the versions, so this is relatively easy to do. We also attempt to use POSIX visibility ifdefs. This is not done so carefully, and has more bugs due to more variations. But does it fairly carefully. It has ifdefs for XSI, POSIX >= 2001, any-POSIX (this is now very broken by unconditional declarations for pthreads), POSIX >= 1995 (realtime POSIX stuff which I think was standardized in POSIX.4 (.1b?) a couple of years before 1995, but we don't have ifdefs for that), POSIX >= 2008 (psignal). That is just in the top-level header. Almost half of that is only under XSI or BSD, and it is quite likely that some newer or older POSIX or XSI things are under the wrong ifdefed but are usually visible because everything is visible by default. sys/signal.h has ifdefs for POSIX >= 1993, more-delicate version ifdefs for XSI and POSIX <= 2001. Most of the POSIX >= 1993 ifdefs are for realtime POSIX stuff. An enormous number of definitions for things like trap codes for FP errors are misplaced under the POSIX >= 1993 || XSI ifdef. These weren't in POSIX.1-2006. This contrasts with the fine-grained ifdefs for signal numbers. I find the ifdefs useful for seeing when POSIX introduced a feature but not for actual use to compile under an old standard. >>> Modified: head/sys/mips/include/ucontext.h >>> ============================================================================== >>> --- head/sys/mips/include/ucontext.h Fri Feb 12 07:27:24 2016 (r295560) >>> +++ head/sys/mips/include/ucontext.h Fri Feb 12 07:38:19 2016 (r295561) >>> @@ -50,13 +50,13 @@ typedef struct __mcontext { >>> * struct sigcontext and ucontext_t at the same time. >>> */ >>> int mc_onstack; /* sigstack state to restore */ >>> - register_t mc_pc; /* pc at time of signal */ >>> - register_t mc_regs[32]; /* processor regs 0 to 31 */ >>> - register_t sr; /* status register */ >>> - register_t mullo, mulhi; /* mullo and mulhi registers... */ >>> + __register_t mc_pc; /* pc at time of signal */ >>> + __register_t mc_regs[32]; /* processor regs 0 to 31 */ >>> + __register_t sr; /* status register */ >>> + __register_t mullo, mulhi; /* mullo and mulhi registers... */ >>> int mc_fpused; /* fp has been used */ >>> f_register_t mc_fpregs[33]; /* fp regs 0 to 31 and csr */ >>> - register_t mc_fpc_eir; /* fp exception instruction reg */ >>> + __register_t mc_fpc_eir; /* fp exception instruction reg */ >>> void *mc_tls; /* pointer to TLS area */ >>> int __spare__[8]; /* XXX reserved */ >>> } mcontext_t; >>> >> >> These mc_* names always polluted but no one cared since it >> was an XSI extension. >> >> sr, mullo and mulhi have worse names. These names don't even use the >> same style as the others. They now pollute of course. >> >> __spare__ is bogusly named and has a banal comment. The names of spares >> should be in the normal (reserved) namespace for the struct. No namespace >> is reserved here, bug mc_spare would be no worse than the other mc_'s. >> >> i386 was missing all of these bugs except the mc_* pollution. > The members names for the structures are private per the structure > namespace. The names of the members cannot pollute signal.h. No, they aren't private. Applications can #define them to , and this is valid since they are not reserved. Standards have to reserve names of all struct members to make this invalid. POSIX does this for uc_*. >>> Copied and modified: head/sys/sys/_ucontext.h (from r295560, head/sys/sys/ucontext.h) >> >> sys/ucontext.h (== ) remains polluted. I point out its >> old bugs here since most of it is all quoted. > > I am not sure what do you mean by 'quoted' (enough quotes ?). I Just quoted in the mail. > carefully left everything not related to the ucontext_t definition out > of sys/_ucontext.h. This way, there is no pollution of signal.h from > the symbols you list below as contaminating. Since ucontext.h is not in > POSIX, there is no compliance issues. Yes, removal of ucontext.h in POSIX reduces the bugs. The main remaining ones are: - includes and and picks up any pollution there. The main pollution there is: - mc_* in (much more on arm64) - uc_* in . This is only reserved in certain POSIX cases. Approximately POSIX >= 2008, or POSIX >= 2001 && XSI, or just certain XSI. - POSIX between about 2001 and 2008 (and/or certain XSI) does have . This seems to have just the old bugs, since any inclusion of this header means that you are using a version that supports it. The old bugs are: - mc_* in (much more on arm64) - a couple of nonstandard function.s >>> --- head/sys/sys/ucontext.h Fri Feb 12 07:27:24 2016 (r295560, copy source) >>> +++ head/sys/sys/_ucontext.h Fri Feb 12 07:38:19 2016 (r295561) > ... >>> -#ifndef _KERNEL >>> - >>> -__BEGIN_DECLS >>> - >>> -int getcontext(ucontext_t *) __returns_twice; >>> -ucontext_t *getcontextx(void); >> > Nothing of the listed functions is in any POSIX header. They are in , which is in certain versions of POSIX. >>> +/* >>> + * Structure used in sigaltstack call. Its definition is always >>> + * needed for __ucontext. If __BSD_VISIBLE is defined, the structure >>> + * tag is actually sigaltstack. >>> + */ >>> +struct __stack_t { >>> + void *ss_sp; /* signal stack base */ >>> + __size_t ss_size; /* signal stack length */ >>> + int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */ >>> +}; >> >> This is now broken since it is outside of all ifdefs. Its ss_* names are >> in the application namespace for the non-POSIX case and POSIX before about >> 2001. > It only consumes the __stack_t tag which is both in the implementation name > space (__ prefix) and in the POSIX reserved namespace (_t suffix). #if _POSIX_VISIBLE < 200112 #define ss_sp ss_sp is in the application namespace in versions of POSIX \ before 2001. #endif BTW, the '<= 200112' ifdef for sigmask() is broken. 2001 is not before 2001. (sigmask() was removed in 2001.) >>> Modified: head/sys/x86/include/ucontext.h >>> ============================================================================== >>> --- head/sys/x86/include/ucontext.h Fri Feb 12 07:27:24 2016 (r295560) >>> +++ head/sys/x86/include/ucontext.h Fri Feb 12 07:38:19 2016 (r295561) >>> @@ -162,4 +162,9 @@ typedef struct __mcontext { >>> } mcontext_t; >>> #endif /* __amd64__ */ > The x86 ucontext.h is very accurate in not conflicting with the application > namespace, all constants are defined in implementation-reserved namespace > (have _M prefix). I did not verified other arches, I only noted that MIPS > has f_register_t bug. Except for mc_*. It started fairly clean and we cleaned it further a few years ago. >> I don't like the combined headers for x86, and this file is an especially >> good bad example. It consists of an __amd64__ ifdef and a __i386__ ifdef >> with nothing shared outside except the copyright notice and the >> idempotency ifdef. This gives the lint bug. > > And I do like them. More, I consider -m32 feature that was completed by > the merging, an essential feature of the modern OS on x86_64. Lots of the merge is a bad way to work around the design error of . -m32 should select the includes using -I, but it is hard to think of a method less suited to that than . I have no good solution. This reminds me that -m32 worked for about a month on freefall, but has been broken by a missing -lgcc and possibly other libraries for a couple of years. More recently, old dynamically-linked executables stopped working on freefall due to missing libraries at runtime. I should have known better than to use dynamic linkage. Bruce From owner-svn-src-all@freebsd.org Fri Feb 12 16:59:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F0F3AA6100; Fri, 12 Feb 2016 16:59:44 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 D68121A74; Fri, 12 Feb 2016 16:59:43 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1CGxgPI058374; Fri, 12 Feb 2016 16:59:42 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1CGxgpK058373; Fri, 12 Feb 2016 16:59:42 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201602121659.u1CGxgpK058373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 12 Feb 2016 16:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295565 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 16:59:44 -0000 Author: ian Date: Fri Feb 12 16:59:42 2016 New Revision: 295565 URL: https://svnweb.freebsd.org/changeset/base/295565 Log: Clarify the difference between 7- and 8-bit i2c addresses, used in FDT versus hints-based configuration, respectively. Reported by: Jukka Ukkonen Modified: head/share/man/man4/ds3231.4 Modified: head/share/man/man4/ds3231.4 ============================================================================== --- head/share/man/man4/ds3231.4 Fri Feb 12 14:29:14 2016 (r295564) +++ head/share/man/man4/ds3231.4 Fri Feb 12 16:59:42 2016 (r295565) @@ -110,8 +110,11 @@ that the .Nm is connected to. .It Va hint.ds3231.%d.addr -The i2c address of +The 8-bit i2c address of .Nm . +The default 8-bit address for +.Nm +is 0xd0. .El .Pp On a @@ -121,11 +124,11 @@ based system the following properties mu .It Va compatible Must always be set to "maxim,ds3231". .It Va reg -The i2c address of +The 7-bit i2c address of .Nm . -The default address for +The default 7-bit address for .Nm -is 0xd0. +is 0x68. .El .Sh SEE ALSO .Xr fdt 4 , From owner-svn-src-all@freebsd.org Fri Feb 12 17:03:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2815AA64FE; Fri, 12 Feb 2016 17:03:25 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 9495E1F70; Fri, 12 Feb 2016 17:03:25 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1CH3Ohw061132; Fri, 12 Feb 2016 17:03:24 GMT (envelope-from bjk@FreeBSD.org) Received: (from bjk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1CH3OMx061131; Fri, 12 Feb 2016 17:03:24 GMT (envelope-from bjk@FreeBSD.org) Message-Id: <201602121703.u1CH3OMx061131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bjk set sender to bjk@FreeBSD.org using -f From: Benjamin Kaduk Date: Fri, 12 Feb 2016 17:03:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295566 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 17:03:25 -0000 Author: bjk (doc committer) Date: Fri Feb 12 17:03:24 2016 New Revision: 295566 URL: https://svnweb.freebsd.org/changeset/base/295566 Log: Update .Dd for r295565 Modified: head/share/man/man4/ds3231.4 Modified: head/share/man/man4/ds3231.4 ============================================================================== --- head/share/man/man4/ds3231.4 Fri Feb 12 16:59:42 2016 (r295565) +++ head/share/man/man4/ds3231.4 Fri Feb 12 17:03:24 2016 (r295566) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 6, 2015 +.Dd February 12, 2016 .Dt DS3231 4 .Os .Sh NAME From owner-svn-src-all@freebsd.org Fri Feb 12 17:04:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29623AA6598; Fri, 12 Feb 2016 17:04:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 F00741C1; Fri, 12 Feb 2016 17:04:04 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1CH44c0061200; Fri, 12 Feb 2016 17:04:04 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1CH44Xm061199; Fri, 12 Feb 2016 17:04:04 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602121704.u1CH44Xm061199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 12 Feb 2016 17:04:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295567 - head/sys/arm/mv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 17:04:05 -0000 Author: andrew Date: Fri Feb 12 17:04:03 2016 New Revision: 295567 URL: https://svnweb.freebsd.org/changeset/base/295567 Log: Stop adding an extra null terminator to strings, OF_getprop already returns a null terminated string. Modified: head/sys/arm/mv/twsi.c Modified: head/sys/arm/mv/twsi.c ============================================================================== --- head/sys/arm/mv/twsi.c Fri Feb 12 17:03:24 2016 (r295566) +++ head/sys/arm/mv/twsi.c Fri Feb 12 17:04:03 2016 (r295567) @@ -401,10 +401,9 @@ mv_twsi_attach(device_t dev) for (child = OF_child(ofw_bus_get_node(dev)); child != 0; child = OF_peer(child)) { len = OF_getproplen(child, "model"); - if (len <= 0 || len > sizeof(dname) - 1) + if (len <= 0 || len > sizeof(dname)) continue; error = OF_getprop(child, "model", &dname, len); - dname[len + 1] = '\0'; if (error == -1) continue; len = strlen(dname); @@ -428,10 +427,9 @@ mv_twsi_attach(device_t dev) /* Get device driver name. */ len = OF_getproplen(child, "model"); - if (len <= 0 || len > sizeof(dname) - 1) + if (len <= 0 || len > sizeof(dname)) continue; OF_getprop(child, "model", &dname, len); - dname[len + 1] = '\0'; if (bootverbose) device_printf(dev, "adding a device %s at %d.\n", From owner-svn-src-all@freebsd.org Fri Feb 12 17:17:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43C77AA6B82 for ; Fri, 12 Feb 2016 17:17:26 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from erouter6.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) (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 0D904983 for ; Fri, 12 Feb 2016 17:17:25 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 1a838a48-d1ac-11e5-a023-11ad6df26ed1 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Fri, 12 Feb 2016 17:14:31 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u1CHH7El018590; Fri, 12 Feb 2016 10:17:07 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1455297427.1271.17.camel@freebsd.org> Subject: Re: svn commit: r295566 - head/share/man/man4 From: Ian Lepore To: Benjamin Kaduk , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 12 Feb 2016 10:17:07 -0700 In-Reply-To: <201602121703.u1CH3OMx061131@repo.freebsd.org> References: <201602121703.u1CH3OMx061131@repo.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 17:17:26 -0000 On Fri, 2016-02-12 at 17:03 +0000, Benjamin Kaduk wrote: > Author: bjk (doc committer) > Date: Fri Feb 12 17:03:24 2016 > New Revision: 295566 > URL: https://svnweb.freebsd.org/changeset/base/295566 > > Log: > Update .Dd for r295565 > > Modified: > head/share/man/man4/ds3231.4 I thought .Dd only got bumped for significant revisions? -- Ian From owner-svn-src-all@freebsd.org Fri Feb 12 17:25:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 574E7AA6FB6; Fri, 12 Feb 2016 17:25:02 +0000 (UTC) (envelope-from kaduk@mit.edu) Received: from dmz-mailsec-scanner-1.mit.edu (dmz-mailsec-scanner-1.mit.edu [18.9.25.12]) (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 AF395FA0; Fri, 12 Feb 2016 17:25:01 +0000 (UTC) (envelope-from kaduk@mit.edu) X-AuditID: 1209190c-15fff70000002996-e9-56be14359b3c Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 20.C0.10646.5341EB65; Fri, 12 Feb 2016 12:19:49 -0500 (EST) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id u1CHJmlx026412; Fri, 12 Feb 2016 12:19:49 -0500 Received: from multics.mit.edu (system-low-sipb.mit.edu [18.187.2.37]) (authenticated bits=56) (User authenticated as kaduk@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id u1CHJjQK032014 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 12 Feb 2016 12:19:48 -0500 Received: (from kaduk@localhost) by multics.mit.edu (8.12.9.20060308) id u1CHJjKS009910; Fri, 12 Feb 2016 12:19:45 -0500 (EST) Date: Fri, 12 Feb 2016 12:19:45 -0500 (EST) From: Benjamin Kaduk X-X-Sender: kaduk@multics.mit.edu To: Ian Lepore cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295566 - head/share/man/man4 In-Reply-To: <1455297427.1271.17.camel@freebsd.org> Message-ID: References: <201602121703.u1CH3OMx061131@repo.freebsd.org> <1455297427.1271.17.camel@freebsd.org> User-Agent: Alpine 1.10 (GSO 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHIsWRmVeSWpSXmKPExsUixCmqrWsqsi/M4MI8a4snx98wW/xpn8Ji 8WfTQlaLpi8LmBxYPGZ8ms8SwBjFZZOSmpNZllqkb5fAlTHp2VHGgrMsFR+vL2dqYLzA3MXI ySEhYCLx5G83axcjF4eQQBuTxORti5khnI2MEvvPbGCBcA4xSZw/dpENwmlglNjz+wMjSD+L gLbE9J+3WUFsNgE1icd7m1kh5ipKbD41CWyHiICCxJZ5q8FsZoEoiedTLrKD2MICZhLbl+4D sjk4OAWMJU72VYKEeQUcJSaufcYEYgsJJEpcndgHZosK6Eis3j+FBaJGUOLkzCcsECO1JJZP 38YygVFwFpLULCSpBYxMqxhlU3KrdHMTM3OKU5N1i5MT8/JSi3QN9XIzS/RSU0o3MYKDVpJn B+Obg0qHGAU4GJV4eG9c3xMmxJpYVlyZe4hRkoNJSZS38dneMCG+pPyUyozE4oz4otKc1OJD jBIczEoivAZNQDnelMTKqtSifJiUNAeLkjjvo187w4QE0hNLUrNTUwtSi2CyMhwcShK8ksL7 woQEi1LTUyvSMnNKENJMHJwgw3mAhvuC1PAWFyTmFmemQ+RPMepyLPhxey2TEEtefl6qlDiv NUiRAEhRRmke3BxwstnNpPqKURzoLWFeL5AqHmCigpv0CmgJE9CSHd93gSwpSURISTUwNvca WxkfivR9pP6gpu/j3b8nvp5fJTZBll1n6t7NOQd+addvWBNY22pdu/iWV+jq7ZO+3dFg1vAz eZm44ZdzdA6vSeC0rWlp1idrpFq0zvIoGp0NmyL0L//V+br4E+ns+y6x5a9cZ5IYZ9Lz4Kqg 6r4Ct1A/PQch7vi4OmXW27q+/x/MaKlWYinOSDTUYi4qTgQA/kbQcBEDAAA= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 17:25:02 -0000 On Fri, 12 Feb 2016, Ian Lepore wrote: > On Fri, 2016-02-12 at 17:03 +0000, Benjamin Kaduk wrote: > > Author: bjk (doc committer) > > Date: Fri Feb 12 17:03:24 2016 > > New Revision: 295566 > > URL: https://svnweb.freebsd.org/changeset/base/295566 > > > > Log: > > Update .Dd for r295565 > > > > Modified: > > head/share/man/man4/ds3231.4 > > I thought .Dd only got bumped for significant revisions? Basically, yes. The threshold for "significant" has been going down over time, though; some people use a threshold of "changes the rendered output", even. -Ben From owner-svn-src-all@freebsd.org Fri Feb 12 17:36:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10A9AAA6576; Fri, 12 Feb 2016 17:36:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CBA0162D; Fri, 12 Feb 2016 17:36:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u1CHafah086376 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 12 Feb 2016 19:36:41 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u1CHafah086376 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u1CHafEQ086375; Fri, 12 Feb 2016 19:36:41 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 12 Feb 2016 19:36:41 +0200 From: Konstantin Belousov To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295561 - in head: include sys/mips/include sys/powerpc/include sys/sparc64/include sys/sys sys/x86/include Message-ID: <20160212173641.GV91220@kib.kiev.ua> References: <201602120738.u1C7cKpq093956@repo.freebsd.org> <20160212232717.P894@besplex.bde.org> <20160212143630.GS91220@kib.kiev.ua> <20160213021939.S1340@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160213021939.S1340@besplex.bde.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 17:36:48 -0000 On Sat, Feb 13, 2016 at 03:56:42AM +1100, Bruce Evans wrote: > Our Standard C namespace is a subset of the POSIX namespace. Most > Standard C headers are (were) careful about this. There aren't many > Standard C headers or versions of Standard C or large variations in the > versions, so this is relatively easy to do. > > We also attempt to use POSIX visibility ifdefs. This is not done so > carefully, and has more bugs due to more variations. But > does it fairly carefully. It has ifdefs for XSI, POSIX >= 2001, > any-POSIX (this is now very broken by unconditional declarations for > pthreads), POSIX >= 1995 (realtime POSIX stuff which I think was > standardized in POSIX.4 (.1b?) a couple of years before 1995, but we > don't have ifdefs for that), POSIX >= 2008 (psignal). That is just > in the top-level header. Almost half of that is only under XSI or > BSD, and it is quite likely that some newer or older POSIX or XSI > things are under the wrong ifdefed but are usually visible because > everything is visible by default. sys/signal.h has ifdefs for > POSIX >= 1993, more-delicate version ifdefs for XSI and POSIX <= 2001. > Most of the POSIX >= 1993 ifdefs are for realtime POSIX stuff. An > enormous number of definitions for things like trap codes for FP errors > are misplaced under the POSIX >= 1993 || XSI ifdef. These weren't in > POSIX.1-2006. This contrasts with the fine-grained ifdefs for signal > numbers. > > I find the ifdefs useful for seeing when POSIX introduced a feature > but not for actual use to compile under an old standard. So you are about the ANSI C & non-POSIX compilation environment ? Do you mean the following: diff --git a/include/signal.h b/include/signal.h index 33be55c..31cded7 100644 --- a/include/signal.h +++ b/include/signal.h @@ -36,8 +36,10 @@ #include #include #include +#if __POSIX_VISIBLE || __XSI_VISIBLE #include #include +#endif #if __BSD_VISIBLE /* I can change #if __POSIX_VISIBLE to some version cap, if you prefer. From owner-svn-src-all@freebsd.org Fri Feb 12 17:55:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C2A9AA6D48; Fri, 12 Feb 2016 17:55:07 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 6CABC1F4C; Fri, 12 Feb 2016 17:55:07 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1CHt677075889; Fri, 12 Feb 2016 17:55:06 GMT (envelope-from feld@FreeBSD.org) Received: (from feld@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1CHt64A075888; Fri, 12 Feb 2016 17:55:06 GMT (envelope-from feld@FreeBSD.org) Message-Id: <201602121755.u1CHt64A075888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: feld set sender to feld@FreeBSD.org using -f From: Mark Felder Date: Fri, 12 Feb 2016 17:55:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295568 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 17:55:07 -0000 Author: feld (ports committer) Date: Fri Feb 12 17:55:06 2016 New Revision: 295568 URL: https://svnweb.freebsd.org/changeset/base/295568 Log: Document the new jail_reverse_stop parameter While here clean up the documentation for jail_list PR: 196152 Approved by: jamie, wblock MFC after: 1 week, with r295471 Differential Revision: https://reviews.freebsd.org/D5243 Modified: head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Fri Feb 12 17:04:03 2016 (r295567) +++ head/share/man/man5/rc.conf.5 Fri Feb 12 17:55:06 2016 (r295568) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 9, 2015 +.Dd February 12, 2016 .Dt RC.CONF 5 .Os .Sh NAME @@ -3853,20 +3853,22 @@ for every jail in .Va jail_list . .It Va jail_list .Pq Vt str -A space separated list of names for jails. -If this variable is empty, -all of +A space-delimited list of jail names. +When left empty, all of the .Xr jail 8 -instances in the configuration file will be configured. -This is purely a configuration aid to help identify and -configure multiple jails. -The names specified in this list will be used to -identify settings common to an instance of a jail, -and should contain alphanumeric characters only. -The literal jail name of -.Dq Li 0 -.Pq zero -is not allowed. +instances defined in the configuration file are started. +The names specified in this list control the jail startup order. +.Xr jail 8 +instances missing from +.Va jail_list +must be started manually. +.It Va jail_reverse_stop +.Pq Vt bool +When set to +.Dq Li YES , +all configured jails in +.Va jail_list +are stopped in reverse order. .It Va jail_* variables Note that older releases supported per-jail configuration via .Xr rc.conf 5 From owner-svn-src-all@freebsd.org Fri Feb 12 18:13:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39880AA667B; Fri, 12 Feb 2016 18:13:45 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from mail.made4.biz (mail.made4.biz [IPv6:2001:41d0:2:c018::1:3]) (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 042D7C0A; Fri, 12 Feb 2016 18:13:45 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from [176.158.145.63] (helo=magellan.dumbbell.fr) by mail.made4.biz with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aUIDu-00085v-L1; Fri, 12 Feb 2016 19:13:42 +0100 Subject: Re: svn commit: r293857 - stable/10/sys/dev/drm2/i915 To: Slawa Olhovchenkov References: <201601132156.u0DLunQs020854@repo.freebsd.org> <20160123162617.GL37895@zxy.spb.ru> <56A5E89A.3050106@FreeBSD.org> <20160125104506.GV88527@zxy.spb.ru> <56A619C5.6070109@FreeBSD.org> <20160208122910.GZ37895@zxy.spb.ru> Cc: Andriy Voskoboinyk , svn-src-stable@freebsd.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , svn-src-stable-10@freebsd.org From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Message-ID: <56BE20D2.3080002@FreeBSD.org> Date: Fri, 12 Feb 2016 19:13:38 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160208122910.GZ37895@zxy.spb.ru> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="DFdrGxF1t5AKu8e39ciD1Us4QgRu9wjPg" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 18:13:45 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --DFdrGxF1t5AKu8e39ciD1Us4QgRu9wjPg Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 08/02/2016 13:29, Slawa Olhovchenkov wrote: > On Mon, Jan 25, 2016 at 01:49:09PM +0100, Jean-S=C3=A9bastien P=C3=A9dr= on wrote: >=20 >> On 25/01/2016 11:50, Andriy Voskoboinyk wrote: >>> Try to apply https://svnweb.freebsd.org/base?view=3Drevision&revision= =3D288653 >>> (as for me, head/sys/dev/drm2/i915/i915_dma.c change fixes this) >> >> If this fixes the problem, perfect, I will merge it. >=20 > BETA builds in actions, do you plan to merge at this time? Hi! I'm going to send a merge request tonight. It should be part of the next BETA or RC (but not BETA2). --=20 Jean-S=C3=A9bastien P=C3=A9dron --DFdrGxF1t5AKu8e39ciD1Us4QgRu9wjPg Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJWviDSXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NzA4N0ZEMUFFQUUwRTEyREJDNkE2RjAz OUU5OTc2MUE1RkQ5NENDAAoJEDnpl2Gl/ZTMmukP/3yb9NAPbdj8rZVIg63AyzY0 IM88oIqdDUpOPncNu+ZLNFi+gMgKTA2PrYvy9pUJxx333E0p1pgIX9/m+G88EUrY jORag+NeZtlHLOfoCDwEJSKCzzghRAc+w4tzseYAV674UtDKUQ1pndDI8r7fGofo gDulEsDJ2FZW4UmSL727uSIgjBs0SmlFnGSnn0+5WuMj7MGj7r9QZapVMbhxqb0u ZvBA/5mJ9/GxxyXFRsl7VAgP78ddYzE70WaFT/wR/orUPaWjNs7P2jPoebxAhOvn YhLRmlBTIbJf5qAOV1QgPXazDa+6pi+WJKT/KeDSVQxyfh/rrkOoBKYsRQj4khuS nmF+vKnJ1R/j0rQgwrOJQecqmx4R4gR40hBI7vcfvd4C6MCGknYJFZt3A9JmD1L6 j8xYjAf8kXrBbXFLmWySpW704OmAXboVBSrEHGL979bYC3G/0A99dLKkctSm2OLL nQYU9LBvGabdFPiILvCMC+MfMddJ9jrtCkRQPM7aTuNYpTzwzNviWirSXGF0u5pN RbuI4hQOPRb3CdUS0ENGrJVd7DaLdGLYNHJNA6vIqy35uwmULBMFV5yC7wbg4o5D 2sR2EEnS5Nc3fEk2ap0pLXolQaZX5BAvoTCUeYWm9p8BAuVCx+oIdkrSarq0rhIl ZuKGl5m51Hk3HgwuGNyg =6kIO -----END PGP SIGNATURE----- --DFdrGxF1t5AKu8e39ciD1Us4QgRu9wjPg-- From owner-svn-src-all@freebsd.org Fri Feb 12 18:16:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF128AA6874; Fri, 12 Feb 2016 18:16:57 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 7DE2FF03; Fri, 12 Feb 2016 18:16:57 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aUIH1-0007gV-LD; Fri, 12 Feb 2016 21:16:55 +0300 Date: Fri, 12 Feb 2016 21:16:55 +0300 From: Slawa Olhovchenkov To: =?utf-8?Q?Jean-S=C3=A9bastien_P=C3=A9dron?= Cc: Andriy Voskoboinyk , svn-src-stable@freebsd.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , svn-src-stable-10@freebsd.org Subject: Re: svn commit: r293857 - stable/10/sys/dev/drm2/i915 Message-ID: <20160212181655.GO68298@zxy.spb.ru> References: <201601132156.u0DLunQs020854@repo.freebsd.org> <20160123162617.GL37895@zxy.spb.ru> <56A5E89A.3050106@FreeBSD.org> <20160125104506.GV88527@zxy.spb.ru> <56A619C5.6070109@FreeBSD.org> <20160208122910.GZ37895@zxy.spb.ru> <56BE20D2.3080002@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <56BE20D2.3080002@FreeBSD.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 18:16:57 -0000 On Fri, Feb 12, 2016 at 07:13:38PM +0100, Jean-Sébastien Pédron wrote: > On 08/02/2016 13:29, Slawa Olhovchenkov wrote: > > On Mon, Jan 25, 2016 at 01:49:09PM +0100, Jean-Sébastien Pédron wrote: > > > >> On 25/01/2016 11:50, Andriy Voskoboinyk wrote: > >>> Try to apply https://svnweb.freebsd.org/base?view=revision&revision=288653 > >>> (as for me, head/sys/dev/drm2/i915/i915_dma.c change fixes this) > >> > >> If this fixes the problem, perfect, I will merge it. > > > > BETA builds in actions, do you plan to merge at this time? > > Hi! > > I'm going to send a merge request tonight. It should be part of the next > BETA or RC (but not BETA2). Thanks! From owner-svn-src-all@freebsd.org Fri Feb 12 18:18:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52780AA6A57; Fri, 12 Feb 2016 18:18:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 2E79A1095; Fri, 12 Feb 2016 18:18:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1CIIo2c081834; Fri, 12 Feb 2016 18:18:50 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1CIIorE081831; Fri, 12 Feb 2016 18:18:50 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602121818.u1CIIorE081831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 12 Feb 2016 18:18:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295569 - in vendor/elftoolchain/dist: elfcopy libelf X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 18:18:51 -0000 Author: emaste Date: Fri Feb 12 18:18:49 2016 New Revision: 295569 URL: https://svnweb.freebsd.org/changeset/base/295569 Log: Import ELF Tool Chain snapshot revision 3399 From http://svn.code.sf.net/p/elftoolchain/code Modified: vendor/elftoolchain/dist/elfcopy/main.c vendor/elftoolchain/dist/elfcopy/segments.c vendor/elftoolchain/dist/libelf/_libelf_config.h Modified: vendor/elftoolchain/dist/elfcopy/main.c ============================================================================== --- vendor/elftoolchain/dist/elfcopy/main.c Fri Feb 12 17:55:06 2016 (r295568) +++ vendor/elftoolchain/dist/elfcopy/main.c Fri Feb 12 18:18:49 2016 (r295569) @@ -39,7 +39,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: main.c 3381 2016-01-30 19:39:47Z jkoshy $"); +ELFTC_VCSID("$Id: main.c 3399 2016-02-12 18:07:56Z emaste $"); enum options { @@ -316,6 +316,7 @@ create_elf(struct elfcopy *ecp) oeh.e_entry = ieh.e_entry; oeh.e_version = ieh.e_version; + ecp->flags &= ~(EXECUTABLE | DYNAMIC | RELOCATABLE); if (ieh.e_type == ET_EXEC) ecp->flags |= EXECUTABLE; else if (ieh.e_type == ET_DYN) @@ -1485,6 +1486,7 @@ Usage: %s [options] file...\n\ Options:\n\ -d | -g | -S | --strip-debug Remove debugging symbols.\n\ -h | --help Print a help message.\n\ + -o FILE | --output-file FILE Write output to FILE.\n\ --only-keep-debug Keep debugging information only.\n\ -p | --preserve-dates Preserve access and modification times.\n\ -s | --strip-all Remove all symbols.\n\ Modified: vendor/elftoolchain/dist/elfcopy/segments.c ============================================================================== --- vendor/elftoolchain/dist/elfcopy/segments.c Fri Feb 12 17:55:06 2016 (r295568) +++ vendor/elftoolchain/dist/elfcopy/segments.c Fri Feb 12 18:18:49 2016 (r295569) @@ -34,7 +34,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: segments.c 3340 2016-01-17 15:00:56Z kaiwang27 $"); +ELFTC_VCSID("$Id: segments.c 3397 2016-02-12 14:35:19Z emaste $"); static void insert_to_inseg_list(struct segment *seg, struct section *sec); @@ -489,7 +489,7 @@ copy_phdr(struct elfcopy *ecp) ophdr.p_filesz = seg->fsz; ophdr.p_memsz = seg->msz; if (!gelf_update_phdr(ecp->eout, i, &ophdr)) - err(EXIT_FAILURE, "gelf_update_phdr failed :%s", + errx(EXIT_FAILURE, "gelf_update_phdr failed: %s", elf_errmsg(-1)); i++; Modified: vendor/elftoolchain/dist/libelf/_libelf_config.h ============================================================================== --- vendor/elftoolchain/dist/libelf/_libelf_config.h Fri Feb 12 17:55:06 2016 (r295568) +++ vendor/elftoolchain/dist/libelf/_libelf_config.h Fri Feb 12 18:18:49 2016 (r295569) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: _libelf_config.h 3168 2015-02-24 19:17:47Z emaste $ + * $Id: _libelf_config.h 3396 2016-02-10 21:50:05Z emaste $ */ #if defined(__APPLE__) || defined(__DragonFly__) @@ -97,6 +97,12 @@ #define LIBELF_BYTEORDER ELFDATA2MSB #define LIBELF_CLASS ELFCLASS32 +#elif defined(__riscv64) + +#define LIBELF_ARCH EM_RISCV +#define LIBELF_BYTEORDER ELFDATA2LSB +#define LIBELF_CLASS ELFCLASS64 + #elif defined(__sparc__) #define LIBELF_ARCH EM_SPARCV9 From owner-svn-src-all@freebsd.org Fri Feb 12 18:19:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8CF3AA6AB8; Fri, 12 Feb 2016 18:19:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 60262120C; Fri, 12 Feb 2016 18:19:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1CIJWkl081902; Fri, 12 Feb 2016 18:19:32 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1CIJWWB081901; Fri, 12 Feb 2016 18:19:32 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602121819.u1CIJWWB081901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 12 Feb 2016 18:19:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295570 - vendor/elftoolchain/elftoolchain-r3399 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 18:19:33 -0000 Author: emaste Date: Fri Feb 12 18:19:32 2016 New Revision: 295570 URL: https://svnweb.freebsd.org/changeset/base/295570 Log: Tag elftoolchain-r3399 Added: vendor/elftoolchain/elftoolchain-r3399/ - copied from r295569, vendor/elftoolchain/dist/ From owner-svn-src-all@freebsd.org Fri Feb 12 18:53:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7389AAA77F9; Fri, 12 Feb 2016 18:53:32 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 2BA5413D8; Fri, 12 Feb 2016 18:53:32 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1CIrV1H094753; Fri, 12 Feb 2016 18:53:31 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1CIrTB4094733; Fri, 12 Feb 2016 18:53:29 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201602121853.u1CIrTB4094733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 12 Feb 2016 18:53:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295571 - in vendor-sys/acpica/dist: . generate/unix/iasl source/common source/compiler source/components/debugger source/components/disassembler source/components/dispatcher source/com... X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 18:53:32 -0000 Author: jkim Date: Fri Feb 12 18:53:29 2016 New Revision: 295571 URL: https://svnweb.freebsd.org/changeset/base/295571 Log: Import ACPICA 20160212. Added: vendor-sys/acpica/dist/source/compiler/asldebug.c (contents, props changed) vendor-sys/acpica/dist/source/compiler/aslexternal.c (contents, props changed) vendor-sys/acpica/dist/source/compiler/aslxrefout.c (contents, props changed) Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/generate/unix/iasl/Makefile vendor-sys/acpica/dist/source/common/adwalk.c vendor-sys/acpica/dist/source/common/ahids.c vendor-sys/acpica/dist/source/common/ahpredef.c vendor-sys/acpica/dist/source/common/dmextern.c vendor-sys/acpica/dist/source/common/dmtable.c vendor-sys/acpica/dist/source/common/dmtables.c vendor-sys/acpica/dist/source/common/dmtbdump.c vendor-sys/acpica/dist/source/common/dmtbinfo.c vendor-sys/acpica/dist/source/compiler/aslanalyze.c vendor-sys/acpica/dist/source/compiler/aslbtypes.c vendor-sys/acpica/dist/source/compiler/aslcodegen.c vendor-sys/acpica/dist/source/compiler/aslcompile.c vendor-sys/acpica/dist/source/compiler/aslcompiler.h vendor-sys/acpica/dist/source/compiler/asldefine.h vendor-sys/acpica/dist/source/compiler/aslfiles.c vendor-sys/acpica/dist/source/compiler/aslglobal.h vendor-sys/acpica/dist/source/compiler/asllength.c vendor-sys/acpica/dist/source/compiler/asllisting.c vendor-sys/acpica/dist/source/compiler/aslload.c vendor-sys/acpica/dist/source/compiler/aslmain.c vendor-sys/acpica/dist/source/compiler/aslmap.c vendor-sys/acpica/dist/source/compiler/aslmapoutput.c vendor-sys/acpica/dist/source/compiler/aslmethod.c vendor-sys/acpica/dist/source/compiler/aslopcodes.c vendor-sys/acpica/dist/source/compiler/asloperands.c vendor-sys/acpica/dist/source/compiler/asloptions.c vendor-sys/acpica/dist/source/compiler/aslprune.c vendor-sys/acpica/dist/source/compiler/aslrestype2s.c vendor-sys/acpica/dist/source/compiler/aslrules.y vendor-sys/acpica/dist/source/compiler/aslstubs.c vendor-sys/acpica/dist/source/compiler/asltransform.c vendor-sys/acpica/dist/source/compiler/asltree.c vendor-sys/acpica/dist/source/compiler/asltypes.h vendor-sys/acpica/dist/source/compiler/aslutils.c vendor-sys/acpica/dist/source/compiler/aslwalks.c vendor-sys/acpica/dist/source/compiler/aslxref.c vendor-sys/acpica/dist/source/compiler/dtparser.y vendor-sys/acpica/dist/source/compiler/prparser.y vendor-sys/acpica/dist/source/compiler/prscan.c vendor-sys/acpica/dist/source/components/debugger/dbcmds.c vendor-sys/acpica/dist/source/components/debugger/dbconvert.c vendor-sys/acpica/dist/source/components/disassembler/dmopcode.c vendor-sys/acpica/dist/source/components/disassembler/dmwalk.c vendor-sys/acpica/dist/source/components/dispatcher/dsmethod.c vendor-sys/acpica/dist/source/components/dispatcher/dsobject.c vendor-sys/acpica/dist/source/components/events/evgpeblk.c vendor-sys/acpica/dist/source/components/events/evgpeinit.c vendor-sys/acpica/dist/source/components/events/evregion.c vendor-sys/acpica/dist/source/components/executer/exconfig.c vendor-sys/acpica/dist/source/components/executer/exoparg3.c vendor-sys/acpica/dist/source/components/hardware/hwxfsleep.c vendor-sys/acpica/dist/source/components/namespace/nseval.c vendor-sys/acpica/dist/source/components/namespace/nsinit.c vendor-sys/acpica/dist/source/components/parser/psargs.c vendor-sys/acpica/dist/source/components/tables/tbinstal.c vendor-sys/acpica/dist/source/components/tables/tbprint.c vendor-sys/acpica/dist/source/components/tables/tbutils.c vendor-sys/acpica/dist/source/components/tables/tbxfload.c vendor-sys/acpica/dist/source/components/utilities/utcache.c vendor-sys/acpica/dist/source/components/utilities/utdecode.c vendor-sys/acpica/dist/source/components/utilities/utnonansi.c vendor-sys/acpica/dist/source/components/utilities/uttrack.c vendor-sys/acpica/dist/source/components/utilities/utxferror.c vendor-sys/acpica/dist/source/components/utilities/utxfinit.c vendor-sys/acpica/dist/source/include/acdisasm.h vendor-sys/acpica/dist/source/include/acglobal.h vendor-sys/acpica/dist/source/include/aclocal.h vendor-sys/acpica/dist/source/include/acnamesp.h vendor-sys/acpica/dist/source/include/acoutput.h vendor-sys/acpica/dist/source/include/acpixf.h vendor-sys/acpica/dist/source/include/acpredef.h vendor-sys/acpica/dist/source/include/actbl.h vendor-sys/acpica/dist/source/include/actbl1.h vendor-sys/acpica/dist/source/include/actypes.h vendor-sys/acpica/dist/source/tools/acpiexec/aemain.c vendor-sys/acpica/dist/source/tools/acpisrc/asfile.c vendor-sys/acpica/dist/source/tools/acpisrc/astable.c vendor-sys/acpica/dist/source/tools/examples/examples.c Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/changes.txt Fri Feb 12 18:53:29 2016 (r295571) @@ -1,4 +1,66 @@ ---------------------------------------- +12 February 2016. Summary of changes for version 20160212: + +This release is available at https://acpica.org/downloads + +1) ACPICA kernel-resident subsystem: + +Implemented full support for the ACPI 6.1 specification (released in +January). This version of the specification is available at: +http://www.uefi.org/specifications + +Only a relatively small number of changes were required in ACPICA to +support ACPI 6.1, in these areas: +- New predefined names +- New _HID values +- A new subtable for HEST +- A few other header changes for new values + +Ensure \_SB_._INI is executed before any _REG methods are executed. There +appears to be existing BIOS code that relies on this behavior. Lv Zheng. + +Reverted a change made in version 20151218 which enabled method +invocations to be targets of various ASL operators (SuperName and Target +grammar elements). While the new behavior is supported by the ACPI +specification, other AML interpreters do not support this behavior and +never will. The ACPI specification will be updated for ACPI 6.2 to remove +this support. Therefore, the change was reverted to the original ACPICA +behavior. + +ACPICA now supports the GCC 6 compiler. + +Current Release: (Note: build changes increased sizes) + Non-Debug Version: 136.2K Code, 51.5K Data, 187.7K Total + Debug Version: 200.4K Code, 82.0K Data, 282.4K Total +Previous Release: + Non-Debug Version: 102.7K Code, 28.4K Data, 131.1K Total + Debug Version: 200.4K Code, 81.9K Data, 282.3K Total + + +2) iASL Compiler/Disassembler and Tools: + +Completed full support for the ACPI 6.0 External() AML opcode. The +compiler emits an external AML opcode for each ASL External statement. +This opcode is used by the disassembler to assist with the disassembly of +external control methods by specifying the required number of arguments +for the method. AML interpreters do not use this opcode. To ensure that +interpreters do not even see the opcode, a block of one or more external +opcodes is surrounded by an "If(0)" construct. As this feature becomes +commonly deployed in BIOS code, the ability of disassemblers to correctly +disassemble AML code will be greatly improved. David Box. + +iASL: Implemented support for an optional cross-reference output file. +The -lx option will create a the cross-reference file with the suffix +"xrf". Three different types of cross-reference are created in this file: +- List of object references made from within each control method +- Invocation (caller) list for each user-defined control method +- List of references to each non-method object in the namespace + +iASL: Method invocations as ASL Target operands are now disallowed and +flagged as errors in preparation for ACPI 6.2 (see the description of the +problem above). + +---------------------------------------- 8 January 2016. Summary of changes for version 20160108: 1) ACPICA kernel-resident subsystem: Modified: vendor-sys/acpica/dist/generate/unix/iasl/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/iasl/Makefile Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/generate/unix/iasl/Makefile Fri Feb 12 18:53:29 2016 (r295571) @@ -56,7 +56,9 @@ OBJECTS = \ $(OBJDIR)/aslbtypes.o\ $(OBJDIR)/aslcodegen.o\ $(OBJDIR)/aslcompile.o\ + $(OBJDIR)/asldebug.o\ $(OBJDIR)/aslerror.o\ + $(OBJDIR)/aslexternal.o\ $(OBJDIR)/aslfiles.o\ $(OBJDIR)/aslfileio.o\ $(OBJDIR)/aslfold.o\ @@ -100,6 +102,7 @@ OBJECTS = \ $(OBJDIR)/asluuid.o\ $(OBJDIR)/aslwalks.o\ $(OBJDIR)/aslxref.o\ + $(OBJDIR)/aslxrefout.o\ $(OBJDIR)/cmfsize.o\ $(OBJDIR)/dbfileio.o\ $(OBJDIR)/dmbuffer.o\ Modified: vendor-sys/acpica/dist/source/common/adwalk.c ============================================================================== --- vendor-sys/acpica/dist/source/common/adwalk.c Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/source/common/adwalk.c Fri Feb 12 18:53:29 2016 (r295571) @@ -760,6 +760,7 @@ AcpiDmXrefDescendingOp ( ACPI_OPERAND_OBJECT *Object; UINT32 ParamCount = 0; char *Pathname; + UINT16 Flags = 0; WalkState = Info->WalkState; @@ -774,7 +775,24 @@ AcpiDmXrefDescendingOp ( { goto Exit; } + else if (Op->Common.Parent && + Op->Common.Parent->Common.AmlOpcode == AML_EXTERNAL_OP) + { + /* External() NamePath */ + + Path = Op->Common.Value.String; + ObjectType = (ACPI_OBJECT_TYPE) Op->Common.Next->Common.Value.Integer; + if (ObjectType == ACPI_TYPE_METHOD) + { + ParamCount = (UINT32) + Op->Common.Next->Common.Next->Common.Value.Integer; + } + + AcpiDmAddOpToExternalList (Op, Path, + (UINT8) ObjectType, ParamCount, Flags); + goto Exit; + } /* Get the NamePath from the appropriate place */ @@ -842,6 +860,7 @@ AcpiDmXrefDescendingOp ( /* Node was created by an External() statement */ Status = AE_NOT_FOUND; + Flags = ACPI_EXT_RESOLVED_REFERENCE; } if (ACPI_FAILURE (Status)) @@ -861,12 +880,12 @@ AcpiDmXrefDescendingOp ( if (Node) { AcpiDmAddNodeToExternalList (Node, - (UINT8) ObjectType, 0, 0); + (UINT8) ObjectType, 0, Flags); } else { AcpiDmAddOpToExternalList (Op, Path, - (UINT8) ObjectType, 0, 0); + (UINT8) ObjectType, 0, Flags); } } } Modified: vendor-sys/acpica/dist/source/common/ahids.c ============================================================================== --- vendor-sys/acpica/dist/source/common/ahids.c Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/source/common/ahids.c Fri Feb 12 18:53:29 2016 (r295571) @@ -75,6 +75,10 @@ const AH_DEVICE_ID AslDeviceIds[] = {"ACPI000D", "Power Meter Device"}, {"ACPI000E", "Time and Alarm Device"}, {"ACPI000F", "User Presence Detection Device"}, + {"ACPI0010", "Processor Container Device"}, + {"ACPI0011", "Generic Buttons Device"}, + {"ACPI0012", "NVDIMM Root Device"}, + {"ACPI0013", "Generic Event Device"}, {"ADMA0F28", "Intel Audio DMA"}, {"AMCR0F28", "Intel Audio Machine Driver"}, {"ATK4001", "Asus Radio Control Button"}, @@ -185,6 +189,7 @@ const AH_DEVICE_ID AslDeviceIds[] = {"PNP0C12", "Device Bay Controller"}, {"PNP0C14", "Windows Management Instrumentation Device"}, {"PNP0C15", "Docking Station"}, + {"PNP0C33", "Error Device"}, {"PNP0C40", "Standard Button Controller"}, {"PNP0C50", "HID Protocol Device (I2C bus)"}, {"PNP0C60", "Display Sensor Device"}, Modified: vendor-sys/acpica/dist/source/common/ahpredef.c ============================================================================== --- vendor-sys/acpica/dist/source/common/ahpredef.c Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/source/common/ahpredef.c Fri Feb 12 18:53:29 2016 (r295571) @@ -140,6 +140,7 @@ const AH_PREDEFINED_NAME AslPredefine AH_PREDEF ("_FDI", "Floppy Drive Information", "Returns a floppy drive information block"), AH_PREDEF ("_FDM", "Floppy Drive Mode", "Sets a floppy drive speed"), AH_PREDEF ("_FIF", "Fan Information", "Returns fan device information"), + AH_PREDEF ("_FIT", "Firmware Interface Table", "Returns a list of NFIT structures"), AH_PREDEF ("_FIX", "Fixed Register Resource Provider", "Returns a list of devices that implement FADT register blocks"), AH_PREDEF ("_FLC", "Flow Control", "Flow control, Resource Descriptor field"), AH_PREDEF ("_FPS", "Fan Performance States", "Returns a list of supported fan performance states"), @@ -332,8 +333,10 @@ const AH_PREDEFINED_NAME AslPredefine AH_PREDEF ("_UPP", "User Presence Polling", "Returns the recommended user presence polling interval"), AH_PREDEF ("_VEN", "Vendor Data", "Resource Descriptor field"), AH_PREDEF ("_VPO", "Video Post Options", "Returns the implemented video post options"), - AH_PREDEF ("_WAK", "Wake", "Inform AML that the system has just awakened"), AH_PREDEF ("_Wxx", "Wake Event", "Method executed as a result of a wake event"), + AH_PREDEF ("_WAK", "Wake", "Inform AML that the system has just awakened"), + AH_PREDEF ("_WPC", "Wireless Power Calibration", "Calibrate power and notify wireless device"), + AH_PREDEF ("_WPP", "Wireless Power Polling", "Get recommended polling interval"), AH_PREDEF (NULL, NULL, NULL) }; Modified: vendor-sys/acpica/dist/source/common/dmextern.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmextern.c Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/source/common/dmextern.c Fri Feb 12 18:53:29 2016 (r295571) @@ -754,6 +754,46 @@ AcpiDmAddPathToExternalList ( /******************************************************************************* * + * FUNCTION: AcpiDmEternalIsMatch + * + * PARAMETERS: NamePath - Path to match to External Name + * ExternalPath - External NamePath to be matched + * + * RETURN: BOOLEAN + * + * DESCRIPTION: Returns TRUE if NamePath matches the last NamePath-length + * characters of ExternalPath. + * + * External (_SB_.DEV0.ABCD) will match: + * _SB_.DEV0.ABCD + * DEV0.ABCD + * ABCD + * + ******************************************************************************/ + +static BOOLEAN +AcpiDmExternalIsMatch ( + const char * NamePath, + const char * ListNamePath) +{ + BOOLEAN Match = FALSE; + + + if (strlen (ListNamePath) >= strlen (NamePath)) + { + if (!strcmp (ListNamePath + + (strlen (ListNamePath) - strlen (NamePath)), NamePath)) + { + return (TRUE); + } + } + + return (Match); +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmCreateNewExternal * * PARAMETERS: ExternalPath - External path to the object @@ -808,11 +848,14 @@ AcpiDmCreateNewExternal ( NextExternal = AcpiGbl_ExternalList; while (NextExternal) { - if (!strcmp (ExternalPath, NextExternal->Path)) + /* Check for duplicates */ + + if (AcpiDmExternalIsMatch (ExternalPath, NextExternal->Path)) { /* Duplicate method, check that the Value (ArgCount) is the same */ if ((NextExternal->Type == ACPI_TYPE_METHOD) && + (NextExternal->Flags & ANOBJ_IS_EXTERNAL) && (NextExternal->Value != Value) && (Value > 0)) { @@ -830,6 +873,11 @@ AcpiDmCreateNewExternal ( NextExternal->Value = Value; } + /* Update flags. */ + + NextExternal->Flags |= Flags; + NextExternal->Flags &= ~ACPI_EXT_INTERNAL_PATH_ALLOCATED; + return_ACPI_STATUS (AE_ALREADY_EXISTS); } @@ -1266,76 +1314,85 @@ appearing in an SSDT, the disassembler d the owning SSDT has been loaded via the -e option. #endif +static char ExternalWarningPart1[600]; +static char ExternalWarningPart2[400]; +static char ExternalWarningPart3[400]; +static char ExternalWarningPart4[200]; + void AcpiDmUnresolvedWarning ( UINT8 Type) { + char *Format; + char Pad[] = " *"; + char NoPad[] = ""; + if (!AcpiGbl_NumExternalMethods) { return; } + if (AcpiGbl_NumExternalMethods == AcpiGbl_ResolvedExternalMethods) + { + return; + } + + Format = Type ? Pad : NoPad; + + sprintf (ExternalWarningPart1, + "%s iASL Warning: There were %u external control methods found during\n" + "%s disassembly, but only %u %s resolved (%u unresolved). Additional\n" + "%s ACPI tables may be required to properly disassemble the code. This\n" + "%s resulting disassembler output file may not compile because the\n" + "%s disassembler did not know how many arguments to assign to the\n" + "%s unresolved methods. Note: SSDTs can be dynamically loaded at\n" + "%s runtime and may or may not be available via the host OS.\n", + Format, AcpiGbl_NumExternalMethods, Format, AcpiGbl_ResolvedExternalMethods, + (AcpiGbl_ResolvedExternalMethods > 1 ? "were" : "was"), + (AcpiGbl_NumExternalMethods - AcpiGbl_ResolvedExternalMethods), + Format, Format, Format, Format, Format); + + sprintf (ExternalWarningPart2, + "%s To specify the tables needed to resolve external control method\n" + "%s references, the -e option can be used to specify the filenames.\n" + "%s Example iASL invocations:\n" + "%s iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml\n" + "%s iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml\n" + "%s iasl -e ssdt*.aml -d dsdt.aml\n", + Format, Format, Format, Format, Format, Format); + + sprintf (ExternalWarningPart3, + "%s In addition, the -fe option can be used to specify a file containing\n" + "%s control method external declarations with the associated method\n" + "%s argument counts. Each line of the file must be of the form:\n" + "%s External (, MethodObj, )\n" + "%s Invocation:\n" + "%s iasl -fe refs.txt -d dsdt.aml\n", + Format, Format, Format, Format, Format, Format); + + sprintf (ExternalWarningPart4, + "%s The following methods were unresolved and many not compile properly\n" + "%s because the disassembler had to guess at the number of arguments\n" + "%s required for each:\n", + Format, Format, Format); + if (Type) { if (!AcpiGbl_ExternalFileList) { /* The -e option was not specified */ - AcpiOsPrintf (" /*\n" - " * iASL Warning: There were %u external control methods found during\n" - " * disassembly, but additional ACPI tables to resolve these externals\n" - " * were not specified. This resulting disassembler output file may not\n" - " * compile because the disassembler did not know how many arguments\n" - " * to assign to these methods. To specify the tables needed to resolve\n" - " * external control method references, the -e option can be used to\n" - " * specify the filenames. Note: SSDTs can be dynamically loaded at\n" - " * runtime and may or may not be available via the host OS.\n" - " * Example iASL invocations:\n" - " * iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml\n" - " * iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml\n" - " * iasl -e ssdt*.aml -d dsdt.aml\n" - " *\n" - " * In addition, the -fe option can be used to specify a file containing\n" - " * control method external declarations with the associated method\n" - " * argument counts. Each line of the file must be of the form:\n" - " * External (, MethodObj, )\n" - " * Invocation:\n" - " * iasl -fe refs.txt -d dsdt.aml\n" - " *\n" - " * The following methods were unresolved and many not compile properly\n" - " * because the disassembler had to guess at the number of arguments\n" - " * required for each:\n" - " */\n", - AcpiGbl_NumExternalMethods); + AcpiOsPrintf (" /*\n%s *\n%s *\n%s *\n%s */\n", + ExternalWarningPart1, ExternalWarningPart2, ExternalWarningPart3, + ExternalWarningPart4); } - else if (AcpiGbl_NumExternalMethods != AcpiGbl_ResolvedExternalMethods) + else { /* The -e option was specified, but there are still some unresolved externals */ - AcpiOsPrintf (" /*\n" - " * iASL Warning: There were %u external control methods found during\n" - " * disassembly, but only %u %s resolved (%u unresolved). Additional\n" - " * ACPI tables may be required to properly disassemble the code. This\n" - " * resulting disassembler output file may not compile because the\n" - " * disassembler did not know how many arguments to assign to the\n" - " * unresolved methods. Note: SSDTs can be dynamically loaded at\n" - " * runtime and may or may not be available via the host OS.\n" - " *\n" - " * If necessary, the -fe option can be used to specify a file containing\n" - " * control method external declarations with the associated method\n" - " * argument counts. Each line of the file must be of the form:\n" - " * External (, MethodObj, )\n" - " * Invocation:\n" - " * iasl -fe refs.txt -d dsdt.aml\n" - " *\n" - " * The following methods were unresolved and many not compile properly\n" - " * because the disassembler had to guess at the number of arguments\n" - " * required for each:\n" - " */\n", - AcpiGbl_NumExternalMethods, AcpiGbl_ResolvedExternalMethods, - (AcpiGbl_ResolvedExternalMethods > 1 ? "were" : "was"), - (AcpiGbl_NumExternalMethods - AcpiGbl_ResolvedExternalMethods)); + AcpiOsPrintf (" /*\n%s *\n *\n */\n", + ExternalWarningPart1, ExternalWarningPart3, ExternalWarningPart4); } } else @@ -1344,50 +1401,15 @@ AcpiDmUnresolvedWarning ( { /* The -e option was not specified */ - fprintf (stderr, "\n" - "iASL Warning: There were %u external control methods found during\n" - "disassembly, but additional ACPI tables to resolve these externals\n" - "were not specified. The resulting disassembler output file may not\n" - "compile because the disassembler did not know how many arguments\n" - "to assign to these methods. To specify the tables needed to resolve\n" - "external control method references, the -e option can be used to\n" - "specify the filenames. Note: SSDTs can be dynamically loaded at\n" - "runtime and may or may not be available via the host OS.\n" - "Example iASL invocations:\n" - " iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml\n" - " iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml\n" - " iasl -e ssdt*.aml -d dsdt.aml\n" - "\n" - "In addition, the -fe option can be used to specify a file containing\n" - "control method external declarations with the associated method\n" - "argument counts. Each line of the file must be of the form:\n" - " External (, MethodObj, )\n" - "Invocation:\n" - " iasl -fe refs.txt -d dsdt.aml\n", - AcpiGbl_NumExternalMethods); + fprintf (stderr, "\n%s\n%s\n%s\n", + ExternalWarningPart1, ExternalWarningPart2, ExternalWarningPart3); } - else if (AcpiGbl_NumExternalMethods != AcpiGbl_ResolvedExternalMethods) + else { /* The -e option was specified, but there are still some unresolved externals */ - fprintf (stderr, "\n" - "iASL Warning: There were %u external control methods found during\n" - "disassembly, but only %u %s resolved (%u unresolved). Additional\n" - "ACPI tables may be required to properly disassemble the code. The\n" - "resulting disassembler output file may not compile because the\n" - "disassembler did not know how many arguments to assign to the\n" - "unresolved methods. Note: SSDTs can be dynamically loaded at\n" - "runtime and may or may not be available via the host OS.\n" - "\n" - "If necessary, the -fe option can be used to specify a file containing\n" - "control method external declarations with the associated method\n" - "argument counts. Each line of the file must be of the form:\n" - " External (, MethodObj, )\n" - "Invocation:\n" - " iasl -fe refs.txt -d dsdt.aml\n", - AcpiGbl_NumExternalMethods, AcpiGbl_ResolvedExternalMethods, - (AcpiGbl_ResolvedExternalMethods > 1 ? "were" : "was"), - (AcpiGbl_NumExternalMethods - AcpiGbl_ResolvedExternalMethods)); + fprintf (stderr, "\n%s\n%s\n", + ExternalWarningPart1, ExternalWarningPart3); } } } Modified: vendor-sys/acpica/dist/source/common/dmtable.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtable.c Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/source/common/dmtable.c Fri Feb 12 18:53:29 2016 (r295571) @@ -196,6 +196,7 @@ static const char *AcpiDmHestS "PCI Express AER (AER Endpoint)", "PCI Express/PCI-X Bridge AER", "Generic Hardware Error Source", + "Generic Hardware Error Source V2", "Unknown Subtable Type" /* Reserved */ }; Modified: vendor-sys/acpica/dist/source/common/dmtables.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtables.c Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/source/common/dmtables.c Fri Feb 12 18:53:29 2016 (r295571) @@ -145,6 +145,11 @@ AdCreateTableHeader ( UINT8 Checksum; + /* Reset globals for External statements */ + + AcpiGbl_NumExternalMethods = 0; + AcpiGbl_ResolvedExternalMethods = 0; + /* * Print file header and dump original table header */ Modified: vendor-sys/acpica/dist/source/common/dmtbdump.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtbdump.c Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/source/common/dmtbdump.c Fri Feb 12 18:53:29 2016 (r295571) @@ -1616,6 +1616,12 @@ AcpiDmDumpHest ( SubTableLength = sizeof (ACPI_HEST_GENERIC); break; + case ACPI_HEST_TYPE_GENERIC_ERROR_V2: + + InfoTable = AcpiDmTableInfoHest10; + SubTableLength = sizeof (ACPI_HEST_GENERIC_V2); + break; + default: /* Cannot continue on unknown type - no length */ Modified: vendor-sys/acpica/dist/source/common/dmtbinfo.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtbinfo.c Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/source/common/dmtbinfo.c Fri Feb 12 18:53:29 2016 (r295571) @@ -163,6 +163,7 @@ #define ACPI_HEST7_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_AER,f) #define ACPI_HEST8_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_AER_BRIDGE,f) #define ACPI_HEST9_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_GENERIC,f) +#define ACPI_HEST10_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_GENERIC_V2,f) #define ACPI_HESTN_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_NOTIFY,f) #define ACPI_HESTB_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_ERROR_BANK,f) #define ACPI_IORT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_ITS_GROUP,f) @@ -1342,6 +1343,26 @@ ACPI_DMTABLE_INFO AcpiDmTableI ACPI_DMT_TERMINATOR }; +/* 10: Generic Hardware Error Source - Version 2 */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoHest10[] = +{ + ACPI_DM_HEST_HEADER, + {ACPI_DMT_UINT16, ACPI_HEST10_OFFSET (RelatedSourceId), "Related Source Id", 0}, + {ACPI_DMT_UINT8, ACPI_HEST10_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT8, ACPI_HEST10_OFFSET (Enabled), "Enabled", 0}, + {ACPI_DMT_UINT32, ACPI_HEST10_OFFSET (RecordsToPreallocate), "Records To Preallocate", 0}, + {ACPI_DMT_UINT32, ACPI_HEST10_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record", 0}, + {ACPI_DMT_UINT32, ACPI_HEST10_OFFSET (MaxRawDataLength), "Max Raw Data Length", 0}, + {ACPI_DMT_GAS, ACPI_HEST10_OFFSET (ErrorStatusAddress), "Error Status Address", 0}, + {ACPI_DMT_HESTNTFY, ACPI_HEST10_OFFSET (Notify), "Notify", 0}, + {ACPI_DMT_UINT32, ACPI_HEST10_OFFSET (ErrorBlockLength), "Error Status Block Length", 0}, + {ACPI_DMT_GAS, ACPI_HEST10_OFFSET (ReadAckRegister), "Read Ack Register", 0}, + {ACPI_DMT_UINT64, ACPI_HEST10_OFFSET (ReadAckPreserve), "Read Ack Preserve", 0}, + {ACPI_DMT_UINT64, ACPI_HEST10_OFFSET (ReadAckWrite), "Read Ack Write", 0}, + ACPI_DMT_TERMINATOR +}; + ACPI_DMTABLE_INFO AcpiDmTableInfoHestNotify[] = { {ACPI_DMT_HESTNTYP, ACPI_HESTN_OFFSET (Type), "Notify Type", 0}, @@ -2141,6 +2162,7 @@ ACPI_DMTABLE_INFO AcpiDmTableI {ACPI_DMT_FLAG3, ACPI_NFIT1_FLAG_OFFSET (Flags,0), "Device not armed", 0}, {ACPI_DMT_FLAG4, ACPI_NFIT1_FLAG_OFFSET (Flags,0), "Health events observed", 0}, {ACPI_DMT_FLAG5, ACPI_NFIT1_FLAG_OFFSET (Flags,0), "Health events enabled", 0}, + {ACPI_DMT_FLAG6, ACPI_NFIT1_FLAG_OFFSET (Flags,0), "Mapping failed", 0}, {ACPI_DMT_UINT16, ACPI_NFIT1_OFFSET (Reserved), "Reserved", 0}, ACPI_DMT_TERMINATOR }; Modified: vendor-sys/acpica/dist/source/compiler/aslanalyze.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslanalyze.c Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/source/compiler/aslanalyze.c Fri Feb 12 18:53:29 2016 (r295571) @@ -308,6 +308,12 @@ AnCheckMethodReturnValue ( Node = ArgOp->Asl.Node; + if (!Node) + { + /* No error message, this can happen and is OK */ + + return; + } /* Examine the parent op of this method */ Modified: vendor-sys/acpica/dist/source/compiler/aslbtypes.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslbtypes.c Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/source/compiler/aslbtypes.c Fri Feb 12 18:53:29 2016 (r295571) @@ -408,12 +408,25 @@ AnGetBtype ( Node = Op->Asl.Node; if (!Node) { + /* These are not expected to have a node at this time */ + + if ((Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CREATEWORDFIELD) || + (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CREATEDWORDFIELD) || + (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CREATEQWORDFIELD) || + (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CREATEBYTEFIELD) || + (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CREATEBITFIELD) || + (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CREATEFIELD) || + (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CONDREFOF)) + { + return (ACPI_UINT32_MAX - 1); + } + DbgPrint (ASL_DEBUG_OUTPUT, "No attached Nsnode: [%s] at line %u name [%s], " - "ignoring typecheck\n", + "ignoring typecheck. Parent [%s]\n", Op->Asl.ParseOpName, Op->Asl.LineNumber, - Op->Asl.ExternalName); - return (ACPI_UINT32_MAX); + Op->Asl.ExternalName, Op->Asl.Parent->Asl.ParseOpName); + return (ACPI_UINT32_MAX - 1); } ThisNodeBtype = AnMapEtypeToBtype (Node->Type); Modified: vendor-sys/acpica/dist/source/compiler/aslcodegen.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcodegen.c Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/source/compiler/aslcodegen.c Fri Feb 12 18:53:29 2016 (r295571) @@ -97,22 +97,16 @@ CgGenerateAmlOutput ( void) { - DbgPrint (ASL_DEBUG_OUTPUT, "\nWriting AML\n\n"); - /* Generate the AML output file */ FlSeekFile (ASL_FILE_SOURCE_OUTPUT, 0); Gbl_SourceLine = 0; Gbl_NextError = Gbl_ErrorLog; - TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD, CgAmlWriteWalk, NULL, NULL); - DbgPrint (ASL_TREE_OUTPUT, - "%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr" - " Parent Child Next Flags AcTyp Final Col L# EL# LL# ELL#\n", - 76, " "); - + DbgPrint (ASL_TREE_OUTPUT, ASL_PARSE_TREE_HEADER2); CgCloseTable (); } @@ -136,40 +130,43 @@ CgAmlWriteWalk ( void *Context) { - /* - * Print header at level 0. Alignment assumes 32-bit pointers - */ - if (!Level) + /* Generate the AML for this node */ + + CgWriteNode (Op); + + if (!Gbl_DebugFlag) { - DbgPrint (ASL_TREE_OUTPUT, - "Final parse tree used for AML output:\n"); - DbgPrint (ASL_TREE_OUTPUT, - "%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr" - " Parent Child Next Flags AcTyp Final Col L# EL# LL# ELL#\n", - 76, " "); + return (AE_OK); } - /* Debug output */ - - DbgPrint (ASL_TREE_OUTPUT, - "%5.5d [%2d]", Op->Asl.LogicalLineNumber, Level); - UtPrintFormattedName (Op->Asl.ParseOpcode, Level); + /* Print header at level 0. Alignment assumes 32-bit pointers */ - if (Op->Asl.ParseOpcode == PARSEOP_NAMESEG || - Op->Asl.ParseOpcode == PARSEOP_NAMESTRING || - Op->Asl.ParseOpcode == PARSEOP_METHODCALL) + if (!Level) { DbgPrint (ASL_TREE_OUTPUT, - "%10.32s ", Op->Asl.ExternalName); + "\nFinal parse tree used for AML output:\n"); + DbgPrint (ASL_TREE_OUTPUT, ASL_PARSE_TREE_HEADER2); } - else + + /* Dump ParseOp name and possible value */ + + switch (Op->Asl.ParseOpcode) { - DbgPrint (ASL_TREE_OUTPUT, " "); + case PARSEOP_NAMESEG: + case PARSEOP_NAMESTRING: + case PARSEOP_METHODCALL: + case PARSEOP_STRING_LITERAL: + + UtDumpStringOp (Op, Level); + break; + + default: + + UtDumpBasicOp (Op, Level); + break; } - DbgPrint (ASL_TREE_OUTPUT, - "%08X %04X %04X %01X %04X %04X %04X %04X " - "%08X %08X %08X %08X %08X %08X %04X %02d %02d %02d %02d %02d\n", + DbgPrint (ASL_TREE_OUTPUT, ASL_PARSE_TREE_DEBUG2, /* 1 */ (UINT32) Op->Asl.Value.Integer, /* 2 */ Op->Asl.ParseOpcode, /* 3 */ Op->Asl.AmlOpcode, @@ -191,9 +188,6 @@ CgAmlWriteWalk ( /* 19 */ Op->Asl.LogicalLineNumber, /* 20 */ Op->Asl.EndLogicalLine); - /* Generate the AML for this node */ - - CgWriteNode (Op); return (AE_OK); } @@ -558,7 +552,7 @@ CgCloseTable ( /* Process all definition blocks */ - Op = RootNode->Asl.Child; + Op = Gbl_ParseTreeRoot->Asl.Child; while (Op) { CgUpdateHeader (Op); @@ -590,7 +584,6 @@ CgWriteNode ( /* TBD: this may not be the best place for this check */ if ((Op->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG) || - (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL) || (Op->Asl.ParseOpcode == PARSEOP_INCLUDE) || (Op->Asl.ParseOpcode == PARSEOP_INCLUDE_END)) { Modified: vendor-sys/acpica/dist/source/compiler/aslcompile.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompile.c Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/source/compiler/aslcompile.c Fri Feb 12 18:53:29 2016 (r295571) @@ -138,7 +138,7 @@ CmDoCompile ( /* Did the parse tree get successfully constructed? */ - if (!RootNode) + if (!Gbl_ParseTreeRoot) { /* * If there are no errors, then we have some sort of @@ -166,22 +166,22 @@ CmDoCompile ( LsDumpParseTree (); - OpcGetIntegerWidth (RootNode->Asl.Child); + OpcGetIntegerWidth (Gbl_ParseTreeRoot->Asl.Child); UtEndEvent (Event); /* Pre-process parse tree for any operator transforms */ Event = UtBeginEvent ("Parse tree transforms"); DbgPrint (ASL_DEBUG_OUTPUT, "\nParse tree transforms\n\n"); - TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, - TrAmlTransformWalk, NULL, NULL); + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE, + TrAmlTransformWalkBegin, TrAmlTransformWalkEnd, NULL); UtEndEvent (Event); /* Generate AML opcodes corresponding to the parse tokens */ Event = UtBeginEvent ("Generate AML opcodes"); - DbgPrint (ASL_DEBUG_OUTPUT, "\nGenerating AML opcodes\n\n"); - TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL, + DbgPrint (ASL_DEBUG_OUTPUT, "Generating AML opcodes\n\n"); + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL, OpcAmlOpcodeWalk, NULL); UtEndEvent (Event); @@ -203,11 +203,11 @@ CmDoCompile ( Event = UtBeginEvent ("Constant folding via AML interpreter"); DbgPrint (ASL_DEBUG_OUTPUT, - "\nInterpreting compile-time constant expressions\n\n"); + "Interpreting compile-time constant expressions\n\n"); if (Gbl_FoldConstants) { - TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD, OpcAmlConstantWalk, NULL, NULL); } else @@ -220,16 +220,16 @@ CmDoCompile ( Event = UtBeginEvent ("Updating AML opcodes after constant folding"); DbgPrint (ASL_DEBUG_OUTPUT, - "\nUpdating AML opcodes after constant folding\n\n"); - TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, + "Updating AML opcodes after constant folding\n\n"); + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL, OpcAmlOpcodeUpdateWalk, NULL); UtEndEvent (Event); /* Calculate all AML package lengths */ Event = UtBeginEvent ("Generate AML package lengths"); - DbgPrint (ASL_DEBUG_OUTPUT, "\nGenerating Package lengths\n\n"); - TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL, + DbgPrint (ASL_DEBUG_OUTPUT, "Generating Package lengths\n\n"); + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL, LnPackageLengthWalk, NULL); UtEndEvent (Event); @@ -255,7 +255,8 @@ CmDoCompile ( /* Namespace loading */ Event = UtBeginEvent ("Create ACPI Namespace"); - Status = LdLoadNamespace (RootNode); + DbgPrint (ASL_DEBUG_OUTPUT, "Creating ACPI Namespace\n\n"); + Status = LdLoadNamespace (Gbl_ParseTreeRoot); UtEndEvent (Event); if (ACPI_FAILURE (Status)) { @@ -266,6 +267,7 @@ CmDoCompile ( AslGbl_NamespaceEvent = UtBeginEvent ( "Cross reference parse tree and Namespace"); + DbgPrint (ASL_DEBUG_OUTPUT, "Cross referencing namespace\n\n"); Status = XfCrossReferenceNamespace (); if (ACPI_FAILURE (Status)) { @@ -277,6 +279,14 @@ CmDoCompile ( LkFindUnreferencedObjects (); UtEndEvent (AslGbl_NamespaceEvent); + /* Resolve External Declarations */ + + Event = UtBeginEvent ("Resolve all Externals"); + DbgPrint (ASL_DEBUG_OUTPUT, "\nResolve Externals\n\n"); + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE, + ExAmlExternalWalkBegin, ExAmlExternalWalkEnd, NULL); + UtEndEvent (Event); + /* * Semantic analysis. This can happen only after the * namespace has been loaded and cross-referenced. @@ -286,17 +296,30 @@ CmDoCompile ( Event = UtBeginEvent ("Analyze control method return types"); AnalysisWalkInfo.MethodStack = NULL; - DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Method analysis\n\n"); - TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE, + DbgPrint (ASL_DEBUG_OUTPUT, "Semantic analysis - Method analysis\n\n"); + + if (Gbl_CrossReferenceOutput) + { + OtPrintHeaders ("Part 1: Object Reference Map " + "(Object references from within each control method)"); + } + + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE, MtMethodAnalysisWalkBegin, MtMethodAnalysisWalkEnd, &AnalysisWalkInfo); UtEndEvent (Event); + /* Generate the object cross-reference file if requested */ + + Event = UtBeginEvent ("Generate cross-reference file"); + OtCreateXrefFile (); + UtEndEvent (Event); + /* Semantic error checking part two - typing of method returns */ Event = UtBeginEvent ("Determine object types returned by methods"); - DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Method typing\n\n"); - TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, + DbgPrint (ASL_DEBUG_OUTPUT, "Semantic analysis - Method typing\n\n"); + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL, AnMethodTypingWalkEnd, NULL); UtEndEvent (Event); @@ -304,10 +327,10 @@ CmDoCompile ( Event = UtBeginEvent ("Analyze AML operand types"); DbgPrint (ASL_DEBUG_OUTPUT, - "\nSemantic analysis - Operand type checking\n\n"); + "Semantic analysis - Operand type checking\n\n"); if (Gbl_DoTypechecking) { - TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL, AnOperandTypecheckWalkEnd, &AnalysisWalkInfo); } UtEndEvent (Event); @@ -315,8 +338,8 @@ CmDoCompile ( /* Semantic error checking part four - other miscellaneous checks */ Event = UtBeginEvent ("Miscellaneous analysis"); - DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - miscellaneous\n\n"); - TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, + DbgPrint (ASL_DEBUG_OUTPUT, "Semantic analysis - miscellaneous\n\n"); + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD, AnOtherSemanticAnalysisWalkBegin, NULL, &AnalysisWalkInfo); UtEndEvent (Event); @@ -324,16 +347,17 @@ CmDoCompile ( /* Calculate all AML package lengths */ Event = UtBeginEvent ("Finish AML package length generation"); - DbgPrint (ASL_DEBUG_OUTPUT, "\nGenerating Package lengths\n\n"); - TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL, + DbgPrint (ASL_DEBUG_OUTPUT, "Generating Package lengths\n\n"); + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL, LnInitLengthsWalk, NULL); - TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL, + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL, LnPackageLengthWalk, NULL); UtEndEvent (Event); /* Code generation - emit the AML */ Event = UtBeginEvent ("Generate AML code and write output files"); + DbgPrint (ASL_DEBUG_OUTPUT, "Writing AML byte code\n\n"); CgGenerateAmlOutput (); UtEndEvent (Event); @@ -816,7 +840,7 @@ CmDeleteCaches ( Gbl_ParseOpCount = 0; Gbl_ParseOpCacheNext = NULL; Gbl_ParseOpCacheLast = NULL; - RootNode = NULL; + Gbl_ParseTreeRoot = NULL; /* Generic string cache */ Modified: vendor-sys/acpica/dist/source/compiler/aslcompiler.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompiler.h Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/source/compiler/aslcompiler.h Fri Feb 12 18:53:29 2016 (r295571) @@ -652,7 +652,13 @@ ApCheckPackage ( * asltransform - parse tree transformations */ ACPI_STATUS -TrAmlTransformWalk ( +TrAmlTransformWalkBegin ( + ACPI_PARSE_OBJECT *Op, + UINT32 Level, + void *Context); + +ACPI_STATUS +TrAmlTransformWalkEnd ( ACPI_PARSE_OBJECT *Op, UINT32 Level, void *Context); @@ -669,6 +675,25 @@ TrWalkParseTree ( ASL_WALK_CALLBACK AscendingCallback, void *Context); +/* + * aslexternal - External opcode support + */ +ACPI_STATUS +ExAmlExternalWalkBegin ( + ACPI_PARSE_OBJECT *Op, + UINT32 Level, + void *Context); + +ACPI_STATUS +ExAmlExternalWalkEnd ( + ACPI_PARSE_OBJECT *Op, + UINT32 Level, + void *Context); + +void +ExDoExternal ( + ACPI_PARSE_OBJECT *Op); + /* Values for "Visitation" parameter above */ #define ASL_WALK_VISIT_DOWNWARD 0x01 @@ -909,6 +934,24 @@ XfCrossReferenceNamespace ( /* + * aslxrefout + */ +void +OtPrintHeaders ( + char *Message); + +void +OtCreateXrefFile ( + void); + +void +OtXrefWalkPart1 ( + ACPI_PARSE_OBJECT *Op, + UINT32 Level, + ASL_METHOD_INFO *MethodInfo); + + +/* * aslutils - common compiler utilites */ void @@ -923,11 +966,31 @@ DbgPrint ( #define ASL_PARSE_OUTPUT 1 #define ASL_TREE_OUTPUT 2 +UINT8 +UtIsBigEndianMachine ( + void); + BOOLEAN UtQueryForOverwrite ( char *Pathname); void +UtDumpStringOp ( + ACPI_PARSE_OBJECT *Op, + UINT32 Level); + +void +UtDumpIntegerOp ( + ACPI_PARSE_OBJECT *Op, + UINT32 Level, + UINT32 IntegerLength); + +void +UtDumpBasicOp ( *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Feb 12 18:54:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BA3EAA785F; Fri, 12 Feb 2016 18:54:22 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 346AD15F5; Fri, 12 Feb 2016 18:54:22 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1CIsLxM094945; Fri, 12 Feb 2016 18:54:21 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1CIsLCo094944; Fri, 12 Feb 2016 18:54:21 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201602121854.u1CIsLCo094944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 12 Feb 2016 18:54:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295572 - vendor-sys/acpica/20160212 X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 18:54:22 -0000 Author: jkim Date: Fri Feb 12 18:54:21 2016 New Revision: 295572 URL: https://svnweb.freebsd.org/changeset/base/295572 Log: Tag ACPICA 20160212. Added: vendor-sys/acpica/20160212/ - copied from r295571, vendor-sys/acpica/dist/ From owner-svn-src-all@freebsd.org Fri Feb 12 19:53:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 887C4AA72E0; Fri, 12 Feb 2016 19:53:35 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 52B1180C; Fri, 12 Feb 2016 19:53:34 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id C4C601A4096; Sat, 13 Feb 2016 06:53:26 +1100 (AEDT) Date: Sat, 13 Feb 2016 06:53:25 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Marius Strobl cc: Michal Meloun , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295557 - head/sys/dev/uart In-Reply-To: <20160212164755.GC4980@alchemy.franken.de> Message-ID: <20160213041246.V1974@besplex.bde.org> References: <201602120514.u1C5EwWt053622@repo.freebsd.org> <20160212164755.GC4980@alchemy.franken.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=PfoC/XVd c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=e1hDg8Xxpqo5XIWwGXQA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 19:53:35 -0000 On Fri, 12 Feb 2016, Marius Strobl wrote: > On Fri, Feb 12, 2016 at 05:14:58AM +0000, Michal Meloun wrote: >> Author: mmel >> Date: Fri Feb 12 05:14:58 2016 >> New Revision: 295557 >> URL: https://svnweb.freebsd.org/changeset/base/295557 >> >> Log: >> UART: Fix spurious interrupts generated by ns8250 and lpc drivers: >> - don't enable transmitter empty interrupt before filling TX FIFO. > > Are you sure this doesn't create a race that leads to lost TX ready > interrupts? For a single character, the TX FIFO very well may be empty > again at the point in time IER_ETXRDY is enabled now. With the varying > behavior of 8250/16x50 chips - some of which is documented in sio(4) - That is mostly FUD. More likely driver bugs than chip bugs. A non-broken xx50 interrupts after you (re)enable tx interrupts, iff the fifo is already empty. This gives a "spurious" interrupt. But perhaps depending on this is too fragile. Normal operation is to keep the tx interrupt enabled and depend on writing to the fifo causing a tx interrupt later. But it is a more common chip bug for tx interrupts later to not go away when they should (normally by reading the IIR), so some drivers toggle the tx interrupt enable dynamically. An example of a driver bug is only enabling tx interrupts for this. It takes a transition of the interrupt enable bit from off to on to get the interrupt. Other driver bugs may result in a missing transition because the bit was supposed to be off but is actually on. > I'd expect there are many that no longer generate a TX ready at all > with this change in place. In this case, receiving spurious interrupts > (which ones? IIR_NOPEND? IIR_TXRDY?) with some devices appears to be > the lesser evil. Not many. Only broken ones. The "spurious" interrupts are just normal ones from bon-broken chips: - uart first does a potentially-unbounded busy-wait before the doing anything to ensure that the fifo is empty. This should be unecessary since this function should not be called unless sc_txbusy is 0 and sc_txbusy should be nonzero if the fifo is not empty. If it is called when the fifo is not emptu, then the worst-case busy-wait is approx. 640 seconds for a 128-byte fifo at 2 bps. The 'broken_txfifo case' busy-waits for a long time in normal operation. - enabling the tx interrupt causes one immediately on non-broken uarts - the interrupt handler is normally called immediately. Then it always blocks on uart_lock() - then the main code fills the fifo and unlocks - then the interrupt handler runs. It normally finds that the fifo is not empty (since it has just been filled) and does nothing - another tx interrupt occurs later and the interrupt handler runs again. It normally doesn't hit the lock again, and normally finds the fifo empty, so it does something. But you are probably correct that a 1-byte write to the fifo often loses the race. This depends on how fast the hardware moves the byte from the fifo to the tx register. Actually, since we didn't wait for the tx register to become empty, it will often take a full character time before the move. After that, I think it might take 1 bit time but no more. sio uses a timeout to recover from lost output interrupts in case they occur because the driver or hardware has unforseen bugs. This works too well. It hides bugs like interrupts not working at all provided the fifo size is larger enough for the low timeout frequency to give enough throughput. On newer systems, the overhead for timeouts is in the noise compared with the overhead for bus accesses (especially reads), so a simple timeout method is almost as good as an interrupt-driven method. It can probably be even better for output by calculating times to avoid slow reads of status registers to see how far the chip got. Bruce From owner-svn-src-all@freebsd.org Fri Feb 12 20:14:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26259AA79D9; Fri, 12 Feb 2016 20:14:05 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 EB7E0105E; Fri, 12 Feb 2016 20:14:04 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1CKE4gf019731; Fri, 12 Feb 2016 20:14:04 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1CKE3d6019729; Fri, 12 Feb 2016 20:14:03 GMT (envelope-from np@FreeBSD.org) Message-Id: <201602122014.u1CKE3d6019729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 12 Feb 2016 20:14:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295573 - in head/sys/dev/cxgbe: . common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 20:14:05 -0000 Author: np Date: Fri Feb 12 20:14:03 2016 New Revision: 295573 URL: https://svnweb.freebsd.org/changeset/base/295573 Log: Remove duplicate definition (CPL_TRACE_PKT_T5). Modified: head/sys/dev/cxgbe/common/t4_msg.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/common/t4_msg.h ============================================================================== --- head/sys/dev/cxgbe/common/t4_msg.h Fri Feb 12 18:54:21 2016 (r295572) +++ head/sys/dev/cxgbe/common/t4_msg.h Fri Feb 12 20:14:03 2016 (r295573) @@ -126,7 +126,6 @@ enum { CPL_RDMA_IMM_DATA_SE = 0xAD, CPL_TRACE_PKT = 0xB0, - CPL_TRACE_PKT_T5 = 0x48, CPL_RX2TX_DATA = 0xB1, CPL_ISCSI_DATA = 0xB2, CPL_FCOE_DATA = 0xB3, Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Feb 12 18:54:21 2016 (r295572) +++ head/sys/dev/cxgbe/t4_main.c Fri Feb 12 20:14:03 2016 (r295573) @@ -708,7 +708,7 @@ t4_attach(device_t dev) sc->fw_msg_handler[i] = fw_msg_not_handled; t4_register_cpl_handler(sc, CPL_SET_TCB_RPL, t4_filter_rpl); t4_register_cpl_handler(sc, CPL_TRACE_PKT, t4_trace_pkt); - t4_register_cpl_handler(sc, CPL_TRACE_PKT_T5, t5_trace_pkt); + t4_register_cpl_handler(sc, CPL_T5_TRACE_PKT, t5_trace_pkt); t4_init_sge_cpl_handlers(sc); /* Prepare the adapter for operation */ From owner-svn-src-all@freebsd.org Fri Feb 12 20:29:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C1BDAA61C0; Fri, 12 Feb 2016 20:29:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 133D71E8E; Fri, 12 Feb 2016 20:29:51 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 58B45D46744; Sat, 13 Feb 2016 07:29:49 +1100 (AEDT) Date: Sat, 13 Feb 2016 07:29:48 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295561 - in head: include sys/mips/include sys/powerpc/include sys/sparc64/include sys/sys sys/x86/include In-Reply-To: <20160212173641.GV91220@kib.kiev.ua> Message-ID: <20160213070506.N2501@besplex.bde.org> References: <201602120738.u1C7cKpq093956@repo.freebsd.org> <20160212232717.P894@besplex.bde.org> <20160212143630.GS91220@kib.kiev.ua> <20160213021939.S1340@besplex.bde.org> <20160212173641.GV91220@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=R4L+YolX c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=k41GPJUOWNQkfJVGFsEA:9 a=rDLYWgRMfs3qs9-j:21 a=ljb_BbTqrRM-5nSN:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 20:29:52 -0000 On Fri, 12 Feb 2016, Konstantin Belousov wrote: > On Sat, Feb 13, 2016 at 03:56:42AM +1100, Bruce Evans wrote: >> Our Standard C namespace is a subset of the POSIX namespace. Most >> Standard C headers are (were) careful about this. There aren't many >> Standard C headers or versions of Standard C or large variations in the >> versions, so this is relatively easy to do. >> >> We also attempt to use POSIX visibility ifdefs. This is not done so >> carefully, and has more bugs due to more variations. But >> does it fairly carefully. It has ifdefs for XSI, POSIX >= 2001, >> >> I find the ifdefs useful for seeing when POSIX introduced a feature >> but not for actual use to compile under an old standard. > > So you are about the ANSI C & non-POSIX compilation environment ? > Do you mean the following: > > diff --git a/include/signal.h b/include/signal.h > index 33be55c..31cded7 100644 > --- a/include/signal.h > +++ b/include/signal.h > @@ -36,8 +36,10 @@ > #include > #include > #include > +#if __POSIX_VISIBLE || __XSI_VISIBLE > #include > #include > +#endif > > #if __BSD_VISIBLE > /* > > I can change #if __POSIX_VISIBLE to some version cap, if you prefer. It needs a version number to be correct. Plain __POSIX_VISIBLE means all versions. __POSIX_VISBLE >= 200112 is probably good enough for the POSIX part. I don't know the correct number for XSI. Perhaps it can be simply omitted. _XOPEN_SOURCE >= 600 gives __XSI_VISIBLE >= 600 && _POSIX_C_SOURCE >= 200112. So __XSI_VISIBLE in the above is only to support XSI before 2001. We only support 1 XSI before that -- #500 which corresponds to 1996 POSIX. Very likely XSI did have ucontext_t then, so the above ifdef is correct. It is just hard to read. Easier than google hits though :-). I found a gnu man page about getcontext() being in SVID but couldn't easily find the history. Bruce From owner-svn-src-all@freebsd.org Fri Feb 12 20:43:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F6FCAA6AF3; Fri, 12 Feb 2016 20:43:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 6CAAF1AE4; Fri, 12 Feb 2016 20:43:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1CKhrrN029331; Fri, 12 Feb 2016 20:43:53 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1CKhrxK029330; Fri, 12 Feb 2016 20:43:53 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201602122043.u1CKhrxK029330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 12 Feb 2016 20:43:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295574 - head/sys/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 20:43:54 -0000 Author: markj Date: Fri Feb 12 20:43:53 2016 New Revision: 295574 URL: https://svnweb.freebsd.org/changeset/base/295574 Log: Clear the cookie pointer on error in tmpfs_readdir(). It is otherwise left dangling, and callers that request cookies always free the cookie buffer, even when VOP_READDIR(9) returns an error. This results in a double free if tmpfs_readdir() returns an error to the NFS server or the Linux getdents(2) emulation code. Reported by: pho MFC after: 1 week Security: double free of malloc(9)-backed memory Sponsored by: EMC / Isilon Storage Division Modified: head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Fri Feb 12 20:14:03 2016 (r295573) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Fri Feb 12 20:43:53 2016 (r295574) @@ -1191,8 +1191,11 @@ tmpfs_readdir(struct vop_readdir_args *v if (error == EJUSTRETURN) error = (uio->uio_resid != startresid) ? 0 : EINVAL; - if (error != 0 && cookies != NULL) + if (error != 0 && cookies != NULL && ncookies != NULL) { free(*cookies, M_TEMP); + *cookies = NULL; + *ncookies = 0; + } if (eofflag != NULL) *eofflag = From owner-svn-src-all@freebsd.org Fri Feb 12 20:46:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CADCAA6C9C; Fri, 12 Feb 2016 20:46:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 EE0761EA0; Fri, 12 Feb 2016 20:46:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1CKkrK8029741; Fri, 12 Feb 2016 20:46:53 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1CKkrYn029740; Fri, 12 Feb 2016 20:46:53 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201602122046.u1CKkrYn029740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 12 Feb 2016 20:46:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295575 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 20:46:55 -0000 Author: markj Date: Fri Feb 12 20:46:53 2016 New Revision: 295575 URL: https://svnweb.freebsd.org/changeset/base/295575 Log: Remove some unreferenced NDP debug variable definitions. MFC after: 1 week Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Fri Feb 12 20:43:53 2016 (r295574) +++ head/sys/netinet6/nd6.c Fri Feb 12 20:46:53 2016 (r295575) @@ -113,11 +113,6 @@ VNET_DEFINE(int, nd6_debug) = 0; static eventhandler_tag lle_event_eh, iflladdr_event_eh; -/* for debugging? */ -#if 0 -static int nd6_inuse, nd6_allocated; -#endif - VNET_DEFINE(struct nd_drhead, nd_defrouter); VNET_DEFINE(struct nd_prhead, nd_prefix); From owner-svn-src-all@freebsd.org Fri Feb 12 20:52:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 893AEAA7037; Fri, 12 Feb 2016 20:52:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 3CB326D3; Fri, 12 Feb 2016 20:52:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1CKqsbt032654; Fri, 12 Feb 2016 20:52:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1CKqsIl032652; Fri, 12 Feb 2016 20:52:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201602122052.u1CKqsIl032652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 12 Feb 2016 20:52:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295576 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 20:52:55 -0000 Author: markj Date: Fri Feb 12 20:52:53 2016 New Revision: 295576 URL: https://svnweb.freebsd.org/changeset/base/295576 Log: Fix style around allocations from M_IP6NDP. - Don't cast the return value of malloc(9). - Use M_ZERO instead of explicitly calling bzero(9). MFC after: 1 week Modified: head/sys/netinet6/nd6.c head/sys/netinet6/nd6_rtr.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Fri Feb 12 20:46:53 2016 (r295575) +++ head/sys/netinet6/nd6.c Fri Feb 12 20:52:53 2016 (r295576) @@ -243,7 +243,7 @@ nd6_ifattach(struct ifnet *ifp) { struct nd_ifinfo *nd; - nd = (struct nd_ifinfo *)malloc(sizeof(*nd), M_IP6NDP, M_WAITOK|M_ZERO); + nd = malloc(sizeof(*nd), M_IP6NDP, M_WAITOK | M_ZERO); nd->initialized = 1; nd->chlim = IPV6_DEFHLIM; Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Fri Feb 12 20:46:53 2016 (r295575) +++ head/sys/netinet6/nd6_rtr.c Fri Feb 12 20:52:53 2016 (r295576) @@ -779,11 +779,10 @@ defrtrlist_update(struct nd_defrouter *n if (new->rtlifetime == 0) return (NULL); - n = (struct nd_defrouter *)malloc(sizeof(*n), M_IP6NDP, M_NOWAIT); + n = malloc(sizeof(*n), M_IP6NDP, M_NOWAIT | M_ZERO); if (n == NULL) return (NULL); - bzero(n, sizeof(*n)); - *n = *new; + memcpy(n, new, sizeof(*n)); insert: /* @@ -826,10 +825,9 @@ pfxrtr_add(struct nd_prefix *pr, struct { struct nd_pfxrouter *new; - new = (struct nd_pfxrouter *)malloc(sizeof(*new), M_IP6NDP, M_NOWAIT); + new = malloc(sizeof(*new), M_IP6NDP, M_NOWAIT | M_ZERO); if (new == NULL) return; - bzero(new, sizeof(*new)); new->router = dr; LIST_INSERT_HEAD(&pr->ndpr_advrtrs, new, pfr_entry); @@ -869,10 +867,9 @@ nd6_prelist_add(struct nd_prefixctl *pr, int error = 0; char ip6buf[INET6_ADDRSTRLEN]; - new = (struct nd_prefix *)malloc(sizeof(*new), M_IP6NDP, M_NOWAIT); + new = malloc(sizeof(*new), M_IP6NDP, M_NOWAIT | M_ZERO); if (new == NULL) - return(ENOMEM); - bzero(new, sizeof(*new)); + return (ENOMEM); new->ndpr_ifp = pr->ndpr_ifp; new->ndpr_prefix = pr->ndpr_prefix; new->ndpr_plen = pr->ndpr_plen; From owner-svn-src-all@freebsd.org Fri Feb 12 20:54:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 690F1AA70DA; Fri, 12 Feb 2016 20:54:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 35F5588B; Fri, 12 Feb 2016 20:54:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1CKs43p032754; Fri, 12 Feb 2016 20:54:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1CKs3RS032739; Fri, 12 Feb 2016 20:54:03 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602122054.u1CKs3RS032739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 12 Feb 2016 20:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295577 - in head: contrib/elftoolchain/addr2line contrib/elftoolchain/ar contrib/elftoolchain/brandelf contrib/elftoolchain/common contrib/elftoolchain/cxxfilt contrib/elftoolchain/elf... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 20:54:05 -0000 Author: emaste Date: Fri Feb 12 20:54:02 2016 New Revision: 295577 URL: https://svnweb.freebsd.org/changeset/base/295577 Log: Update ELF Tool Chain to upstream rev 3400 Some notable improvements include: readelf: - Add AArch64 relocation definitions. - Report value of unknown relocation types. elfcopy: - Consider symbols with STB_GNU_UNIQUE binding as global symbols. - Fixed support for VMA adjustment for loadable sections found in relocatable objects. - Handle nameless global symbols. - Improve wildcard matching for !-prefixed symbols. - Add PE/COFF support. elfdump: - Improve section type reporting. - Add MIPS-specific section types. This update also includes a significant number of bug fixes. PR: 207091 [exp-run] Sponsored by: The FreeBSD Foundation Added: head/contrib/elftoolchain/addr2line/os.NetBSD.mk - copied unchanged from r295484, vendor/elftoolchain/dist/addr2line/os.NetBSD.mk head/contrib/elftoolchain/elfcopy/pe.c - copied unchanged from r295484, vendor/elftoolchain/dist/elfcopy/pe.c head/contrib/elftoolchain/elfdump/os.NetBSD.mk - copied unchanged from r295484, vendor/elftoolchain/dist/elfdump/os.NetBSD.mk head/contrib/elftoolchain/libdwarf/os.NetBSD.mk - copied unchanged from r295484, vendor/elftoolchain/dist/libdwarf/os.NetBSD.mk head/contrib/elftoolchain/libelftc/os.NetBSD.mk - copied unchanged from r295484, vendor/elftoolchain/dist/libelftc/os.NetBSD.mk head/contrib/elftoolchain/libpe/ - copied from r295484, vendor/elftoolchain/dist/libpe/ head/contrib/elftoolchain/nm/os.NetBSD.mk - copied unchanged from r295484, vendor/elftoolchain/dist/nm/os.NetBSD.mk head/contrib/elftoolchain/readelf/os.NetBSD.mk - copied unchanged from r295484, vendor/elftoolchain/dist/readelf/os.NetBSD.mk head/contrib/elftoolchain/size/os.NetBSD.mk - copied unchanged from r295484, vendor/elftoolchain/dist/size/os.NetBSD.mk head/contrib/elftoolchain/strings/os.NetBSD.mk - copied unchanged from r295484, vendor/elftoolchain/dist/strings/os.NetBSD.mk Deleted: head/contrib/elftoolchain/libelftc/elftc_symbol_table_create.3 Modified: head/contrib/elftoolchain/addr2line/addr2line.c head/contrib/elftoolchain/ar/ar.c head/contrib/elftoolchain/brandelf/brandelf.c head/contrib/elftoolchain/common/elfdefinitions.h head/contrib/elftoolchain/common/native-elf-format head/contrib/elftoolchain/cxxfilt/cxxfilt.c head/contrib/elftoolchain/elfcopy/Makefile head/contrib/elftoolchain/elfcopy/archive.c head/contrib/elftoolchain/elfcopy/elfcopy.1 head/contrib/elftoolchain/elfcopy/elfcopy.h head/contrib/elftoolchain/elfcopy/main.c head/contrib/elftoolchain/elfcopy/sections.c head/contrib/elftoolchain/elfcopy/segments.c head/contrib/elftoolchain/elfcopy/symbols.c head/contrib/elftoolchain/elfdump/elfdump.c head/contrib/elftoolchain/libdwarf/_libdwarf.h head/contrib/elftoolchain/libdwarf/dwarf.3 head/contrib/elftoolchain/libdwarf/dwarf_str.c head/contrib/elftoolchain/libdwarf/libdwarf.h head/contrib/elftoolchain/libdwarf/libdwarf_rw.c head/contrib/elftoolchain/libelf/_libelf_config.h head/contrib/elftoolchain/libelftc/Makefile head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 head/contrib/elftoolchain/libelftc/elftc_copyfile.c head/contrib/elftoolchain/libelftc/elftc_demangle.c head/contrib/elftoolchain/libelftc/libelftc.h head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c head/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c head/contrib/elftoolchain/libelftc/make-toolchain-version head/contrib/elftoolchain/readelf/readelf.c head/contrib/elftoolchain/strings/strings.1 head/contrib/elftoolchain/strings/strings.c head/lib/libelftc/elftc_version.c Directory Properties: head/contrib/elftoolchain/ (props changed) head/contrib/elftoolchain/ar/ (props changed) head/contrib/elftoolchain/brandelf/ (props changed) head/contrib/elftoolchain/elfdump/ (props changed) Modified: head/contrib/elftoolchain/addr2line/addr2line.c ============================================================================== --- head/contrib/elftoolchain/addr2line/addr2line.c Fri Feb 12 20:52:53 2016 (r295576) +++ head/contrib/elftoolchain/addr2line/addr2line.c Fri Feb 12 20:54:02 2016 (r295577) @@ -40,7 +40,7 @@ #include "uthash.h" #include "_elftc.h" -ELFTC_VCSID("$Id: addr2line.c 3264 2015-11-30 05:38:14Z kaiwang27 $"); +ELFTC_VCSID("$Id: addr2line.c 3273 2015-12-11 21:38:57Z kaiwang27 $"); struct Func { char *name; @@ -368,7 +368,8 @@ print_inlines(struct CU *cu, struct Func printf("%s\n", f->name); } } - (void) printf("%s:%ju\n", base ? basename(file) : file, call_line); + (void) printf("%s:%ju\n", base ? basename(file) : file, + (uintmax_t) call_line); if (f->inlined_caller != NULL) print_inlines(cu, f->inlined_caller, f->call_file, @@ -562,7 +563,8 @@ out: } } - (void) printf("%s:%ju\n", base ? basename(file) : file, lineno); + (void) printf("%s:%ju\n", base ? basename(file) : file, + (uintmax_t) lineno); if (ret == DW_DLV_OK && inlines && cu != NULL && cu->srcfiles != NULL && f != NULL && f->inlined_caller != NULL) Copied: head/contrib/elftoolchain/addr2line/os.NetBSD.mk (from r295484, vendor/elftoolchain/dist/addr2line/os.NetBSD.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/elftoolchain/addr2line/os.NetBSD.mk Fri Feb 12 20:54:02 2016 (r295577, copy of r295484, vendor/elftoolchain/dist/addr2line/os.NetBSD.mk) @@ -0,0 +1,2 @@ +# TODO(#511): Revert after the source tree is -Wconversion clean. +WARNS=5 Modified: head/contrib/elftoolchain/ar/ar.c ============================================================================== --- head/contrib/elftoolchain/ar/ar.c Fri Feb 12 20:52:53 2016 (r295576) +++ head/contrib/elftoolchain/ar/ar.c Fri Feb 12 20:54:02 2016 (r295577) @@ -72,7 +72,7 @@ #include "ar.h" -ELFTC_VCSID("$Id: ar.c 3243 2015-08-31 19:28:45Z emaste $"); +ELFTC_VCSID("$Id: ar.c 3319 2016-01-13 21:37:53Z jkoshy $"); enum options { @@ -407,7 +407,7 @@ Usage: %s [options] archive fi -F FORMAT | --flavor=FORMAT\n\ Create archives with the specified format.\n\ -S Do not generate an archive symbol table.\n\ - -U Use original metadata, for unique archive checksums.\n" + -U Use original metadata for archive members.\n" static void bsdar_usage(void) Modified: head/contrib/elftoolchain/brandelf/brandelf.c ============================================================================== --- head/contrib/elftoolchain/brandelf/brandelf.c Fri Feb 12 20:52:53 2016 (r295576) +++ head/contrib/elftoolchain/brandelf/brandelf.c Fri Feb 12 20:54:02 2016 (r295577) @@ -44,7 +44,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: brandelf.c 3234 2015-07-31 12:35:09Z emaste $"); +ELFTC_VCSID("$Id: brandelf.c 3354 2016-01-18 21:50:15Z jkoshy $"); static int elftype(const char *); static const char *iselftype(int); @@ -212,7 +212,7 @@ main(int argc, char **argv) /* * Update the ABI type. */ - ehdr.e_ident[EI_OSABI] = type; + ehdr.e_ident[EI_OSABI] = (unsigned char) type; if (gelf_update_ehdr(elf, &ehdr) == 0) { warnx("gelf_update_ehdr error: %s", elf_errmsg(-1)); Modified: head/contrib/elftoolchain/common/elfdefinitions.h ============================================================================== --- head/contrib/elftoolchain/common/elfdefinitions.h Fri Feb 12 20:52:53 2016 (r295576) +++ head/contrib/elftoolchain/common/elfdefinitions.h Fri Feb 12 20:54:02 2016 (r295577) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: elfdefinitions.h 3253 2015-10-10 18:31:33Z kaiwang27 $ + * $Id: elfdefinitions.h 3392 2016-02-05 19:51:22Z emaste $ */ /* @@ -1228,6 +1228,7 @@ _ELF_DEFINE_STB(STB_GLOBAL, 1, _ELF_DEFINE_STB(STB_WEAK, 2, \ "visible across all object files but with low precedence") \ _ELF_DEFINE_STB(STB_LOOS, 10, "start of OS-specific range") \ +_ELF_DEFINE_STB(STB_GNU_UNIQUE, 10, "unique symbol (GNU)") \ _ELF_DEFINE_STB(STB_HIOS, 12, "end of OS-specific range") \ _ELF_DEFINE_STB(STB_LOPROC, 13, \ "start of processor-specific range") \ @@ -1259,6 +1260,7 @@ _ELF_DEFINE_STT(STT_LOPROC, 13, "start of processor-specific types") \ _ELF_DEFINE_STT(STT_ARM_TFUNC, 13, "Thumb function (GNU)") \ _ELF_DEFINE_STT(STT_ARM_16BIT, 15, "Thumb label (GNU)") \ +_ELF_DEFINE_STT(STT_SPARC_REGISTER, 13, "SPARC register information") \ _ELF_DEFINE_STT(STT_HIPROC, 15, \ "end of processor-specific types") @@ -1395,7 +1397,7 @@ _ELF_DEFINE_RELOC(R_386_GOT32, 3) \ _ELF_DEFINE_RELOC(R_386_PLT32, 4) \ _ELF_DEFINE_RELOC(R_386_COPY, 5) \ _ELF_DEFINE_RELOC(R_386_GLOB_DAT, 6) \ -_ELF_DEFINE_RELOC(R_386_JMP_SLOT, 7) \ +_ELF_DEFINE_RELOC(R_386_JUMP_SLOT, 7) \ _ELF_DEFINE_RELOC(R_386_RELATIVE, 8) \ _ELF_DEFINE_RELOC(R_386_GOTOFF, 9) \ _ELF_DEFINE_RELOC(R_386_GOTPC, 10) \ @@ -1407,9 +1409,129 @@ _ELF_DEFINE_RELOC(R_386_PC8, 23) /* */ -#define _ELF_DEFINE_AARCH64_RELOCATIONS() \ -_ELF_DEFINE_RELOC(R_AARCH64_ABS64, 257) \ -_ELF_DEFINE_RELOC(R_AARCH64_ABS32, 258) \ +#define _ELF_DEFINE_AARCH64_RELOCATIONS() \ +_ELF_DEFINE_RELOC(R_AARCH64_NONE, 0) \ +_ELF_DEFINE_RELOC(R_AARCH64_ABS64, 257) \ +_ELF_DEFINE_RELOC(R_AARCH64_ABS32, 258) \ +_ELF_DEFINE_RELOC(R_AARCH64_ABS16, 259) \ +_ELF_DEFINE_RELOC(R_AARCH64_PREL64, 260) \ +_ELF_DEFINE_RELOC(R_AARCH64_PREL32, 261) \ +_ELF_DEFINE_RELOC(R_AARCH64_PREL16, 262) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_UABS_G0, 263) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_UABS_G0_NC, 264) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_UABS_G1, 265) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_UABS_G1_NC, 266) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_UABS_G2, 267) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_UABS_G2_NC, 268) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_UABS_G3, 269) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_SABS_G0, 270) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_SABS_G1, 271) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_SABS_G2, 272) \ +_ELF_DEFINE_RELOC(R_AARCH64_LD_PREL_LO19, 273) \ +_ELF_DEFINE_RELOC(R_AARCH64_ADR_PREL_LO21, 274) \ +_ELF_DEFINE_RELOC(R_AARCH64_ADR_PREL_PG_HI21, 275) \ +_ELF_DEFINE_RELOC(R_AARCH64_ADR_PREL_PG_HI21_NC, 276) \ +_ELF_DEFINE_RELOC(R_AARCH64_ADD_ABS_LO12_NC, 277) \ +_ELF_DEFINE_RELOC(R_AARCH64_LDST8_ABS_LO12_NC, 278) \ +_ELF_DEFINE_RELOC(R_AARCH64_TSTBR14, 279) \ +_ELF_DEFINE_RELOC(R_AARCH64_CONDBR19, 280) \ +_ELF_DEFINE_RELOC(R_AARCH64_JUMP26, 282) \ +_ELF_DEFINE_RELOC(R_AARCH64_CALL26, 283) \ +_ELF_DEFINE_RELOC(R_AARCH64_LDST16_ABS_LO12_NC, 284) \ +_ELF_DEFINE_RELOC(R_AARCH64_LDST32_ABS_LO12_NC, 285) \ +_ELF_DEFINE_RELOC(R_AARCH64_LDST64_ABS_LO12_NC, 286) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_PREL_G0, 287) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_PREL_G0_NC, 288) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_PREL_G1, 289) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_PREL_G1_NC, 290) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_PREL_G2, 291) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_PREL_G2_NC, 292) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_PREL_G3, 293) \ +_ELF_DEFINE_RELOC(R_AARCH64_LDST128_ABS_LO12_NC, 299) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_GOTOFF_G0, 300) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_GOTOFF_G0_NC, 301) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_GOTOFF_G1, 302) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_GOTOFF_G1_NC, 303) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_GOTOFF_G2, 304) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_GOTOFF_G2_NC, 305) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_GOTOFF_G3, 306) \ +_ELF_DEFINE_RELOC(R_AARCH64_GOTREL64, 307) \ +_ELF_DEFINE_RELOC(R_AARCH64_GOTREL32, 308) \ +_ELF_DEFINE_RELOC(R_AARCH64_GOT_LD_PREL19, 309) \ +_ELF_DEFINE_RELOC(R_AARCH64_LD64_GOTOFF_LO15, 310) \ +_ELF_DEFINE_RELOC(R_AARCH64_ADR_GOT_PAGE, 311) \ +_ELF_DEFINE_RELOC(R_AARCH64_LD64_GOT_LO12_NC, 312) \ +_ELF_DEFINE_RELOC(R_AARCH64_LD64_GOTPAGE_LO15, 313) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSGD_ADR_PREL21, 512) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSGD_ADR_PAGE21, 513) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSGD_ADD_LO12_NC, 514) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSGD_MOVW_G1, 515) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSGD_MOVW_G0_NC, 516) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_ADR_PREL21, 517) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_ADR_PAGE21, 518) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_ADD_LO12_NC, 519) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_MOVW_G1, 520) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_MOVW_G0_NC, 521) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LD_PREL19, 522) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_MOVW_DTPREL_G2, 523) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_MOVW_DTPREL_G1, 524) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, 525) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_MOVW_DTPREL_G0, 526) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, 527) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_ADD_DTPREL_HI12, 529) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, 530) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST8_DTPREL_LO12, 531) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, 532) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST16_DTPREL_LO12, 533) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, 534) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST32_DTPREL_LO12, 535) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, 536) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST64_DTPREL_LO12, 537) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, 538) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSIE_MOVW_GOTTPREL_G1, 539) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, 540) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, 541) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, 542) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSIE_LD_GOTTPREL_PREL19, 543) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G2, 544) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G1, 545) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G1_NC, 546) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G0, 547) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G0_NC, 548) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_ADD_TPREL_HI12, 549) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_ADD_TPREL_LO12, 550) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_ADD_TPREL_LO12_NC, 551) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST8_TPREL_LO12, 552) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, 553) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST16_TPREL_LO12, 554) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, 555) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST32_TPREL_LO12, 556) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, 557) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST64_TPREL_LO12, 558) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, 559) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_LD_PREL19, 560) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_ADR_PREL21, 561) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_ADR_PAGE21, 562) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_LD64_LO12, 563) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_ADD_LO12, 564) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_OFF_G1, 565) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_OFF_G0_NC, 566) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_LDR, 567) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_ADD, 568) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_CALL, 569) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST128_TPREL_LO12, 570) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC, 571) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST128_DTPREL_LO12, 572) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC, 573) \ +_ELF_DEFINE_RELOC(R_AARCH64_COPY, 1024) \ +_ELF_DEFINE_RELOC(R_AARCH64_GLOB_DAT, 1025) \ +_ELF_DEFINE_RELOC(R_AARCH64_JUMP_SLOT, 1026) \ +_ELF_DEFINE_RELOC(R_AARCH64_RELATIVE, 1027) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLS_DTPREL64, 1028) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLS_DTPMOD64, 1029) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLS_TPREL64, 1030) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC, 1031) \ +_ELF_DEFINE_RELOC(R_AARCH64_IRELATIVE, 1032) /* * These are the symbols used in the Sun ``Linkers and Loaders @@ -1633,7 +1755,7 @@ _ELF_DEFINE_RELOC(R_IA_64_LTV32MSB, 0x7 _ELF_DEFINE_RELOC(R_IA_64_LTV32LSB, 0x75) \ _ELF_DEFINE_RELOC(R_IA_64_LTV64MSB, 0x76) \ _ELF_DEFINE_RELOC(R_IA_64_LTV64LSB, 0x77) \ -_ELF_DEFINE_RELOC(R_IA_64_PCREL21BIa, 0x79) \ +_ELF_DEFINE_RELOC(R_IA_64_PCREL21BI, 0x79) \ _ELF_DEFINE_RELOC(R_IA_64_PCREL22, 0x7A) \ _ELF_DEFINE_RELOC(R_IA_64_PCREL64I, 0x7B) \ _ELF_DEFINE_RELOC(R_IA_64_IPLTMSB, 0x80) \ @@ -1723,7 +1845,7 @@ _ELF_DEFINE_RELOC(R_PPC_REL32, 26) \ _ELF_DEFINE_RELOC(R_PPC_PLT32, 27) \ _ELF_DEFINE_RELOC(R_PPC_PLTREL32, 28) \ _ELF_DEFINE_RELOC(R_PPC_PLT16_LO, 29) \ -_ELF_DEFINE_RELOC(R_PPL_PLT16_HI, 30) \ +_ELF_DEFINE_RELOC(R_PPC_PLT16_HI, 30) \ _ELF_DEFINE_RELOC(R_PPC_PLT16_HA, 31) \ _ELF_DEFINE_RELOC(R_PPC_SDAREL16, 32) \ _ELF_DEFINE_RELOC(R_PPC_SECTOFF, 33) \ @@ -1926,7 +2048,7 @@ _ELF_DEFINE_RELOC(R_RISCV_SUB32, 39) \ _ELF_DEFINE_RELOC(R_RISCV_SUB64, 40) \ _ELF_DEFINE_RELOC(R_RISCV_GNU_VTINHERIT, 41) \ _ELF_DEFINE_RELOC(R_RISCV_GNU_VTENTRY, 42) \ -_ELF_DEFINE_RELOC(R_RISCV_ALIGN 43) \ +_ELF_DEFINE_RELOC(R_RISCV_ALIGN, 43) \ _ELF_DEFINE_RELOC(R_RISCV_RVC_BRANCH, 44) \ _ELF_DEFINE_RELOC(R_RISCV_RVC_JUMP, 45) @@ -2042,6 +2164,7 @@ _ELF_DEFINE_IA64_RELOCATIONS() \ _ELF_DEFINE_MIPS_RELOCATIONS() \ _ELF_DEFINE_PPC32_RELOCATIONS() \ _ELF_DEFINE_PPC64_RELOCATIONS() \ +_ELF_DEFINE_RISCV_RELOCATIONS() \ _ELF_DEFINE_SPARC_RELOCATIONS() \ _ELF_DEFINE_X86_64_RELOCATIONS() Modified: head/contrib/elftoolchain/common/native-elf-format ============================================================================== --- head/contrib/elftoolchain/common/native-elf-format Fri Feb 12 20:52:53 2016 (r295576) +++ head/contrib/elftoolchain/common/native-elf-format Fri Feb 12 20:54:02 2016 (r295577) @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: native-elf-format 3186 2015-04-16 22:16:40Z emaste $ +# $Id: native-elf-format 3293 2016-01-07 19:26:27Z emaste $ # # Find the native ELF format for a host platform by compiling a # test object and examining the resulting object. @@ -33,6 +33,8 @@ $1 ~ "Data:" { $1 ~ "Machine:" { if (match($0, "Intel.*386")) { elfarch = "EM_386"; + } else if (match($0, "MIPS")) { + elfarch = "EM_MIPS"; } else if (match($0, ".*[xX]86-64")) { elfarch = "EM_X86_64"; } else { Modified: head/contrib/elftoolchain/cxxfilt/cxxfilt.c ============================================================================== --- head/contrib/elftoolchain/cxxfilt/cxxfilt.c Fri Feb 12 20:52:53 2016 (r295576) +++ head/contrib/elftoolchain/cxxfilt/cxxfilt.c Fri Feb 12 20:54:02 2016 (r295577) @@ -35,7 +35,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: cxxfilt.c 3174 2015-03-27 17:13:41Z emaste $"); +ELFTC_VCSID("$Id: cxxfilt.c 3356 2016-01-22 22:31:38Z jkoshy $"); #define STRBUFSZ 8192 @@ -112,11 +112,11 @@ find_format(const char *fstr) } static char * -demangle(char *name, int strict, int *pos) +demangle(char *name, int strict, size_t *pos) { static char dem[STRBUFSZ]; char nb[STRBUFSZ]; - int p, t; + size_t p, t; if (stripus && *name == '_') { strncpy(nb, name + 1, sizeof(nb) - 1); @@ -128,10 +128,10 @@ demangle(char *name, int strict, int *po nb[sizeof(nb) - 1] = '\0'; p = strlen(nb); - if (p <= 0) + if (p == 0) return NULL; - while (elftc_demangle(nb, dem, sizeof(dem), format) < 0) { + while (elftc_demangle(nb, dem, sizeof(dem), (unsigned) format) < 0) { if (!strict && p > 1) { nb[--p] = '\0'; continue; @@ -149,7 +149,8 @@ int main(int argc, char **argv) { char *dem, buf[STRBUFSZ]; - int c, i, p, s, opt; + size_t i, p, s; + int c, n, opt; while ((opt = getopt_long(argc, argv, "_nps:V", longopts, NULL)) != -1) { @@ -182,9 +183,9 @@ main(int argc, char **argv) argc -= optind; if (*argv != NULL) { - for (i = 0; i < argc; i++) { - if ((dem = demangle(argv[i], 1, NULL)) == NULL) - fprintf(stderr, "Failed: %s\n", argv[i]); + for (n = 0; n < argc; n++) { + if ((dem = demangle(argv[n], 1, NULL)) == NULL) + fprintf(stderr, "Failed: %s\n", argv[n]); else printf("%s\n", dem); } @@ -213,7 +214,7 @@ main(int argc, char **argv) if ((size_t) p >= sizeof(buf) - 1) warnx("buffer overflowed"); else - buf[p++] = c; + buf[p++] = (char) c; } } Modified: head/contrib/elftoolchain/elfcopy/Makefile ============================================================================== --- head/contrib/elftoolchain/elfcopy/Makefile Fri Feb 12 20:52:53 2016 (r295576) +++ head/contrib/elftoolchain/elfcopy/Makefile Fri Feb 12 20:54:02 2016 (r295577) @@ -1,10 +1,13 @@ -# $Id: Makefile 2290 2011-12-04 07:20:46Z jkoshy $ +# $Id: Makefile 3381 2016-01-30 19:39:47Z jkoshy $ TOP= .. +.include "${TOP}/mk/elftoolchain.components.mk" + PROG= elfcopy -SRCS= archive.c ascii.c binary.c main.c sections.c segments.c symbols.c +SRCS= archive.c ascii.c binary.c main.c sections.c segments.c \ + symbols.c WARNS?= 5 @@ -15,14 +18,24 @@ LDADD= -lelf -lelftc LDADD+= -larchive .endif +.if defined(WITH_PE) && ${WITH_PE:tl} == "yes" +SRCS+= pe.c +CFLAGS+= -DWITH_PE=1 + +DPADD+= ${LIBPE} +LDADD+= -lpe +.endif + MAN= elfcopy.1 mcs.1 strip.1 +MLINKS= elfcopy.1 objcopy.1 NO_SHARED?= yes -LINKS= ${BINDIR}/elfcopy ${BINDIR}/strip \ - ${BINDIR}/elfcopy ${BINDIR}/mcs +LINKS= ${BINDIR}/elfcopy ${BINDIR}/mcs \ + ${BINDIR}/elfcopy ${BINDIR}/objcopy \ + ${BINDIR}/elfcopy ${BINDIR}/strip -EXTRA_TARGETS= strip mcs +EXTRA_TARGETS= mcs strip objcopy CLEANFILES+= ${EXTRA_TARGETS} Modified: head/contrib/elftoolchain/elfcopy/archive.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/archive.c Fri Feb 12 20:52:53 2016 (r295576) +++ head/contrib/elftoolchain/elfcopy/archive.c Fri Feb 12 20:54:02 2016 (r295577) @@ -38,7 +38,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: archive.c 3174 2015-03-27 17:13:41Z emaste $"); +ELFTC_VCSID("$Id: archive.c 3287 2015-12-31 16:58:48Z emaste $"); #define _ARMAG_LEN 8 /* length of ar magic string */ #define _ARHDR_LEN 60 /* length of ar header */ @@ -382,7 +382,7 @@ ac_read_objs(struct elfcopy *ecp, int if if (lseek(ifd, 0, SEEK_SET) == -1) err(EXIT_FAILURE, "lseek failed"); if ((a = archive_read_new()) == NULL) - errx(EXIT_FAILURE, "%s", archive_error_string(a)); + errx(EXIT_FAILURE, "archive_read_new failed"); archive_read_support_format_ar(a); AC(archive_read_open_fd(a, ifd, 10240)); for(;;) { @@ -443,7 +443,7 @@ ac_write_objs(struct elfcopy *ecp, int o int nr; if ((a = archive_write_new()) == NULL) - errx(EXIT_FAILURE, "%s", archive_error_string(a)); + errx(EXIT_FAILURE, "archive_write_new failed"); archive_write_set_format_ar_svr4(a); AC(archive_write_open_fd(a, ofd)); Modified: head/contrib/elftoolchain/elfcopy/elfcopy.1 ============================================================================== --- head/contrib/elftoolchain/elfcopy/elfcopy.1 Fri Feb 12 20:52:53 2016 (r295576) +++ head/contrib/elftoolchain/elfcopy/elfcopy.1 Fri Feb 12 20:54:02 2016 (r295577) @@ -21,13 +21,14 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elfcopy.1 3266 2015-12-07 15:38:26Z emaste $ +.\" $Id: elfcopy.1 3381 2016-01-30 19:39:47Z jkoshy $ .\" -.Dd December 7, 2015 +.Dd January 29, 2016 .Os .Dt ELFCOPY 1 .Sh NAME -.Nm elfcopy +.Nm elfcopy , +.Nm objcopy .Nd copy and translate object files .Sh SYNOPSIS .Nm @@ -85,7 +86,7 @@ .Sh DESCRIPTION The .Nm -utility copies the content of the ELF object named by argument +utility copies the content of the binary object named by argument .Ar infile to that named by argument .Ar outfile , @@ -121,6 +122,10 @@ to the output. .It Fl O Ar objformat | Fl -output-target= Ns Ar objformat Write the output file using the object format specified in argument .Ar objformat . +The argument +.Ar objformat +should be one of the target names recognized by +.Xr elftc_bfd_find_target 3 . .It Fl R Ar sectionname | Fl -remove-section= Ns Ar sectionname Remove any section with name .Ar sectionname @@ -330,8 +335,14 @@ Do not copy symbols that are not needed .Xr mcs 1 , .Xr strip 1 , .Xr elf 3 , +.Xr elftc_bfd_find_target 3 , .Xr ar 5 , .Xr elf 5 +.Sh COMPATIBILITY +The +.Nm +utility is expected to be option compatible with GNU +.Nm objcopy . .Sh HISTORY .Nm has been implemented by Modified: head/contrib/elftoolchain/elfcopy/elfcopy.h ============================================================================== --- head/contrib/elftoolchain/elfcopy/elfcopy.h Fri Feb 12 20:52:53 2016 (r295576) +++ head/contrib/elftoolchain/elfcopy/elfcopy.h Fri Feb 12 20:54:02 2016 (r295577) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: elfcopy.h 3221 2015-05-24 23:42:43Z kaiwang27 $ + * $Id: elfcopy.h 3310 2016-01-10 09:10:54Z kaiwang27 $ */ #include @@ -287,6 +287,7 @@ struct section *create_external_section( int _loadable); void create_external_symtab(struct elfcopy *_ecp); void create_ihex(int _ifd, int _ofd); +void create_pe(struct elfcopy *_ecp, int _ifd, int _ofd); void create_scn(struct elfcopy *_ecp); void create_srec(struct elfcopy *_ecp, int _ifd, int _ofd, const char *_ofn); void create_symtab(struct elfcopy *_ecp); Modified: head/contrib/elftoolchain/elfcopy/main.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/main.c Fri Feb 12 20:52:53 2016 (r295576) +++ head/contrib/elftoolchain/elfcopy/main.c Fri Feb 12 20:54:02 2016 (r295577) @@ -39,7 +39,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: main.c 3268 2015-12-07 20:30:55Z emaste $"); +ELFTC_VCSID("$Id: main.c 3399 2016-02-12 18:07:56Z emaste $"); enum options { @@ -316,6 +316,7 @@ create_elf(struct elfcopy *ecp) oeh.e_entry = ieh.e_entry; oeh.e_version = ieh.e_version; + ecp->flags &= ~(EXECUTABLE | DYNAMIC | RELOCATABLE); if (ieh.e_type == ET_EXEC) ecp->flags |= EXECUTABLE; else if (ieh.e_type == ET_DYN) @@ -722,6 +723,15 @@ create_file(struct elfcopy *ecp, const c create_srec(ecp, ofd, ofd0, dst != NULL ? dst : src); break; + case ETF_PE: + case ETF_EFI: +#if WITH_PE + create_pe(ecp, ofd, ofd0); +#else + errx(EXIT_FAILURE, "PE/EFI support not enabled" + " at compile time"); +#endif + break; default: errx(EXIT_FAILURE, "Internal: unsupported" " output flavour %d", ecp->oec); @@ -1345,6 +1355,9 @@ set_output_target(struct elfcopy *ecp, c ecp->oed = elftc_bfd_target_byteorder(tgt); ecp->oem = elftc_bfd_target_machine(tgt); } + if (ecp->otf == ETF_EFI || ecp->otf == ETF_PE) + ecp->oem = elftc_bfd_target_machine(tgt); + ecp->otgt = target_name; } @@ -1366,7 +1379,7 @@ set_osabi(struct elfcopy *ecp, const cha #define ELFCOPY_USAGE_MESSAGE "\ Usage: %s [options] infile [outfile]\n\ - Transform an ELF object.\n\n\ + Transform object files.\n\n\ Options:\n\ -d | -g | --strip-debug Remove debugging information from the output.\n\ -j SECTION | --only-section=SECTION\n\ @@ -1382,6 +1395,8 @@ Usage: %s [options] infile [outfile]\n\ -N SYM | --strip-symbol=SYM Do not copy symbol SYM to the output.\n\ -O FORMAT | --output-target=FORMAT\n\ Specify object format for the output file.\n\ + FORMAT should be a target name understood by\n\ + elftc_bfd_find_target(3).\n\ -R NAME | --remove-section=NAME\n\ Remove the named section.\n\ -S | --strip-all Remove all symbol and relocation information\n\ @@ -1471,6 +1486,7 @@ Usage: %s [options] file...\n\ Options:\n\ -d | -g | -S | --strip-debug Remove debugging symbols.\n\ -h | --help Print a help message.\n\ + -o FILE | --output-file FILE Write output to FILE.\n\ --only-keep-debug Keep debugging information only.\n\ -p | --preserve-dates Preserve access and modification times.\n\ -s | --strip-all Remove all symbols.\n\ Copied: head/contrib/elftoolchain/elfcopy/pe.c (from r295484, vendor/elftoolchain/dist/elfcopy/pe.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/elftoolchain/elfcopy/pe.c Fri Feb 12 20:54:02 2016 (r295577, copy of r295484, vendor/elftoolchain/dist/elfcopy/pe.c) @@ -0,0 +1,233 @@ +/*- + * Copyright (c) 2016 Kai Wang + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "elfcopy.h" + +ELFTC_VCSID("$Id: pe.c 3312 2016-01-10 09:23:51Z kaiwang27 $"); + +/* Convert ELF object to Portable Executable (PE). */ +void +create_pe(struct elfcopy *ecp, int ifd, int ofd) +{ + Elf *e; + Elf_Scn *scn; + Elf_Data *d; + GElf_Ehdr eh; + GElf_Shdr sh; + PE *pe; + PE_Scn *ps; + PE_SecHdr psh; + PE_CoffHdr pch; + PE_OptHdr poh; + PE_Object po; + PE_Buffer *pb; + const char *name; + size_t indx; + int elferr, i; + + if (ecp->otf == ETF_EFI || ecp->oem == EM_X86_64) + po = PE_O_PE32P; + else + po = PE_O_PE32; + + if ((e = elf_begin(ifd, ELF_C_READ, NULL)) == NULL) + errx(EXIT_FAILURE, "elf_begin() failed: %s", + elf_errmsg(-1)); + + if (gelf_getehdr(e, &eh) == NULL) + errx(EXIT_FAILURE, "gelf_getehdr() failed: %s", + elf_errmsg(-1)); + + if (elf_getshstrndx(ecp->ein, &indx) == 0) + errx(EXIT_FAILURE, "elf_getshstrndx() failed: %s", + elf_errmsg(-1)); + + if ((pe = pe_init(ofd, PE_C_WRITE, po)) == NULL) + err(EXIT_FAILURE, "pe_init() failed"); + + /* Setup PE COFF header. */ + memset(&pch, 0, sizeof(pch)); + switch (ecp->oem) { + case EM_386: + pch.ch_machine = IMAGE_FILE_MACHINE_I386; + break; + case EM_X86_64: + pch.ch_machine = IMAGE_FILE_MACHINE_AMD64; + break; + default: + pch.ch_machine = IMAGE_FILE_MACHINE_UNKNOWN; + break; + } + pch.ch_timestamp = (uint32_t) time(NULL); + if (pe_update_coff_header(pe, &pch) < 0) + err(EXIT_FAILURE, "pe_update_coff_header() failed"); + + /* Setup PE optional header. */ + memset(&poh, 0, sizeof(poh)); + if (ecp->otf == ETF_EFI) + poh.oh_subsystem = IMAGE_SUBSYSTEM_EFI_APPLICATION; + poh.oh_entry = (uint32_t) eh.e_entry; + + /* + * Default section alignment and file alignment. (Here the + * section alignment is set to the default page size of the + * archs supported. We should use different section alignment + * for some arch. (e.g. IA64) + */ + poh.oh_secalign = 0x1000; + poh.oh_filealign = 0x200; + + /* Copy sections. */ + scn = NULL; + while ((scn = elf_nextscn(e, scn)) != NULL) { + + /* + * Read in ELF section. + */ + + if (gelf_getshdr(scn, &sh) == NULL) { + warnx("gelf_getshdr() failed: %s", elf_errmsg(-1)); + (void) elf_errno(); + continue; + } + if ((name = elf_strptr(ecp->ein, indx, sh.sh_name)) == + NULL) { + warnx("elf_strptr() failed: %s", elf_errmsg(-1)); + (void) elf_errno(); + continue; + } + + /* Skip sections unneeded. */ + if (strcmp(name, ".shstrtab") == 0 || + strcmp(name, ".symtab") == 0 || + strcmp(name, ".strtab") == 0) + continue; + + if ((d = elf_getdata(scn, NULL)) == NULL) { + warnx("elf_getdata() failed: %s", elf_errmsg(-1)); + (void) elf_errno(); + continue; + } + + if (strcmp(name, ".text") == 0) { + poh.oh_textbase = (uint32_t) sh.sh_addr; + poh.oh_textsize = (uint32_t) roundup(sh.sh_size, + poh.oh_filealign); + } else { + if (po == PE_O_PE32 && strcmp(name, ".data") == 0) + poh.oh_database = sh.sh_addr; + if (sh.sh_type == SHT_NOBITS) + poh.oh_bsssize += (uint32_t) + roundup(sh.sh_size, poh.oh_filealign); + else if (sh.sh_flags & SHF_ALLOC) + poh.oh_datasize += (uint32_t) + roundup(sh.sh_size, poh.oh_filealign); + } + + /* + * Create PE/COFF section. + */ + + if ((ps = pe_newscn(pe)) == NULL) { + warn("pe_newscn() failed"); + continue; + } + + /* + * Setup PE/COFF section header. The section name is not + * NUL-terminated if its length happens to be 8. Long + * section name should be truncated for PE image according + * to the PE/COFF specification. + */ + memset(&psh, 0, sizeof(psh)); + strncpy(psh.sh_name, name, sizeof(psh.sh_name)); + psh.sh_addr = sh.sh_addr; + psh.sh_virtsize = sh.sh_size; + if (sh.sh_type != SHT_NOBITS) + psh.sh_rawsize = sh.sh_size; + else + psh.sh_char |= IMAGE_SCN_CNT_UNINITIALIZED_DATA; + + /* + * Translate ELF section flags to PE/COFF section flags. + */ + psh.sh_char |= IMAGE_SCN_MEM_READ; + if (sh.sh_flags & SHF_WRITE) + psh.sh_char |= IMAGE_SCN_MEM_WRITE; + if (sh.sh_flags & SHF_EXECINSTR) + psh.sh_char |= IMAGE_SCN_MEM_EXECUTE | + IMAGE_SCN_CNT_CODE; + if ((sh.sh_flags & SHF_ALLOC) && (psh.sh_char & 0xF0) == 0) + psh.sh_char |= IMAGE_SCN_CNT_INITIALIZED_DATA; + for (i = 0xE; i > 0; i--) { + if (sh.sh_addralign & (1U << (i - 1))) { + psh.sh_char |= i << 20; + break; + } + } + + /* Mark relocation section "discardable". */ + if (strcmp(name, ".reloc") == 0) + psh.sh_char |= IMAGE_SCN_MEM_DISCARDABLE; + + if (pe_update_section_header(ps, &psh) < 0) { + warn("pe_update_section_header() failed"); + continue; + } + + /* Copy section content. */ + if ((pb = pe_newbuffer(ps)) == NULL) { + warn("pe_newbuffer() failed"); + continue; + } + pb->pb_align = 1; + pb->pb_off = 0; + pb->pb_size = sh.sh_size; + pb->pb_buf = d->d_buf; + } + elferr = elf_errno(); + if (elferr != 0) + warnx("elf_nextscn() failed: %s", elf_errmsg(elferr)); + + /* Update PE optional header. */ + if (pe_update_opt_header(pe, &poh) < 0) + err(EXIT_FAILURE, "pe_update_opt_header() failed"); + + /* Write out PE/COFF object. */ + if (pe_update(pe) < 0) + err(EXIT_FAILURE, "pe_update() failed"); + + pe_finish(pe); + elf_end(e); +} Modified: head/contrib/elftoolchain/elfcopy/sections.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/sections.c Fri Feb 12 20:52:53 2016 (r295576) +++ head/contrib/elftoolchain/elfcopy/sections.c Fri Feb 12 20:54:02 2016 (r295577) @@ -34,7 +34,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: sections.c 3272 2015-12-11 20:00:54Z kaiwang27 $"); +ELFTC_VCSID("$Id: sections.c 3346 2016-01-17 20:09:15Z kaiwang27 $"); static void add_gnu_debuglink(struct elfcopy *ecp); static uint32_t calc_crc32(const char *p, size_t len, uint32_t crc); @@ -223,6 +223,7 @@ static int is_debug_section(const char *name) { const char *dbg_sec[] = { + ".apple_", ".debug", ".gnu.linkonce.wi.", ".line", @@ -369,7 +370,7 @@ create_scn(struct elfcopy *ecp) is = NULL; while ((is = elf_nextscn(ecp->ein, is)) != NULL) { if (gelf_getshdr(is, &ish) == NULL) - errx(EXIT_FAILURE, "219 gelf_getshdr failed: %s", + errx(EXIT_FAILURE, "gelf_getshdr failed: %s", elf_errmsg(-1)); if ((name = elf_strptr(ecp->ein, indx, ish.sh_name)) == NULL) errx(EXIT_FAILURE, "elf_strptr failed: %s", @@ -416,12 +417,19 @@ create_scn(struct elfcopy *ecp) * is loadable, but if user explicitly set section flags * while neither "load" nor "alloc" is set, we make the * section unloadable. + * + * Sections in relocatable object is loadable if + * section flag SHF_ALLOC is set. */ if (sec_flags && (sec_flags & (SF_LOAD | SF_ALLOC)) == 0) s->loadable = 0; - else + else { s->loadable = add_to_inseg_list(ecp, s); + if ((ecp->flags & RELOCATABLE) && + (ish.sh_flags & SHF_ALLOC)) + s->loadable = 1; + } } else { /* Assuming .shstrtab is "unloadable". */ s = ecp->shstrtab; @@ -875,10 +883,10 @@ resync_sections(struct elfcopy *ecp) if (s->align == 0) s->align = 1; if (off <= s->off) { - if (!s->loadable) + if (!s->loadable || (ecp->flags & RELOCATABLE)) s->off = roundup(off, s->align); } else { - if (s->loadable) + if (s->loadable && (ecp->flags & RELOCATABLE) == 0) warnx("moving loadable section %s, " "is this intentional?", s->name); s->off = roundup(off, s->align); @@ -1028,8 +1036,11 @@ print_section(struct section *s) print_data(s->buf, s->sz); } else { id = NULL; - while ((id = elf_getdata(s->is, id)) != NULL) + while ((id = elf_getdata(s->is, id)) != NULL || + (id = elf_rawdata(s->is, id)) != NULL) { + (void) elf_errno(); print_data(id->d_buf, id->d_size); + } elferr = elf_errno(); if (elferr != 0) errx(EXIT_FAILURE, "elf_getdata() failed: %s", @@ -1049,7 +1060,9 @@ read_section(struct section *s, size_t * sz = 0; b = NULL; id = NULL; - while ((id = elf_getdata(s->is, id)) != NULL) { + while ((id = elf_getdata(s->is, id)) != NULL || + (id = elf_rawdata(s->is, id)) != NULL) { + (void) elf_errno(); if (b == NULL) b = malloc(id->d_size); else @@ -1077,10 +1090,10 @@ copy_shdr(struct elfcopy *ecp, struct se GElf_Shdr ish, osh; if (gelf_getshdr(s->is, &ish) == NULL) - errx(EXIT_FAILURE, "526 gelf_getshdr() failed: %s", + errx(EXIT_FAILURE, "gelf_getshdr() failed: %s", elf_errmsg(-1)); if (gelf_getshdr(s->os, &osh) == NULL) - errx(EXIT_FAILURE, "529 gelf_getshdr() failed: %s", + errx(EXIT_FAILURE, "gelf_getshdr() failed: %s", elf_errmsg(-1)); if (copy) @@ -1097,19 +1110,32 @@ copy_shdr(struct elfcopy *ecp, struct se if (sec_flags) { osh.sh_flags = 0; - if (sec_flags & SF_ALLOC) { + if (sec_flags & SF_ALLOC) osh.sh_flags |= SHF_ALLOC; - if (!s->loadable) - warnx("set SHF_ALLOC flag for " - "unloadable section %s", - s->name); - } if ((sec_flags & SF_READONLY) == 0) osh.sh_flags |= SHF_WRITE; if (sec_flags & SF_CODE) osh.sh_flags |= SHF_EXECINSTR; + if ((sec_flags & SF_CONTENTS) && + s->type == SHT_NOBITS && s->sz > 0) { + /* + * Convert SHT_NOBITS section to section with + * (zero'ed) content on file. + */ + osh.sh_type = s->type = SHT_PROGBITS; + if ((s->buf = calloc(1, s->sz)) == NULL) + err(EXIT_FAILURE, "malloc failed"); + s->nocopy = 1; + } } else { osh.sh_flags = ish.sh_flags; + /* + * Newer binutils as(1) emits the section flag + * SHF_INFO_LINK for relocation sections. elfcopy + * emits this flag in the output section if it's + * missing in the input section, to remain compatible + * with binutils. + */ if (ish.sh_type == SHT_REL || ish.sh_type == SHT_RELA) osh.sh_flags |= SHF_INFO_LINK; } @@ -1135,11 +1161,14 @@ copy_data(struct section *s) return; if ((id = elf_getdata(s->is, NULL)) == NULL) { - elferr = elf_errno(); - if (elferr != 0) - errx(EXIT_FAILURE, "elf_getdata() failed: %s", - elf_errmsg(elferr)); - return; + (void) elf_errno(); + if ((id = elf_rawdata(s->is, NULL)) == NULL) { + elferr = elf_errno(); + if (elferr != 0) + errx(EXIT_FAILURE, "failed to read section:" + " %s", s->name); + return; + } } if ((od = elf_newdata(s->os)) == NULL) @@ -1245,6 +1274,7 @@ insert_sections(struct elfcopy *ecp) struct sec_add *sa; struct section *s; size_t off; + uint64_t stype; /* Put these sections in the end of current list. */ off = 0; @@ -1259,8 +1289,20 @@ insert_sections(struct elfcopy *ecp) /* TODO: Add section header vma/lma, flag changes here */ + /* + * The default section type for user added section is + * SHT_PROGBITS. If the section name match certain patterns, + * elfcopy will try to set a more appropriate section type. + * However, data type is always set to ELF_T_BYTE and no *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Feb 12 20:55:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A607CAA7172; Fri, 12 Feb 2016 20:55:23 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 734E8A03; Fri, 12 Feb 2016 20:55:23 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1CKtMoQ032869; Fri, 12 Feb 2016 20:55:22 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1CKtM28032866; Fri, 12 Feb 2016 20:55:22 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201602122055.u1CKtM28032866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 12 Feb 2016 20:55:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295578 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 20:55:23 -0000 Author: markj Date: Fri Feb 12 20:55:22 2016 New Revision: 295578 URL: https://svnweb.freebsd.org/changeset/base/295578 Log: Remove superfluous return statements from the neighbour discovery code. MFC after: 1 week Modified: head/sys/netinet6/nd6.c head/sys/netinet6/nd6_nbr.c head/sys/netinet6/nd6_rtr.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Fri Feb 12 20:54:02 2016 (r295577) +++ head/sys/netinet6/nd6.c Fri Feb 12 20:55:22 2016 (r295578) @@ -2512,7 +2512,6 @@ clear_llinfo_pqueue(struct llentry *ln) } ln->la_hold = NULL; - return; } static int nd6_sysctl_drlist(SYSCTL_HANDLER_ARGS); Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Fri Feb 12 20:54:02 2016 (r295577) +++ head/sys/netinet6/nd6_nbr.c Fri Feb 12 20:55:22 2016 (r295578) @@ -584,7 +584,6 @@ nd6_ns_output_fib(struct ifnet *ifp, con bad: m_freem(m); - return; } #ifndef BURN_BRIDGES @@ -1078,7 +1077,6 @@ nd6_na_output_fib(struct ifnet *ifp, con bad: m_freem(m); - return; } #ifndef BURN_BRIDGES Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Fri Feb 12 20:54:02 2016 (r295577) +++ head/sys/netinet6/nd6_rtr.c Fri Feb 12 20:55:22 2016 (r295578) @@ -503,7 +503,6 @@ defrouter_addreq(struct nd_defrouter *ne } if (error == 0) new->installed = 1; - return; } struct nd_defrouter * @@ -702,8 +701,6 @@ defrouter_select(void) defrouter_delreq(installed_dr); defrouter_addreq(selected_dr); } - - return; } /* From owner-svn-src-all@freebsd.org Fri Feb 12 21:01:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D295EAA7437; Fri, 12 Feb 2016 21:01:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 A63F9DAC; Fri, 12 Feb 2016 21:01:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1CL1rS2035736; Fri, 12 Feb 2016 21:01:53 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1CL1rmN035735; Fri, 12 Feb 2016 21:01:53 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201602122101.u1CL1rmN035735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 12 Feb 2016 21:01:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295579 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 21:01:54 -0000 Author: markj Date: Fri Feb 12 21:01:53 2016 New Revision: 295579 URL: https://svnweb.freebsd.org/changeset/base/295579 Log: Remove a bogus comment from nd6_na_input(). The splnet() call that it refers to has been removed, and a lock for the default router list is in fact needed. MFC after: 1 week Modified: head/sys/netinet6/nd6_nbr.c Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Fri Feb 12 20:55:22 2016 (r295578) +++ head/sys/netinet6/nd6_nbr.c Fri Feb 12 21:01:53 2016 (r295579) @@ -863,12 +863,6 @@ nd6_na_input(struct mbuf *m, int off, in in6 = &ln->r_l3addr.addr6; - /* - * Lock to protect the default router list. - * XXX: this might be unnecessary, since this function - * is only called under the network software interrupt - * context. However, we keep it just for safety. - */ nd6_ifp = lltable_get_ifp(ln->lle_tbl); dr = defrouter_lookup(in6, nd6_ifp); if (dr) From owner-svn-src-all@freebsd.org Fri Feb 12 21:06:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB21CAA77B1; Fri, 12 Feb 2016 21:06:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 A69B717ED; Fri, 12 Feb 2016 21:06:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1CL6mWa036376; Fri, 12 Feb 2016 21:06:48 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1CL6miY036375; Fri, 12 Feb 2016 21:06:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201602122106.u1CL6miY036375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 12 Feb 2016 21:06:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295580 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 21:06:50 -0000 Author: markj Date: Fri Feb 12 21:06:48 2016 New Revision: 295580 URL: https://svnweb.freebsd.org/changeset/base/295580 Log: Simplify defrtrlist_update() slightly in preparation for future changes. No functional change intended. MFC after: 1 week Modified: head/sys/netinet6/nd6_rtr.c Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Fri Feb 12 21:01:53 2016 (r295579) +++ head/sys/netinet6/nd6_rtr.c Fri Feb 12 21:06:48 2016 (r295580) @@ -734,42 +734,37 @@ static struct nd_defrouter * defrtrlist_update(struct nd_defrouter *new) { struct nd_defrouter *dr, *n; + int oldpref; if ((dr = defrouter_lookup(&new->rtaddr, new->ifp)) != NULL) { /* entry exists */ if (new->rtlifetime == 0) { defrtrlist_del(dr); - dr = NULL; - } else { - int oldpref = rtpref(dr); + return (NULL); + } - /* override */ - dr->flags = new->flags; /* xxx flag check */ - dr->rtlifetime = new->rtlifetime; - dr->expire = new->expire; + oldpref = rtpref(dr); - /* - * If the preference does not change, there's no need - * to sort the entries. Also make sure the selected - * router is still installed in the kernel. - */ - if (dr->installed && rtpref(new) == oldpref) - return (dr); + /* override */ + dr->flags = new->flags; /* xxx flag check */ + dr->rtlifetime = new->rtlifetime; + dr->expire = new->expire; - /* - * preferred router may be changed, so relocate - * this router. - * XXX: calling TAILQ_REMOVE directly is a bad manner. - * However, since defrtrlist_del() has many side - * effects, we intentionally do so here. - * defrouter_select() below will handle routing - * changes later. - */ - TAILQ_REMOVE(&V_nd_defrouter, dr, dr_entry); - n = dr; - goto insert; - } - return (dr); + /* + * If the preference does not change, there's no need + * to sort the entries. Also make sure the selected + * router is still installed in the kernel. + */ + if (dr->installed && rtpref(new) == oldpref) + return (dr); + + /* + * The preferred router may have changed, so relocate this + * router. + */ + TAILQ_REMOVE(&V_nd_defrouter, dr, dr_entry); + n = dr; + goto insert; } /* entry does not exist */ From owner-svn-src-all@freebsd.org Fri Feb 12 21:12:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5105DAA7C3E; Fri, 12 Feb 2016 21:12:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 12DC11E10; Fri, 12 Feb 2016 21:12:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1CLCmk8039194; Fri, 12 Feb 2016 21:12:48 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1CLClTG039190; Fri, 12 Feb 2016 21:12:47 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602122112.u1CLClTG039190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 12 Feb 2016 21:12:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295581 - in head: . lib lib/libpe share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 21:12:49 -0000 Author: emaste Date: Fri Feb 12 21:12:47 2016 New Revision: 295581 URL: https://svnweb.freebsd.org/changeset/base/295581 Log: Add libpe for elfcopy(1) PE/COFF support Sponsored by: The FreeBSD Foundation Added: head/lib/libpe/ head/lib/libpe/Makefile (contents, props changed) Modified: head/Makefile.inc1 head/lib/Makefile head/share/mk/src.libnames.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Feb 12 21:06:48 2016 (r295580) +++ head/Makefile.inc1 Fri Feb 12 21:12:47 2016 (r295581) @@ -1638,6 +1638,7 @@ _binutils= gnu/usr.bin/binutils .endif .if ${MK_ELFTOOLCHAIN_BOOTSTRAP} != "no" _elftctools= lib/libelftc \ + lib/libpe \ usr.bin/elfcopy \ usr.bin/nm \ usr.bin/size \ @@ -1650,6 +1651,7 @@ _elftctools+= usr.bin/addr2line # If cross-building with an external binutils we still need to build strip for # the target (for at least crunchide). _elftctools= lib/libelftc \ + lib/libpe \ usr.bin/elfcopy .endif Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Fri Feb 12 21:06:48 2016 (r295580) +++ head/lib/Makefile Fri Feb 12 21:12:47 2016 (r295581) @@ -80,6 +80,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ libopie \ libpam \ libpcap \ + ${_libpe} \ libpjdlog \ ${_libpmc} \ ${_libproc} \ @@ -184,6 +185,7 @@ _cuse= libcuse .if ${MK_TOOLCHAIN} != "no" _libelftc= libelftc +_libpe= libpe .endif .if ${MK_FILE} != "no" Added: head/lib/libpe/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libpe/Makefile Fri Feb 12 21:12:47 2016 (r295581) @@ -0,0 +1,34 @@ +# $FreeBSD$ +.include + +INTERNALLIB= + +ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain + +.PATH: ${ELFTCDIR}/libpe + +LIB= pe + +SRCS= libpe_buffer.c \ + libpe_coff.c \ + libpe_dos.c \ + libpe_init.c \ + libpe_rich.c \ + libpe_section.c \ + libpe_utils.c \ + pe_buffer.c \ + pe_cntl.c \ + pe_coff.c \ + pe_dos.c \ + pe_flag.c \ + pe_init.c \ + pe_rich.c \ + pe_section.c \ + pe_symtab.c \ + pe_update.c + +CFLAGS+=-I${ELFTCDIR}/libpe -I${ELFTCDIR}/common + +MAN= + +.include Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Fri Feb 12 21:06:48 2016 (r295580) +++ head/share/mk/src.libnames.mk Fri Feb 12 21:12:47 2016 (r295581) @@ -39,6 +39,7 @@ _INTERNALLIBS= \ openbsd \ opts \ parse \ + pe \ readline \ sl \ sm \ @@ -367,6 +368,9 @@ LDADD+= ${LDADD_${_l}} LIBELFTCDIR= ${OBJTOP}/lib/libelftc LIBELFTC?= ${LIBELFTCDIR}/libelftc.a +LIBPEDIR= ${OBJTOP}/lib/libpe +LIBPE?= ${LIBPEDIR}/libpe.a + LIBREADLINEDIR= ${OBJTOP}/gnu/lib/libreadline/readline LIBREADLINE?= ${LIBREADLINEDIR}/libreadline.a From owner-svn-src-all@freebsd.org Fri Feb 12 21:15:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 713A3AA7D47; Fri, 12 Feb 2016 21:15:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 3E9881FAD; Fri, 12 Feb 2016 21:15:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1CLFWFs039335; Fri, 12 Feb 2016 21:15:32 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1CLFWQ2039334; Fri, 12 Feb 2016 21:15:32 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602122115.u1CLFWQ2039334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 12 Feb 2016 21:15:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295582 - head/usr.bin/elfcopy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 21:15:33 -0000 Author: emaste Date: Fri Feb 12 21:15:31 2016 New Revision: 295582 URL: https://svnweb.freebsd.org/changeset/base/295582 Log: elfcopy: enable PE and EFI support Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/elfcopy/Makefile Modified: head/usr.bin/elfcopy/Makefile ============================================================================== --- head/usr.bin/elfcopy/Makefile Fri Feb 12 21:12:47 2016 (r295581) +++ head/usr.bin/elfcopy/Makefile Fri Feb 12 21:15:31 2016 (r295582) @@ -17,13 +17,14 @@ CLEANFILES+= objcopy.1 PROG= elfcopy .endif -SRCS= archive.c ascii.c binary.c main.c sections.c segments.c symbols.c +SRCS= archive.c ascii.c binary.c main.c pe.c sections.c segments.c symbols.c WARNS?= 5 -LIBADD= archive elftc elf +LIBADD= archive elftc elf pe -CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common +CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/libpe -I${ELFTCDIR}/common +CFLAGS+=-DWITH_PE=1 MAN= ${PROG}.1 strip.1 From owner-svn-src-all@freebsd.org Fri Feb 12 21:15:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16491AA7D9D; Fri, 12 Feb 2016 21:15:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 CCAA11CA; Fri, 12 Feb 2016 21:15:58 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1CLFvgo039394; Fri, 12 Feb 2016 21:15:57 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1CLFv9h039391; Fri, 12 Feb 2016 21:15:57 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201602122115.u1CLFv9h039391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 12 Feb 2016 21:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295583 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 21:15:59 -0000 Author: markj Date: Fri Feb 12 21:15:57 2016 New Revision: 295583 URL: https://svnweb.freebsd.org/changeset/base/295583 Log: Rename the flags field of struct nd_defrouter to "raflags". This field contains the flags inherited from the corresponding router advertisement message and is not for storing private state. MFC after: 1 week Modified: head/sys/netinet6/nd6.c head/sys/netinet6/nd6.h head/sys/netinet6/nd6_rtr.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Fri Feb 12 21:15:31 2016 (r295582) +++ head/sys/netinet6/nd6.c Fri Feb 12 21:15:57 2016 (r295583) @@ -2550,7 +2550,7 @@ nd6_sysctl_drlist(SYSCTL_HANDLER_ARGS) error = sa6_recoverscope(&d.rtaddr); if (error != 0) return (error); - d.flags = dr->flags; + d.flags = dr->raflags; d.rtlifetime = dr->rtlifetime; d.expire = dr->expire + (time_second - time_uptime); d.if_index = dr->ifp->if_index; Modified: head/sys/netinet6/nd6.h ============================================================================== --- head/sys/netinet6/nd6.h Fri Feb 12 21:15:31 2016 (r295582) +++ head/sys/netinet6/nd6.h Fri Feb 12 21:15:57 2016 (r295583) @@ -232,13 +232,13 @@ struct in6_ndifreq { ((MAX_RANDOM_FACTOR - MIN_RANDOM_FACTOR) * (x >> 10)))) /1000) TAILQ_HEAD(nd_drhead, nd_defrouter); -struct nd_defrouter { +struct nd_defrouter { TAILQ_ENTRY(nd_defrouter) dr_entry; - struct in6_addr rtaddr; - u_char flags; /* flags on RA message */ + struct in6_addr rtaddr; + u_char raflags; /* flags on RA message */ u_short rtlifetime; u_long expire; - struct ifnet *ifp; + struct ifnet *ifp; int installed; /* is installed into kernel routing table */ }; Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Fri Feb 12 21:15:31 2016 (r295582) +++ head/sys/netinet6/nd6_rtr.c Fri Feb 12 21:15:57 2016 (r295583) @@ -272,7 +272,7 @@ nd6_ra_input(struct mbuf *m, int off, in bzero(&dr0, sizeof(dr0)); dr0.rtaddr = saddr6; - dr0.flags = nd_ra->nd_ra_flags_reserved; + dr0.raflags = nd_ra->nd_ra_flags_reserved; /* * Effectively-disable routes from RA messages when * ND6_IFF_NO_RADR enabled on the receiving interface or @@ -710,7 +710,7 @@ defrouter_select(void) static int rtpref(struct nd_defrouter *dr) { - switch (dr->flags & ND_RA_FLAG_RTPREF_MASK) { + switch (dr->raflags & ND_RA_FLAG_RTPREF_MASK) { case ND_RA_FLAG_RTPREF_HIGH: return (RTPREF_HIGH); case ND_RA_FLAG_RTPREF_MEDIUM: @@ -724,7 +724,7 @@ rtpref(struct nd_defrouter *dr) * serious bug of kernel internal. We thus always bark here. * Or, can we even panic? */ - log(LOG_ERR, "rtpref: impossible RA flag %x\n", dr->flags); + log(LOG_ERR, "rtpref: impossible RA flag %x\n", dr->raflags); return (RTPREF_INVALID); } /* NOTREACHED */ @@ -746,7 +746,7 @@ defrtrlist_update(struct nd_defrouter *n oldpref = rtpref(dr); /* override */ - dr->flags = new->flags; /* xxx flag check */ + dr->raflags = new->raflags; /* XXX flag check */ dr->rtlifetime = new->rtlifetime; dr->expire = new->expire; From owner-svn-src-all@freebsd.org Fri Feb 12 21:17:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41FD2AA7E98; Fri, 12 Feb 2016 21:17:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 13A7F695; Fri, 12 Feb 2016 21:17:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1CLH1lJ039483; Fri, 12 Feb 2016 21:17:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1CLH1dO039482; Fri, 12 Feb 2016 21:17:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201602122117.u1CLH1dO039482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 12 Feb 2016 21:17:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295584 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 21:17:02 -0000 Author: markj Date: Fri Feb 12 21:17:00 2016 New Revision: 295584 URL: https://svnweb.freebsd.org/changeset/base/295584 Log: Add a missing newline to a log message. MFC after: 1 week Modified: head/sys/netinet6/scope6.c Modified: head/sys/netinet6/scope6.c ============================================================================== --- head/sys/netinet6/scope6.c Fri Feb 12 21:15:57 2016 (r295583) +++ head/sys/netinet6/scope6.c Fri Feb 12 21:17:00 2016 (r295584) @@ -371,7 +371,7 @@ sa6_recoverscope(struct sockaddr_in6 *si zoneid != sin6->sin6_scope_id) { log(LOG_NOTICE, "%s: embedded scope mismatch: %s%%%d. " - "sin6_scope_id was overridden.", __func__, + "sin6_scope_id was overridden\n", __func__, ip6_sprintf(ip6buf, &sin6->sin6_addr), sin6->sin6_scope_id); } From owner-svn-src-all@freebsd.org Fri Feb 12 22:46:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30C5FAA622C; Fri, 12 Feb 2016 22:46:16 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 DF021DAD; Fri, 12 Feb 2016 22:46:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1CMkEjv065857; Fri, 12 Feb 2016 22:46:14 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1CMkEDO065856; Fri, 12 Feb 2016 22:46:14 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602122246.u1CMkEDO065856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 12 Feb 2016 22:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295586 - head/sys/fs/cd9660 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 22:46:16 -0000 Author: pfg Date: Fri Feb 12 22:46:14 2016 New Revision: 295586 URL: https://svnweb.freebsd.org/changeset/base/295586 Log: cd9660: More "check for NULL" cleaunps. Cleanup some checks for NULL. Most of these were always unnecessary and starting with r294954 brelse() doesn't need any NULL checks at all. For now keep the checks somewhat consistent with NetBSD in case we want to merge the cleanups to older versions. Modified: head/sys/fs/cd9660/cd9660_vfsops.c Modified: head/sys/fs/cd9660/cd9660_vfsops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vfsops.c Fri Feb 12 21:46:20 2016 (r295585) +++ head/sys/fs/cd9660/cd9660_vfsops.c Fri Feb 12 22:46:14 2016 (r295586) @@ -309,13 +309,13 @@ iso_mountfs(devvp, mp) default: break; } - if (bp) { + if (bp != NULL) { brelse(bp); bp = NULL; } } vd_end: - if (bp) { + if (bp != NULL) { brelse(bp); bp = NULL; } @@ -474,11 +474,11 @@ iso_mountfs(devvp, mp) return 0; out: - if (bp) + if (bp != NULL) brelse(bp); - if (pribp) + if (pribp != NULL) brelse(pribp); - if (supbp) + if (supbp != NULL) brelse(supbp); if (cp != NULL) { DROP_GIANT(); @@ -751,8 +751,7 @@ cd9660_vget_internal(mp, ino, flags, vpp #if 0 if (isonum_733(isodir->extent) + isonum_711(isodir->ext_attr_length) != ifhp->ifid_start) { - if (bp != 0) - brelse(bp); + brelse(bp); printf("fhtovp: file start miss %d vs %d\n", isonum_733(isodir->extent) + isonum_711(isodir->ext_attr_length), ifhp->ifid_start); @@ -770,7 +769,7 @@ cd9660_vget_internal(mp, ino, flags, vpp * read the `.' entry out of a dir. */ ip->iso_start = ino >> imp->im_bshift; - if (bp != 0) + if (bp != NULL) brelse(bp); if ((error = cd9660_blkatoff(vp, (off_t)0, NULL, &bp)) != 0) { vput(vp); @@ -809,8 +808,7 @@ cd9660_vget_internal(mp, ino, flags, vpp break; } - if (bp != 0) - brelse(bp); + brelse(bp); /* * Initialize the associated vnode From owner-svn-src-all@freebsd.org Sat Feb 13 00:28:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67D73AA6D4F; Sat, 13 Feb 2016 00:28:50 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 398CD1BFC; Sat, 13 Feb 2016 00:28:50 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1D0SnPF094644; Sat, 13 Feb 2016 00:28:49 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1D0SnXE094642; Sat, 13 Feb 2016 00:28:49 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201602130028.u1D0SnXE094642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sat, 13 Feb 2016 00:28:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295587 - head/share/examples/jails X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 00:28:50 -0000 Author: dteske Date: Sat Feb 13 00:28:48 2016 New Revision: 295587 URL: https://svnweb.freebsd.org/changeset/base/295587 Log: Fix missing description for command usage While "jng" or "jib" without arguments told you what each sub-command does, sub-command usage didn't tell you (e.g., "jng bridge" or "jib addm" gave only usage and not description). Modified: head/share/examples/jails/jib head/share/examples/jails/jng Modified: head/share/examples/jails/jib ============================================================================== --- head/share/examples/jails/jib Fri Feb 12 22:46:14 2016 (r295586) +++ head/share/examples/jails/jib Sat Feb 13 00:28:48 2016 (r295587) @@ -164,9 +164,11 @@ usage() action_usage() { - local usage action="$1" + local usage descr action="$1" eval usage=\"\$jib_${action}_usage\" echo "Usage: $pgm $usage" >&2 + eval descr=\"\$jib_${action}_descr\" + printf "\t%s\n" "$descr" exit $FAILURE } Modified: head/share/examples/jails/jng ============================================================================== --- head/share/examples/jails/jng Fri Feb 12 22:46:14 2016 (r295586) +++ head/share/examples/jails/jng Sat Feb 13 00:28:48 2016 (r295587) @@ -166,9 +166,11 @@ usage() action_usage() { - local usage action="$1" + local usage descr action="$1" eval usage=\"\$jng_${action}_usage\" echo "Usage: $pgm $usage" >&2 + eval descr=\"\$jng_${action}_descr\" + printf "\t%s\n" "$descr" exit $FAILURE } From owner-svn-src-all@freebsd.org Sat Feb 13 00:58:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5574CAA77E3; Sat, 13 Feb 2016 00:58:05 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "alchemy.franken.de", Issuer "alchemy.franken.de" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id F2D01176F; Sat, 13 Feb 2016 00:58:04 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.15.2/8.15.2/ALCHEMY.FRANKEN.DE) with ESMTPS id u1D0w2J3058584 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 13 Feb 2016 01:58:02 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.15.2/8.15.2/Submit) id u1D0w1n2058583; Sat, 13 Feb 2016 01:58:01 +0100 (CET) (envelope-from marius) Date: Sat, 13 Feb 2016 01:58:01 +0100 From: Marius Strobl To: Bruce Evans Cc: Michal Meloun , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295557 - head/sys/dev/uart Message-ID: <20160213005801.GF15359@alchemy.franken.de> References: <201602120514.u1C5EwWt053622@repo.freebsd.org> <20160212164755.GC4980@alchemy.franken.de> <20160213041246.V1974@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160213041246.V1974@besplex.bde.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (alchemy.franken.de [0.0.0.0]); Sat, 13 Feb 2016 01:58:02 +0100 (CET) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 00:58:05 -0000 On Sat, Feb 13, 2016 at 06:53:25AM +1100, Bruce Evans wrote: > On Fri, 12 Feb 2016, Marius Strobl wrote: > > > On Fri, Feb 12, 2016 at 05:14:58AM +0000, Michal Meloun wrote: > >> Author: mmel > >> Date: Fri Feb 12 05:14:58 2016 > >> New Revision: 295557 > >> URL: https://svnweb.freebsd.org/changeset/base/295557 > >> > >> Log: > >> UART: Fix spurious interrupts generated by ns8250 and lpc drivers: > >> - don't enable transmitter empty interrupt before filling TX FIFO. > > > > Are you sure this doesn't create a race that leads to lost TX ready > > interrupts? For a single character, the TX FIFO very well may be empty > > again at the point in time IER_ETXRDY is enabled now. With the varying > > behavior of 8250/16x50 chips - some of which is documented in sio(4) - > > That is mostly FUD. More likely driver bugs than chip bugs. > > A non-broken xx50 interrupts after you (re)enable tx interrupts, iff > the fifo is already empty. This gives a "spurious" interrupt. But > perhaps depending on this is too fragile. Normal operation is to keep > the tx interrupt enabled and depend on writing to the fifo causing a > tx interrupt later. But it is a more common chip bug for tx interrupts > later to not go away when they should (normally by reading the IIR), > so some drivers toggle the tx interrupt enable dynamically. > > An example of a driver bug is only enabling tx interrupts for this. > It takes a transition of the interrupt enable bit from off to on to > get the interrupt. Other driver bugs may result in a missing transition > because the bit was supposed to be off but is actually on. > > > I'd expect there are many that no longer generate a TX ready at all > > with this change in place. In this case, receiving spurious interrupts > > (which ones? IIR_NOPEND? IIR_TXRDY?) with some devices appears to be > > the lesser evil. > > Not many. Only broken ones. In my experience many xx50 are broken, especially the integrated on-board ones you still have in workstations and servers today. > The "spurious" interrupts are just normal > ones from bon-broken chips: > > - uart first does a potentially-unbounded busy-wait before the doing > anything to ensure that the fifo is empty. This should be unecessary > since this function should not be called unless sc_txbusy is 0 and > sc_txbusy should be nonzero if the fifo is not empty. If it is called > when the fifo is not emptu, then the worst-case busy-wait is approx. > 640 seconds for a 128-byte fifo at 2 bps. The 'broken_txfifo case' > busy-waits for a long time in normal operation. > - enabling the tx interrupt causes one immediately on non-broken uarts > - the interrupt handler is normally called immediately. Then it always > blocks on uart_lock() > - then the main code fills the fifo and unlocks > - then the interrupt handler runs. It normally finds that the fifo is > not empty (since it has just been filled) and does nothing > - another tx interrupt occurs later and the interrupt handler runs again. > It normally doesn't hit the lock again, and normally finds the fifo > empty, so it does something. You correctly describe what happens at r295556 with a non-broken xx50. That revision causes a spurious interrupt with non-broken xx50 but also ensures that the relevant TX interrupt isn't missed with broken xx50 that do not issue an interrupt when enabling IER_ETXRDY. Besides, as you say, the general approach of dynamically enabling TX interrupts works around the common brokenness of these interrupts no longer going away when they should. > But you are probably correct that a 1-byte write to the fifo often > loses the race. This depends on how fast the hardware moves the byte > from the fifo to the tx register. Actually, since we didn't wait > for the tx register to become empty, it will often take a full character > time before the move. After that, I think it might take 1 bit time but > no more. My concern is that with r295557, when this race is lost no TX interrupt is seen at all with broken xx50 that do not trigger an interrupt when enabling IER_ETXRDY. Marius From owner-svn-src-all@freebsd.org Sat Feb 13 02:55:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88510AA6A4B; Sat, 13 Feb 2016 02:55:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 5AC1A1096; Sat, 13 Feb 2016 02:55:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1D2tjJW037685; Sat, 13 Feb 2016 02:55:45 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1D2tjaE037684; Sat, 13 Feb 2016 02:55:45 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201602130255.u1D2tjaE037684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sat, 13 Feb 2016 02:55:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295588 - head/sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 02:55:46 -0000 Author: cem Date: Sat Feb 13 02:55:45 2016 New Revision: 295588 URL: https://svnweb.freebsd.org/changeset/base/295588 Log: ioat(4): Recheck status register on zero-descriptor wakeups Errors that halt the channel don't necessarily result in a completion update, apparently. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ioat/ioat.c Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Sat Feb 13 00:28:48 2016 (r295587) +++ head/sys/dev/ioat/ioat.c Sat Feb 13 02:55:45 2016 (r295588) @@ -630,8 +630,14 @@ ioat_process_events(struct ioat_softc *i CTR0(KTR_IOAT, __func__); - if (status == ioat->last_seen) + if (status == ioat->last_seen) { + /* + * If we landed in process_events and nothing has been + * completed, check for a timeout due to channel halt. + */ + comp_update = ioat_get_chansts(ioat); goto out; + } while (1) { desc = ioat_get_ring_entry(ioat, ioat->tail); @@ -661,8 +667,10 @@ out: ioat_write_chanctrl(ioat, IOAT_CHANCTRL_RUN); mtx_unlock(&ioat->cleanup_lock); - ioat_putn(ioat, completed, IOAT_ACTIVE_DESCR_REF); - wakeup(&ioat->tail); + if (completed != 0) { + ioat_putn(ioat, completed, IOAT_ACTIVE_DESCR_REF); + wakeup(&ioat->tail); + } if (!is_ioat_halted(comp_update)) return; From owner-svn-src-all@freebsd.org Sat Feb 13 07:45:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 842F3AA5755; Sat, 13 Feb 2016 07:45:39 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (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 4B92717B7; Sat, 13 Feb 2016 07:45:38 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id D5BE41FE022; Sat, 13 Feb 2016 08:45:31 +0100 (CET) Subject: Re: svn commit: r294327 - in head/sys: dev/cxgb dev/cxgbe dev/e1000 dev/hyperv/netvsc dev/ixgbe dev/mxge netinet sys To: Warner Losh , Pedro Giffuni References: <201601191533.u0JFXSxf037804@repo.freebsd.org> <56BAE4BC.9000105@selasky.org> <56BB5280.5060609@FreeBSD.org> Cc: Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Hans Petter Selasky Message-ID: <56BEDFA9.9080305@selasky.org> Date: Sat, 13 Feb 2016 08:47:53 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 07:45:39 -0000 On 02/11/16 17:47, Warner Losh wrote: > On Wed, Feb 10, 2016 at 8:08 AM, Pedro Giffuni wrote: > >> Hello; >> >> El 10/02/2016 a las 02:20, Hans Petter Selasky escribió: >> >>> On 01/19/16 17:09, Ryan Stone wrote: >>> >>>> On Tue, Jan 19, 2016 at 10:33 AM, Hans Petter Selasky < >>>> hselasky@freebsd.org> >>>> wrote: >>>> >>>> >>>>> + qsort(lc->lro_mbuf_data, lc->lro_mbuf_count, sizeof(struct mbuf >>>>> *), >>>>> + &tcp_lro_mbuf_compare_header); >>>>> >>>>> >>>> In the worst case, qsort() can take O(n**2) time and consume O(n) stack >>>> space. Is there a DOS concern here? >>>> >>>> >>> Hi, >>> >>> Our FreeBSD qsort() routine has been specifically modified to not exhibit >>> the so-called QuickSort worst case behaviour of O(N**2) sorting time. This >>> is not documented in our source code, but here: >>> >>> http://cs.fit.edu/~pkc/classes/writing/samples/bentley93engineering.pdf >>> >>> So I think DOS w.r.t O(N**2) is not a valid consern. >>> >>> Thank you for your input Ryan. >>> >>> BTW: >>> >>> Drew Gallatin has tested our qsort() v.s. my mergesort() and found that: >>> >>> "It looks like mergesort is nearly 2x as expensive. (4.7% vs 2.5%)" >>> >>> >> FWIW, our libc qsort() has an additional enhancement: >> >> http://svnweb.freebsd.org/base?view=revision&revision=279663 >> >> In my measurements qsort(3) was now always faster than mergesort(3). > > > If it is faster, is there any good reason to maintain both qsort and > mergesort > in the kernel then? > No, I've abandoned the mergesort patch. --HPS From owner-svn-src-all@freebsd.org Sat Feb 13 10:16:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21C28AA7F1F; Sat, 13 Feb 2016 10:16:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 939F4143A; Sat, 13 Feb 2016 10:16:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u1DAGOeu053685 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 13 Feb 2016 12:16:24 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u1DAGOeu053685 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u1DAGNiW053647; Sat, 13 Feb 2016 12:16:23 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 13 Feb 2016 12:16:23 +0200 From: Konstantin Belousov To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295561 - in head: include sys/mips/include sys/powerpc/include sys/sparc64/include sys/sys sys/x86/include Message-ID: <20160213101623.GZ91220@kib.kiev.ua> References: <201602120738.u1C7cKpq093956@repo.freebsd.org> <20160212232717.P894@besplex.bde.org> <20160212143630.GS91220@kib.kiev.ua> <20160213021939.S1340@besplex.bde.org> <20160212173641.GV91220@kib.kiev.ua> <20160213070506.N2501@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160213070506.N2501@besplex.bde.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 10:16:30 -0000 On Sat, Feb 13, 2016 at 07:29:48AM +1100, Bruce Evans wrote: > It needs a version number to be correct. Plain __POSIX_VISIBLE means > all versions. __POSIX_VISBLE >= 200112 is probably good enough for > the POSIX part. I don't know the correct number for XSI. Perhaps > it can be simply omitted. _XOPEN_SOURCE >= 600 gives > __XSI_VISIBLE >= 600 && _POSIX_C_SOURCE >= 200112. So __XSI_VISIBLE > in the above is only to support XSI before 2001. We only support 1 > XSI before that -- #500 which corresponds to 1996 POSIX. Very likely > XSI did have ucontext_t then, so the above ifdef is correct. It is > just hard to read. Easier than google hits though :-). I found a > gnu man page about getcontext() being in SVID but couldn't easily > find the history. I have SVID document labeled FINAL COPY June 15, 1995 First Edition. There, it seems that ucontext.h is required. Below is the updated patch. diff --git a/include/signal.h b/include/signal.h index 33be55c..217fadd 100644 --- a/include/signal.h +++ b/include/signal.h @@ -36,8 +36,10 @@ #include #include #include +#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE #include #include +#endif #if __BSD_VISIBLE /* From owner-svn-src-all@freebsd.org Sat Feb 13 14:57:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD0BDAA7E9A; Sat, 13 Feb 2016 14:57:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 76F9A1BF8; Sat, 13 Feb 2016 14:57:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1DEvCkb050285; Sat, 13 Feb 2016 14:57:12 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1DEvAWO050264; Sat, 13 Feb 2016 14:57:10 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201602131457.u1DEvAWO050264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 13 Feb 2016 14:57:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295590 - in vendor/llvm/dist: cmake/modules docs include/llvm/IR lib/Analysis lib/CodeGen/AsmPrinter lib/IR lib/Target/AArch64 lib/Target/AMDGPU lib/Target/AMDGPU/Utils lib/Target/ARM ... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 14:57:13 -0000 Author: dim Date: Sat Feb 13 14:57:10 2016 New Revision: 295590 URL: https://svnweb.freebsd.org/changeset/base/295590 Log: Vendor import of llvm release_38 branch r260756: https://llvm.org/svn/llvm-project/llvm/branches/release_38@260756 Added: vendor/llvm/dist/lib/Target/AArch64/AArch64SchedM1.td vendor/llvm/dist/test/CodeGen/AMDGPU/spill-scavenge-offset.ll vendor/llvm/dist/test/CodeGen/PowerPC/inline-asm-s-modifier.ll vendor/llvm/dist/test/CodeGen/PowerPC/pr26193.ll vendor/llvm/dist/test/CodeGen/PowerPC/pr26356.ll vendor/llvm/dist/test/CodeGen/PowerPC/pr26381.ll vendor/llvm/dist/test/CodeGen/SystemZ/int-cmp-53.ll vendor/llvm/dist/test/DebugInfo/X86/PR26148.ll Modified: vendor/llvm/dist/cmake/modules/AddLLVM.cmake vendor/llvm/dist/cmake/modules/LLVM-Config.cmake vendor/llvm/dist/docs/ReleaseNotes.rst vendor/llvm/dist/include/llvm/IR/IntrinsicsPowerPC.td vendor/llvm/dist/include/llvm/IR/Value.h vendor/llvm/dist/lib/Analysis/DemandedBits.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfDebug.cpp vendor/llvm/dist/lib/IR/Value.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64.td vendor/llvm/dist/lib/Target/AArch64/AArch64ISelLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPU.td vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUSubtarget.h vendor/llvm/dist/lib/Target/AMDGPU/Processors.td vendor/llvm/dist/lib/Target/AMDGPU/SIRegisterInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCFastISel.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCInstrAltivec.td vendor/llvm/dist/lib/Target/SystemZ/SystemZISelLowering.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCompares.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineVectorOps.cpp vendor/llvm/dist/lib/Transforms/Utils/SimplifyCFG.cpp vendor/llvm/dist/test/Analysis/DemandedBits/basic.ll vendor/llvm/dist/test/CodeGen/AArch64/fp16-v4-instructions.ll vendor/llvm/dist/test/CodeGen/AArch64/fp16-v8-instructions.ll vendor/llvm/dist/test/CodeGen/AMDGPU/hsa-note-no-func.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.SI.fs.interp.ll vendor/llvm/dist/test/CodeGen/ARM/shifter_operand.ll vendor/llvm/dist/test/CodeGen/PowerPC/fast-isel-ret.ll vendor/llvm/dist/test/CodeGen/X86/avx512-gather-scatter-intrin.ll vendor/llvm/dist/test/CodeGen/X86/setcc-lowering.ll vendor/llvm/dist/test/Transforms/InstCombine/icmp.ll vendor/llvm/dist/test/Transforms/InstCombine/insert-extract-shuffle.ll vendor/llvm/dist/test/Transforms/InstCombine/unpack-fca.ll vendor/llvm/dist/test/Transforms/LoopVectorize/AArch64/loop-vectorization-factors.ll vendor/llvm/dist/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll vendor/llvm/dist/tools/CMakeLists.txt vendor/llvm/dist/utils/release/test-release.sh vendor/llvm/dist/utils/unittest/CMakeLists.txt vendor/llvm/dist/utils/unittest/UnitTestMain/CMakeLists.txt Modified: vendor/llvm/dist/cmake/modules/AddLLVM.cmake ============================================================================== --- vendor/llvm/dist/cmake/modules/AddLLVM.cmake Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/cmake/modules/AddLLVM.cmake Sat Feb 13 14:57:10 2016 (r295590) @@ -468,20 +468,23 @@ function(llvm_add_library name) endif() endif() - # Add the explicit dependency information for this library. - # - # It would be nice to verify that we have the dependencies for this library - # name, but using get_property(... SET) doesn't suffice to determine if a - # property has been set to an empty value. - get_property(lib_deps GLOBAL PROPERTY LLVMBUILD_LIB_DEPS_${name}) - - if (LLVM_LINK_LLVM_DYLIB AND NOT ARG_STATIC AND NOT ARG_DISABLE_LLVM_LINK_LLVM_DYLIB) - set(llvm_libs LLVM) - else() - llvm_map_components_to_libnames(llvm_libs - ${ARG_LINK_COMPONENTS} - ${LLVM_LINK_COMPONENTS} - ) + if (DEFINED LLVM_LINK_COMPONENTS OR DEFINED ARG_LINK_COMPONENTS) + if (LLVM_LINK_LLVM_DYLIB AND NOT ARG_DISABLE_LLVM_LINK_LLVM_DYLIB) + set(llvm_libs LLVM) + else() + llvm_map_components_to_libnames(llvm_libs + ${ARG_LINK_COMPONENTS} + ${LLVM_LINK_COMPONENTS} + ) + endif() + else() + # Components have not been defined explicitly in CMake, so add the + # dependency information for this library as defined by LLVMBuild. + # + # It would be nice to verify that we have the dependencies for this library + # name, but using get_property(... SET) doesn't suffice to determine if a + # property has been set to an empty value. + get_property(lib_deps GLOBAL PROPERTY LLVMBUILD_LIB_DEPS_${name}) endif() if(CMAKE_VERSION VERSION_LESS 2.8.12) @@ -882,14 +885,11 @@ function(add_unittest test_suite test_na set(LLVM_REQUIRES_RTTI OFF) + list(APPEND LLVM_LINK_COMPONENTS Support) # gtest needs it for raw_ostream add_llvm_executable(${test_name} IGNORE_EXTERNALIZE_DEBUGINFO ${ARGN}) set(outdir ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}) set_output_directory(${test_name} BINARY_DIR ${outdir} LIBRARY_DIR ${outdir}) - target_link_libraries(${test_name} - gtest - gtest_main - LLVMSupport # gtest needs it for raw_ostream. - ) + target_link_libraries(${test_name} gtest_main gtest) add_dependencies(${test_suite} ${test_name}) get_target_property(test_suite_folder ${test_suite} FOLDER) Modified: vendor/llvm/dist/cmake/modules/LLVM-Config.cmake ============================================================================== --- vendor/llvm/dist/cmake/modules/LLVM-Config.cmake Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/cmake/modules/LLVM-Config.cmake Sat Feb 13 14:57:10 2016 (r295590) @@ -40,10 +40,19 @@ macro(llvm_config executable) # done in case libLLVM does not contain all of the components # the target requires. # - # TODO strip LLVM_DYLIB_COMPONENTS out of link_components. + # Strip LLVM_DYLIB_COMPONENTS out of link_components. # To do this, we need special handling for "all", since that # may imply linking to libraries that are not included in # libLLVM. + + if (DEFINED link_components AND DEFINED LLVM_DYLIB_COMPONENTS) + if("${LLVM_DYLIB_COMPONENTS}" STREQUAL "all") + set(link_components "") + else() + list(REMOVE_ITEM link_components ${LLVM_DYLIB_COMPONENTS}) + endif() + endif() + target_link_libraries(${executable} LLVM) endif() Modified: vendor/llvm/dist/docs/ReleaseNotes.rst ============================================================================== --- vendor/llvm/dist/docs/ReleaseNotes.rst Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/docs/ReleaseNotes.rst Sat Feb 13 14:57:10 2016 (r295590) @@ -5,11 +5,6 @@ LLVM 3.8 Release Notes .. contents:: :local: -.. warning:: - These are in-progress notes for the upcoming LLVM 3.8 release. You may - prefer the `LLVM 3.7 Release Notes `_. - Introduction ============ @@ -26,11 +21,6 @@ have questions or comments, the `LLVM De `_ is a good place to send them. -Note that if you are reading this file from a Subversion checkout or the main -LLVM web page, this document applies to the *next* release, not the current -one. To see the release notes for a specific release, please see the `releases -page `_. - Non-comprehensive list of changes in this release ================================================= * With this release, the minimum Windows version required for running LLVM is @@ -79,6 +69,26 @@ Non-comprehensive list of changes in thi * Support for dematerializing has been dropped. +* RegisterScheduler::setDefault was removed. Targets that used to call into the + command line parser to set the DAGScheduler, and that don't have enough + control with setSchedulingPreference, should look into overriding the + SubTargetHook "getDAGScheduler()". + +* ``ilist_iterator`` no longer has implicit conversions to and from ``T*``, + since ``ilist_iterator`` may be pointing at the sentinel (which is usually + not of type ``T`` at all). To convert from an iterator ``I`` to a pointer, + use ``&*I``; to convert from a pointer ``P`` to an iterator, use + ``P->getIterator()``. Alternatively, explicit conversions via + ``static_cast(U)`` are still available. + +* ``ilist_node::getNextNode()`` and ``ilist_node::getPrevNode()`` now + fail at compile time when the node cannot access its parent list. + Previously, when the sentinel was was an ``ilist_half_node``, this API + could return the sentinal instead of ``nullptr``. Frustrated callers should + be updated to use ``iplist::getNextNode(T*)`` instead. Alternatively, if + the node ``N`` is guaranteed not to be the last in the list, it is safe to + call ``&*++N->getIterator()`` directly. + .. NOTE For small 1-3 sentence descriptions, just add an entry at the end of this list. If your description won't fit comfortably in one bullet @@ -98,17 +108,97 @@ Non-comprehensive list of changes in thi Makes programs 10x faster by doing Special New Thing. -Changes to the ARM Backend --------------------------- - During this release ... +Changes to the ARM Backends +--------------------------- + +During this release the AArch64 target has: + +* Added support for more sanitizers (MSAN, TSAN) and made them compatible with + all VMA kernel configurations (kurrently tested on 39 and 42 bits). +* Gained initial LLD support in the new ELF back-end +* Extended the Load/Store optimiser and cleaned up some of the bad decisions + made earlier. +* Expanded LLDB support, including watchpoints, native building, Renderscript, + LLDB-server, debugging 32-bit applications. +* Added support for the ``Exynos M1`` chip. + +During this release the ARM target has: + +* Gained massive performance improvements on embedded benchmarks due to finally + running the stride vectorizer in full form, incrementing the performance gains + that we already had in the previous releases with limited stride vectorization. +* Expanded LLDB support, including watchpoints, unwind tables +* Extended the Load/Store optimiser and cleaned up some of the bad decisions + made earlier. +* Simplified code generation for global variable addresses in ELF, resulting in + a significant (4% in Chromium) reduction in code size. +* Gained some additional code size improvements, though there's still a long road + ahead, especially for older cores. +* Added some EABI floating point comparison functions to Compiler-RT +* Added support for Windows+GNU triple, +features in -mcpu/-march options. Changes to the MIPS Target -------------------------- - During this release ... +During this release the MIPS target has: + +* Significantly extended support for the Integrated Assembler. See below for + more information +* Added support for the ``P5600`` processor. +* Added support for the ``interrupt`` attribute for MIPS32R2 and later. This + attribute will generate a function which can be used as a interrupt handler + on bare metal MIPS targets using the static relocation model. +* Added support for the ``ERETNC`` instruction found in MIPS32R5 and later. +* Added support for OpenCL. See http://portablecl.org/. + + * Address spaces 1 to 255 are now reserved for software use and conversions + between them are no-op casts. + +* Removed the ``mips16`` value for the -mcpu option since it is an :abbr:`ASE + (Application Specific Extension)` and not a processor. If you were using this, + please specify another CPU and use ``-mips16`` to enable MIPS16. +* Removed ``copy_u.w`` from 32-bit MSA and ``copy_u.d`` from 64-bit MSA since + they have been removed from the MSA specification due to forward compatibility + issues. For example, 32-bit MSA code containing ``copy_u.w`` would behave + differently on a 64-bit processor supporting MSA. The corresponding intrinsics + are still available and may expand to ``copy_s.[wd]`` where this is + appropriate for forward compatibility purposes. +* Relaxed the ``-mnan`` option to allow ``-mnan=2008`` on MIPS32R2/MIPS64R2 for + compatibility with GCC. +* Made MIPS64R6 the default CPU for 64-bit Android triples. + +The MIPS target has also fixed various bugs including the following notable +fixes: + +* Fixed reversed operands on ``mthi``/``mtlo`` in the DSP :abbr:`ASE + (Application Specific Extension)`. +* The code generator no longer uses ``jal`` for calls to absolute immediate + addresses. +* Disabled fast instruction selection on MIPS32R6 and MIPS64R6 since this is not + yet supported. +* Corrected addend for ``R_MIPS_HI16`` and ``R_MIPS_PCHI16`` in MCJIT +* The code generator no longer crashes when handling subregisters of an 64-bit + FPU register with undefined value. +* The code generator no longer attempts to use ``$zero`` for operands that do + not permit ``$zero``. +* Corrected the opcode used for ``ll``/``sc`` when using MIPS32R6/MIPS64R6 and + the Integrated Assembler. +* Added support for atomic load and atomic store. +* Corrected debug info when dynamically re-aligning the stack. + +Integrated Assembler +^^^^^^^^^^^^^^^^^^^^ +We have made a large number of improvements to the integrated assembler for +MIPS. In this release, the integrated assembler isn't quite production-ready +since there are a few known issues related to bare-metal support, checking +immediates on instructions, and the N32/N64 ABI's. However, the current support +should be sufficient for many users of the O32 ABI, particularly those targeting +MIPS32 on Linux or bare-metal MIPS32. +If you would like to try the integrated assembler, please use +``-fintegrated-as``. Changes to the PowerPC Target ----------------------------- @@ -123,6 +213,20 @@ Changes to the X86 Target * TLS is enabled for Cygwin as emutls. +* Smaller code for materializing 32-bit 1 and -1 constants at ``-Os``. + +* More efficient code for wide integer compares. (E.g. 64-bit compares + on 32-bit targets.) + +* Tail call support for ``thiscall``, ``stdcall`, ``vectorcall``, and + ``fastcall`` functions. + +Changes to the AVR Target +------------------------- + +Slightly less than half of the AVR backend has been merged in at this point. It is still +missing a number large parts which cause it to be unusable, but is well on the +road to being completely merged and workable. Changes to the OCaml bindings ----------------------------- @@ -140,7 +244,19 @@ An exciting aspect of LLVM is that it is a lot of other language and tools projects. This section lists some of the projects that have already been updated to work with LLVM 3.8. -* A project +LDC - the LLVM-based D compiler +------------------------------- + +`D `_ is a language with C-like syntax and static typing. It +pragmatically combines efficiency, control, and modeling power, with safety and +programmer productivity. D supports powerful concepts like Compile-Time Function +Execution (CTFE) and Template Meta-Programming, provides an innovative approach +to concurrency and offers many classical paradigms. + +`LDC `_ uses the frontend from the reference compiler +combined with LLVM as backend to produce efficient native code. LDC targets +x86/x86_64 systems like Linux, OS X and Windows and also PowerPC (32/64 bit) +and ARM. Ports to other architectures like AArch64 and MIPS64 are underway. Additional Information Modified: vendor/llvm/dist/include/llvm/IR/IntrinsicsPowerPC.td ============================================================================== --- vendor/llvm/dist/include/llvm/IR/IntrinsicsPowerPC.td Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/include/llvm/IR/IntrinsicsPowerPC.td Sat Feb 13 14:57:10 2016 (r295590) @@ -484,7 +484,7 @@ let TargetPrefix = "ppc" in { // All PP Intrinsic<[llvm_v16i8_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>; def int_ppc_altivec_vpkswss : GCCBuiltin<"__builtin_altivec_vpkswss">, - Intrinsic<[llvm_v16i8_ty], [llvm_v4i32_ty, llvm_v4i32_ty], + Intrinsic<[llvm_v8i16_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>; def int_ppc_altivec_vpkswus : GCCBuiltin<"__builtin_altivec_vpkswus">, Intrinsic<[llvm_v8i16_ty], [llvm_v4i32_ty, llvm_v4i32_ty], Modified: vendor/llvm/dist/include/llvm/IR/Value.h ============================================================================== --- vendor/llvm/dist/include/llvm/IR/Value.h Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/include/llvm/IR/Value.h Sat Feb 13 14:57:10 2016 (r295590) @@ -280,11 +280,7 @@ public: // when using them since you might not get all uses. // The methods that don't start with materialized_ assert that modules is // fully materialized. -#ifdef NDEBUG - void assertModuleIsMaterialized() const {} -#else void assertModuleIsMaterialized() const; -#endif bool use_empty() const { assertModuleIsMaterialized(); Modified: vendor/llvm/dist/lib/Analysis/DemandedBits.cpp ============================================================================== --- vendor/llvm/dist/lib/Analysis/DemandedBits.cpp Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/lib/Analysis/DemandedBits.cpp Sat Feb 13 14:57:10 2016 (r295590) @@ -242,13 +242,6 @@ void DemandedBits::determineLiveOperandB if (OperandNo != 0) AB = AOut; break; - case Instruction::ICmp: - // Count the number of leading zeroes in each operand. - ComputeKnownBits(BitWidth, UserI->getOperand(0), UserI->getOperand(1)); - auto NumLeadingZeroes = std::min(KnownZero.countLeadingOnes(), - KnownZero2.countLeadingOnes()); - AB = ~APInt::getHighBitsSet(BitWidth, NumLeadingZeroes); - break; } } Modified: vendor/llvm/dist/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp ============================================================================== --- vendor/llvm/dist/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp Sat Feb 13 14:57:10 2016 (r295590) @@ -555,6 +555,11 @@ bool AsmPrinter::PrintAsmOperand(const M return true; O << -MO.getImm(); return false; + case 's': // The GCC deprecated s modifier + if (MO.getType() != MachineOperand::MO_Immediate) + return true; + O << ((32 - MO.getImm()) & 31); + return false; } } return true; Modified: vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfDebug.cpp ============================================================================== --- vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Sat Feb 13 14:57:10 2016 (r295590) @@ -793,16 +793,27 @@ static DebugLocEntry::Value getDebugLocV llvm_unreachable("Unexpected 4-operand DBG_VALUE instruction!"); } -/// Determine whether two variable pieces overlap. -static bool piecesOverlap(const DIExpression *P1, const DIExpression *P2) { - if (!P1->isBitPiece() || !P2->isBitPiece()) - return true; +// Determine the relative position of the pieces described by P1 and P2. +// Returns -1 if P1 is entirely before P2, 0 if P1 and P2 overlap, +// 1 if P1 is entirely after P2. +static int pieceCmp(const DIExpression *P1, const DIExpression *P2) { unsigned l1 = P1->getBitPieceOffset(); unsigned l2 = P2->getBitPieceOffset(); unsigned r1 = l1 + P1->getBitPieceSize(); unsigned r2 = l2 + P2->getBitPieceSize(); - // True where [l1,r1[ and [r1,r2[ overlap. - return (l1 < r2) && (l2 < r1); + if (r1 <= l2) + return -1; + else if (r2 <= l1) + return 1; + else + return 0; +} + +/// Determine whether two variable pieces overlap. +static bool piecesOverlap(const DIExpression *P1, const DIExpression *P2) { + if (!P1->isBitPiece() || !P2->isBitPiece()) + return true; + return pieceCmp(P1, P2) == 0; } /// \brief If this and Next are describing different pieces of the same @@ -811,14 +822,32 @@ static bool piecesOverlap(const DIExpres /// Return true if the merge was successful. bool DebugLocEntry::MergeValues(const DebugLocEntry &Next) { if (Begin == Next.Begin) { - auto *Expr = cast_or_null(Values[0].Expression); - auto *NextExpr = cast_or_null(Next.Values[0].Expression); - if (Expr->isBitPiece() && NextExpr->isBitPiece() && - !piecesOverlap(Expr, NextExpr)) { - addValues(Next.Values); - End = Next.End; - return true; + auto *FirstExpr = cast(Values[0].Expression); + auto *FirstNextExpr = cast(Next.Values[0].Expression); + if (!FirstExpr->isBitPiece() || !FirstNextExpr->isBitPiece()) + return false; + + // We can only merge entries if none of the pieces overlap any others. + // In doing so, we can take advantage of the fact that both lists are + // sorted. + for (unsigned i = 0, j = 0; i < Values.size(); ++i) { + for (; j < Next.Values.size(); ++j) { + int res = pieceCmp(cast(Values[i].Expression), + cast(Next.Values[j].Expression)); + if (res == 0) // The two expressions overlap, we can't merge. + return false; + // Values[i] is entirely before Next.Values[j], + // so go back to the next entry of Values. + else if (res == -1) + break; + // Next.Values[j] is entirely before Values[i], so go on to the + // next entry of Next.Values. + } } + + addValues(Next.Values); + End = Next.End; + return true; } return false; } Modified: vendor/llvm/dist/lib/IR/Value.cpp ============================================================================== --- vendor/llvm/dist/lib/IR/Value.cpp Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/lib/IR/Value.cpp Sat Feb 13 14:57:10 2016 (r295590) @@ -313,8 +313,8 @@ void Value::takeName(Value *V) { ST->reinsertValue(this); } -#ifndef NDEBUG void Value::assertModuleIsMaterialized() const { +#ifndef NDEBUG const GlobalValue *GV = dyn_cast(this); if (!GV) return; @@ -322,8 +322,10 @@ void Value::assertModuleIsMaterialized() if (!M) return; assert(M->isMaterialized()); +#endif } +#ifndef NDEBUG static bool contains(SmallPtrSetImpl &Cache, ConstantExpr *Expr, Constant *C) { if (!Cache.insert(Expr).second) Modified: vendor/llvm/dist/lib/Target/AArch64/AArch64.td ============================================================================== --- vendor/llvm/dist/lib/Target/AArch64/AArch64.td Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/lib/Target/AArch64/AArch64.td Sat Feb 13 14:57:10 2016 (r295590) @@ -90,6 +90,7 @@ def AArch64InstrInfo : InstrInfo; include "AArch64SchedA53.td" include "AArch64SchedA57.td" include "AArch64SchedCyclone.td" +include "AArch64SchedM1.td" def ProcA35 : SubtargetFeature<"a35", "ARMProcFamily", "CortexA35", "Cortex-A35 ARM processors", @@ -144,8 +145,7 @@ def : ProcessorModel<"cortex-a57", Corte // FIXME: Cortex-A72 is currently modelled as an Cortex-A57. def : ProcessorModel<"cortex-a72", CortexA57Model, [ProcA57]>; def : ProcessorModel<"cyclone", CycloneModel, [ProcCyclone]>; -// FIXME: Exynos-M1 is currently modelled without a specific SchedModel. -def : ProcessorModel<"exynos-m1", NoSchedModel, [ProcExynosM1]>; +def : ProcessorModel<"exynos-m1", ExynosM1Model, [ProcExynosM1]>; //===----------------------------------------------------------------------===// // Assembly parser Modified: vendor/llvm/dist/lib/Target/AArch64/AArch64ISelLowering.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/AArch64/AArch64ISelLowering.cpp Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/lib/Target/AArch64/AArch64ISelLowering.cpp Sat Feb 13 14:57:10 2016 (r295590) @@ -6689,6 +6689,9 @@ SDValue AArch64TargetLowering::LowerVSET return DAG.getSExtOrTrunc(Cmp, dl, Op.getValueType()); } + if (LHS.getValueType().getVectorElementType() == MVT::f16) + return SDValue(); + assert(LHS.getValueType().getVectorElementType() == MVT::f32 || LHS.getValueType().getVectorElementType() == MVT::f64); Added: vendor/llvm/dist/lib/Target/AArch64/AArch64SchedM1.td ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/lib/Target/AArch64/AArch64SchedM1.td Sat Feb 13 14:57:10 2016 (r295590) @@ -0,0 +1,359 @@ +//=- AArch64SchedM1.td - Samsung Exynos-M1 Scheduling Defs ---*- tablegen -*-=// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines the machine model for Samsung Exynos-M1 to support +// instruction scheduling and other instruction cost heuristics. +// +//===----------------------------------------------------------------------===// + +//===----------------------------------------------------------------------===// +// The Exynos-M1 is a traditional superscalar microprocessor with a +// 4-wide in-order stage for decode and dispatch and a wider issue stage. +// The execution units and loads and stores are out-of-order. + +def ExynosM1Model : SchedMachineModel { + let IssueWidth = 4; // Up to 4 uops per cycle. + let MinLatency = 0; // OoO. + let MicroOpBufferSize = 96; // ROB size. + let LoopMicroOpBufferSize = 32; // Instruction queue size. + let LoadLatency = 4; // Optimistic load cases. + let MispredictPenalty = 14; // Minimum branch misprediction penalty. + let CompleteModel = 0; // Use the default model otherwise. +} + +//===----------------------------------------------------------------------===// +// Define each kind of processor resource and number available on the Exynos-M1, +// which has 9 pipelines, each with its own queue with out-of-order dispatch. + +def M1UnitA : ProcResource<2>; // Simple integer +def M1UnitC : ProcResource<1>; // Simple and complex integer +def M1UnitB : ProcResource<2>; // Branch +def M1UnitL : ProcResource<1>; // Load +def M1UnitS : ProcResource<1>; // Store +def M1PipeF0 : ProcResource<1>; // FP #0 +def M1PipeF1 : ProcResource<1>; // FP #1 + +let Super = M1PipeF0 in { + def M1UnitFMAC : ProcResource<1>; // FP multiplication + def M1UnitFCVT : ProcResource<1>; // FP conversion + def M1UnitNAL0 : ProcResource<1>; // Simple vector. + def M1UnitNMISC : ProcResource<1>; // Miscellanea + def M1UnitNCRYPT : ProcResource<1>; // Cryptographic +} + +let Super = M1PipeF1 in { + def M1UnitFADD : ProcResource<1>; // Simple FP + let BufferSize = 1 in + def M1UnitFVAR : ProcResource<1>; // FP division & square root (serialized) + def M1UnitNAL1 : ProcResource<1>; // Simple vector. + def M1UnitFST : ProcResource<1>; // FP store +} + +let SchedModel = ExynosM1Model in { + def M1UnitALU : ProcResGroup<[M1UnitA, + M1UnitC]>; // All simple integer. + def M1UnitNALU : ProcResGroup<[M1UnitNAL0, + M1UnitNAL1]>; // All simple vector. +} + +let SchedModel = ExynosM1Model in { + +//===----------------------------------------------------------------------===// +// Coarse scheduling model for the Exynos-M1. + +// Branch instructions. +// TODO: Non-conditional direct branches take zero cycles and units. +def : WriteRes { let Latency = 1; } +def : WriteRes { let Latency = 1; } +// TODO: Branch and link is much different. + +// Arithmetic and logical integer instructions. +def : WriteRes { let Latency = 1; } +// TODO: Shift over 3 and some extensions take 2 cycles. +def : WriteRes { let Latency = 1; } +def : WriteRes { let Latency = 1; } +def : WriteRes { let Latency = 1; } + +// Move instructions. +def : WriteRes { let Latency = 1; } + +// Divide and multiply instructions. +// TODO: Division blocks the divider inside C. +def : WriteRes { let Latency = 13; } +def : WriteRes { let Latency = 21; } +// TODO: Long multiplication take 5 cycles and also the ALU. +// TODO: Multiplication with accumulation can be advanced. +def : WriteRes { let Latency = 3; } +// TODO: 64-bit multiplication has a throughput of 1/2. +def : WriteRes { let Latency = 4; } + +// Miscellaneous instructions. +def : WriteRes { let Latency = 2; } + +// TODO: The latency for the post or pre register is 1 cycle. +def : WriteRes { let Latency = 0; } + +// Load instructions. +def : WriteRes { let Latency = 4; } +// TODO: Extended address requires also the ALU. +def : WriteRes { let Latency = 5; } +def : WriteRes { let Latency = 4; } + +// Store instructions. +def : WriteRes { let Latency = 1; } +// TODO: Extended address requires also the ALU. +def : WriteRes { let Latency = 1; } +def : WriteRes { let Latency = 1; } +def : WriteRes { let Latency = 1; } + +// FP data instructions. +def : WriteRes { let Latency = 3; } +// TODO: FCCMP is much different. +def : WriteRes { let Latency = 4; } +// TODO: DP takes longer. +def : WriteRes { let Latency = 15; } +// TODO: MACC takes longer. +def : WriteRes { let Latency = 4; } + +// FP miscellaneous instructions. +// TODO: Conversion between register files is much different. +def : WriteRes { let Latency = 3; } +def : WriteRes { let Latency = 1; } +// TODO: Copy from FPR to GPR is much different. +def : WriteRes { let Latency = 4; } + +// FP load instructions. +// TODO: ASIMD loads are much different. +def : WriteRes { let Latency = 5; } + +// FP store instructions. +// TODO: ASIMD stores are much different. +def : WriteRes { let Latency = 1; } + +// ASIMD FP instructions. +// TODO: Other operations are much different. +def : WriteRes { let Latency = 3; } + +// Other miscellaneous instructions. +def : WriteRes { let Latency = 1; } +def : WriteRes { let Latency = 1; } +def : WriteRes { let Latency = 1; } + +//===----------------------------------------------------------------------===// +// Fast forwarding. + +// TODO: Add FP register forwarding rules. + +def : ReadAdvance; +def : ReadAdvance; +def : ReadAdvance; +def : ReadAdvance; +// Integer multiply-accumulate. +// TODO: The forwarding for WriteIM64 saves actually 3 cycles. +def : ReadAdvance; +def : ReadAdvance; +def : ReadAdvance; +def : ReadAdvance; +def : ReadAdvance; + +//===----------------------------------------------------------------------===// +// Finer scheduling model for the Exynos-M1. + +def M1WriteNEONA : SchedWriteRes<[M1UnitNALU, + M1UnitNALU, + M1UnitFADD]> { let Latency = 9; } +def M1WriteNEONB : SchedWriteRes<[M1UnitNALU, + M1UnitFST]> { let Latency = 5; } +def M1WriteNEONC : SchedWriteRes<[M1UnitNALU, + M1UnitFST]> { let Latency = 6; } +def M1WriteNEOND : SchedWriteRes<[M1UnitNALU, + M1UnitFST, + M1UnitL]> { let Latency = 10; } +def M1WriteNEONE : SchedWriteRes<[M1UnitFCVT, + M1UnitFST]> { let Latency = 8; } +def M1WriteNEONF : SchedWriteRes<[M1UnitFCVT, + M1UnitFST, + M1UnitL]> { let Latency = 13; } +def M1WriteNEONG : SchedWriteRes<[M1UnitNMISC, + M1UnitFST]> { let Latency = 6; } +def M1WriteNEONH : SchedWriteRes<[M1UnitNALU, + M1UnitFST]> { let Latency = 3; } +def M1WriteNEONI : SchedWriteRes<[M1UnitFST, + M1UnitL]> { let Latency = 9; } +def M1WriteALU1 : SchedWriteRes<[M1UnitALU]> { let Latency = 1; } +def M1WriteB : SchedWriteRes<[M1UnitB]> { let Latency = 1; } +// FIXME: This is the worst case, conditional branch and link. +def M1WriteBL : SchedWriteRes<[M1UnitB, + M1UnitALU]> { let Latency = 1; } +// FIXME: This is the worst case, when using LR. +def M1WriteBLR : SchedWriteRes<[M1UnitB, + M1UnitALU, + M1UnitALU]> { let Latency = 2; } +def M1WriteC1 : SchedWriteRes<[M1UnitC]> { let Latency = 1; } +def M1WriteC2 : SchedWriteRes<[M1UnitC]> { let Latency = 2; } +def M1WriteFADD3 : SchedWriteRes<[M1UnitFADD]> { let Latency = 3; } +def M1WriteFCVT3 : SchedWriteRes<[M1UnitFCVT]> { let Latency = 3; } +def M1WriteFCVT4 : SchedWriteRes<[M1UnitFCVT]> { let Latency = 4; } +def M1WriteFMAC4 : SchedWriteRes<[M1UnitFMAC]> { let Latency = 4; } +def M1WriteFMAC5 : SchedWriteRes<[M1UnitFMAC]> { let Latency = 5; } +def M1WriteFVAR15 : SchedWriteRes<[M1UnitFVAR]> { let Latency = 15; } +def M1WriteFVAR23 : SchedWriteRes<[M1UnitFVAR]> { let Latency = 23; } +def M1WriteNALU1 : SchedWriteRes<[M1UnitNALU]> { let Latency = 1; } +def M1WriteNALU2 : SchedWriteRes<[M1UnitNALU]> { let Latency = 2; } +def M1WriteNAL11 : SchedWriteRes<[M1UnitNAL1]> { let Latency = 1; } +def M1WriteNAL12 : SchedWriteRes<[M1UnitNAL1]> { let Latency = 2; } +def M1WriteNAL13 : SchedWriteRes<[M1UnitNAL1]> { let Latency = 3; } +def M1WriteNCRYPT1 : SchedWriteRes<[M1UnitNCRYPT]> { let Latency = 1; } +def M1WriteNCRYPT5 : SchedWriteRes<[M1UnitNCRYPT]> { let Latency = 5; } +def M1WriteNMISC1 : SchedWriteRes<[M1UnitNMISC]> { let Latency = 1; } +def M1WriteNMISC2 : SchedWriteRes<[M1UnitNMISC]> { let Latency = 2; } +def M1WriteNMISC3 : SchedWriteRes<[M1UnitNMISC]> { let Latency = 3; } +def M1WriteNMISC4 : SchedWriteRes<[M1UnitNMISC]> { let Latency = 4; } +def M1WriteS4 : SchedWriteRes<[M1UnitS]> { let Latency = 4; } +def M1WriteTB : SchedWriteRes<[M1UnitC, + M1UnitALU]> { let Latency = 2; } + +// Branch instructions +def : InstRW<[M1WriteB ], (instrs Bcc)>; +def : InstRW<[M1WriteBL], (instrs BL)>; +def : InstRW<[M1WriteBLR], (instrs BLR)>; +def : InstRW<[M1WriteC1], (instregex "^CBN?Z[WX]")>; +def : InstRW<[M1WriteTB], (instregex "^TBN?Z[WX]")>; + +// Arithmetic and logical integer instructions. +def : InstRW<[M1WriteALU1], (instrs COPY)>; + +// Divide and multiply instructions. + +// Miscellaneous instructions. + +// Load instructions. + +// Store instructions. + +// FP data instructions. +def : InstRW<[M1WriteNALU1], (instregex "^F(ABS|NEG)[DS]r")>; +def : InstRW<[M1WriteFADD3], (instregex "^F(ADD|SUB)[DS]rr")>; +def : InstRW<[M1WriteNEONG], (instregex "^FCCMPE?[DS]rr")>; +def : InstRW<[M1WriteNMISC4], (instregex "^FCMPE?[DS]r")>; +def : InstRW<[M1WriteFVAR15], (instrs FDIVSrr)>; +def : InstRW<[M1WriteFVAR23], (instrs FDIVDrr)>; +def : InstRW<[M1WriteNMISC2], (instregex "^F(MAX|MIN).+rr")>; +def : InstRW<[M1WriteFMAC4], (instregex "^FN?MUL[DS]rr")>; +def : InstRW<[M1WriteFMAC5], (instregex "^FN?M(ADD|SUB)[DS]rrr")>; +def : InstRW<[M1WriteFCVT3], (instregex "^FRINT.+r")>; +def : InstRW<[M1WriteNEONH], (instregex "^FCSEL[DS]rrr")>; +def : InstRW<[M1WriteFVAR15], (instrs FSQRTSr)>; +def : InstRW<[M1WriteFVAR23], (instrs FSQRTDr)>; + +// FP miscellaneous instructions. +def : InstRW<[M1WriteFCVT3], (instregex "^FCVT[DS][DS]r")>; +def : InstRW<[M1WriteNEONF], (instregex "^[FSU]CVT[AMNPZ][SU](_Int)?[SU]?[XW]?[DS]?[rds]i?")>; +def : InstRW<[M1WriteNEONE], (instregex "^[SU]CVTF[SU]")>; +def : InstRW<[M1WriteNALU1], (instregex "^FMOV[DS][ir]")>; +def : InstRW<[M1WriteS4], (instregex "^FMOV[WX][DS](High)?r")>; +def : InstRW<[M1WriteNEONI], (instregex "^FMOV[DS][WX](High)?r")>; + +// FP load instructions. + +// FP store instructions. + +// ASIMD instructions. +def : InstRW<[M1WriteNMISC3], (instregex "^[SU]ABAL?v")>; +def : InstRW<[M1WriteNMISC1], (instregex "^[SU]ABDL?v")>; +def : InstRW<[M1WriteNMISC1], (instregex "^(SQ)?ABSv")>; +def : InstRW<[M1WriteNMISC1], (instregex "^SQNEGv")>; +def : InstRW<[M1WriteNALU1], (instregex "^(ADD|NEG|SUB)v")>; +def : InstRW<[M1WriteNMISC3], (instregex "^[SU]?H(ADD|SUB)v")>; +def : InstRW<[M1WriteNMISC3], (instregex "^[SU]?AD[AD](L|LP|P|W)V?2?v")>; +def : InstRW<[M1WriteNMISC3], (instregex "^[SU]?SUB[LW]2?v")>; +def : InstRW<[M1WriteNMISC3], (instregex "^R?(ADD|SUB)HN?2?v")>; +def : InstRW<[M1WriteNMISC3], (instregex "^[SU]+Q(ADD|SUB)v")>; +def : InstRW<[M1WriteNMISC3], (instregex "^[SU]RHADDv")>; +def : InstRW<[M1WriteNMISC1], (instregex "^CM(EQ|GE|GT|HI|HS|LE|LT)v")>; +def : InstRW<[M1WriteNALU1], (instregex "^CMTSTv")>; +def : InstRW<[M1WriteNALU1], (instregex "^(AND|BIC|EOR|MVNI|NOT|ORN|ORR)v")>; +def : InstRW<[M1WriteNMISC1], (instregex "^[SU](MIN|MAX)v")>; +def : InstRW<[M1WriteNMISC2], (instregex "^[SU](MIN|MAX)Pv")>; +def : InstRW<[M1WriteNMISC3], (instregex "^[SU](MIN|MAX)Vv")>; +def : InstRW<[M1WriteNMISC4], (instregex "^(MUL|SQR?DMULH)v")>; +def : InstRW<[M1WriteNMISC4], (instregex "^ML[AS]v")>; +def : InstRW<[M1WriteNMISC4], (instregex "^(S|U|SQD|SQRD)ML[AS][HL]v")>; +def : InstRW<[M1WriteNMISC4], (instregex "^(S|U|SQD)MULLv")>; +def : InstRW<[M1WriteNAL13], (instregex "^(S|SR|U|UR)SRAv")>; +def : InstRW<[M1WriteNALU1], (instregex "^[SU]?SH(L|LL|R)2?v")>; +def : InstRW<[M1WriteNALU1], (instregex "^S[LR]Iv")>; +def : InstRW<[M1WriteNAL13], (instregex "^[SU]?(Q|QR|R)?SHR(N|U|UN)?2?v")>; +def : InstRW<[M1WriteNAL13], (instregex "^[SU](Q|QR|R)SHLU?v")>; + +// ASIMD FP instructions. +def : InstRW<[M1WriteNALU1], (instregex "^F(ABS|NEG)v")>; +def : InstRW<[M1WriteNMISC3], (instregex "^F(ABD|ADD|SUB)v")>; +def : InstRW<[M1WriteNEONA], (instregex "^FADDP")>; +def : InstRW<[M1WriteNMISC1], (instregex "^F(AC|CM)(EQ|GE|GT|LE|LT)v[^1]")>; +def : InstRW<[M1WriteFCVT3], (instregex "^[FVSU]CVTX?[AFLMNPZ][SU]?(_Int)?v")>; +def : InstRW<[M1WriteFVAR15], (instregex "FDIVv.f32")>; +def : InstRW<[M1WriteFVAR23], (instregex "FDIVv2f64")>; +def : InstRW<[M1WriteFVAR15], (instregex "FSQRTv.f32")>; +def : InstRW<[M1WriteFVAR23], (instregex "FSQRTv2f64")>; +def : InstRW<[M1WriteNMISC1], (instregex "^F(MAX|MIN)(NM)?V?v")>; +def : InstRW<[M1WriteNMISC2], (instregex "^F(MAX|MIN)(NM)?Pv")>; +def : InstRW<[M1WriteFMAC4], (instregex "^FMULX?v")>; +def : InstRW<[M1WriteFMAC5], (instregex "^FML[AS]v")>; +def : InstRW<[M1WriteFCVT3], (instregex "^FRINT[AIMNPXZ]v")>; + +// ASIMD miscellaneous instructions. +def : InstRW<[M1WriteNALU1], (instregex "^RBITv")>; +def : InstRW<[M1WriteNAL11], (instregex "^(BIF|BIT|BSL)v")>; +def : InstRW<[M1WriteNALU1], (instregex "^CPY")>; +def : InstRW<[M1WriteNEONB], (instregex "^DUPv.+gpr")>; +def : InstRW<[M1WriteNALU1], (instregex "^DUPv.+lane")>; +def : InstRW<[M1WriteNAL13], (instregex "^[SU]?Q?XTU?Nv")>; +def : InstRW<[M1WriteNEONC], (instregex "^INSv.+gpr")>; +def : InstRW<[M1WriteFCVT4], (instregex "^[FU](RECP|RSQRT)Ev")>; +def : InstRW<[M1WriteNMISC1], (instregex "^[FU](RECP|RSQRT)Xv")>; +def : InstRW<[M1WriteFMAC5], (instregex "^F(RECP|RSQRT)Sv")>; +def : InstRW<[M1WriteNALU1], (instregex "^REV(16|32|64)v")>; +def : InstRW<[M1WriteNAL11], (instregex "^TB[LX]v8i8One")>; +def : InstRW<[WriteSequence<[M1WriteNAL11], 2>], + (instregex "^TB[LX]v8i8Two")>; +def : InstRW<[WriteSequence<[M1WriteNAL11], 3>], + (instregex "^TB[LX]v8i8Three")>; +def : InstRW<[WriteSequence<[M1WriteNAL11], 4>], + (instregex "^TB[LX]v8i8Four")>; +def : InstRW<[M1WriteNAL12], (instregex "^TB[LX]v16i8One")>; +def : InstRW<[WriteSequence<[M1WriteNAL12], 2>], + (instregex "^TB[LX]v16i8Two")>; +def : InstRW<[WriteSequence<[M1WriteNAL12], 3>], + (instregex "^TB[LX]v16i8Three")>; +def : InstRW<[WriteSequence<[M1WriteNAL12], 4>], + (instregex "^TB[LX]v16i8Four")>; +def : InstRW<[M1WriteNEOND], (instregex "^[SU]MOVv")>; +def : InstRW<[M1WriteNALU1], (instregex "^INSv.+lane")>; +def : InstRW<[M1WriteNALU1], (instregex "^(TRN|UZP)(1|2)(v8i8|v4i16|v2i32)")>; +def : InstRW<[M1WriteNALU2], (instregex "^(TRN|UZP)(1|2)(v16i8|v8i16|v4i32|v2i64)")>; +def : InstRW<[M1WriteNALU1], (instregex "^ZIP(1|2)v")>; + +// ASIMD load instructions. + +// ASIMD store instructions. + +// Cryptography instructions. +def : InstRW<[M1WriteNCRYPT1], (instregex "^AES")>; +def : InstRW<[M1WriteNCRYPT1], (instregex "^PMUL")>; +def : InstRW<[M1WriteNCRYPT1], (instregex "^SHA1(H|SU)")>; +def : InstRW<[M1WriteNCRYPT5], (instregex "^SHA1[CMP]")>; +def : InstRW<[M1WriteNCRYPT1], (instregex "^SHA256SU0")>; +def : InstRW<[M1WriteNCRYPT5], (instregex "^SHA256(H|SU1)")>; + +// CRC instructions. +def : InstRW<[M1WriteC2], (instregex "^CRC32")>; + +} // SchedModel = ExynosM1Model Modified: vendor/llvm/dist/lib/Target/AMDGPU/AMDGPU.td ============================================================================== --- vendor/llvm/dist/lib/Target/AMDGPU/AMDGPU.td Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/lib/Target/AMDGPU/AMDGPU.td Sat Feb 13 14:57:10 2016 (r295590) @@ -183,6 +183,7 @@ def FeatureISAVersion7_0_0 : SubtargetFe def FeatureISAVersion7_0_1 : SubtargetFeatureISAVersion <7,0,1>; def FeatureISAVersion8_0_0 : SubtargetFeatureISAVersion <8,0,0>; def FeatureISAVersion8_0_1 : SubtargetFeatureISAVersion <8,0,1>; +def FeatureISAVersion8_0_3 : SubtargetFeatureISAVersion <8,0,3>; class SubtargetFeatureLocalMemorySize : SubtargetFeature< "localmemorysize"#Value, @@ -252,7 +253,7 @@ def FeatureSeaIslands : SubtargetFeature def FeatureVolcanicIslands : SubtargetFeatureGeneration<"VOLCANIC_ISLANDS", [Feature64BitPtr, FeatureFP64, FeatureLocalMemorySize65536, FeatureWavefrontSize64, FeatureFlatAddressSpace, FeatureGCN, - FeatureGCN3Encoding, FeatureCIInsts, FeatureLDSBankCount32]>; + FeatureGCN3Encoding, FeatureCIInsts]>; //===----------------------------------------------------------------------===// Modified: vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUSubtarget.h ============================================================================== --- vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUSubtarget.h Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUSubtarget.h Sat Feb 13 14:57:10 2016 (r295590) @@ -53,7 +53,8 @@ public: ISAVersion7_0_0, ISAVersion7_0_1, ISAVersion8_0_0, - ISAVersion8_0_1 + ISAVersion8_0_1, + ISAVersion8_0_3 }; private: Modified: vendor/llvm/dist/lib/Target/AMDGPU/Processors.td ============================================================================== --- vendor/llvm/dist/lib/Target/AMDGPU/Processors.td Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/lib/Target/AMDGPU/Processors.td Sat Feb 13 14:57:10 2016 (r295590) @@ -128,21 +128,23 @@ def : ProcessorModel<"mullins", SIQua //===----------------------------------------------------------------------===// def : ProcessorModel<"tonga", SIQuarterSpeedModel, - [FeatureVolcanicIslands, FeatureSGPRInitBug, FeatureISAVersion8_0_0] + [FeatureVolcanicIslands, FeatureSGPRInitBug, FeatureISAVersion8_0_0, + FeatureLDSBankCount32] >; def : ProcessorModel<"iceland", SIQuarterSpeedModel, - [FeatureVolcanicIslands, FeatureSGPRInitBug, FeatureISAVersion8_0_0] + [FeatureVolcanicIslands, FeatureSGPRInitBug, FeatureISAVersion8_0_0, + FeatureLDSBankCount32] >; def : ProcessorModel<"carrizo", SIQuarterSpeedModel, - [FeatureVolcanicIslands, FeatureISAVersion8_0_1] + [FeatureVolcanicIslands, FeatureISAVersion8_0_1, FeatureLDSBankCount32] >; def : ProcessorModel<"fiji", SIQuarterSpeedModel, - [FeatureVolcanicIslands, FeatureISAVersion8_0_1] + [FeatureVolcanicIslands, FeatureISAVersion8_0_3, FeatureLDSBankCount32] >; def : ProcessorModel<"stoney", SIQuarterSpeedModel, - [FeatureVolcanicIslands, FeatureISAVersion8_0_1] + [FeatureVolcanicIslands, FeatureISAVersion8_0_1, FeatureLDSBankCount16] >; Modified: vendor/llvm/dist/lib/Target/AMDGPU/SIRegisterInfo.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/AMDGPU/SIRegisterInfo.cpp Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/lib/Target/AMDGPU/SIRegisterInfo.cpp Sat Feb 13 14:57:10 2016 (r295590) @@ -234,6 +234,7 @@ void SIRegisterInfo::buildScratchLoadSto bool IsLoad = TII->get(LoadStoreOp).mayLoad(); bool RanOutOfSGPRs = false; + bool Scavenged = false; unsigned SOffset = ScratchOffset; unsigned NumSubRegs = getNumSubRegsForSpillOp(MI->getOpcode()); @@ -244,6 +245,8 @@ void SIRegisterInfo::buildScratchLoadSto if (SOffset == AMDGPU::NoRegister) { RanOutOfSGPRs = true; SOffset = AMDGPU::SGPR0; + } else { + Scavenged = true; } BuildMI(*MBB, MI, DL, TII->get(AMDGPU::S_ADD_U32), SOffset) .addReg(ScratchOffset) @@ -259,10 +262,14 @@ void SIRegisterInfo::buildScratchLoadSto getPhysRegSubReg(Value, &AMDGPU::VGPR_32RegClass, i) : Value; + unsigned SOffsetRegState = 0; + if (i + 1 == e && Scavenged) + SOffsetRegState |= RegState::Kill; + BuildMI(*MBB, MI, DL, TII->get(LoadStoreOp)) .addReg(SubReg, getDefRegState(IsLoad)) .addReg(ScratchRsrcReg) - .addReg(SOffset) + .addReg(SOffset, SOffsetRegState) .addImm(Offset) .addImm(0) // glc .addImm(0) // slc Modified: vendor/llvm/dist/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp Sat Feb 13 14:57:10 2016 (r295590) @@ -41,6 +41,9 @@ IsaVersion getIsaVersion(const FeatureBi if (Features.test(FeatureISAVersion8_0_1)) return {8, 0, 1}; + if (Features.test(FeatureISAVersion8_0_3)) + return {8, 0, 3}; + return {0, 0, 0}; } Modified: vendor/llvm/dist/lib/Target/ARM/ARMISelDAGToDAG.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/ARM/ARMISelDAGToDAG.cpp Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/lib/Target/ARM/ARMISelDAGToDAG.cpp Sat Feb 13 14:57:10 2016 (r295590) @@ -747,7 +747,7 @@ bool ARMDAGToDAGISel::SelectLdStSOReg(SD // If Offset is a multiply-by-constant and it's profitable to extract a shift // and use it in a shifted operand do so. - if (Offset.getOpcode() == ISD::MUL) { + if (Offset.getOpcode() == ISD::MUL && N.hasOneUse()) { unsigned PowerOfTwo = 0; SDValue NewMulConst; if (canExtractShiftFromMul(Offset, 31, PowerOfTwo, NewMulConst)) { @@ -1422,7 +1422,7 @@ bool ARMDAGToDAGISel::SelectT2AddrModeSo // If OffReg is a multiply-by-constant and it's profitable to extract a shift // and use it in a shifted operand do so. - if (OffReg.getOpcode() == ISD::MUL) { + if (OffReg.getOpcode() == ISD::MUL && N.hasOneUse()) { unsigned PowerOfTwo = 0; SDValue NewMulConst; if (canExtractShiftFromMul(OffReg, 3, PowerOfTwo, NewMulConst)) { Modified: vendor/llvm/dist/lib/Target/PowerPC/PPCFastISel.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/PowerPC/PPCFastISel.cpp Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/lib/Target/PowerPC/PPCFastISel.cpp Sat Feb 13 14:57:10 2016 (r295590) @@ -1615,7 +1615,7 @@ bool PPCFastISel::SelectRet(const Instru // extension rather than sign extension. Make sure we pass the return // value extension property to integer materialization. unsigned SrcReg = - PPCMaterializeInt(CI, MVT::i64, VA.getLocInfo() == CCValAssign::SExt); + PPCMaterializeInt(CI, MVT::i64, VA.getLocInfo() != CCValAssign::ZExt); BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(TargetOpcode::COPY), RetReg).addReg(SrcReg); @@ -2091,25 +2091,21 @@ unsigned PPCFastISel::PPCMaterializeInt( const TargetRegisterClass *RC = ((VT == MVT::i64) ? &PPC::G8RCRegClass : &PPC::GPRCRegClass); + int64_t Imm = UseSExt ? CI->getSExtValue() : CI->getZExtValue(); // If the constant is in range, use a load-immediate. - if (UseSExt && isInt<16>(CI->getSExtValue())) { + // Since LI will sign extend the constant we need to make sure that for + // our zeroext constants that the sign extended constant fits into 16-bits - + // a range of 0..0x7fff. + if (isInt<16>(Imm)) { unsigned Opc = (VT == MVT::i64) ? PPC::LI8 : PPC::LI; unsigned ImmReg = createResultReg(RC); BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(Opc), ImmReg) - .addImm(CI->getSExtValue()); - return ImmReg; - } else if (!UseSExt && isUInt<16>(CI->getZExtValue())) { - unsigned Opc = (VT == MVT::i64) ? PPC::LI8 : PPC::LI; - unsigned ImmReg = createResultReg(RC); - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(Opc), ImmReg) - .addImm(CI->getZExtValue()); + .addImm(Imm); return ImmReg; } // Construct the constant piecewise. - int64_t Imm = CI->getZExtValue(); - if (VT == MVT::i64) return PPCMaterialize64BitInt(Imm, RC); else if (VT == MVT::i32) Modified: vendor/llvm/dist/lib/Target/PowerPC/PPCInstrAltivec.td ============================================================================== --- vendor/llvm/dist/lib/Target/PowerPC/PPCInstrAltivec.td Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/lib/Target/PowerPC/PPCInstrAltivec.td Sat Feb 13 14:57:10 2016 (r295590) @@ -736,7 +736,7 @@ def VPKSHSS : VX1_Int_Ty2<398, "vpkshss" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Feb 13 14:57:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31963AA7F41; Sat, 13 Feb 2016 14:57:48 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 DF9951D98; Sat, 13 Feb 2016 14:57:47 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1DEvkbe050351; Sat, 13 Feb 2016 14:57:46 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1DEvk0u050350; Sat, 13 Feb 2016 14:57:46 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201602131457.u1DEvk0u050350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 13 Feb 2016 14:57:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295591 - vendor/llvm/llvm-release_38-r260756 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 14:57:48 -0000 Author: dim Date: Sat Feb 13 14:57:46 2016 New Revision: 295591 URL: https://svnweb.freebsd.org/changeset/base/295591 Log: Tag llvm release_38 branch r260756. Added: vendor/llvm/llvm-release_38-r260756/ - copied from r295590, vendor/llvm/dist/ From owner-svn-src-all@freebsd.org Sat Feb 13 14:58:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 239F4AA7FBA; Sat, 13 Feb 2016 14:58:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 E2F3E1ECF; Sat, 13 Feb 2016 14:58:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1DEwEwL050417; Sat, 13 Feb 2016 14:58:14 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1DEwEbR050415; Sat, 13 Feb 2016 14:58:14 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201602131458.u1DEwEbR050415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 13 Feb 2016 14:58:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295592 - in vendor/clang/dist: docs include/clang/Sema lib/AST lib/Basic lib/CodeGen lib/Driver lib/Sema test/CodeGenCXX test/CodeGenOpenCL test/Driver test/Misc test/OpenMP test/Prepr... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 14:58:15 -0000 Author: dim Date: Sat Feb 13 14:58:13 2016 New Revision: 295592 URL: https://svnweb.freebsd.org/changeset/base/295592 Log: Vendor import of clang release_38 branch r260756: https://llvm.org/svn/llvm-project/cfe/branches/release_38@260756 Added: vendor/clang/dist/test/SemaObjC/ovl-check.m Modified: vendor/clang/dist/docs/AttributeReference.rst vendor/clang/dist/docs/ReleaseNotes.rst vendor/clang/dist/docs/UndefinedBehaviorSanitizer.rst vendor/clang/dist/docs/UsersManual.rst vendor/clang/dist/include/clang/Sema/Sema.h vendor/clang/dist/lib/AST/ASTDiagnostic.cpp vendor/clang/dist/lib/Basic/Targets.cpp vendor/clang/dist/lib/CodeGen/Address.h vendor/clang/dist/lib/CodeGen/CGOpenMPRuntime.cpp vendor/clang/dist/lib/CodeGen/CGStmtOpenMP.cpp vendor/clang/dist/lib/Driver/ToolChains.cpp vendor/clang/dist/lib/Driver/Tools.cpp vendor/clang/dist/lib/Sema/SemaDeclCXX.cpp vendor/clang/dist/lib/Sema/SemaExpr.cpp vendor/clang/dist/lib/Sema/SemaExprObjC.cpp vendor/clang/dist/lib/Sema/SemaOverload.cpp vendor/clang/dist/test/CodeGenCXX/lambda-expressions.cpp vendor/clang/dist/test/CodeGenOpenCL/pipe_types.cl vendor/clang/dist/test/Driver/netbsd.c vendor/clang/dist/test/Driver/netbsd.cpp vendor/clang/dist/test/Misc/diag-template-diffing-color.cpp vendor/clang/dist/test/Misc/diag-template-diffing.cpp vendor/clang/dist/test/OpenMP/cancel_codegen.cpp vendor/clang/dist/test/OpenMP/cancellation_point_codegen.cpp vendor/clang/dist/test/OpenMP/parallel_sections_codegen.cpp vendor/clang/dist/test/OpenMP/sections_codegen.cpp vendor/clang/dist/test/OpenMP/sections_firstprivate_codegen.cpp vendor/clang/dist/test/OpenMP/sections_lastprivate_codegen.cpp vendor/clang/dist/test/OpenMP/sections_private_codegen.cpp vendor/clang/dist/test/OpenMP/sections_reduction_codegen.cpp vendor/clang/dist/test/Preprocessor/predefined-arch-macros.c Modified: vendor/clang/dist/docs/AttributeReference.rst ============================================================================== --- vendor/clang/dist/docs/AttributeReference.rst Sat Feb 13 14:57:46 2016 (r295591) +++ vendor/clang/dist/docs/AttributeReference.rst Sat Feb 13 14:58:13 2016 (r295592) @@ -1,13 +1,2035 @@ .. ------------------------------------------------------------------- NOTE: This file is automatically generated by running clang-tblgen - -gen-attr-docs. Do not edit this file by hand!! The contents for - this file are automatically generated by a server-side process. - - Please do not commit this file. The file exists for local testing - purposes only. + -gen-attr-docs. Do not edit this file by hand!! ------------------------------------------------------------------- =================== Attributes in Clang -=================== \ No newline at end of file +=================== +.. contents:: + :local: + +Introduction +============ + +This page lists the attributes currently supported by Clang. + +Function Attributes +=================== + + +interrupt +--------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +Clang supports the GNU style ``__attribute__((interrupt("TYPE")))`` attribute on +ARM targets. This attribute may be attached to a function definition and +instructs the backend to generate appropriate function entry/exit code so that +it can be used directly as an interrupt service routine. + +The parameter passed to the interrupt attribute is optional, but if +provided it must be a string literal with one of the following values: "IRQ", +"FIQ", "SWI", "ABORT", "UNDEF". + +The semantics are as follows: + +- If the function is AAPCS, Clang instructs the backend to realign the stack to + 8 bytes on entry. This is a general requirement of the AAPCS at public + interfaces, but may not hold when an exception is taken. Doing this allows + other AAPCS functions to be called. +- If the CPU is M-class this is all that needs to be done since the architecture + itself is designed in such a way that functions obeying the normal AAPCS ABI + constraints are valid exception handlers. +- If the CPU is not M-class, the prologue and epilogue are modified to save all + non-banked registers that are used, so that upon return the user-mode state + will not be corrupted. Note that to avoid unnecessary overhead, only + general-purpose (integer) registers are saved in this way. If VFP operations + are needed, that state must be saved manually. + + Specifically, interrupt kinds other than "FIQ" will save all core registers + except "lr" and "sp". "FIQ" interrupts will save r0-r7. +- If the CPU is not M-class, the return instruction is changed to one of the + canonical sequences permitted by the architecture for exception return. Where + possible the function itself will make the necessary "lr" adjustments so that + the "preferred return address" is selected. + + Unfortunately the compiler is unable to make this guarantee for an "UNDEF" + handler, where the offset from "lr" to the preferred return address depends on + the execution state of the code which generated the exception. In this case + a sequence equivalent to "movs pc, lr" will be used. + + +acquire_capability (acquire_shared_capability, clang::acquire_capability, clang::acquire_shared_capability) +----------------------------------------------------------------------------------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +Marks a function as acquiring a capability. + + +assert_capability (assert_shared_capability, clang::assert_capability, clang::assert_shared_capability) +------------------------------------------------------------------------------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +Marks a function that dynamically tests whether a capability is held, and halts +the program if it is not held. + + +assume_aligned (gnu::assume_aligned) +------------------------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +Use ``__attribute__((assume_aligned([,]))`` on a function +declaration to specify that the return value of the function (which must be a +pointer type) has the specified offset, in bytes, from an address with the +specified alignment. The offset is taken to be zero if omitted. + +.. code-block:: c++ + + // The returned pointer value has 32-byte alignment. + void *a() __attribute__((assume_aligned (32))); + + // The returned pointer value is 4 bytes greater than an address having + // 32-byte alignment. + void *b() __attribute__((assume_aligned (32, 4))); + +Note that this attribute provides information to the compiler regarding a +condition that the code already ensures is true. It does not cause the compiler +to enforce the provided alignment assumption. + + +availability +------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +The ``availability`` attribute can be placed on declarations to describe the +lifecycle of that declaration relative to operating system versions. Consider +the function declaration for a hypothetical function ``f``: + +.. code-block:: c++ + + void f(void) __attribute__((availability(macosx,introduced=10.4,deprecated=10.6,obsoleted=10.7))); + +The availability attribute states that ``f`` was introduced in Mac OS X 10.4, +deprecated in Mac OS X 10.6, and obsoleted in Mac OS X 10.7. This information +is used by Clang to determine when it is safe to use ``f``: for example, if +Clang is instructed to compile code for Mac OS X 10.5, a call to ``f()`` +succeeds. If Clang is instructed to compile code for Mac OS X 10.6, the call +succeeds but Clang emits a warning specifying that the function is deprecated. +Finally, if Clang is instructed to compile code for Mac OS X 10.7, the call +fails because ``f()`` is no longer available. + +The availability attribute is a comma-separated list starting with the +platform name and then including clauses specifying important milestones in the +declaration's lifetime (in any order) along with additional information. Those +clauses can be: + +introduced=\ *version* + The first version in which this declaration was introduced. + +deprecated=\ *version* + The first version in which this declaration was deprecated, meaning that + users should migrate away from this API. + +obsoleted=\ *version* + The first version in which this declaration was obsoleted, meaning that it + was removed completely and can no longer be used. + +unavailable + This declaration is never available on this platform. + +message=\ *string-literal* + Additional message text that Clang will provide when emitting a warning or + error about use of a deprecated or obsoleted declaration. Useful to direct + users to replacement APIs. + +Multiple availability attributes can be placed on a declaration, which may +correspond to different platforms. Only the availability attribute with the +platform corresponding to the target platform will be used; any others will be +ignored. If no availability attribute specifies availability for the current +target platform, the availability attributes are ignored. Supported platforms +are: + +``ios`` + Apple's iOS operating system. The minimum deployment target is specified by + the ``-mios-version-min=*version*`` or ``-miphoneos-version-min=*version*`` + command-line arguments. + +``macosx`` + Apple's Mac OS X operating system. The minimum deployment target is + specified by the ``-mmacosx-version-min=*version*`` command-line argument. + +``tvos`` + Apple's tvOS operating system. The minimum deployment target is specified by + the ``-mtvos-version-min=*version*`` command-line argument. + +``watchos`` + Apple's watchOS operating system. The minimum deployment target is specified by + the ``-mwatchos-version-min=*version*`` command-line argument. + +A declaration can be used even when deploying back to a platform version prior +to when the declaration was introduced. When this happens, the declaration is +`weakly linked +`_, +as if the ``weak_import`` attribute were added to the declaration. A +weakly-linked declaration may or may not be present a run-time, and a program +can determine whether the declaration is present by checking whether the +address of that declaration is non-NULL. + +If there are multiple declarations of the same entity, the availability +attributes must either match on a per-platform basis or later +declarations must not have availability attributes for that +platform. For example: + +.. code-block:: c + + void g(void) __attribute__((availability(macosx,introduced=10.4))); + void g(void) __attribute__((availability(macosx,introduced=10.4))); // okay, matches + void g(void) __attribute__((availability(ios,introduced=4.0))); // okay, adds a new platform + void g(void); // okay, inherits both macosx and ios availability from above. + void g(void) __attribute__((availability(macosx,introduced=10.5))); // error: mismatch + +When one method overrides another, the overriding method can be more widely available than the overridden method, e.g.,: + +.. code-block:: objc + + @interface A + - (id)method __attribute__((availability(macosx,introduced=10.4))); + - (id)method2 __attribute__((availability(macosx,introduced=10.4))); + @end + + @interface B : A + - (id)method __attribute__((availability(macosx,introduced=10.3))); // okay: method moved into base class later + - (id)method __attribute__((availability(macosx,introduced=10.5))); // error: this method was available via the base class in 10.4 + @end + + +_Noreturn +--------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "","","","X", "" + +A function declared as ``_Noreturn`` shall not return to its caller. The +compiler will generate a diagnostic for a function declared as ``_Noreturn`` +that appears to be capable of returning to its caller. + + +noreturn +-------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "","X","","", "" + +A function declared as ``[[noreturn]]`` shall not return to its caller. The +compiler will generate a diagnostic for a function declared as ``[[noreturn]]`` +that appears to be capable of returning to its caller. + + +carries_dependency +------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +The ``carries_dependency`` attribute specifies dependency propagation into and +out of functions. + +When specified on a function or Objective-C method, the ``carries_dependency`` +attribute means that the return value carries a dependency out of the function, +so that the implementation need not constrain ordering upon return from that +function. Implementations of the function and its caller may choose to preserve +dependencies instead of emitting memory ordering instructions such as fences. + +Note, this attribute does not change the meaning of the program, but may result +in generation of more efficient code. + + +disable_tail_calls (clang::disable_tail_calls) +---------------------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +The ``disable_tail_calls`` attribute instructs the backend to not perform tail call optimization inside the marked function. + +For example: + + .. code-block:: c + + int callee(int); + + int foo(int a) __attribute__((disable_tail_calls)) { + return callee(a); // This call is not tail-call optimized. + } + +Marking virtual functions as ``disable_tail_calls`` is legal. + + .. code-block: c++ + + int callee(int); + + class Base { + public: + [[clang::disable_tail_calls]] virtual int foo1() { + return callee(); // This call is not tail-call optimized. + } + }; + + class Derived1 : public Base { + public: + int foo1() override { + return callee(); // This call is tail-call optimized. + } + }; + + +enable_if +--------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +.. Note:: Some features of this attribute are experimental. The meaning of + multiple enable_if attributes on a single declaration is subject to change in + a future version of clang. Also, the ABI is not standardized and the name + mangling may change in future versions. To avoid that, use asm labels. + +The ``enable_if`` attribute can be placed on function declarations to control +which overload is selected based on the values of the function's arguments. +When combined with the ``overloadable`` attribute, this feature is also +available in C. + +.. code-block:: c++ + + int isdigit(int c); + int isdigit(int c) __attribute__((enable_if(c <= -1 || c > 255, "chosen when 'c' is out of range"))) __attribute__((unavailable("'c' must have the value of an unsigned char or EOF"))); + + void foo(char c) { + isdigit(c); + isdigit(10); + isdigit(-10); // results in a compile-time error. + } + +The enable_if attribute takes two arguments, the first is an expression written +in terms of the function parameters, the second is a string explaining why this +overload candidate could not be selected to be displayed in diagnostics. The +expression is part of the function signature for the purposes of determining +whether it is a redeclaration (following the rules used when determining +whether a C++ template specialization is ODR-equivalent), but is not part of +the type. + +The enable_if expression is evaluated as if it were the body of a +bool-returning constexpr function declared with the arguments of the function +it is being applied to, then called with the parameters at the call site. If the +result is false or could not be determined through constant expression +evaluation, then this overload will not be chosen and the provided string may +be used in a diagnostic if the compile fails as a result. + +Because the enable_if expression is an unevaluated context, there are no global +state changes, nor the ability to pass information from the enable_if +expression to the function body. For example, suppose we want calls to +strnlen(strbuf, maxlen) to resolve to strnlen_chk(strbuf, maxlen, size of +strbuf) only if the size of strbuf can be determined: + +.. code-block:: c++ + + __attribute__((always_inline)) + static inline size_t strnlen(const char *s, size_t maxlen) + __attribute__((overloadable)) + __attribute__((enable_if(__builtin_object_size(s, 0) != -1))), + "chosen when the buffer size is known but 'maxlen' is not"))) + { + return strnlen_chk(s, maxlen, __builtin_object_size(s, 0)); + } + +Multiple enable_if attributes may be applied to a single declaration. In this +case, the enable_if expressions are evaluated from left to right in the +following manner. First, the candidates whose enable_if expressions evaluate to +false or cannot be evaluated are discarded. If the remaining candidates do not +share ODR-equivalent enable_if expressions, the overload resolution is +ambiguous. Otherwise, enable_if overload resolution continues with the next +enable_if attribute on the candidates that have not been discarded and have +remaining enable_if attributes. In this way, we pick the most specific +overload out of a number of viable overloads using enable_if. + +.. code-block:: c++ + + void f() __attribute__((enable_if(true, ""))); // #1 + void f() __attribute__((enable_if(true, ""))) __attribute__((enable_if(true, ""))); // #2 + + void g(int i, int j) __attribute__((enable_if(i, ""))); // #1 + void g(int i, int j) __attribute__((enable_if(j, ""))) __attribute__((enable_if(true))); // #2 + +In this example, a call to f() is always resolved to #2, as the first enable_if +expression is ODR-equivalent for both declarations, but #1 does not have another +enable_if expression to continue evaluating, so the next round of evaluation has +only a single candidate. In a call to g(1, 1), the call is ambiguous even though +#2 has more enable_if attributes, because the first enable_if expressions are +not ODR-equivalent. + +Query for this feature with ``__has_attribute(enable_if)``. + + +flatten (gnu::flatten) +---------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +The ``flatten`` attribute causes calls within the attributed function to +be inlined unless it is impossible to do so, for example if the body of the +callee is unavailable or if the callee has the ``noinline`` attribute. + + +format (gnu::format) +-------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +Clang supports the ``format`` attribute, which indicates that the function +accepts a ``printf`` or ``scanf``-like format string and corresponding +arguments or a ``va_list`` that contains these arguments. + +Please see `GCC documentation about format attribute +`_ to find details +about attribute syntax. + +Clang implements two kinds of checks with this attribute. + +#. Clang checks that the function with the ``format`` attribute is called with + a format string that uses format specifiers that are allowed, and that + arguments match the format string. This is the ``-Wformat`` warning, it is + on by default. + +#. Clang checks that the format string argument is a literal string. This is + the ``-Wformat-nonliteral`` warning, it is off by default. + + Clang implements this mostly the same way as GCC, but there is a difference + for functions that accept a ``va_list`` argument (for example, ``vprintf``). + GCC does not emit ``-Wformat-nonliteral`` warning for calls to such + functions. Clang does not warn if the format string comes from a function + parameter, where the function is annotated with a compatible attribute, + otherwise it warns. For example: + + .. code-block:: c + + __attribute__((__format__ (__scanf__, 1, 3))) + void foo(const char* s, char *buf, ...) { + va_list ap; + va_start(ap, buf); + + vprintf(s, ap); // warning: format string is not a string literal + } + + In this case we warn because ``s`` contains a format string for a + ``scanf``-like function, but it is passed to a ``printf``-like function. + + If the attribute is removed, clang still warns, because the format string is + not a string literal. + + Another example: + + .. code-block:: c + + __attribute__((__format__ (__printf__, 1, 3))) + void foo(const char* s, char *buf, ...) { + va_list ap; + va_start(ap, buf); + + vprintf(s, ap); // warning + } + + In this case Clang does not warn because the format string ``s`` and + the corresponding arguments are annotated. If the arguments are + incorrect, the caller of ``foo`` will receive a warning. + + +internal_linkage (clang::internal_linkage) +------------------------------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +The ``internal_linkage`` attribute changes the linkage type of the declaration to internal. +This is similar to C-style ``static``, but can be used on classes and class methods. When applied to a class definition, +this attribute affects all methods and static data members of that class. +This can be used to contain the ABI of a C++ library by excluding unwanted class methods from the export tables. + + +interrupt +--------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +Clang supports the GNU style ``__attribute__((interrupt("ARGUMENT")))`` attribute on +MIPS targets. This attribute may be attached to a function definition and instructs +the backend to generate appropriate function entry/exit code so that it can be used +directly as an interrupt service routine. + +By default, the compiler will produce a function prologue and epilogue suitable for +an interrupt service routine that handles an External Interrupt Controller (eic) +generated interrupt. This behaviour can be explicitly requested with the "eic" +argument. + +Otherwise, for use with vectored interrupt mode, the argument passed should be +of the form "vector=LEVEL" where LEVEL is one of the following values: +"sw0", "sw1", "hw0", "hw1", "hw2", "hw3", "hw4", "hw5". The compiler will +then set the interrupt mask to the corresponding level which will mask all +interrupts up to and including the argument. + +The semantics are as follows: + +- The prologue is modified so that the Exception Program Counter (EPC) and + Status coprocessor registers are saved to the stack. The interrupt mask is + set so that the function can only be interrupted by a higher priority + interrupt. The epilogue will restore the previous values of EPC and Status. + +- The prologue and epilogue are modified to save and restore all non-kernel + registers as necessary. + +- The FPU is disabled in the prologue, as the floating pointer registers are not + spilled to the stack. + +- The function return sequence is changed to use an exception return instruction. + +- The parameter sets the interrupt mask for the function corresponding to the + interrupt level specified. If no mask is specified the interrupt mask + defaults to "eic". + + +noalias +------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "","","X","", "" + +The ``noalias`` attribute indicates that the only memory accesses inside +function are loads and stores from objects pointed to by its pointer-typed +arguments, with arbitrary offsets. + + +noduplicate (clang::noduplicate) +-------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +The ``noduplicate`` attribute can be placed on function declarations to control +whether function calls to this function can be duplicated or not as a result of +optimizations. This is required for the implementation of functions with +certain special requirements, like the OpenCL "barrier" function, that might +need to be run concurrently by all the threads that are executing in lockstep +on the hardware. For example this attribute applied on the function +"nodupfunc" in the code below avoids that: + +.. code-block:: c + + void nodupfunc() __attribute__((noduplicate)); + // Setting it as a C++11 attribute is also valid + // void nodupfunc() [[clang::noduplicate]]; + void foo(); + void bar(); + + nodupfunc(); + if (a > n) { + foo(); + } else { + bar(); + } + +gets possibly modified by some optimizations into code similar to this: + +.. code-block:: c + + if (a > n) { + nodupfunc(); + foo(); + } else { + nodupfunc(); + bar(); + } + +where the call to "nodupfunc" is duplicated and sunk into the two branches +of the condition. + + +no_sanitize (clang::no_sanitize) +-------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +Use the ``no_sanitize`` attribute on a function declaration to specify +that a particular instrumentation or set of instrumentations should not be +applied to that function. The attribute takes a list of string literals, +which have the same meaning as values accepted by the ``-fno-sanitize=`` +flag. For example, ``__attribute__((no_sanitize("address", "thread")))`` +specifies that AddressSanitizer and ThreadSanitizer should not be applied +to the function. + +See :ref:`Controlling Code Generation ` for a +full list of supported sanitizer flags. + + +no_sanitize_address (no_address_safety_analysis, gnu::no_address_safety_analysis, gnu::no_sanitize_address) +----------------------------------------------------------------------------------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +.. _langext-address_sanitizer: + +Use ``__attribute__((no_sanitize_address))`` on a function declaration to +specify that address safety instrumentation (e.g. AddressSanitizer) should +not be applied to that function. + + +no_sanitize_thread +------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +.. _langext-thread_sanitizer: + +Use ``__attribute__((no_sanitize_thread))`` on a function declaration to +specify that checks for data races on plain (non-atomic) memory accesses should +not be inserted by ThreadSanitizer. The function is still instrumented by the +tool to avoid false positives and provide meaningful stack traces. + + +no_sanitize_memory +------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +.. _langext-memory_sanitizer: + +Use ``__attribute__((no_sanitize_memory))`` on a function declaration to +specify that checks for uninitialized memory should not be inserted +(e.g. by MemorySanitizer). The function may still be instrumented by the tool +to avoid false positives in other places. + + +no_split_stack (gnu::no_split_stack) +------------------------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +The ``no_split_stack`` attribute disables the emission of the split stack +preamble for a particular function. It has no effect if ``-fsplit-stack`` +is not specified. + + +not_tail_called (clang::not_tail_called) +---------------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +The ``not_tail_called`` attribute prevents tail-call optimization on statically bound calls. It has no effect on indirect calls. Virtual functions, objective-c methods, and functions marked as ``always_inline`` cannot be marked as ``not_tail_called``. + +For example, it prevents tail-call optimization in the following case: + + .. code-block: c + + int __attribute__((not_tail_called)) foo1(int); + + int foo2(int a) { + return foo1(a); // No tail-call optimization on direct calls. + } + +However, it doesn't prevent tail-call optimization in this case: + + .. code-block: c + + int __attribute__((not_tail_called)) foo1(int); + + int foo2(int a) { + int (*fn)(int) = &foo1; + + // not_tail_called has no effect on an indirect call even if the call can be + // resolved at compile time. + return (*fn)(a); + } + +Marking virtual functions as ``not_tail_called`` is an error: + + .. code-block: c++ + + class Base { + public: + // not_tail_called on a virtual function is an error. + [[clang::not_tail_called]] virtual int foo1(); + + virtual int foo2(); + + // Non-virtual functions can be marked ``not_tail_called``. + [[clang::not_tail_called]] int foo3(); + }; + + class Derived1 : public Base { + public: + int foo1() override; + + // not_tail_called on a virtual function is an error. + [[clang::not_tail_called]] int foo2() override; + }; + + +objc_boxable +------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +Structs and unions marked with the ``objc_boxable`` attribute can be used +with the Objective-C boxed expression syntax, ``@(...)``. + +**Usage**: ``__attribute__((objc_boxable))``. This attribute +can only be placed on a declaration of a trivially-copyable struct or union: + +.. code-block:: objc + + struct __attribute__((objc_boxable)) some_struct { + int i; + }; + union __attribute__((objc_boxable)) some_union { + int i; + float f; + }; + typedef struct __attribute__((objc_boxable)) _some_struct some_struct; + + // ... + + some_struct ss; + NSValue *boxed = @(ss); + + +objc_method_family +------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +Many methods in Objective-C have conventional meanings determined by their +selectors. It is sometimes useful to be able to mark a method as having a +particular conventional meaning despite not having the right selector, or as +not having the conventional meaning that its selector would suggest. For these +use cases, we provide an attribute to specifically describe the "method family" +that a method belongs to. + +**Usage**: ``__attribute__((objc_method_family(X)))``, where ``X`` is one of +``none``, ``alloc``, ``copy``, ``init``, ``mutableCopy``, or ``new``. This +attribute can only be placed at the end of a method declaration: + +.. code-block:: objc + + - (NSString *)initMyStringValue __attribute__((objc_method_family(none))); + +Users who do not wish to change the conventional meaning of a method, and who +merely want to document its non-standard retain and release semantics, should +use the retaining behavior attributes (``ns_returns_retained``, +``ns_returns_not_retained``, etc). + +Query for this feature with ``__has_attribute(objc_method_family)``. + + +objc_requires_super +------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +Some Objective-C classes allow a subclass to override a particular method in a +parent class but expect that the overriding method also calls the overridden +method in the parent class. For these cases, we provide an attribute to +designate that a method requires a "call to ``super``" in the overriding +method in the subclass. + +**Usage**: ``__attribute__((objc_requires_super))``. This attribute can only +be placed at the end of a method declaration: + +.. code-block:: objc + + - (void)foo __attribute__((objc_requires_super)); + +This attribute can only be applied the method declarations within a class, and +not a protocol. Currently this attribute does not enforce any placement of +where the call occurs in the overriding method (such as in the case of +``-dealloc`` where the call must appear at the end). It checks only that it +exists. + +Note that on both OS X and iOS that the Foundation framework provides a +convenience macro ``NS_REQUIRES_SUPER`` that provides syntactic sugar for this +attribute: + +.. code-block:: objc + + - (void)foo NS_REQUIRES_SUPER; + +This macro is conditionally defined depending on the compiler's support for +this attribute. If the compiler does not support the attribute the macro +expands to nothing. + +Operationally, when a method has this annotation the compiler will warn if the +implementation of an override in a subclass does not call super. For example: + +.. code-block:: objc + + warning: method possibly missing a [super AnnotMeth] call + - (void) AnnotMeth{}; + ^ + + +objc_runtime_name +----------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +By default, the Objective-C interface or protocol identifier is used +in the metadata name for that object. The `objc_runtime_name` +attribute allows annotated interfaces or protocols to use the +specified string argument in the object's metadata name instead of the +default name. + +**Usage**: ``__attribute__((objc_runtime_name("MyLocalName")))``. This attribute +can only be placed before an @protocol or @interface declaration: + +.. code-block:: objc + + __attribute__((objc_runtime_name("MyLocalName"))) + @interface Message + @end + + +optnone (clang::optnone) +------------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +The ``optnone`` attribute suppresses essentially all optimizations +on a function or method, regardless of the optimization level applied to +the compilation unit as a whole. This is particularly useful when you +need to debug a particular function, but it is infeasible to build the +entire application without optimization. Avoiding optimization on the +specified function can improve the quality of the debugging information +for that function. + +This attribute is incompatible with the ``always_inline`` and ``minsize`` +attributes. + + +overloadable +------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +Clang provides support for C++ function overloading in C. Function overloading +in C is introduced using the ``overloadable`` attribute. For example, one +might provide several overloaded versions of a ``tgsin`` function that invokes +the appropriate standard function computing the sine of a value with ``float``, +``double``, or ``long double`` precision: + +.. code-block:: c + + #include + float __attribute__((overloadable)) tgsin(float x) { return sinf(x); } + double __attribute__((overloadable)) tgsin(double x) { return sin(x); } + long double __attribute__((overloadable)) tgsin(long double x) { return sinl(x); } + +Given these declarations, one can call ``tgsin`` with a ``float`` value to +receive a ``float`` result, with a ``double`` to receive a ``double`` result, +etc. Function overloading in C follows the rules of C++ function overloading +to pick the best overload given the call arguments, with a few C-specific +semantics: + +* Conversion from ``float`` or ``double`` to ``long double`` is ranked as a + floating-point promotion (per C99) rather than as a floating-point conversion + (as in C++). + +* A conversion from a pointer of type ``T*`` to a pointer of type ``U*`` is + considered a pointer conversion (with conversion rank) if ``T`` and ``U`` are + compatible types. + +* A conversion from type ``T`` to a value of type ``U`` is permitted if ``T`` + and ``U`` are compatible types. This conversion is given "conversion" rank. + +The declaration of ``overloadable`` functions is restricted to function +declarations and definitions. Most importantly, if any function with a given +name is given the ``overloadable`` attribute, then all function declarations +and definitions with that name (and in that scope) must have the +``overloadable`` attribute. This rule even applies to redeclarations of +functions whose original declaration had the ``overloadable`` attribute, e.g., + +.. code-block:: c + + int f(int) __attribute__((overloadable)); + float f(float); // error: declaration of "f" must have the "overloadable" attribute + + int g(int) __attribute__((overloadable)); + int g(int) { } // error: redeclaration of "g" must also have the "overloadable" attribute + +Functions marked ``overloadable`` must have prototypes. Therefore, the +following code is ill-formed: + +.. code-block:: c + + int h() __attribute__((overloadable)); // error: h does not have a prototype + +However, ``overloadable`` functions are allowed to use a ellipsis even if there +are no named parameters (as is permitted in C++). This feature is particularly +useful when combined with the ``unavailable`` attribute: + +.. code-block:: c++ + + void honeypot(...) __attribute__((overloadable, unavailable)); // calling me is an error + +Functions declared with the ``overloadable`` attribute have their names mangled +according to the same rules as C++ function names. For example, the three +``tgsin`` functions in our motivating example get the mangled names +``_Z5tgsinf``, ``_Z5tgsind``, and ``_Z5tgsine``, respectively. There are two +caveats to this use of name mangling: + +* Future versions of Clang may change the name mangling of functions overloaded + in C, so you should not depend on an specific mangling. To be completely + safe, we strongly urge the use of ``static inline`` with ``overloadable`` + functions. + +* The ``overloadable`` attribute has almost no meaning when used in C++, + because names will already be mangled and functions are already overloadable. + However, when an ``overloadable`` function occurs within an ``extern "C"`` + linkage specification, it's name *will* be mangled in the same way as it + would in C. + +Query for this feature with ``__has_extension(attribute_overloadable)``. + + +release_capability (release_shared_capability, clang::release_capability, clang::release_shared_capability) +----------------------------------------------------------------------------------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +Marks a function as releasing a capability. + + +target (gnu::target) +-------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +Clang supports the GNU style ``__attribute__((target("OPTIONS")))`` attribute. +This attribute may be attached to a function definition and instructs +the backend to use different code generation options than were passed on the +command line. + +The current set of options correspond to the existing "subtarget features" for +the target with or without a "-mno-" in front corresponding to the absence +of the feature, as well as ``arch="CPU"`` which will change the default "CPU" +for the function. + +Example "subtarget features" from the x86 backend include: "mmx", "sse", "sse4.2", +"avx", "xop" and largely correspond to the machine specific options handled by +the front end. + + +try_acquire_capability (try_acquire_shared_capability, clang::try_acquire_capability, clang::try_acquire_shared_capability) +--------------------------------------------------------------------------------------------------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Feb 13 14:58:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AF8CAA7051; Sat, 13 Feb 2016 14:58:42 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 43D0E101D; Sat, 13 Feb 2016 14:58:42 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1DEwfTH050473; Sat, 13 Feb 2016 14:58:41 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1DEwfuq050472; Sat, 13 Feb 2016 14:58:41 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201602131458.u1DEwfuq050472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 13 Feb 2016 14:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295593 - vendor/clang/clang-release_38-r260756 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 14:58:42 -0000 Author: dim Date: Sat Feb 13 14:58:41 2016 New Revision: 295593 URL: https://svnweb.freebsd.org/changeset/base/295593 Log: Tag clang release_38 branch r260756. Added: vendor/clang/clang-release_38-r260756/ - copied from r295592, vendor/clang/dist/ From owner-svn-src-all@freebsd.org Sat Feb 13 14:59:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81B5DAA712D; Sat, 13 Feb 2016 14:59:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 5AC281262; Sat, 13 Feb 2016 14:59:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1DExu4A050574; Sat, 13 Feb 2016 14:59:56 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1DExt1G050566; Sat, 13 Feb 2016 14:59:55 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201602131459.u1DExt1G050566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 13 Feb 2016 14:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295594 - in vendor/compiler-rt/dist: . cmake/Modules lib/tsan lib/tsan/rtl test/msan test/tsan X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 14:59:57 -0000 Author: dim Date: Sat Feb 13 14:59:55 2016 New Revision: 295594 URL: https://svnweb.freebsd.org/changeset/base/295594 Log: Vendor import of compiler-rt release_38 branch r260756: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_38@260756 Modified: vendor/compiler-rt/dist/CMakeLists.txt vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake vendor/compiler-rt/dist/lib/tsan/CMakeLists.txt vendor/compiler-rt/dist/lib/tsan/rtl/tsan_suppressions.cc vendor/compiler-rt/dist/test/msan/fork.cc vendor/compiler-rt/dist/test/tsan/CMakeLists.txt vendor/compiler-rt/dist/test/tsan/lit.cfg vendor/compiler-rt/dist/test/tsan/lit.site.cfg.in Modified: vendor/compiler-rt/dist/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/CMakeLists.txt Sat Feb 13 14:58:41 2016 (r295593) +++ vendor/compiler-rt/dist/CMakeLists.txt Sat Feb 13 14:59:55 2016 (r295594) @@ -66,8 +66,10 @@ if (NOT COMPILER_RT_STANDALONE_BUILD) # Windows where we need to use clang-cl instead. if(NOT MSVC) set(COMPILER_RT_TEST_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang) + set(COMPILER_RT_TEST_CXX_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++) else() set(COMPILER_RT_TEST_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang.exe) + set(COMPILER_RT_TEST_CXX_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++.exe) endif() else() # Take output dir and install path from the user. @@ -81,6 +83,7 @@ else() option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" OFF) # Use a host compiler to compile/link tests. set(COMPILER_RT_TEST_COMPILER ${CMAKE_C_COMPILER} CACHE PATH "Compiler to use for testing") + set(COMPILER_RT_TEST_CXX_COMPILER ${CMAKE_CXX_COMPILER} CACHE PATH "C++ Compiler to use for testing") if (NOT LLVM_CONFIG_PATH) find_program(LLVM_CONFIG_PATH "llvm-config" Modified: vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake ============================================================================== --- vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake Sat Feb 13 14:58:41 2016 (r295593) +++ vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake Sat Feb 13 14:59:55 2016 (r295594) @@ -290,11 +290,12 @@ macro(add_custom_libcxx name prefix) SOURCE_DIR ${COMPILER_RT_LIBCXX_PATH} CMAKE_ARGS -DCMAKE_MAKE_PROGRAM:STRING=${CMAKE_MAKE_PROGRAM} -DCMAKE_C_COMPILER=${COMPILER_RT_TEST_COMPILER} - -DCMAKE_CXX_COMPILER=${COMPILER_RT_TEST_COMPILER} + -DCMAKE_CXX_COMPILER=${COMPILER_RT_TEST_CXX_COMPILER} -DCMAKE_C_FLAGS=${LIBCXX_CFLAGS} -DCMAKE_CXX_FLAGS=${LIBCXX_CFLAGS} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH= + -DLLVM_PATH=${LLVM_MAIN_SRC_DIR} LOG_BUILD 1 LOG_CONFIGURE 1 LOG_INSTALL 1 Modified: vendor/compiler-rt/dist/lib/tsan/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/lib/tsan/CMakeLists.txt Sat Feb 13 14:58:41 2016 (r295593) +++ vendor/compiler-rt/dist/lib/tsan/CMakeLists.txt Sat Feb 13 14:59:55 2016 (r295594) @@ -204,10 +204,17 @@ endif() # Build libcxx instrumented with TSan. if(COMPILER_RT_HAS_LIBCXX_SOURCES AND COMPILER_RT_TEST_COMPILER_ID STREQUAL "Clang") - set(LIBCXX_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libcxx_tsan) - add_custom_libcxx(libcxx_tsan ${LIBCXX_PREFIX} - DEPS ${TSAN_RUNTIME_LIBRARIES} - CFLAGS -fsanitize=thread) + set(libcxx_tsan_deps) + foreach(arch ${TSAN_SUPPORTED_ARCH}) + get_target_flags_for_arch(${arch} TARGET_CFLAGS) + set(LIBCXX_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libcxx_tsan_${arch}) + add_custom_libcxx(libcxx_tsan_${arch} ${LIBCXX_PREFIX} + DEPS ${TSAN_RUNTIME_LIBRARIES} + CFLAGS ${TARGET_CFLAGS} -fsanitize=thread) + list(APPEND libcxx_tsan_deps libcxx_tsan_${arch}) + endforeach() + + add_custom_target(libcxx_tsan DEPENDS ${libcxx_tsan_deps}) endif() if(COMPILER_RT_INCLUDE_TESTS) Modified: vendor/compiler-rt/dist/lib/tsan/rtl/tsan_suppressions.cc ============================================================================== --- vendor/compiler-rt/dist/lib/tsan/rtl/tsan_suppressions.cc Sat Feb 13 14:58:41 2016 (r295593) +++ vendor/compiler-rt/dist/lib/tsan/rtl/tsan_suppressions.cc Sat Feb 13 14:59:55 2016 (r295594) @@ -159,8 +159,8 @@ void PrintMatchedSuppressions() { Printf("ThreadSanitizer: Matched %d suppressions (pid=%d):\n", hit_count, (int)internal_getpid()); for (uptr i = 0; i < matched.size(); i++) { - Printf("%d %s:%s\n", matched[i]->hit_count, matched[i]->type, - matched[i]->templ); + Printf("%d %s:%s\n", atomic_load_relaxed(&matched[i]->hit_count), + matched[i]->type, matched[i]->templ); } } } // namespace __tsan Modified: vendor/compiler-rt/dist/test/msan/fork.cc ============================================================================== --- vendor/compiler-rt/dist/test/msan/fork.cc Sat Feb 13 14:58:41 2016 (r295593) +++ vendor/compiler-rt/dist/test/msan/fork.cc Sat Feb 13 14:59:55 2016 (r295594) @@ -4,6 +4,11 @@ // RUN: %clangxx_msan -std=c++11 -fsanitize-memory-track-origins=2 -g -O3 %s -o %t // RUN: MSAN_OPTIONS=store_context_size=1000,origin_history_size=0,origin_history_per_stack_limit=0 %run %t |& FileCheck %s +// +// Big-endian mips64 currently hangs on this test. Mark it unsupported to allow +// llvm-lit to finish. This also marks mips unsupported in most cases but msan +// is already unsupported for 32-bit mips. +// UNSUPPORTED: mips64-supported-target // Fun fact: if test output is redirected to a file (as opposed to // being piped directly to FileCheck), we may lose some "done"s due to Modified: vendor/compiler-rt/dist/test/tsan/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/test/tsan/CMakeLists.txt Sat Feb 13 14:58:41 2016 (r295593) +++ vendor/compiler-rt/dist/test/tsan/CMakeLists.txt Sat Feb 13 14:59:55 2016 (r295594) @@ -14,9 +14,33 @@ else() set(TSAN_HAS_LIBCXX False) endif() -configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in - ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg) +set(TSAN_TESTSUITES) + +set(TSAN_TEST_ARCH ${TSAN_SUPPORTED_ARCH}) +if(APPLE) + darwin_filter_host_archs(TSAN_SUPPORTED_ARCH TSAN_TEST_ARCH) +endif() + +foreach(arch ${TSAN_TEST_ARCH}) + string(TOLOWER "-${arch}" TSAN_TEST_CONFIG_SUFFIX) + if(ANDROID OR ${arch} MATCHES "arm|aarch64") + # This is only true if we are cross-compiling. + # Build all tests with host compiler and use host tools. + set(TSAN_TEST_TARGET_CC ${COMPILER_RT_TEST_COMPILER}) + set(TSAN_TEST_TARGET_CFLAGS ${COMPILER_RT_TEST_COMPILER_CFLAGS}) + else() + get_target_flags_for_arch(${arch} TSAN_TEST_TARGET_CFLAGS) + string(REPLACE ";" " " TSAN_TEST_TARGET_CFLAGS "${TSAN_TEST_TARGET_CFLAGS}") + endif() + + string(TOUPPER ${arch} ARCH_UPPER_CASE) + set(CONFIG_NAME ${ARCH_UPPER_CASE}Config) + + configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in + ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg) + list(APPEND TSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}) +endforeach() if(COMPILER_RT_INCLUDE_TESTS) configure_lit_site_cfg( @@ -26,6 +50,6 @@ if(COMPILER_RT_INCLUDE_TESTS) endif() add_lit_testsuite(check-tsan "Running ThreadSanitizer tests" - ${CMAKE_CURRENT_BINARY_DIR} + ${TSAN_TESTSUITES} DEPENDS ${TSAN_TEST_DEPS}) set_target_properties(check-tsan PROPERTIES FOLDER "TSan tests") Modified: vendor/compiler-rt/dist/test/tsan/lit.cfg ============================================================================== --- vendor/compiler-rt/dist/test/tsan/lit.cfg Sat Feb 13 14:58:41 2016 (r295593) +++ vendor/compiler-rt/dist/test/tsan/lit.cfg Sat Feb 13 14:59:55 2016 (r295594) @@ -12,7 +12,7 @@ def get_required_attr(config, attr_name) return attr_value # Setup config name. -config.name = 'ThreadSanitizer' +config.name = 'ThreadSanitizer' + config.name_suffix # Setup source root. config.test_source_root = os.path.dirname(__file__) @@ -39,16 +39,18 @@ else: extra_cflags = [] # Setup default compiler flags used with -fsanitize=thread option. -clang_tsan_cflags = ["-fsanitize=thread", - "-Wall", - "-m64"] + config.debug_info_flags + extra_cflags +clang_tsan_cflags = (["-fsanitize=thread", + "-Wall"] + + [config.target_cflags] + + config.debug_info_flags + + extra_cflags) clang_tsan_cxxflags = config.cxx_mode_flags + clang_tsan_cflags # Add additional flags if we're using instrumented libc++. # Instrumented libcxx currently not supported on Darwin. if config.has_libcxx and config.host_os != 'Darwin': # FIXME: Dehardcode this path somehow. libcxx_path = os.path.join(config.compiler_rt_obj_root, "lib", - "tsan", "libcxx_tsan") + "tsan", "libcxx_tsan_" + config.arch) libcxx_incdir = os.path.join(libcxx_path, "include", "c++", "v1") libcxx_libdir = os.path.join(libcxx_path, "lib") libcxx_so = os.path.join(libcxx_libdir, "libc++.so") Modified: vendor/compiler-rt/dist/test/tsan/lit.site.cfg.in ============================================================================== --- vendor/compiler-rt/dist/test/tsan/lit.site.cfg.in Sat Feb 13 14:58:41 2016 (r295593) +++ vendor/compiler-rt/dist/test/tsan/lit.site.cfg.in Sat Feb 13 14:59:55 2016 (r295594) @@ -1,7 +1,10 @@ ## Autogenerated by LLVM/Clang configuration. # Do not edit! +config.name_suffix = "@TSAN_TEST_CONFIG_SUFFIX@" +config.arch = "@arch@" config.has_libcxx = @TSAN_HAS_LIBCXX@ +config.target_cflags = "@TSAN_TEST_TARGET_CFLAGS@" # Load common config for all compiler-rt lit tests. lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured") From owner-svn-src-all@freebsd.org Sat Feb 13 15:00:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A94BAA71D9; Sat, 13 Feb 2016 15:00:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 B87B113D7; Sat, 13 Feb 2016 15:00:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1DF0Vvi050671; Sat, 13 Feb 2016 15:00:31 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1DF0Vvt050670; Sat, 13 Feb 2016 15:00:31 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201602131500.u1DF0Vvt050670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 13 Feb 2016 15:00:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295595 - vendor/compiler-rt/compiler-rt-release_38-r260756 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 15:00:33 -0000 Author: dim Date: Sat Feb 13 15:00:31 2016 New Revision: 295595 URL: https://svnweb.freebsd.org/changeset/base/295595 Log: Tag compiler-rt release_38 branch r260756. Added: vendor/compiler-rt/compiler-rt-release_38-r260756/ - copied from r295594, vendor/compiler-rt/dist/ From owner-svn-src-all@freebsd.org Sat Feb 13 15:00:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEC3DAA722C; Sat, 13 Feb 2016 15:00:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 881751602; Sat, 13 Feb 2016 15:00:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1DF0oo9050731; Sat, 13 Feb 2016 15:00:50 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1DF0nv6050723; Sat, 13 Feb 2016 15:00:49 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201602131500.u1DF0nv6050723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 13 Feb 2016 15:00:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295596 - in vendor/libc++/dist/test: libcxx/test std/localization/locale.categories/category.collate/locale.collate.byname std/localization/locale.categories/category.ctype/locale.ctyp... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 15:00:51 -0000 Author: dim Date: Sat Feb 13 15:00:49 2016 New Revision: 295596 URL: https://svnweb.freebsd.org/changeset/base/295596 Log: Vendor import of libc++ release_38 branch r260756: https://llvm.org/svn/llvm-project/libcxx/branches/release_38@260756 Modified: vendor/libc++/dist/test/libcxx/test/format.py vendor/libc++/dist/test/std/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp Modified: vendor/libc++/dist/test/libcxx/test/format.py ============================================================================== --- vendor/libc++/dist/test/libcxx/test/format.py Sat Feb 13 15:00:31 2016 (r295595) +++ vendor/libc++/dist/test/libcxx/test/format.py Sat Feb 13 15:00:49 2016 (r295596) @@ -161,7 +161,7 @@ class LibcxxTestFormat(object): 'expected-error', 'expected-no-diagnostics'] use_verify = self.use_verify_for_fail and \ any([tag in contents for tag in verify_tags]) - extra_flags = [] + extra_flags = ['-fsyntax-only'] if use_verify: extra_flags += ['-Xclang', '-verify', '-Xclang', '-verify-ignore-unexpected=note'] Modified: vendor/libc++/dist/test/std/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp Sat Feb 13 15:00:31 2016 (r295595) +++ vendor/libc++/dist/test/std/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp Sat Feb 13 15:00:49 2016 (r295596) @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// REQUIRES: locale.en_US.UTF-8 + // // template class collate_byname Modified: vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp Sat Feb 13 15:00:31 2016 (r295595) +++ vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp Sat Feb 13 15:00:49 2016 (r295596) @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// REQUIRES: locale.en_US.UTF-8 + // // template class ctype_byname; Modified: vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp Sat Feb 13 15:00:31 2016 (r295595) +++ vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp Sat Feb 13 15:00:49 2016 (r295596) @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// REQUIRES: locale.en_US.UTF-8 + // // template class ctype_byname; Modified: vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp Sat Feb 13 15:00:31 2016 (r295595) +++ vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp Sat Feb 13 15:00:49 2016 (r295596) @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// REQUIRES: locale.en_US.UTF-8 + // // template class ctype_byname; Modified: vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp Sat Feb 13 15:00:31 2016 (r295595) +++ vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp Sat Feb 13 15:00:49 2016 (r295596) @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// REQUIRES: locale.en_US.UTF-8 + // // template class ctype_byname; Modified: vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp Sat Feb 13 15:00:31 2016 (r295595) +++ vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp Sat Feb 13 15:00:49 2016 (r295596) @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// REQUIRES: locale.en_US.UTF-8 + // // template class ctype_byname; Modified: vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp Sat Feb 13 15:00:31 2016 (r295595) +++ vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp Sat Feb 13 15:00:49 2016 (r295596) @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// REQUIRES: locale.en_US.UTF-8 + // // template class ctype_byname; From owner-svn-src-all@freebsd.org Sat Feb 13 15:01:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 880CBAA72A6; Sat, 13 Feb 2016 15:01:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 43905187E; Sat, 13 Feb 2016 15:01:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1DF1EQK051403; Sat, 13 Feb 2016 15:01:14 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1DF1EZX051402; Sat, 13 Feb 2016 15:01:14 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201602131501.u1DF1EZX051402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 13 Feb 2016 15:01:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295597 - vendor/libc++/libc++-release_38-r260756 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 15:01:15 -0000 Author: dim Date: Sat Feb 13 15:01:14 2016 New Revision: 295597 URL: https://svnweb.freebsd.org/changeset/base/295597 Log: Tag libc++ release_38 branch r260756. Added: vendor/libc++/libc++-release_38-r260756/ - copied from r295596, vendor/libc++/dist/ From owner-svn-src-all@freebsd.org Sat Feb 13 15:01:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D15ADAA7307; Sat, 13 Feb 2016 15:01:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 6977B1A26; Sat, 13 Feb 2016 15:01:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1DF1ahL053414; Sat, 13 Feb 2016 15:01:36 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1DF1Xj6051457; Sat, 13 Feb 2016 15:01:33 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201602131501.u1DF1Xj6051457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 13 Feb 2016 15:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295598 - in vendor/lldb/dist: . include/lldb/API include/lldb/Core include/lldb/Symbol packages/Python/lldbsuite/test packages/Python/lldbsuite/test/expression_command/char packages/Py... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 15:01:38 -0000 Author: dim Date: Sat Feb 13 15:01:33 2016 New Revision: 295598 URL: https://svnweb.freebsd.org/changeset/base/295598 Log: Vendor import of lldb release_38 branch r260756: https://llvm.org/svn/llvm-project/lldb/branches/release_38@260756 Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/Makefile (contents, props changed) vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py (contents, props changed) vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/main.c (contents, props changed) Modified: vendor/lldb/dist/Makefile vendor/lldb/dist/include/lldb/API/SBInstruction.h vendor/lldb/dist/include/lldb/Core/RangeMap.h vendor/lldb/dist/include/lldb/Symbol/Symtab.h vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py vendor/lldb/dist/packages/Python/lldbsuite/test/lldbtest.py vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/function_symbol/TestSymbolAPI.py vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/lldbutil/process/TestPrintStackTraces.py vendor/lldb/dist/scripts/interface/SBInstruction.i vendor/lldb/dist/source/API/SBInstruction.cpp vendor/lldb/dist/source/Core/Module.cpp vendor/lldb/dist/source/Expression/IRDynamicChecks.cpp vendor/lldb/dist/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp vendor/lldb/dist/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp vendor/lldb/dist/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp vendor/lldb/dist/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h vendor/lldb/dist/source/Plugins/Platform/MacOSX/Makefile vendor/lldb/dist/source/Symbol/GoASTContext.cpp vendor/lldb/dist/source/Symbol/Symtab.cpp vendor/lldb/dist/source/Target/Target.cpp vendor/lldb/dist/tools/lldb-server/CMakeLists.txt Modified: vendor/lldb/dist/Makefile ============================================================================== --- vendor/lldb/dist/Makefile Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/Makefile Sat Feb 13 15:01:33 2016 (r295598) @@ -88,14 +88,6 @@ EXTRA_OPTIONS += -Wno-sign-compare ifeq ($(IS_TOP_LEVEL),1) -ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT)) -$(RecursiveTargets):: - $(Verb) if [ ! -f test/Makefile ]; then \ - $(MKDIR) test; \ - $(CP) $(PROJ_SRC_DIR)/test/Makefile test/Makefile; \ - fi -endif - test:: @ $(MAKE) -C test Modified: vendor/lldb/dist/include/lldb/API/SBInstruction.h ============================================================================== --- vendor/lldb/dist/include/lldb/API/SBInstruction.h Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/include/lldb/API/SBInstruction.h Sat Feb 13 15:01:33 2016 (r295598) @@ -60,6 +60,9 @@ public: bool DoesBranch (); + bool + HasDelaySlot (); + void Print (FILE *out); Modified: vendor/lldb/dist/include/lldb/Core/RangeMap.h ============================================================================== --- vendor/lldb/dist/include/lldb/Core/RangeMap.h Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/include/lldb/Core/RangeMap.h Sat Feb 13 15:01:33 2016 (r295598) @@ -1216,6 +1216,25 @@ namespace lldb_private { } return UINT32_MAX; } + + uint32_t + FindEntryIndexesThatContain(B addr, std::vector &indexes) const + { +#ifdef ASSERT_RANGEMAP_ARE_SORTED + assert (IsSorted()); +#endif + + if (!m_entries.empty()) + { + typename Collection::const_iterator pos; + for (const auto &entry : m_entries) + { + if (entry.Contains(addr)) + indexes.push_back(entry.data); + } + } + return indexes.size() ; + } Entry * FindEntryThatContains (B addr) Modified: vendor/lldb/dist/include/lldb/Symbol/Symtab.h ============================================================================== --- vendor/lldb/dist/include/lldb/Symbol/Symtab.h Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/include/lldb/Symbol/Symtab.h Sat Feb 13 15:01:33 2016 (r295598) @@ -81,6 +81,7 @@ public: Symbol * FindFirstSymbolWithNameAndType (const ConstString &name, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility); Symbol * FindSymbolContainingFileAddress (lldb::addr_t file_addr, const uint32_t* indexes, uint32_t num_indexes); Symbol * FindSymbolContainingFileAddress (lldb::addr_t file_addr); + void ForEachSymbolContainingFileAddress(lldb::addr_t file_addr, std::function const &callback); size_t FindFunctionSymbols (const ConstString &name, uint32_t name_type_mask, SymbolContextList& sc_list); void CalculateSymbolSizes (); Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py Sat Feb 13 15:01:33 2016 (r295598) @@ -65,5 +65,6 @@ class ExprCharTestCase(TestBase): @expectedFailurei386("llvm.org/pr23069") @expectedFailurex86_64("llvm.org/pr23069") @expectedFailureWindows("llvm.org/pr21765") + @expectedFailureAll(bugnumber="llvm.org/pr23069", triple = 'mips*') def test_unsigned_char(self): self.do_test(dictionary={'CFLAGS_EXTRAS': '-funsigned-char'}) Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/Makefile Sat Feb 13 15:01:33 2016 (r295598) @@ -0,0 +1,6 @@ +LEVEL = ../../../make + +C_SOURCES := main.c + +include $(LEVEL)/Makefile.rules + Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py Sat Feb 13 15:01:33 2016 (r295598) @@ -0,0 +1,84 @@ +""" +Test specific to MIPS +""" + +from __future__ import print_function + +import os, time +import re +import unittest2 +import lldb +import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test.lldbtest import * + +class AvoidBreakpointInDelaySlotAPITestCase(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + @skipUnlessArch(archs=re.compile('mips*')) + def test(self): + self.build() + exe = os.path.join(os.getcwd(), "a.out") + self.expect("file " + exe, + patterns = [ "Current executable set to .*a.out.*" ]) + + # Create a target by the debugger. + target = self.dbg.CreateTarget(exe) + self.assertTrue(target, VALID_TARGET) + + breakpoint = target.BreakpointCreateByName('main', 'a.out') + self.assertTrue(breakpoint and + breakpoint.GetNumLocations() == 1, + VALID_BREAKPOINT) + + # Now launch the process, and do not stop at entry point. + process = target.LaunchSimple (None, None, self.get_process_working_directory()) + self.assertTrue(process, PROCESS_IS_VALID) + + list = target.FindFunctions('foo', lldb.eFunctionNameTypeAuto) + self.assertTrue(list.GetSize() == 1) + sc = list.GetContextAtIndex(0) + self.assertTrue(sc.GetSymbol().GetName() == "foo") + function = sc.GetFunction() + self.assertTrue(function) + self.function(function, target) + + def function (self, function, target): + """Iterate over instructions in function and place a breakpoint on delay slot instruction""" + # Get the list of all instructions in the function + insts = function.GetInstructions(target) + print(insts) + i = 0 + for inst in insts: + if (inst.HasDelaySlot()): + # Remember the address of branch instruction. + branchinstaddress = inst.GetAddress().GetLoadAddress(target) + + # Get next instruction i.e delay slot instruction. + delayinst = insts.GetInstructionAtIndex(i+1) + delayinstaddr = delayinst.GetAddress().GetLoadAddress(target) + + # Set breakpoint on delay slot instruction + breakpoint = target.BreakpointCreateByAddress(delayinstaddr) + + # Verify the breakpoint. + self.assertTrue(breakpoint and + breakpoint.GetNumLocations() == 1, + VALID_BREAKPOINT) + # Get the location from breakpoint + location = breakpoint.GetLocationAtIndex(0) + + # Get the address where breakpoint is actually set. + bpaddr = location.GetLoadAddress() + + # Breakpoint address should be adjusted to the address of branch instruction. + self.assertTrue(branchinstaddress == bpaddr) + i += 1 + else: + i += 1 + +if __name__ == '__main__': + import atexit + lldb.SBDebugger.Initialize() + atexit.register(lambda: lldb.SBDebugger.Terminate()) + unittest2.main() Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/main.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/main.c Sat Feb 13 15:01:33 2016 (r295598) @@ -0,0 +1,21 @@ +#include + +foo (int a, int b) +{ + int c; + if (a<=b) + c=b-a; + else + c=b+a; + return c; +} + +int main() +{ + int a=7, b=8, c; + + c = foo(a, b); + +return 0; +} + Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/lldbtest.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/lldbtest.py Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/lldbtest.py Sat Feb 13 15:01:33 2016 (r295598) @@ -633,6 +633,14 @@ def check_list_or_lambda(list_or_lambda, else: return list_or_lambda is None or value is None or list_or_lambda == value +def matchArchitectures(archs, actual_arch): + retype = type(re.compile('hello, world')) + list_passes = isinstance(archs, list) and actual_arch in archs + basestring_passes = isinstance(archs, six.string_types) and actual_arch == archs + regex_passes = isinstance(archs, retype) and re.match(archs, actual_arch) + + return (list_passes or basestring_passes or regex_passes) + # provide a function to xfail on defined oslist, compiler version, and archs # if none is specified for any argument, that argument won't be checked and thus means for all # for example, @@ -1026,7 +1034,7 @@ def skipUnlessHostPlatform(oslist): return unittest2.skipUnless(getHostPlatform() in oslist, "requires on of %s" % (", ".join(oslist))) -def skipUnlessArch(archlist): +def skipUnlessArch(archs): """Decorate the item to skip tests unless running on one of the listed architectures.""" def myImpl(func): if isinstance(func, type) and issubclass(func, unittest2.TestCase): @@ -1035,9 +1043,8 @@ def skipUnlessArch(archlist): @wraps(func) def wrapper(*args, **kwargs): self = args[0] - if self.getArchitecture() not in archlist: - self.skipTest("skipping for architecture %s (requires one of %s)" % - (self.getArchitecture(), ", ".join(archlist))) + if not matchArchitectures(archs, self.getArchitecture()): + self.skipTest("skipping for architecture %s" % (self.getArchitecture())) else: func(*args, **kwargs) return wrapper Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/function_symbol/TestSymbolAPI.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/function_symbol/TestSymbolAPI.py Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/function_symbol/TestSymbolAPI.py Sat Feb 13 15:01:33 2016 (r295598) @@ -24,7 +24,6 @@ class SymbolAPITestCase(TestBase): self.line2 = line_number('main.c', '// Find the line number for breakpoint 2 here.') @add_test_categories(['pyapi']) - @expectedFailureWindows("llvm.org/pr24778") def test(self): """Exercise some SBSymbol and SBAddress APIs.""" self.build() Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/lldbutil/process/TestPrintStackTraces.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/lldbutil/process/TestPrintStackTraces.py Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/lldbutil/process/TestPrintStackTraces.py Sat Feb 13 15:01:33 2016 (r295598) @@ -22,6 +22,10 @@ class ThreadsStackTracesTestCase(TestBas self.line = line_number('main.cpp', '// Set break point at this line.') @expectedFailureAll("llvm.org/pr23043", ["linux"], archs=["i386"]) # We are unable to produce a backtrace of the main thread when the thread is blocked in fgets + + #The __thread_start function in libc doesn't contain any epilogue and prologue instructions + #hence unwinding fail when we are stopped in __thread_start + @expectedFailureAll(triple = 'mips*') @expectedFailureWindows("llvm.org/pr24778") @add_test_categories(['pyapi']) def test_stack_traces(self): Modified: vendor/lldb/dist/scripts/interface/SBInstruction.i ============================================================================== --- vendor/lldb/dist/scripts/interface/SBInstruction.i Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/scripts/interface/SBInstruction.i Sat Feb 13 15:01:33 2016 (r295598) @@ -51,6 +51,9 @@ public: bool DoesBranch (); + bool + HasDelaySlot (); + void Print (FILE *out); Modified: vendor/lldb/dist/source/API/SBInstruction.cpp ============================================================================== --- vendor/lldb/dist/source/API/SBInstruction.cpp Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/source/API/SBInstruction.cpp Sat Feb 13 15:01:33 2016 (r295598) @@ -160,6 +160,14 @@ SBInstruction::DoesBranch () return false; } +bool +SBInstruction::HasDelaySlot () +{ + if (m_opaque_sp) + return m_opaque_sp->HasDelaySlot (); + return false; +} + void SBInstruction::SetOpaque (const lldb::InstructionSP &inst_sp) { Modified: vendor/lldb/dist/source/Core/Module.cpp ============================================================================== --- vendor/lldb/dist/source/Core/Module.cpp Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/source/Core/Module.cpp Sat Feb 13 15:01:33 2016 (r295598) @@ -559,7 +559,18 @@ Module::ResolveSymbolContextForAddress ( Symtab *symtab = sym_vendor->GetSymtab(); if (symtab && so_addr.IsSectionOffset()) { - sc.symbol = symtab->FindSymbolContainingFileAddress(so_addr.GetFileAddress()); + Symbol *matching_symbol = nullptr; + + symtab->ForEachSymbolContainingFileAddress(so_addr.GetFileAddress(), + [&matching_symbol](Symbol *symbol) -> bool { + if (symbol->GetType() != eSymbolTypeInvalid) + { + matching_symbol = symbol; + return false; // Stop iterating + } + return true; // Keep iterating + }); + sc.symbol = matching_symbol; if (!sc.symbol && resolve_scope & eSymbolContextFunction && !(resolved_flags & eSymbolContextFunction)) { Modified: vendor/lldb/dist/source/Expression/IRDynamicChecks.cpp ============================================================================== --- vendor/lldb/dist/source/Expression/IRDynamicChecks.cpp Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/source/Expression/IRDynamicChecks.cpp Sat Feb 13 15:01:33 2016 (r295598) @@ -35,12 +35,12 @@ using namespace lldb_private; static char ID; -#define VALID_POINTER_CHECK_NAME "$__lldb_valid_pointer_check" +#define VALID_POINTER_CHECK_NAME "_$__lldb_valid_pointer_check" #define VALID_OBJC_OBJECT_CHECK_NAME "$__lldb_objc_object_check" static const char g_valid_pointer_check_text[] = "extern \"C\" void\n" -"$__lldb_valid_pointer_check (unsigned char *$__lldb_arg_ptr)\n" +"_$__lldb_valid_pointer_check (unsigned char *$__lldb_arg_ptr)\n" "{\n" " unsigned char $__lldb_local_val = *$__lldb_arg_ptr;\n" "}"; Modified: vendor/lldb/dist/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp Sat Feb 13 15:01:33 2016 (r295598) @@ -242,16 +242,27 @@ ABISysV_mips::PrepareTrivialCall (Thread const RegisterInfo *sp_reg_info = reg_ctx->GetRegisterInfo (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_SP); const RegisterInfo *ra_reg_info = reg_ctx->GetRegisterInfo (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_RA); const RegisterInfo *r25_info = reg_ctx->GetRegisterInfoByName("r25", 0); + const RegisterInfo *r0_info = reg_ctx->GetRegisterInfoByName("zero", 0); if (log) - log->Printf("Writing SP: 0x%" PRIx64, (uint64_t)sp); + log->Printf("Writing R0: 0x%" PRIx64, (uint64_t)0); + + /* Write r0 with 0, in case we are stopped in syscall, + * such setting prevents automatic decrement of the PC. + * This clears the bug 23659 for MIPS. + */ + if (!reg_ctx->WriteRegisterFromUnsigned (r0_info, (uint64_t)0)) + return false; + + if (log) + log->Printf("Writing SP: 0x%" PRIx64, (uint64_t)sp); // Set "sp" to the requested value if (!reg_ctx->WriteRegisterFromUnsigned (sp_reg_info, sp)) return false; if (log) - log->Printf("Writing RA: 0x%" PRIx64, (uint64_t)return_addr); + log->Printf("Writing RA: 0x%" PRIx64, (uint64_t)return_addr); // Set "ra" to the return address if (!reg_ctx->WriteRegisterFromUnsigned (ra_reg_info, return_addr)) Modified: vendor/lldb/dist/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp Sat Feb 13 15:01:33 2016 (r295598) @@ -207,16 +207,27 @@ ABISysV_mips64::PrepareTrivialCall (Thre const RegisterInfo *sp_reg_info = reg_ctx->GetRegisterInfo (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_SP); const RegisterInfo *ra_reg_info = reg_ctx->GetRegisterInfo (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_RA); const RegisterInfo *r25_info = reg_ctx->GetRegisterInfoByName("r25", 0); + const RegisterInfo *r0_info = reg_ctx->GetRegisterInfoByName("zero", 0); if (log) - log->Printf("Writing SP: 0x%" PRIx64, (uint64_t)sp); + log->Printf("Writing R0: 0x%" PRIx64, (uint64_t)0); + + /* Write r0 with 0, in case we are stopped in syscall, + * such setting prevents automatic decrement of the PC. + * This clears the bug 23659 for MIPS. + */ + if (!reg_ctx->WriteRegisterFromUnsigned (r0_info, (uint64_t)0)) + return false; + + if (log) + log->Printf("Writing SP: 0x%" PRIx64, (uint64_t)sp); // Set "sp" to the requested value if (!reg_ctx->WriteRegisterFromUnsigned (sp_reg_info, sp)) return false; if (log) - log->Printf("Writing RA: 0x%" PRIx64, (uint64_t)return_addr); + log->Printf("Writing RA: 0x%" PRIx64, (uint64_t)return_addr); // Set "ra" to the return address if (!reg_ctx->WriteRegisterFromUnsigned (ra_reg_info, return_addr)) Modified: vendor/lldb/dist/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp Sat Feb 13 15:01:33 2016 (r295598) @@ -169,6 +169,18 @@ ObjectFilePECOFF::MagicBytesMatch (DataB return magic == IMAGE_DOS_SIGNATURE; } +lldb::SymbolType +ObjectFilePECOFF::MapSymbolType(uint16_t coff_symbol_type) +{ + // TODO: We need to complete this mapping of COFF symbol types to LLDB ones. + // For now, here's a hack to make sure our function have types. + const auto complex_type = coff_symbol_type >> llvm::COFF::SCT_COMPLEX_TYPE_SHIFT; + if (complex_type == llvm::COFF::IMAGE_SYM_DTYPE_FUNCTION) + { + return lldb::eSymbolTypeCode; + } + return lldb::eSymbolTypeInvalid; +} ObjectFilePECOFF::ObjectFilePECOFF (const lldb::ModuleSP &module_sp, DataBufferSP& data_sp, @@ -534,8 +546,8 @@ ObjectFilePECOFF::GetSymtab() { const uint32_t symbol_size = 18; const uint32_t addr_byte_size = GetAddressByteSize (); - const size_t symbol_data_size = num_syms * symbol_size; - // Include the 4 bytes string table size at the end of the symbols + const size_t symbol_data_size = num_syms * symbol_size; + // Include the 4-byte string table size at the end of the symbols DataBufferSP symtab_data_sp(m_file.ReadFileContents (m_coff_header.symoff, symbol_data_size + 4)); DataExtractor symtab_data (symtab_data_sp, GetByteOrder(), addr_byte_size); lldb::offset_t offset = symbol_data_size; @@ -556,8 +568,8 @@ ObjectFilePECOFF::GetSymtab() coff_symbol_t symbol; const uint32_t symbol_offset = offset; const char *symbol_name_cstr = NULL; - // If the first 4 bytes of the symbol string are zero, then we - // it is followed by a 4 byte string table offset. Else these + // If the first 4 bytes of the symbol string are zero, then they + // are followed by a 4-byte string table offset. Else these // 8 bytes contain the symbol name if (symtab_data.GetU32 (&offset) == 0) { @@ -586,6 +598,7 @@ ObjectFilePECOFF::GetSymtab() { Address symbol_addr(sect_list->GetSectionAtIndex(symbol.sect-1), symbol.value); symbols[i].GetAddressRef() = symbol_addr; + symbols[i].SetType(MapSymbolType(symbol.type)); } if (symbol.naux > 0) Modified: vendor/lldb/dist/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h ============================================================================== --- vendor/lldb/dist/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h Sat Feb 13 15:01:33 2016 (r295598) @@ -101,7 +101,10 @@ public: static bool MagicBytesMatch (lldb::DataBufferSP& data_sp); - + + static lldb::SymbolType + MapSymbolType(uint16_t coff_symbol_type); + bool ParseHeader() override; @@ -116,7 +119,7 @@ public: uint32_t GetAddressByteSize() const override; - + // virtual lldb_private::AddressClass // GetAddressClass (lldb::addr_t file_addr); Modified: vendor/lldb/dist/source/Plugins/Platform/MacOSX/Makefile ============================================================================== --- vendor/lldb/dist/source/Plugins/Platform/MacOSX/Makefile Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/source/Plugins/Platform/MacOSX/Makefile Sat Feb 13 15:01:33 2016 (r295598) @@ -8,6 +8,25 @@ ##===----------------------------------------------------------------------===## LLDB_LEVEL := ../../../.. +LEVEL := $(LLDB_LEVEL)/../.. + +include $(LEVEL)/Makefile.config + +SOURCES += PlatformDarwin.cpp \ + PlatformDarwinKernel.cpp \ + PlatformMacOSX.cpp \ + PlatformRemoteiOS.cpp \ + PlatformRemoteAppleTV.cpp \ + PlatformRemoteAppleWatch.cpp + +ifeq ($(HOST_OS),Darwin) +SOURCES += PlatformAppleSimulator.cpp \ + PlatformiOSSimulator.cpp \ + PlatformiOSSimulatorCoreSimulatorSupport.mm \ + PlatformAppleTVSimulator.cpp \ + PlatformAppleWatchSimulator.cpp +endif + LIBRARYNAME := lldbPluginPlatformMacOSX BUILD_ARCHIVE = 1 Modified: vendor/lldb/dist/source/Symbol/GoASTContext.cpp ============================================================================== --- vendor/lldb/dist/source/Symbol/GoASTContext.cpp Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/source/Symbol/GoASTContext.cpp Sat Feb 13 15:01:33 2016 (r295598) @@ -13,6 +13,7 @@ #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" +#include "lldb/Core/StreamFile.h" #include "lldb/Core/UniqueCStringMap.h" #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/StringPrinter.h" @@ -1268,13 +1269,115 @@ GoASTContext::ConvertStringToFloatValue( //---------------------------------------------------------------------- // Dumping types //---------------------------------------------------------------------- +#define DEPTH_INCREMENT 2 + void GoASTContext::DumpValue(lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, Stream *s, lldb::Format format, - const DataExtractor &data, lldb::offset_t data_offset, size_t data_byte_size, + const DataExtractor &data, lldb::offset_t data_byte_offset, size_t data_byte_size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset, bool show_types, bool show_summary, bool verbose, uint32_t depth) { - assert(false); + if (IsTypedefType(type)) + type = GetTypedefedType(type).GetOpaqueQualType(); + if (!type) + return; + GoType *t = static_cast(type); + + if (GoStruct *st = t->GetStruct()) + { + if (GetCompleteType(type)) + { + uint32_t field_idx = 0; + for (auto* field = st->GetField(field_idx); field != nullptr; field_idx++) + { + // Print the starting squiggly bracket (if this is the + // first member) or comma (for member 2 and beyond) for + // the struct/union/class member. + if (field_idx == 0) + s->PutChar('{'); + else + s->PutChar(','); + + // Indent + s->Printf("\n%*s", depth + DEPTH_INCREMENT, ""); + + // Print the member type if requested + if (show_types) + { + ConstString field_type_name = field->m_type.GetTypeName(); + s->Printf("(%s) ", field_type_name.AsCString()); + } + // Print the member name and equal sign + s->Printf("%s = ", field->m_name.AsCString()); + + + // Dump the value of the member + CompilerType field_type = field->m_type; + field_type.DumpValue (exe_ctx, + s, // Stream to dump to + field_type.GetFormat(), // The format with which to display the member + data, // Data buffer containing all bytes for this type + data_byte_offset + field->m_byte_offset,// Offset into "data" where to grab value from + field->m_type.GetByteSize(exe_ctx->GetBestExecutionContextScope()), // Size of this type in bytes + 0, // Bitfield bit size + 0, // Bitfield bit offset + show_types, // Boolean indicating if we should show the variable types + show_summary, // Boolean indicating if we should show a summary for the current type + verbose, // Verbose output? + depth + DEPTH_INCREMENT); // Scope depth for any types that have children + } + + // Indent the trailing squiggly bracket + if (field_idx > 0) + s->Printf("\n%*s}", depth, ""); + + } + } + + if (GoArray *a = t->GetArray()) { + CompilerType element_clang_type = a->GetElementType(); + lldb::Format element_format = element_clang_type.GetFormat(); + uint32_t element_byte_size = element_clang_type.GetByteSize(exe_ctx->GetBestExecutionContextScope()); + + uint64_t element_idx; + for (element_idx = 0; element_idx < a->GetLength(); ++element_idx) + { + // Print the starting squiggly bracket (if this is the + // first member) or comman (for member 2 and beyong) for + // the struct/union/class member. + if (element_idx == 0) + s->PutChar('{'); + else + s->PutChar(','); + + // Indent and print the index + s->Printf("\n%*s[%" PRIu64 "] ", depth + DEPTH_INCREMENT, "", element_idx); + + // Figure out the field offset within the current struct/union/class type + uint64_t element_offset = element_idx * element_byte_size; + + // Dump the value of the member + element_clang_type.DumpValue (exe_ctx, + s, // Stream to dump to + element_format, // The format with which to display the element + data, // Data buffer containing all bytes for this type + data_byte_offset + element_offset,// Offset into "data" where to grab value from + element_byte_size, // Size of this type in bytes + 0, // Bitfield bit size + 0, // Bitfield bit offset + show_types, // Boolean indicating if we should show the variable types + show_summary, // Boolean indicating if we should show a summary for the current type + verbose, // Verbose output? + depth + DEPTH_INCREMENT); // Scope depth for any types that have children + } + + // Indent the trailing squiggly bracket + if (element_idx > 0) + s->Printf("\n%*s}", depth, ""); + } + + if (show_summary) + DumpSummary (type, exe_ctx, s, data, data_byte_offset, data_byte_size); } bool @@ -1371,19 +1474,55 @@ void GoASTContext::DumpSummary(lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, Stream *s, const DataExtractor &data, lldb::offset_t data_offset, size_t data_byte_size) { - assert(false); + if (type && GoType::KIND_STRING == static_cast(type)->GetGoKind()) + { + // TODO(ribrdb): read length and data + } } void GoASTContext::DumpTypeDescription(lldb::opaque_compiler_type_t type) { - assert(false); -} // Dump to stdout + // Dump to stdout + StreamFile s (stdout, false); + DumpTypeDescription (type, &s); +} void GoASTContext::DumpTypeDescription(lldb::opaque_compiler_type_t type, Stream *s) { - assert(false); + if (!type) + return; + ConstString name = GetTypeName(type); + GoType *t = static_cast(type); + + if (GoStruct *st = t->GetStruct()) + { + if (GetCompleteType(type)) + { + if (NULL == strchr(name.AsCString(), '{')) + s->Printf("type %s ", name.AsCString()); + s->PutCString("struct {"); + if (st->GetNumFields() == 0) { + s->PutChar('}'); + return; + } + s->IndentMore(); + uint32_t field_idx = 0; + for (auto* field = st->GetField(field_idx); field != nullptr; field_idx++) + { + s->PutChar('\n'); + s->Indent(); + s->Printf("%s %s", field->m_name.AsCString(), field->m_type.GetTypeName().AsCString()); + } + s->IndentLess(); + s->PutChar('\n'); + s->Indent("}"); + return; + } + } + + s->PutCString(name.AsCString()); } CompilerType Modified: vendor/lldb/dist/source/Symbol/Symtab.cpp ============================================================================== --- vendor/lldb/dist/source/Symbol/Symtab.cpp Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/source/Symbol/Symtab.cpp Sat Feb 13 15:01:33 2016 (r295598) @@ -1071,6 +1071,26 @@ Symtab::FindSymbolContainingFileAddress } void +Symtab::ForEachSymbolContainingFileAddress(addr_t file_addr, std::function const &callback) +{ + Mutex::Locker locker (m_mutex); + + if (!m_file_addr_to_index_computed) + InitAddressIndexes(); + + std::vector all_addr_indexes; + + // Get all symbols with file_addr + const size_t addr_match_count = m_file_addr_to_index.FindEntryIndexesThatContain(file_addr, all_addr_indexes); + + for (size_t i = 0; i < addr_match_count; ++i) + { + if (!callback(SymbolAtIndex(all_addr_indexes[i]))) + break; + } +} + +void Symtab::SymbolIndicesToSymbolContextList (std::vector &symbol_indexes, SymbolContextList &sc_list) { // No need to protect this call using m_mutex all other method calls are Modified: vendor/lldb/dist/source/Target/Target.cpp ============================================================================== --- vendor/lldb/dist/source/Target/Target.cpp Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/source/Target/Target.cpp Sat Feb 13 15:01:33 2016 (r295598) @@ -2442,18 +2442,18 @@ Target::GetBreakableLoadAddress (lldb::a SymbolContext sc; uint32_t resolve_scope = eSymbolContextFunction | eSymbolContextSymbol; temp_addr_module_sp->ResolveSymbolContextForAddress(resolved_addr, resolve_scope, sc); + Address sym_addr; if (sc.function) - { - function_start = sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress(this); - if (function_start == LLDB_INVALID_ADDRESS) - function_start = sc.function->GetAddressRange().GetBaseAddress().GetFileAddress(); - } + sym_addr = sc.function->GetAddressRange().GetBaseAddress(); else if (sc.symbol) - { - Address sym_addr = sc.symbol->GetAddress(); + sym_addr = sc.symbol->GetAddress(); + + function_start = sym_addr.GetLoadAddress(this); + if (function_start == LLDB_INVALID_ADDRESS) function_start = sym_addr.GetFileAddress(); - } - current_offset = addr - function_start; + + if (function_start) + current_offset = addr - function_start; } // If breakpoint address is start of function then we dont have to do anything. Modified: vendor/lldb/dist/tools/lldb-server/CMakeLists.txt ============================================================================== --- vendor/lldb/dist/tools/lldb-server/CMakeLists.txt Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/tools/lldb-server/CMakeLists.txt Sat Feb 13 15:01:33 2016 (r295598) @@ -33,24 +33,19 @@ add_lldb_executable(lldb-server LLDBServerUtilities.cpp ) -if (BUILD_SHARED_LIBS ) - target_link_libraries(lldb-server liblldb) - target_link_libraries(lldb-server ${LLDB_SYSTEM_LIBS}) +# The Darwin linker doesn't understand --start-group/--end-group. +if (LLDB_LINKER_SUPPORTS_GROUPS) + target_link_libraries(lldb-server + -Wl,--start-group ${LLDB_USED_LIBS} -Wl,--end-group) + target_link_libraries(lldb-server + -Wl,--start-group ${CLANG_USED_LIBS} -Wl,--end-group) else() - # The Darwin linker doesn't understand --start-group/--end-group. - if (LLDB_LINKER_SUPPORTS_GROUPS) - target_link_libraries(lldb-server - -Wl,--start-group ${LLDB_USED_LIBS} -Wl,--end-group) - target_link_libraries(lldb-server - -Wl,--start-group ${CLANG_USED_LIBS} -Wl,--end-group) - else() - target_link_libraries(lldb-server ${LLDB_USED_LIBS}) - target_link_libraries(lldb-server ${CLANG_USED_LIBS}) - endif() - llvm_config(lldb-server ${LLVM_LINK_COMPONENTS}) - - target_link_libraries(lldb-server ${LLDB_SYSTEM_LIBS}) + target_link_libraries(lldb-server ${LLDB_USED_LIBS}) + target_link_libraries(lldb-server ${CLANG_USED_LIBS}) endif() +llvm_config(lldb-server ${LLVM_LINK_COMPONENTS}) + +target_link_libraries(lldb-server ${LLDB_SYSTEM_LIBS}) set_target_properties(lldb-server PROPERTIES VERSION ${LLDB_VERSION}) From owner-svn-src-all@freebsd.org Sat Feb 13 15:01:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38E21AA741E; Sat, 13 Feb 2016 15:01:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 E83E61BAE; Sat, 13 Feb 2016 15:01:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1DF1t82053475; Sat, 13 Feb 2016 15:01:55 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1DF1tNp053474; Sat, 13 Feb 2016 15:01:55 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201602131501.u1DF1tNp053474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 13 Feb 2016 15:01:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295599 - vendor/lldb/lldb-release_38-r260756 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 15:01:56 -0000 Author: dim Date: Sat Feb 13 15:01:54 2016 New Revision: 295599 URL: https://svnweb.freebsd.org/changeset/base/295599 Log: Tag lldb release_38 branch r260756. Added: vendor/lldb/lldb-release_38-r260756/ - copied from r295598, vendor/lldb/dist/ From owner-svn-src-all@freebsd.org Sat Feb 13 17:02:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F679AA6A34; Sat, 13 Feb 2016 17:02:07 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 25F171336; Sat, 13 Feb 2016 17:02:06 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 682F0427224; Sun, 14 Feb 2016 04:02:05 +1100 (AEDT) Date: Sun, 14 Feb 2016 04:02:05 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295561 - in head: include sys/mips/include sys/powerpc/include sys/sparc64/include sys/sys sys/x86/include In-Reply-To: <20160213101623.GZ91220@kib.kiev.ua> Message-ID: <20160214035852.D918@besplex.bde.org> References: <201602120738.u1C7cKpq093956@repo.freebsd.org> <20160212232717.P894@besplex.bde.org> <20160212143630.GS91220@kib.kiev.ua> <20160213021939.S1340@besplex.bde.org> <20160212173641.GV91220@kib.kiev.ua> <20160213070506.N2501@besplex.bde.org> <20160213101623.GZ91220@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=R4L+YolX c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=vl1RCeKtdUqxWFC5bxoA:9 a=Sp4CEbam_OlKciZH:21 a=6yJpfTvQ7WEnSl8h:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 17:02:07 -0000 On Sat, 13 Feb 2016, Konstantin Belousov wrote: > On Sat, Feb 13, 2016 at 07:29:48AM +1100, Bruce Evans wrote: >> It needs a version number to be correct. Plain __POSIX_VISIBLE means >> all versions. __POSIX_VISBLE >= 200112 is probably good enough for >> the POSIX part. I don't know the correct number for XSI. Perhaps >> it can be simply omitted. _XOPEN_SOURCE >= 600 gives >> __XSI_VISIBLE >= 600 && _POSIX_C_SOURCE >= 200112. So __XSI_VISIBLE >> in the above is only to support XSI before 2001. We only support 1 >> XSI before that -- #500 which corresponds to 1996 POSIX. Very likely >> XSI did have ucontext_t then, so the above ifdef is correct. It is >> just hard to read. Easier than google hits though :-). I found a >> gnu man page about getcontext() being in SVID but couldn't easily >> find the history. > > I have SVID document labeled FINAL COPY June 15, 1995 First Edition. > There, it seems that ucontext.h is required. > > Below is the updated patch. > > diff --git a/include/signal.h b/include/signal.h > index 33be55c..217fadd 100644 > --- a/include/signal.h > +++ b/include/signal.h > @@ -36,8 +36,10 @@ > #include > #include > #include > +#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE > #include > #include > +#endif > > #if __BSD_VISIBLE > /* Good. The old visibility bugs with mc_* should be fixed someday. I said that uc_* could be used. _mc_* should have been used originally. Maybe we can just change to either of these, since nothing except libc should have used the internals of mcontext_t. Bruce From owner-svn-src-all@freebsd.org Sat Feb 13 17:23:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2D69AA737F; Sat, 13 Feb 2016 17:23:28 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 420951D84; Sat, 13 Feb 2016 17:23:28 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u1DHNNLu020056 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 13 Feb 2016 19:23:23 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u1DHNNLu020056 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u1DHNMQ3020055; Sat, 13 Feb 2016 19:23:22 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 13 Feb 2016 19:23:21 +0200 From: Konstantin Belousov To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295561 - in head: include sys/mips/include sys/powerpc/include sys/sparc64/include sys/sys sys/x86/include Message-ID: <20160213172321.GE91220@kib.kiev.ua> References: <201602120738.u1C7cKpq093956@repo.freebsd.org> <20160212232717.P894@besplex.bde.org> <20160212143630.GS91220@kib.kiev.ua> <20160213021939.S1340@besplex.bde.org> <20160212173641.GV91220@kib.kiev.ua> <20160213070506.N2501@besplex.bde.org> <20160213101623.GZ91220@kib.kiev.ua> <20160214035852.D918@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160214035852.D918@besplex.bde.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 17:23:28 -0000 On Sun, Feb 14, 2016 at 04:02:05AM +1100, Bruce Evans wrote: > The old visibility bugs with mc_* should be fixed someday. I said that > uc_* could be used. _mc_* should have been used originally. Maybe we > can just change to either of these, since nothing except libc should > have used the internals of mcontext_t. mcontext_t is needed and used by many language runtimes which handle exceptions for their functionality. It could be gc barriers, hacks with tagging, and many more. API cannot be broken there by renaming the structure members. The only way to hide mc_* is to rename them to __mc_* and provide compat redefinitions when is included directly. This is extremely cumbersome and I do not see a need in such fix for perceived use case of pure ANSI C code which, to be broken, must #define mc_XXX and then include . From owner-svn-src-all@freebsd.org Sat Feb 13 17:23:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3B4DAA73D3; Sat, 13 Feb 2016 17:23:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 A0BDE1ED5; Sat, 13 Feb 2016 17:23:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1DHNtgF095054; Sat, 13 Feb 2016 17:23:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1DHNteq095053; Sat, 13 Feb 2016 17:23:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201602131723.u1DHNteq095053@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 13 Feb 2016 17:23:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295602 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 17:23:56 -0000 Author: kib Date: Sat Feb 13 17:23:55 2016 New Revision: 295602 URL: https://svnweb.freebsd.org/changeset/base/295602 Log: Hide ucontext_t and mcontext_t when neither POSIX nor XSI features are enabled in the compilation environment, i.e. for ANSI C use of #include . Requested and reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 13 days Modified: head/include/signal.h Modified: head/include/signal.h ============================================================================== --- head/include/signal.h Sat Feb 13 16:02:12 2016 (r295601) +++ head/include/signal.h Sat Feb 13 17:23:55 2016 (r295602) @@ -36,8 +36,10 @@ #include #include #include +#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE #include #include +#endif #if __BSD_VISIBLE /* From owner-svn-src-all@freebsd.org Sat Feb 13 18:47:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 096B5AA6AF0; Sat, 13 Feb 2016 18:47:27 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id C638D1E50; Sat, 13 Feb 2016 18:47:25 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id DA1654238AC; Sun, 14 Feb 2016 05:47:21 +1100 (AEDT) Date: Sun, 14 Feb 2016 05:47:19 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295561 - in head: include sys/mips/include sys/powerpc/include sys/sparc64/include sys/sys sys/x86/include In-Reply-To: <20160213172321.GE91220@kib.kiev.ua> Message-ID: <20160214050522.J1687@besplex.bde.org> References: <201602120738.u1C7cKpq093956@repo.freebsd.org> <20160212232717.P894@besplex.bde.org> <20160212143630.GS91220@kib.kiev.ua> <20160213021939.S1340@besplex.bde.org> <20160212173641.GV91220@kib.kiev.ua> <20160213070506.N2501@besplex.bde.org> <20160213101623.GZ91220@kib.kiev.ua> <20160214035852.D918@besplex.bde.org> <20160213172321.GE91220@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=R4L+YolX c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=0ieMqWJny2FzPIRSrysA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 18:47:27 -0000 On Sat, 13 Feb 2016, Konstantin Belousov wrote: > On Sun, Feb 14, 2016 at 04:02:05AM +1100, Bruce Evans wrote: >> The old visibility bugs with mc_* should be fixed someday. I said that >> uc_* could be used. _mc_* should have been used originally. Maybe we >> can just change to either of these, since nothing except libc should >> have used the internals of mcontext_t. > > mcontext_t is needed and used by many language runtimes which handle > exceptions for their functionality. It could be gc barriers, hacks with > tagging, and many more. API cannot be broken there by renaming the > structure members. But it is not part of the API. The API is specified to be opaque. getcontext(3) doesn't even document the visible parts of it. > The only way to hide mc_* is to rename them to __mc_* and provide compat > redefinitions when is included directly. This is > extremely cumbersome and I do not see a need in such fix for perceived > use case of pure ANSI C code which, to be broken, must #define mc_XXX > and then include . How likely is third party code to use undocumented internals of opqaue types when FreeBSD code mostly doesn't used them. I checked all files in /usr/src outside of /sys/ that contain "ucontext.h". There are 71 such files with 204 lines matching "mc_". The actual users of mcontext_t's internals are: contrib/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc: 8 instances contrib/compiler-rt/lib/sanitizer_common/sanitizer_freebsd.h: 30 instances lib/libc: 102 instances lib/libthread_db: 60 instances tools/KSE/ksetest/kse_threads_test.c: 2 instances tools/KSE/rr/rr.c: 2 instances So there are 4 instances outside of libraries (counting compiler_rt as a libraries) and these 4 are to support KSE which went away about 11 years ago IIRC. tools/KSE doesn't compile now of course. The first error is that its asm source file is i386-only, so fails on i386. The next error is that its primary (?) API file no longer exists. I hoped to find no instances outside of libc. Bits in contrib are are problem. Bruce From owner-svn-src-all@freebsd.org Sat Feb 13 19:01:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1750AA7190; Sat, 13 Feb 2016 19:01:57 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 646CB15E0; Sat, 13 Feb 2016 19:01:57 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1DJ1uVk026673; Sat, 13 Feb 2016 19:01:56 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1DJ1ul2026670; Sat, 13 Feb 2016 19:01:56 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201602131901.u1DJ1ul2026670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sat, 13 Feb 2016 19:01:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295603 - head/sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 19:01:57 -0000 Author: cem Date: Sat Feb 13 19:01:56 2016 New Revision: 295603 URL: https://svnweb.freebsd.org/changeset/base/295603 Log: ioat(4): Decode/define more capabilities, operations These are defined in the Intel Haswell EDS volume 2 (registers) (507849 v2.1). Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ioat/ioat_hw.h head/sys/dev/ioat/ioat_internal.h Modified: head/sys/dev/ioat/ioat_hw.h ============================================================================== --- head/sys/dev/ioat/ioat_hw.h Sat Feb 13 17:23:55 2016 (r295602) +++ head/sys/dev/ioat/ioat_hw.h Sat Feb 13 19:01:56 2016 (r295603) @@ -56,8 +56,13 @@ __FBSDID("$FreeBSD$"); #define IOAT_DMACAPABILITY_OFFSET 0x10 #define IOAT_DMACAP_PB (1 << 0) +#define IOAT_DMACAP_CRC (1 << 1) +#define IOAT_DMACAP_MARKER_SKIP (1 << 2) +#define IOAT_DMACAP_OLD_XOR (1 << 3) #define IOAT_DMACAP_DCA (1 << 4) +#define IOAT_DMACAP_MOVECRC (1 << 5) #define IOAT_DMACAP_BFILL (1 << 6) +#define IOAT_DMACAP_EXT_APIC (1 << 7) #define IOAT_DMACAP_XOR (1 << 8) #define IOAT_DMACAP_PQ (1 << 9) #define IOAT_DMACAP_DMA_DIF (1 << 10) @@ -69,7 +74,8 @@ __FBSDID("$FreeBSD$"); #define IOAT_DMACAP_STR \ "\20\24Completion_Timeout_Support\23DMA_with_Multicasting_Support" \ "\22RAID_Super_descriptors\16Descriptor_Write_Back_Error_Support" \ - "\13DMA_with_DIF\12PQ\11XOR\07Block_Fill\05DCA\01Page_Break" + "\13DMA_with_DIF\12PQ\11XOR\10Extended_APIC_ID\07Block_Fill\06Move_CRC" \ + "\05DCA\04Old_XOR\03Marker_Skipping\02CRC\01Page_Break" /* DMA Channel Registers */ #define IOAT_CHANCTRL_OFFSET 0x80 Modified: head/sys/dev/ioat/ioat_internal.h ============================================================================== --- head/sys/dev/ioat/ioat_internal.h Sat Feb 13 17:23:55 2016 (r295602) +++ head/sys/dev/ioat/ioat_internal.h Sat Feb 13 19:01:56 2016 (r295603) @@ -346,6 +346,22 @@ struct ioat_descriptor { bus_addr_t hw_desc_bus_addr; }; +/* Unsupported by this driver at this time. */ +#define IOAT_OP_MOVECRC 0x41 +#define IOAT_OP_MOVECRC_TEST 0x42 +#define IOAT_OP_MOVECRC_STORE 0x43 +#define IOAT_OP_CRC 0x81 +#define IOAT_OP_CRC_TEST 0x82 +#define IOAT_OP_CRC_STORE 0x83 +#define IOAT_OP_MARKER 0x84 + +/* + * Deprecated OPs -- v3 DMA generates an abort if given these. And this driver + * doesn't support anything older than v3. + */ +#define IOAT_OP_OLD_XOR 0x85 +#define IOAT_OP_OLD_XOR_VAL 0x86 + enum ioat_ref_kind { IOAT_DMAENGINE_REF = 0, IOAT_ACTIVE_DESCR_REF, From owner-svn-src-all@freebsd.org Sat Feb 13 19:13:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CA63AA774B; Sat, 13 Feb 2016 19:13:07 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 241441F71; Sat, 13 Feb 2016 19:13:06 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u1DJD0sm046040 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 13 Feb 2016 21:13:00 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u1DJD0sm046040 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u1DJCx5X046039; Sat, 13 Feb 2016 21:12:59 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 13 Feb 2016 21:12:59 +0200 From: Konstantin Belousov To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295561 - in head: include sys/mips/include sys/powerpc/include sys/sparc64/include sys/sys sys/x86/include Message-ID: <20160213191259.GF91220@kib.kiev.ua> References: <201602120738.u1C7cKpq093956@repo.freebsd.org> <20160212232717.P894@besplex.bde.org> <20160212143630.GS91220@kib.kiev.ua> <20160213021939.S1340@besplex.bde.org> <20160212173641.GV91220@kib.kiev.ua> <20160213070506.N2501@besplex.bde.org> <20160213101623.GZ91220@kib.kiev.ua> <20160214035852.D918@besplex.bde.org> <20160213172321.GE91220@kib.kiev.ua> <20160214050522.J1687@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160214050522.J1687@besplex.bde.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 19:13:07 -0000 On Sun, Feb 14, 2016 at 05:47:19AM +1100, Bruce Evans wrote: > How likely is third party code to use undocumented internals of opqaue > types when FreeBSD code mostly doesn't used them. I already said that they are used. Base system cannot be a benchmark there because base code does not implement modern runtime (i.e. automatically managed memory and type-safe or generally safe execution environment). As a random example, from sbcl (common lisp implementation) runtime: #if defined(LISP_FEATURE_FREEBSD) #if defined(LISP_FEATURE_RESTORE_TLS_SEGMENT_REGISTER_FROM_CONTEXT) void os_restore_tls_segment_register(os_context_t *context) { load_fs(context->uc_mcontext.mc_fs); } #endif ... > > I checked all files in /usr/src outside of /sys/ that contain "ucontext.h". > There are 71 such files with 204 lines matching "mc_". The actual users > of mcontext_t's internals are: > > contrib/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc: 8 instances > contrib/compiler-rt/lib/sanitizer_common/sanitizer_freebsd.h: 30 instances > lib/libc: 102 instances > lib/libthread_db: 60 instances > tools/KSE/ksetest/kse_threads_test.c: 2 instances > tools/KSE/rr/rr.c: 2 instances > > So there are 4 instances outside of libraries (counting compiler_rt as > a libraries) and these 4 are to support KSE which went away about 11 > years ago IIRC. tools/KSE doesn't compile now of course. The first > error is that its asm source file is i386-only, so fails on i386. > The next error is that its primary (?) API file no longer > exists. > > I hoped to find no instances outside of libc. Bits in contrib are are > problem. The contrib is not a problem, it demostrates another legitimate use of the signal handlers. Any code which uses exceptions for more than error reporting does understand ucontext and mcontext. From owner-svn-src-all@freebsd.org Sat Feb 13 19:24:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75B07AA7D85; Sat, 13 Feb 2016 19:24:10 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 3684F15E7; Sat, 13 Feb 2016 19:24:10 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aUfnW-000E5S-FA; Sat, 13 Feb 2016 22:24:02 +0300 Date: Sat, 13 Feb 2016 22:24:02 +0300 From: Slawa Olhovchenkov To: Dag-Erling =?utf-8?B?U23DuHJncmF2?= Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r294693 - in stable/10: . crypto/openssh secure/lib/libssh secure/usr.bin/ssh secure/usr.sbin/sshd share/mk tools/build/options Message-ID: <20160213192402.GC37895@zxy.spb.ru> References: <201601242228.u0OMSIn7032949@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201601242228.u0OMSIn7032949@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 19:24:10 -0000 On Sun, Jan 24, 2016 at 10:28:18PM +0000, Dag-Erling Smørgrav wrote: > Author: des > Date: Sun Jan 24 22:28:18 2016 > New Revision: 294693 > URL: https://svnweb.freebsd.org/changeset/base/294693 > > Log: > MFH (r291198, r291260, r291261, r291375, r294325, r294335, r294563) > > Remove the HPN and None cipher patches. Now ssh terminated if found `noneenabled` in .ssh/config From owner-svn-src-all@freebsd.org Sat Feb 13 22:51:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DC98AA7C4F; Sat, 13 Feb 2016 22:51:18 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 60C061A8D; Sat, 13 Feb 2016 22:51:18 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1DMpHrM092959; Sat, 13 Feb 2016 22:51:17 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1DMpHt6092958; Sat, 13 Feb 2016 22:51:17 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201602132251.u1DMpHt6092958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sat, 13 Feb 2016 22:51:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295604 - head/sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 22:51:18 -0000 Author: cem Date: Sat Feb 13 22:51:17 2016 New Revision: 295604 URL: https://svnweb.freebsd.org/changeset/base/295604 Log: ioat(4): Also check for errors if the channel is suspended Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ioat/ioat.c Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Sat Feb 13 19:01:56 2016 (r295603) +++ head/sys/dev/ioat/ioat.c Sat Feb 13 22:51:17 2016 (r295604) @@ -672,7 +672,7 @@ out: wakeup(&ioat->tail); } - if (!is_ioat_halted(comp_update)) + if (!is_ioat_halted(comp_update) && !is_ioat_suspended(comp_update)) return; ioat->stats.channel_halts++; From owner-svn-src-all@freebsd.org Sat Feb 13 22:51:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E337AA7D7D; Sat, 13 Feb 2016 22:51:27 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 0DFC21C10; Sat, 13 Feb 2016 22:51:26 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1DMpPj4093009; Sat, 13 Feb 2016 22:51:25 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1DMpPlj093007; Sat, 13 Feb 2016 22:51:25 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201602132251.u1DMpPlj093007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sat, 13 Feb 2016 22:51:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295605 - head/sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 22:51:27 -0000 Author: cem Date: Sat Feb 13 22:51:25 2016 New Revision: 295605 URL: https://svnweb.freebsd.org/changeset/base/295605 Log: ioat(4): On error detected in ithread, defer HW reset to taskqueue The I/OAT HW reset process may sleep, so it is invalid to perform a channel reset from the software interrupt thread. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ioat/ioat.c head/sys/dev/ioat/ioat_internal.h Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Sat Feb 13 22:51:17 2016 (r295604) +++ head/sys/dev/ioat/ioat.c Sat Feb 13 22:51:25 2016 (r295605) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -92,6 +93,7 @@ static void ioat_submit_single(struct io static void ioat_comp_update_map(void *arg, bus_dma_segment_t *seg, int nseg, int error); static int ioat_reset_hw(struct ioat_softc *ioat); +static void ioat_reset_hw_task(void *, int); static void ioat_setup_sysctl(device_t device); static int sysctl_handle_reset(SYSCTL_HANDLER_ARGS); static inline struct ioat_softc *ioat_get(struct ioat_softc *, @@ -308,6 +310,7 @@ ioat_detach(device_t device) ioat = DEVICE2SOFTC(device); ioat_test_detach(); + taskqueue_drain(taskqueue_thread, &ioat->reset_task); mtx_lock(IOAT_REFLK); ioat->quiescing = TRUE; @@ -414,6 +417,7 @@ ioat3_attach(device_t device) mtx_init(&ioat->submit_lock, "ioat_submit", NULL, MTX_DEF); mtx_init(&ioat->cleanup_lock, "ioat_cleanup", NULL, MTX_DEF); callout_init(&ioat->timer, 1); + TASK_INIT(&ioat->reset_task, 0, ioat_reset_hw_task, ioat); /* Establish lock order for Witness */ mtx_lock(&ioat->submit_lock); @@ -712,8 +716,23 @@ out: mtx_unlock(&ioat->submit_lock); ioat_log_message(0, "Resetting channel to recover from error\n"); + error = taskqueue_enqueue(taskqueue_thread, &ioat->reset_task); + KASSERT(error == 0, + ("%s: taskqueue_enqueue failed: %d", __func__, error)); +} + +static void +ioat_reset_hw_task(void *ctx, int pending __unused) +{ + struct ioat_softc *ioat; + int error; + + ioat = ctx; + ioat_log_message(1, "%s: Resetting channel\n", __func__); + error = ioat_reset_hw(ioat); KASSERT(error == 0, ("%s: reset failed: %d", __func__, error)); + (void)error; } /* Modified: head/sys/dev/ioat/ioat_internal.h ============================================================================== --- head/sys/dev/ioat/ioat_internal.h Sat Feb 13 22:51:17 2016 (r295604) +++ head/sys/dev/ioat/ioat_internal.h Sat Feb 13 22:51:25 2016 (r295605) @@ -29,6 +29,8 @@ __FBSDID("$FreeBSD$"); #ifndef __IOAT_INTERNAL_H__ #define __IOAT_INTERNAL_H__ +#include + #define DEVICE2SOFTC(dev) ((struct ioat_softc *) device_get_softc(dev)) #define KTR_IOAT KTR_SPARE3 @@ -405,6 +407,7 @@ struct ioat_softc { bus_addr_t comp_update_bus_addr; struct callout timer; + struct task reset_task; boolean_t quiescing; boolean_t is_resize_pending;