From owner-svn-src-head@freebsd.org Sun Feb 7 00:49:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Feb 7 00:55:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12B46A9F4B4 for ; Sun, 7 Feb 2016 00:55:41 +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 C2B08146B for ; Sun, 7 Feb 2016 00:55:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qg0-x230.google.com with SMTP id b67so8208434qgb.1 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=LnpAkht31FMtmSmX+JUqxFZ2rDNDotRMoAZAwcWyUWJt7hZl13CWVgd3Q60zGe8e7Z y2MwM0BFsY+nsMmoJBqZCEifrcaEeoa8Q9bmFUyq0clo36+P8zDVa1yfKDgDYkJlyQSg 1NAMiMYa66rdPtAj4WK9swnOF67Py3No+ypnQI+IP9c38R3KRd2K020Ol/vSIYulQ03z UXgj55LInDMPkpHltXHCyEAfcTim0c4EerZD7eGRTZFbOSSTHyP9Nw4ios+G2eIOcI4D B0qaaDBmtof7IwTKc4QUbXaIbGhr5yNrZl6pg69LKVX+VE12bZy8wxBnD9kEHhZChLsZ aEeQ== X-Gm-Message-State: AG10YOSde3/FeHG9I3PXMWENaTz6rf0r0RN5hhoj5cDwaNXNevHPcLTkaeMRDGzSYo2Fs0ihXC+OvMu4g77RPA== 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Feb 7 01:04:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Feb 7 01:04:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Feb 7 01:09:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Feb 7 03:48:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Feb 7 04:28:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Feb 7 07:32:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Feb 7 07:36:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Feb 7 13:33:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Feb 7 15:26:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Feb 7 15:36:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Feb 7 15:40:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Feb 7 16:03:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7A2FAA1170 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 6DDFD1359 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Feb 7 16:18:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Feb 7 16:41:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Feb 7 16:43:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Feb 7 16:44:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Feb 7 16:44:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Feb 7 16:44:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Feb 7 16:48:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Feb 7 16:51:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Feb 7 18:39:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E94CAA1AF5 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 29926172A for ; Sun, 7 Feb 2016 18:39:02 +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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Feb 7 18:40:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Feb 7 20:15:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Feb 7 21:25:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Feb 7 22:04:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABD1DAA1DE3 for ; Sun, 7 Feb 2016 22:04:47 +0000 (UTC) (envelope-from wlosh@bsdimp.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 70C357A2 for ; Sun, 7 Feb 2016 22:04:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qg0-x233.google.com with SMTP id y89so32376657qge.2 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=PSSFMlZTBf/Y9zEAXW2wqzRGRx2LexwBszKOcu7384M03HGmjSBCvW+77Vrq7TwG8M fZWoka8Ck1nTOj1HqWCFcuUBEHpLH2kLyXupRH00L4kY+QBdp8zQj0NTzCu07ce+5hzo tDD4VnBColf7UW1m13Y8uJyqDhQMbZUFvbPSm/7F9MezAxsz1exGfg2CE9jjaXOqb76O s9/Dp8glBrN9u2+4aDdy6zdVIVUfnDDN2EmyFZ66WQVXHEKbowu+3EHW6DJsSdd6TmQ7 rHDFQCqMS6JVRsnXjrVvWQL6Yf4N77VPwgFmeWdnmL3OU3q+vZWF/lH1AvOdFxXggqVK V6hg== X-Gm-Message-State: AG10YOSu5raqBNfq2rgzCuILrETpJoeyA3tOxHD1U0sjMDQqlHUCQQHBepncjBqdoerSASgZZ6AktH9XHd+IIg== 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Feb 7 22:12:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Feb 7 23:20:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Feb 8 02:11:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Feb 8 10:54:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Feb 8 11:55:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Feb 8 16:59:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Feb 8 17:30:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Feb 8 17:36:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Feb 8 17:47:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Feb 8 19:24:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Feb 8 19:34:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Feb 8 19:45:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Feb 8 20:03:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Feb 8 20:57:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Feb 8 20:58:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Feb 8 21:42:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Feb 8 22:02:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Feb 8 22:13:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Feb 8 22:50:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Feb 8 23:06:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Feb 8 23:11:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Feb 9 00:01:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Feb 9 00:15:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Feb 9 01:41:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Feb 9 03:35:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Feb 9 06:26:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Feb 9 09:32:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Feb 9 09:37:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Feb 9 09:38:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Feb 9 09:39:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Feb 9 09:57:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Feb 9 10:06:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Feb 9 10:18:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Feb 9 16:30:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Feb 9 16:42:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Feb 9 17:09:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Feb 9 18:08:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Feb 9 18:10:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Feb 9 18:11:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Feb 9 18:19:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Feb 9 18:35:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Feb 9 20:22:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Feb 9 21:00:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 00:26:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 04:04:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 04:43:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 04:56:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 07:01:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 07:06:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 07:18:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 08:03:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 08:12:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68A62AA3BE0 for ; Wed, 10 Feb 2016 08:12:55 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::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 E05B8ED9 for ; Wed, 10 Feb 2016 08:12:54 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-wm0-x235.google.com with SMTP id g62so15479270wme.0 for ; Wed, 10 Feb 2016 00:12:54 -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=HnhoJP8g7p8nDj4nKEC3opyeYR3JPz90BNOwgSGNezAKiH5tvVgwKOfshs28yGLxeN kcizW4jvWOnM3sdHQsxdEiFrU4oNOpvgRzI/FsIl+Dm8c4TNh5QWrBcsY2rJmp4SQK0C J+uvNpVBsSIdTx9h8reNi8W4bRA8p5yXKB8XLcSQZYudmGmGpCKGuzrzMBXbbXSPlDM6 Hb2UDctdJx+F5xcGGjT7h6XC3n9BhQM45+i3e6iXsKXnvklSkEOdNN5UU9kJAdfvUJ/m 8ySe20praGIqOV3Zv47Ypt8X+eK6rdh2RqWTWgIgkuJe5588FxdvDlr/dxxAIDLnSyci Farw== X-Gm-Message-State: AG10YOSK8l3DdemIsc1cUbIqVxfvgk/cAsTqp4vEzOv4D8Ba76L7c1jS3Oaz99eHVpdHBcRPdvOSNb8HMDRha+W5 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 09:19:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 09:40:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 09:53:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 10:28:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 10:44:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 12:14:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 14:48:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 15:07:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A891BAA459A 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 732C91538 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 15:08:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62A16AA466E for ; Wed, 10 Feb 2016 15:08:45 +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 0BE2617CC 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 15:56:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 16:14:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 16:21:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3853EAA48CE 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 179121FDF for ; Wed, 10 Feb 2016 16:21:34 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 1FB2B217D0 for ; Wed, 10 Feb 2016 11:21:33 -0500 (EST) Received: from web6 ([10.202.2.216]) by compute3.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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 16:39:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 16:44:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 16:49:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 17:05:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 17:28:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 17:55:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 17:57:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 18:29:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 18:36:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 18:54:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 19:01:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 19:07:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 20:08:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 20:13:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 014C2AA3B5E 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 CEEE41092 for ; Wed, 10 Feb 2016 20:13:58 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id E1E9F21A90 for ; Wed, 10 Feb 2016 15:13:50 -0500 (EST) Received: from web6 ([10.202.2.216]) by compute4.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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 20:28:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 20:38:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 20:49:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 21:16:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 21:29:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B626AA47C0 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 EBD5E365 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 c200so48036053wme.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=X+F2KqvEdCiyXHe17MH7ZMVpNSX1+psbzCysUeptkuOAJ10VhofRdnZoqVmknTsCNF ybBFJWcssclZ+c29zK9QhFgB4Q7P/EeVxV+23M3Fka5zLL5Pm/zKJbQSpYTaYSImIdvW I4NOEV6eAxk+nbk0yteI7DtMOkxhtSLkC5ZO2/FwPPjXL0NylV9tuo5uXrnEk7XWNYVT qLNfiQb8mNzvJMuBnaGA9qS5T6IlO7BmTetS8gTxSl6Qn9H9+lr866kSRqLXoaZYTZl0 eP2tFJVAIEvdVKxJuGvo9VGIcRVQTafqIHEuECijrZZ3wrVbWTyX+G83DEksj/RMQJ1G 1+EA== X-Gm-Message-State: AG10YOTEavSaNGXCP1Z55mVOoixcFtkWGd0pkKSwpNpJzwnXsLzQ7t6BAjcrS2GzMr31J9MetnsztCye3HPkIJLW 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 21:35:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 22:28:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Feb 10 23:57:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 00:14:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 00:30:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 00:34:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 01:16:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 01:18:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 01:30:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 02:02:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 06:09:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 06:13:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 06:15:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 06:19:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 06:20:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 06:23:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 06:24:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 06:50:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 09:15:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 10:03:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 10:48:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 11:21:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 11:49:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 11:50:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 11:53:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 11:55:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 11:57:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 11:57:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 11:58:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 11:59:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 12:01:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 12:03:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 12:05:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 13:15:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 13:28:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 14:45:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 15:27:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 16:43:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 16:47:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 807EBAA47A7 for ; Thu, 11 Feb 2016 16:47:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ig0-x231.google.com (mail-ig0-x231.google.com [IPv6:2607:f8b0:4001:c05::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 4780315BD for ; Thu, 11 Feb 2016 16:47:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ig0-x231.google.com with SMTP id 5so40643127igt.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=K4D5DV6kepxwYYj3c2wVscOg1E2Q9lxUbvzRdzc719p1a1T+STvm2AvC2spGwBl9sa Z2Wmt3ntX1lmKNAQr/hnkRBN6+zMaGo7uDl1AHiKGmi43jJ1WKxMKPlQsdzQ2kWQgxzz g95WjYsqDJUnDyb2K9UU66gk4YrEaiIasm2JOPqXyngABDi1ud0PvD8VCv/Wxd5IMyrj sTLPIGlo1afE0jHk/8sMSYaAGZXuLnvPqEfSCbxhaqX4B/KQlGL+fllZ1thRQ5KYobpp PGXHhbrilHv+cSQ6okrXJvmO1WiKWHo8wW91I159iWfNTPovjCypXTDgu/vTjLMMQrmX mvYw== X-Gm-Message-State: AG10YOShEfl8JTZmZaaXCVJ21MqG13qg4DTLp3sfCws/+alYFW0/xw9CPf58BrxQVaKJTK3YLPkZq3xg6PASoA== 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 16:50:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEBB9AA494A for ; Thu, 11 Feb 2016 16:50:58 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ig0-x236.google.com (mail-ig0-x236.google.com [IPv6:2607:f8b0:4001:c05::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 8499519D4 for ; Thu, 11 Feb 2016 16:50:58 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ig0-x236.google.com with SMTP id xg9so39021851igb.1 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=SJUKFaMUmgC09zVb5nvXBVsNoK7c+bRVxx1SETvQvIozDegws/0aZfW/kLAGUk2ZZO bUIHcNHIJMc7Pk7/agynaz4Rz6L9HVSSIcCLOybT0HxjenezzkyJ3kFwROmkFTPv9frx s+QxrvbA9hd6AnqJP/bZb4ZerRFPQD6qD+HDKKFZV0BqWhAldfj5UbOY1et4ltUX1fJH tcETJ7+lREmdS7XKUkyuq/yutMZgiwTSN7ubqNwyZiKlbHXtznXsQo0fMfbD27/4oq48 2AdxJOXLCNR+kQrQT/VeJVtVqhaQA3YgWv7yGwhnzv+gsCI7p7sAOOGItODCDJRbrSxu NFiA== X-Gm-Message-State: AG10YOSBNyIfN+1w109APV3NSPTFAzZN3Kj2bzMSH+jI6DtCwqjpgIVneLrBmP049u+9lOvYQjKCEx4xkaaAWw== 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 16:55:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 17:07:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 17:32:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 17:33:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 17:37:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 17:43:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 17:48:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 18:01:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 18:35:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 18:37:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 19:01:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CBADAA6C83 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 355C417A8 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 19:06:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 747B4AA6E35 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 289481A86 for ; Thu, 11 Feb 2016 19:06:22 +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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 21:28:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 21:32:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 22:10:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Feb 11 22:29:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 01:12:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 01:41:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 02:50:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 02:50:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 02:53:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 05:15:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 07:20:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 07:20:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 07:27:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 07:38:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 10:58:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 11:34:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8CFAAA4A5F for ; Fri, 12 Feb 2016 11:34:43 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (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 3F76C1C1B for ; Fri, 12 Feb 2016 11:34:43 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x22e.google.com with SMTP id g62so58612664wme.0 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=EDwJwWugcZgQZxOY9HvBc2iBo8zMHSaAbzH3WlXdZw/knOL5h/01JbjXVdL4eocJ3Q Pdlx79n2pvHPefkrYu1qcomCanrAgWNBoAlo+kP4LAxlo95spG1+WkTFu+wOHGVutIPi y/p4L2qo+0FappmI60NAiWefbFB3kvwK/h16BnmglCbqiQqtwUVHmR1KX+E0X2De52yT UG6sCINAnjxE8KiGToI6hH6V1JNRi28IIY5YPgE6D1LPNuaFvjHLUvimF3MXp3ebZjph BCNJnrru9ooz9z9hHPAVJg/pfNv4IKmXDj6jq9/rQ+ZmsXDWYod2TYrqAI8pICGzhtGJ CxhQ== X-Gm-Message-State: AG10YOTbObA1pPk1eUNVrfid39xNaQy1PqCGRA+Sy/nNL2p90ebpXEb0fFR23CXDUCyJ7c9WjEdMby8EAhffsgPR 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 12:38:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 13:57:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 14:09:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 14:14:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 14:29:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 14:31:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 14:36:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 14:41:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 14:49:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 15:19:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 15:32:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 16:06:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 16:47:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 16:56:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 16:59:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 17:03:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 17:04:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 17:17:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43043AA6B81 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 0D7A4980 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 17:25:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 17:36:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 17:55:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 19:53:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 20:14:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 20:29:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 20:43:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 20:46:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 20:52:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 20:54:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 20:55:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 21:01:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 21:06:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 21:12:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 21:15:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 21:15:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 21:17:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Feb 12 22:46:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Feb 13 00:28:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Feb 13 00:58:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Feb 13 02:55:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Feb 13 07:45:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Feb 13 10:16:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Feb 13 17:02:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Feb 13 17:23:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Feb 13 17:23:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Feb 13 18:47:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Feb 13 19:01:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Feb 13 19:13:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Feb 13 22:51:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Feb 13 22:51:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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;