From owner-svn-src-head@freebsd.org Sun Jul 24 00:06: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 AC28DBA2CF7; Sun, 24 Jul 2016 00:06:47 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-yw0-x233.google.com (mail-yw0-x233.google.com [IPv6:2607:f8b0:4002:c05::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B43C1368; Sun, 24 Jul 2016 00:06:47 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-yw0-x233.google.com with SMTP id u134so132750599ywg.3; Sat, 23 Jul 2016 17:06:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:cc:message-id:from:to:in-reply-to:content-transfer-encoding :mime-version:subject:date:references; bh=s+puyyN9GrDzFbiibvcHy6EoQCE8tlgLDb/cNvW+CRk=; b=XqJNCtJcIfry5pnimg1saeuBn9ZB/nxPpJx97XunLhY09krKAirX6AQ9q/5/Syq8zb u5UXeFO4jS5hiosXJY7FkGMiHwmx989SGECM8JKD/utZpjhmYPfpVygOPIbTC2oeaaUa B4VyuiXxSdy8XB/P2/tLaWTNk74jxdaASyZ6L04ZM7hXsC9afiuSpEt1UxpeB6HnmWw5 N1EJ+Hzvqed15Clqf6NaMeC2nCl+HLjWsydqU/LDVQMx6STO7FxSceeLfYMCIjn4NNq4 +bgxfbY/Bx4U9o/Rgtaq6CU3Uwt/6fSPRLgGNnSoy9afCj0AancO96bo34GxCDGaJ7Ss ZZzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:cc:message-id:from:to:in-reply-to :content-transfer-encoding:mime-version:subject:date:references; bh=s+puyyN9GrDzFbiibvcHy6EoQCE8tlgLDb/cNvW+CRk=; b=gokbim1el2pnhoSZXBRdkmB347/wz+MZJxJvIny+fo1Fr2GcjIVobPji/GTnP8vrH1 ROX5vEatsIi+ahK8CSB7R3zjVXcBfgYv5hANxEQ8cg0vxZkdWI7lxd3W0DUL+Kye33rb 7YDY8lU/cKZ+eZupo+ui3C46VhhrycgQKvSOZB4BsiSmMaW1rWzvVttMO/zV+g7Bfifq 5LJhLsh3eKeTXVeqBkITcLzaTT50EHy6XLG2gPblt0nBeuT9Bl/iAyQHJWVpIpIQf3Ue ySqCK0GLk0RoN1e2MqD8WPj/KhAqIiiJIHPoeYHWq6Cbyor0xm7SEHXu9uCBH9AQBnOk zdmg== X-Gm-Message-State: AEkoouulA4a5oR08Z0lIjW6eIZfS8P2YwXEWNi2n7b+PX5aMcmC2sKJgdhL/GT5zBdrWLw== X-Received: by 10.37.0.198 with SMTP id 189mr9152623yba.119.1469318806241; Sat, 23 Jul 2016 17:06:46 -0700 (PDT) Received: from [172.20.1.77] (rrcs-71-43-12-11.se.biz.rr.com. [71.43.12.11]) by smtp.gmail.com with ESMTPSA id x126sm8428847ywg.12.2016.07.23.17.06.44 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 23 Jul 2016 17:06:45 -0700 (PDT) Sender: Justin Hibbits Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <114ED1ED-C709-4C80-B9A3-A0609445AB5E@freebsd.org> From: Justin Hibbits To: Bruce Evans In-Reply-To: <20160723130540.Q2164@besplex.bde.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: svn commit: r303209 - head/sys/powerpc/booke Date: Sat, 23 Jul 2016 20:06:28 -0500 References: <201607230227.u6N2Rgiw002223@repo.freebsd.org> <20160723130540.Q2164@besplex.bde.org> X-Mailer: Apple Mail (2.936) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 24 Jul 2016 00:06:47 -0000 On Jul 22, 2016, at 10:28 PM, Bruce Evans wrote: > On Sat, 23 Jul 2016, Justin Hibbits wrote: > >> Log: >> Use label math instead of hard-coding offsets for return addresses. >> >> Though the chances of the code in these sections changing are low, >> future-proof >> the sections and use label math. > > Not with numeric labels. I'm not future proofing it against label changes, I'm future proofing it against instruction additions/subtractions. > >> Renumber the surrounding areas to avoid duplicate label numbers. > > New numeric labels tend to move the addresses of old labels. > Renumbering > to give unique numeric labels more than defeats their reason for > existence -- > you have to manage them on every change to a label anywhere in the > file > (and perhaps in macros and included files). You never get a error for > a duplicated numeric label. Non-unique numeric labels are also a good > obfuscation. Given a branch to 1f or 1b, grepping the file for 1: may > find many labels 1:. You have to examine all the labels named 1: or > search only near the jump to see where 1 is. Its name is supposed to > not matter, but perhaps it does. I debated renumbering, and in my first iteration I didn't, but decided to for final commit, just for pure aesthetic purposes. In the future, I expect a lot of 0: labels for number labels, but as you mention below, named labels should be used for most labels anyway. > > Numeric labels should only be used in macros, and then only when the > macro processor is too feeble to support generating unique non-numeric > labels. Standard cpp is too feeble for this. > > I managed to remove all numeric labels in i386/exception.s (except in > macros and included files), and none came back. amd64/exception.S has > 19 of them, 7 with the additional style bug of being on a line with > a statement or comment. > > Bruce - Justin From owner-svn-src-head@freebsd.org Sun Jul 24 01:31: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 D6DFEB98CDE; Sun, 24 Jul 2016 01:31:42 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 942FA11F9; Sun, 24 Jul 2016 01:31:42 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6O1Vf7o020388; Sun, 24 Jul 2016 01:31:41 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6O1VfOH020387; Sun, 24 Jul 2016 01:31:41 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201607240131.u6O1VfOH020387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sun, 24 Jul 2016 01:31:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303253 - head/sys/arm/ti 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.22 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, 24 Jul 2016 01:31:43 -0000 Author: loos Date: Sun Jul 24 01:31:41 2016 New Revision: 303253 URL: https://svnweb.freebsd.org/changeset/base/303253 Log: Allow the use of micphy on am335x devices. The Micrel PHYs reads the optional external delays from DTB. Tested and used by uBMC and uFW. Sponsored by: Rubicon Communications (Netgate) Modified: head/sys/arm/ti/files.ti Modified: head/sys/arm/ti/files.ti ============================================================================== --- head/sys/arm/ti/files.ti Sat Jul 23 22:50:59 2016 (r303252) +++ head/sys/arm/ti/files.ti Sun Jul 24 01:31:41 2016 (r303253) @@ -20,6 +20,7 @@ arm/ti/ti_i2c.c optional ti_i2c arm/ti/ti_sdhci.c optional sdhci arm/ti/ti_spi.c optional ti_spi +dev/mii/micphy.c optional micphy dev/uart/uart_dev_ti8250.c optional uart dev/uart/uart_dev_ns8250.c optional uart From owner-svn-src-head@freebsd.org Sun Jul 24 04:39: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 E514DBA071B; Sun, 24 Jul 2016 04:39:06 +0000 (UTC) (envelope-from peter@wemm.org) Received: from smtp2.wemm.org (smtp2.wemm.org [192.203.228.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C69D61355; Sun, 24 Jul 2016 04:39:06 +0000 (UTC) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 711F5CBB; Sat, 23 Jul 2016 21:39:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1469335145; bh=fTJvrAD+E0CJEMJWktmXhRtAINLO/w6noqTE01hSHlA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=dL9tlYkKba13XfqOPVe88v5GviiTCunMOkStMfrpnP06LDnCuVFsPj0pFQ/VFHT1d tdHSqfYdwmfqV3g9ecM8aebM+yuskUuDAcuLDQ7JAEdGlrVXooaOqnVJdUL2WvDSKt u8/BsNkbItSP1/hTJFKdt3T95qIcNRI8aNUQkrEs= From: Peter Wemm To: svn-src-head@freebsd.org Cc: "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, "re@freebsd.org" Subject: Re: svn commit: r303019 - head/sys/geom Date: Sat, 23 Jul 2016 21:39 -0700 Message-ID: <3277576.dFZ2EGo2Fh@overcee.wemm.org> User-Agent: KMail/4.14.3 (FreeBSD/11.0-ALPHA6; KDE/4.14.3; amd64; ; ) In-Reply-To: <201607190536.u6J5aLl7015268@repo.freebsd.org> References: <201607190536.u6J5aLl7015268@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart4542475.Ev8TQeSbU3"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 24 Jul 2016 04:39:07 -0000 --nextPart4542475.Ev8TQeSbU3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Tuesday, July 19, 2016 05:36:21 AM Andrey V. Elsukov wrote: > Author: ae > Date: Tue Jul 19 05:36:21 2016 > New Revision: 303019 > URL: https://svnweb.freebsd.org/changeset/base/303019 >=20 > Log: > Use g_resize_provider() to change the size of GEOM_DISK provider, > when it is being opened. This should fix the possible loss of a res= ize > event when disk capacity changed. Are you sure about this? We have machines in the freebsd.org cluster t= hat now=20 panic on boot: Trying to mount root from zfs:zroot []... GEOM_PART: da0 was automatically resized. Use `gpart commit da0` to save changes or `gpart undo da0` to revert = them. GEOM_PART: integrity check failed (da0, GPT) Fatal trap 12: page fault while in kernel mode cpuid =3D 1; apic id =3D 01 fault virtual address=09=3D 0x48 fault code=09=09=3D supervisor read data, page not present instruction pointer=09=3D 0x20:0xffffffff80740005 stack pointer=09 =3D 0x28:0xfffffe01f119db10 frame pointer=09 =3D 0x28:0xfffffe01f119db30 code segment=09=09=3D base 0x0, limit 0xfffff, type 0x1b =09=09=09=3D DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags=09=3D interrupt enabled, resume, IOPL =3D 0 current process=09=09=3D 13 (g_event) [ thread pid 13 tid 100019 ] Stopped at g_part_resize+0x35: testb $0x8,0x48(%rbx) db> where Tracing pid 13 tid 100019 td 0xfffff8000426fa00 g_part_resize() at g_part_resize+0x35/frame 0xfffffe01f119db30 g_resize_provider_event() at g_resize_provider_event+0xb5/frame 0xfffff= e01f119d0 g_run_events() at g_run_events+0x20e/frame 0xfffffe01f119dbb0 .. It is exploding here: g_part_resize(struct g_consumer *cp) { struct g_part_table *table; G_PART_TRACE((G_T_TOPOLOGY, "%s(%s)", __func__, cp->provider->n= ame)); g_topology_assert(); table =3D cp->geom->softc; if (table->gpt_opened =3D=3D 0) { ^^^^^^^^^ (table is null) Are you creating events too soon now? At the very least, please reconsider having this MFC'ed without getting= to the=20 bottom of it. =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart4542475.Ev8TQeSbU3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJXlEZkAAoJEDXWlwnsgJ4EnC0IAK/3ZRLGACt3gTAWLETbIcJe LGiZw4R9UlNZmbhh49q7wXOIfrlgRFyCh13HSm34CyEFglbE6RMAMiDcMaLNO6LD XIqWJ2gmQxiOU8tdcXign4QxWnO1G7gycZDOnwIRzULsqi2cUmXP9zUomlXoBA08 rtMmHJo+vb9CbUNfu92P+aw/XydAN3CLIwLSHKl52wF4wvEgwv8AP34VWf3fjBWp weLMsslc43EjvCSchDZpf+eFWvBtH35r5aUm3Aty2agnUkhpnnKBkJ2eP7gMl2G3 30qAZZS8m+NGz0FR/RHVpYXgj7UhmuNWUjMXkLq1FX4Oy7/3m0MRKTrKEAhZb8g= =48mN -----END PGP SIGNATURE----- --nextPart4542475.Ev8TQeSbU3-- From owner-svn-src-head@freebsd.org Sun Jul 24 05:27: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 21F91BA11E3; Sun, 24 Jul 2016 05:27:22 +0000 (UTC) (envelope-from peter@wemm.org) Received: from smtp2.wemm.org (smtp2.wemm.org [192.203.228.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 024971944; Sun, 24 Jul 2016 05:27:21 +0000 (UTC) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 0D9F6CD7; Sat, 23 Jul 2016 22:27:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1469338041; bh=lI6exy/p12z/3tykeZ/LEJdEI32/Dani5/7tQAXdkpo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=bjTAlJSCvhFuOJMzXBHCivJHzH7BPZfy9SOvd1XgL2w/3Cl8SFeDkoK+umE4NX1i5 +FTYh9aX9eo5Shj041Zv8lo0zFNE7ViLc0TahoBAeUyi6GPskrNDEn6DfFn7gA1d65 Swq95dTgrKdq+pExZfvd9iELn6MsB9OVBIrDtJpg= From: Peter Wemm To: svn-src-all@freebsd.org Cc: svn-src-head@freebsd.org, "Andrey V. Elsukov" , src-committers@freebsd.org Subject: Re: svn commit: r303019 - head/sys/geom Date: Sat, 23 Jul 2016 22:27:15 -0700 Message-ID: <6198652.UmU69kS6Zt@overcee.wemm.org> User-Agent: KMail/4.14.3 (FreeBSD/11.0-ALPHA6; KDE/4.14.3; amd64; ; ) In-Reply-To: <3277576.dFZ2EGo2Fh@overcee.wemm.org> References: <201607190536.u6J5aLl7015268@repo.freebsd.org> <3277576.dFZ2EGo2Fh@overcee.wemm.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2853987.LzzQhyQHJt"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 24 Jul 2016 05:27:22 -0000 --nextPart2853987.LzzQhyQHJt Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Saturday, July 23, 2016 09:39:00 PM Peter Wemm wrote: > On Tuesday, July 19, 2016 05:36:21 AM Andrey V. Elsukov wrote: > > Author: ae > > Date: Tue Jul 19 05:36:21 2016 > > New Revision: 303019 > > URL: https://svnweb.freebsd.org/changeset/base/303019 > >=20 > > Log: > > Use g_resize_provider() to change the size of GEOM_DISK provider,= > > when it is being opened. This should fix the possible loss of a r= esize > > event when disk capacity changed. >=20 > Are you sure about this? We have machines in the freebsd.org cluster= that > now panic on boot: >=20 > Trying to mount root from zfs:zroot []... > GEOM_PART: da0 was automatically resized. > Use `gpart commit da0` to save changes or `gpart undo da0` to rever= t them. > GEOM_PART: integrity check failed (da0, GPT) >=20 > Fatal trap 12: page fault while in kernel mode > cpuid =3D 1; apic id =3D 01 > fault virtual address=09=3D 0x48 > fault code=09=09=3D supervisor read data, page not present > instruction pointer=09=3D 0x20:0xffffffff80740005 > stack pointer=09 =3D 0x28:0xfffffe01f119db10 > frame pointer=09 =3D 0x28:0xfffffe01f119db30 > code segment=09=09=3D base 0x0, limit 0xfffff, type 0x1b > =09=09=09=3D DPL 0, pres 1, long 1, def32 0, gran 1 > processor eflags=09=3D interrupt enabled, resume, IOPL =3D 0 > current process=09=09=3D 13 (g_event) > [ thread pid 13 tid 100019 ] > Stopped at g_part_resize+0x35: testb $0x8,0x48(%rbx) >=20 >=20 >=20 > db> where > Tracing pid 13 tid 100019 td 0xfffff8000426fa00 > g_part_resize() at g_part_resize+0x35/frame 0xfffffe01f119db30 > g_resize_provider_event() at g_resize_provider_event+0xb5/frame > 0xfffffe01f119d0 g_run_events() at g_run_events+0x20e/frame > 0xfffffe01f119dbb0 > .. >=20 > It is exploding here: > g_part_resize(struct g_consumer *cp) > { > struct g_part_table *table; >=20 > G_PART_TRACE((G_T_TOPOLOGY, "%s(%s)", __func__, > cp->provider->name)); g_topology_assert(); >=20 > table =3D cp->geom->softc; > if (table->gpt_opened =3D=3D 0) { > ^^^^^^^^^ (table is null) >=20 > Are you creating events too soon now? Sometimes da0 fails, other times da1 fails.. and sometimes it is comple= tely=20 fine. There is some sort of race going on with this change during the = very=20 first moments of bootup. =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart2853987.LzzQhyQHJt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJXlFG0AAoJEDXWlwnsgJ4EmLkH/A/haQXONwKWt/OP1PVowC2P ZjSzFQpHogYDJXo0HqENWYD6zNUCgz89lAYBV0jZ/m2vgEmQ3tNL2KD86j8a7Pj/ IsVgBebYT79hrVkBGs5E02iGTNEiDIe0aFupIKdouijiXbDf84eL00gIEJpOGWzy Fh6/Gtjn5LRNK6K9fA6sKJN2O3MH5kxTKqRFmw6/B07Z6vKKr3aG5vQSuISP5GV7 KOi9A1TtdrEpU2Q7OmMMone5zVWchHsmXPX4l1FkUBvxuBz786k6ZVFkHMw9CSjH RSAAB/15kc480IXf114DOL4Hd2oTXpwGaetzb3C8nxDYQIrJsMywwQ2BOyFLE54= =VtCP -----END PGP SIGNATURE----- --nextPart2853987.LzzQhyQHJt-- From owner-svn-src-head@freebsd.org Sun Jul 24 07:45: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 12109BA3314; Sun, 24 Jul 2016 07:45:25 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mail.miracle.cz (mail.miracle.cz [193.84.128.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.miracle.cz", Issuer "Miracle Group Root CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E22A1F54; Sun, 24 Jul 2016 07:45:24 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from [193.84.128.50] (meloun.ad.miracle.cz [193.84.128.50]) by mail.miracle.cz (Postfix) with ESMTPSA id 0EC853ACA4; Sun, 24 Jul 2016 09:45:20 +0200 (CEST) Subject: Re: svn commit: r301453 - in head/sys: arm/arm arm64/arm64 dev/fdt dev/gpio dev/iicbus dev/ofw dev/pci dev/vnic kern mips/mips sys To: Nathan Whitehorn , Svatopluk Kraus , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201606051620.u55GKD5S066398@repo.freebsd.org> <578E0B5D.3070105@FreeBSD.org> <578F6075.7010500@FreeBSD.org> <05a80ac6-4285-ec9d-36e9-2f92c609f746@freebsd.org> <57907B0F.9070204@FreeBSD.org> <9d2a224c-b787-2875-5984-a7a2354e8695@freebsd.org> <57934ABD.6010807@FreeBSD.org> <4e7a3e8f-cc21-f5f2-e3e0-4dbd554a4cd0@freebsd.org> From: Michal Meloun X-Enigmail-Draft-Status: N1110 Message-ID: <5794720F.4050303@FreeBSD.org> Date: Sun, 24 Jul 2016 09:45:19 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <4e7a3e8f-cc21-f5f2-e3e0-4dbd554a4cd0@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.miracle.cz); Sun, 24 Jul 2016 09:45:20 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 24 Jul 2016 07:45:25 -0000 Dne 23.07.2016 v 20:35 Nathan Whitehorn napsal(a): > > > On 07/23/16 03:45, Michal Meloun wrote: >> Dne 21.07.2016 v 17:53 Nathan Whitehorn napsal(a): >>> >>> On PowerPC, GENERIC64 supports FDT systems (some IBM hardware), OFW >>> systems (Macs, some IBM hardware), systems with no device trees at >>> all (old-style PS3), and systems with a mixture of device tree and >>> no device tree (new-style PS3). On these, there is a mixture of >>> "real" interrupts and GPIO-type interrupts. There is no limitation >>> that this be used only for device-tree-type systems. >>> >>> The system requires two things: an interrupt domain key and an >>> arbitrary unique byte string describing the interrupt. When running >>> with a device tree, these are set to the phandle of the >>> interrupt-parent and the contents of the device tree interrupt >>> specifier, respectively, and the system was of course developed with >>> that in mind. But they don't need to be, and often aren't. You could >>> make the domain an element of an enum (where "ACPI" is a choice, for >>> instance -- this is what PS3 does), or set it to a pointer to a >>> device_t, or really anything you like. Similarly, the interrupt >>> specifier is totally free-form. >> >> Yes, I agree. and i think that we followed the same direction. But i >> see two problems with this approach. >> - in some cases (OFW, device_t) you don't have control over domain >> key value, so you cannot guarantee its uniqueness. >> Of course, probability of collision is low, but it is. > > We could solve this in a number of ways, for example widening to 64 > bits, or adding another value (domain type, for example). You could > also make an acpi_bus_map_intr() to go with the OFW one that connect > in some machine-dependent code if you have fundamentally incompatible > bus enumeration mechanisms that you expect to exist simultaneously -- > but, of course, no systems like this seem to actually exist, so the > problem is both easily solved and totally theoretical. > >> - within ofw_bus_map_intr() (or later - at the time when byte string >> must be decoded) you are not able (easily) to differentiate >> between different formats, thus you are not able to select >> appropriate decoder. The GPIO controller, for example, >> must be able to handle interrupts defined by standard OFW property, >> or by pair concurrently. > > In principle, you could solve that as above, or by registering a > second interrupt domain for the same controller. > > In practice, it doesn't matter since, in the GPIO case, for example, > the GPIO controller is never itself also a normal interrupt controller > (i.e. the GIC and GPIO controller are always different devices). As > such, the theoretical does not occur in practice. form https://svnweb.freebsd.org/base/head/sys/gnu/dts/arm/tegra124-jetson-tk1.dts?revision=295436&view=markup#l1380 "interrupts = ; " Do you want more examples ? > >> For this reason we makes domain key composite, in our model, the >> domain key consist of "domain key type" >> and "domain key value". This composite key guarantees uniqueness and >> it also allows to select proper parser for byte string. > > Yes, but this solves what is a nonexistant problem by making the > system substantially less flexible and more invasive. Which is not a > good tradeoff. > I think that existence of problem is confirmed in the above example . Quote from previous paragraph: "We could solve this in a number of ways, ... , or adding another value (domain type, for example)." What can I say more ... >> This is, imho, only one difference between us. > > One of many, yes. > >> >>> You could, for instance, set it to one of the structures introduced >>> in r301453 if you wanted to. >>> >>> I would have zero problems with changing the prototype of the >>> existing dev/ofw function to something more generic in name, like: >>> >>> bus_map_intr(device_t dev, uintptr_t iparent, size_t intrlen, void >>> *intr) >>> >>> instead of the existing equivalent: >>> >>> ofw_bus_map_intr(device_t dev, phandle_t iparent, int icells, >>> pcell_t *intr) >>> >> Our bus_map_intr() method is not indeed as replacement of >> ofw_bus_map_intr(). Its evolution of "how we can store more complex >> data to resource list (from bus enumerator) and transfer it to >> bus_allocate_resource() and/or to bus_setup_intr()" in driver >> independent way. We found no reasonable way to do it, so we postponed >> reading of properties to bus_allocate_resource() time. > > Right, but that is (a) a solved problem with ofw_bus_map_intr() and > (b) this code doesn't solve it as completely. What does it let you do > that the existing code does not? There has not been a single concrete > example of something anyone wants to do on actual hardware so far in > this discussion. > >> But now jhb@ gives us alternative and I must say that this looks >> like a clean and elegant way how to make this (assuming that we can >> expand resource_list_entry by pointer to alloc_resource_args) > > Except that jhb@'s suggestion doesn't actually work for interrupts for > the reasons I and others have pointed out. We could make such a > system, but it would be a different one. > >> >>>> By this, one byte string in OFW encoding can describe one IRQ and >>>> exactly same string in UEFI encoding can describe different IRQ. >>>> Or, in reverse, OFW and UEFI can describe same (and compatible) IRQ >>>> by two different strings. >>>> This is exact reason, why we discards virtual IRQ idea and I think >>>> that this fact is root issue of this clash. >>>> Probably it doesn't make sense to talk about others, unless we can >>>> find consensus on this. >>> >>> You have the larger problem if you end up in this situation that you >>> are enumerating the hardware by two different and incompatible >>> techniques. There simply is no way to solve this unless you either >>> (a) segregate the system into an ACPI-enumerated domain and an >>> OF-enumerated domain, in which case the problem vanishes, (b) >>> discard one enumeration, which is what arm64 does and will always >>> do, according to Andrew in another post, or (c) make some incredibly >>> complex merging code that would naturally handle interrupts with >>> everything else. So I don't think this is an actual, real problem. >>> >> I think that above proposed solution resolves this gracefully. > > Assuming you are talking about jhb's decoration plan in the bus > hierarchy, it doesn't actually work for interrupts at all because of > lateral connections and circular dependencies. > >> >>> >>>>> >>>>>> >>>>>>> 2. It partially duplicates the functionality of >>>>>>> OFW_BUS_MAP_INTR(), but is both problematically more general and >>>>>>> less flexible (it has requirements on timing of PIC attachment >>>>>>> vs. driver resource allocation) >>>>>> OFW_BUS_MAP_INTR() can parse only OFW based data and expect >>>>>> that parsed data are magicaly stored within the call. >>>>>> The new method, bus_map_intr(), can parse data from multiple >>>>>> sources (OFW, UEFI / ACPI, synthetic[gpio device + pin >>>>>> number]). It also returns parsed data back to caller. >>>>> >>>>> That is not true. It works as long as you can specify the >>>>> interrupt state as a 32-bit key of some kind for the PIC and a >>>>> string of arbitrary data, which works with all of those. You could >>>>> even make the interrupt data be a pointer to exactly the structs >>>>> you have chosen to define here. >>>> Nope, in heterogeneous world, same string can describe two >>>> different IRQs and/or two different strings can describe single IRQ >>>> in compatible manner. >>> >>> Can you give *any* concrete example of this that doesn't involve >>> mixed ACPI/FDT enumeration of a single system where devices appear >>> in both trees, which doesn't actually ever happen? >> GPIO - its interrupt function can be accessed by regular >> "interrupts" property, or it can be derived from GPIO pin. > > The GPIO controller has one or more interrupts assigned to it that are > part of its parent's interrupt domain. It cascades them to one or more > virtual interrupts that belong to its own domain. Where is the > ambiguity or complication here? >>> >>>>> >>>>>> >>>>>>> 3. It is not fully transparent to end code. Since it happens at >>>>>>> bus_alloc_resource() time, it is complicated to get the >>>>>>> appropriate values for IRQs constructed by composite techniques >>>>>>> (interrupt-map vs. interrupts vs. hand allocation vs. PCI >>>>>>> routing, for example). >>>>>> I don't see any limitation - can you be more exact? Why is not >>>>>> transparent? Why is more complicated ? >>>>> >>>>> Suppose that a PCI device adds more IRQs to its resource list or >>>>> modifies the ordering. How is whatever bus layer supposed to do >>>>> something sensible at allocation time? It requires that RID >>>>> numbers mean something to the parent bus after assignment, which >>>>> is not guaranteed by anything and is, in more than handful of >>>>> cases I think of, not true in practice. >>>> Sure. And since the new code allows delivering resources in RL, so >>>> I don't see any limitation here. >>> >>> It indexed mapping by RID and then searches interrupt lists by that >>> to get the interrupt-parent. This is fundamentally a broken design >>> if the child needs to, say, add a second interrupt to its RL on a >>> different interrupt-parent. >> ?? I don't understand. The new code doesn't need this. > > int bus_generic_map_intr(device_t dev, device_t child, int *rid, > rman_res_t *start, rman_res_t *end, > rman_res_t *count, struct intr_map_data > **imd); > > This works either by rid or by rman_res_t. In the event of a > self-assigned interrupt from the child, which is a fairly common case, > neither of these values are meaningfully parseable by the bus parent, > especially if the interrupt is on a different controller. The main > issue is that this code goes back to the device tree according to the > *parent*'s idea of how it should be parsed and there are many cases > (GPIO interrupts, for example) when the *child* needs to amend the > list in a different way. >> >>> >>>> >>>>> >>>>>>> It is much easier to do this correctly at bus attach time when >>>>>>> the resource lists are made (how PPC does it). >>>>>>> >>>>>> I don't agree. I don't agree. Making this at bus attach time >>>>>> leads into complicated 'virtual' IRQ infrastructure, with many >>>>>> unresolved corner cases. >>>>> >>>>> Which unresolved corner cases? This has been working correctly on >>>>> a number of platforms in both FreeBSD and Linux for many years. >>>> Nope, it doesn't work for ARM yet (for GPIO interrupts for >>>> example) and Linux uses EPROBE_DEFER mechanism for a long time. >>>> See: http://lxr.free-electrons.com/source/drivers/base/platform.c#L87 >>> >>> There is some missing code on ARM (probably about 30 minutes of work >>> to make it match PowerPC) to make it work in an ideal case, sure, >>> but there is no reason you could not go out right now, with the >>> existing code, and implement GPIO interrupts by declaring the GPIO >>> driver as an interrupt controller. >>> >>> Can you give any concrete case of something that doesn't work? >> GPIO again. How you can allocate interrupt associated with given gpio >> pin installed by "cd-gpios = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_LOW>;" > > You parse that as an interrupt on a interrupt domain associated with > the GPIO controller referenced by &gpio. In pseudo-code: > > int irq = ofw_bus_map_intr(dev, <&gpio>, ncells, GPIO_ACTIVE_LOW>); > The GPIO controller, meanwhile, has registered an interrupt domain for > <&gpio> and is asked to decode and configure the interrupt defined by > , which it knows how to parse. This > is simple and straightforward. And again and again: We have "cd-gpios = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_LOW>;" and interrupt-parent = <&gpio>; "interrupts = ; " in one tree. And we need to get a interrupt in both variants. > >> >>>> >>>>> >>>>>> >>>>>>> (1) is easy to fix without API changes, but (2) and (3) are >>>>>>> fundamental architectural problems that will bite us immediately >>>>>>> down the road and cause a permanent schism between OF support on >>>>>>> different platforms. >>>>>>> >>>>>>> Let me describe how this is handled on PowerPC (Linux on PPC >>>>>>> solves the problem the same way). When constructing a resource >>>>>>> list, bus drivers that construct them from OF properties call >>>>>>> ofw_bus_map_intr() with the interrupt parent phandle and the >>>>>>> array of cells corresponding to the interrupt. This thunks >>>>>>> immediately to nexus, which connects to code in intr_machdep.c. >>>>>>> Code there assigns a unique made-up virtual IRQ and returns it, >>>>>>> caching the interrupt parent ID and opaque interrupt data (if >>>>>>> the same string of data reappears later, you get back the same >>>>>>> virtual IRQ of course). >>>>>>> >>>>>>> When PIC drivers attach and register themselves with the >>>>>>> interrupt handling layer, all the interrupts for that PIC are >>>>>>> passed to it along with the virtual IRQ. The PIC driver is >>>>>>> supposed to know what its interrupt data mean, which can be >>>>>>> safely guaranteed, and it presents the assigned virtual IRQ >>>>>>> number to the kernel when dispatching interrupts. (IRQs >>>>>>> configured after PIC attachment are passed through immediately). >>>>>>> >>>>>>> This accomplishes the following things: >>>>>>> 1. Parsing interrupt data is moved to the PIC driver, which is >>>>>>> the only place it can be done safely. >>>>>> I don't see anything different comparing with INTRNG. >>>>> >>>>> What I am advocating *is* INTRNG, at least as originally conceived >>>>> and implemented. >>>>> >>>>>>> 2. There is no ordering requirement on PIC attachment vs. the >>>>>>> attachment of anything else. >>>>>> I think thats is not a true - PIC must exist before >>>>>> bus_alloc_resource() / bus_setup_intr() is called. >>>>> >>>>> It does not with the IRQ mapping infrastructure. Interrupts are >>>>> set up at PIC attachment, whenever that occurs. >>>>> >>>> Assuming that bus_alloc_resource and bus_setup_intr() are close >>>> thorougher and in linear piece of code, can i assume that you can >>>> call bus_setup_intr() >>>> without PIC attached ? >>> >>> Yes. >> So driver can request and/or setup any random IRQ and gets success >> from bus_alloc_resource() or bus_setup_intr()? >> Do you think that is this right behavior? > > Yes. And it is a behavior required by newbus. > >>> >>>>>> >>>>>>> 3. Changes are extremely minimal relative to the "standard" >>>>>>> interrupt flow: you only have to patch code that is already >>>>>>> directly dealing with OF interrupts. >>>>>> I don't see anything different comparing with INTRNG. >>>>> >>>>> Again, this was the original INTRNG architecture and is already >>>>> implemented. As such, there are *no* changes required on ARM to >>>>> get it. bus_map_intr() adds a bunch of new code, in parallel with >>>>> the old code that also solves the problem, to no purpose. >>>> So, on PPC, how i can get interrupt for GPIO pin described by this >>>> property: >>>> https://svnweb.freebsd.org/base/head/sys/gnu/dts/arm/tegra124-jetson-tk1.dts?revision=295436&view=markup#l1691 >>>> >>> >>> The GPIO controller registers itself as an interrupt domain and >>> decodes those strings as IRQ specifiers. When interrupts are >>> configured, it does whatever it needs to do to configure them >>> appropriately and dispatches them to the kernel when they occur. >>> It's a pretty trivial cascaded interrupt configuration. And, since >>> the VIRQ code does not need the interrupt controller attached in >>> advance, you don't need to worry about attach order of wherever >>> &gpio points and the SDHCI driver. >>> >>>>> >>>>>>> 4. It happens at bus enumeration time, when results can be >>>>>>> guaranteed self-consistent. >>>>>> Where do you see any potential source of inconsistency in INTRNG? >>>>> >>>>> See the example above about modified interrupt lists. There is >>>>> also no obvious way for a child device to construct an interrupt >>>>> not assigned to it by the parent device from device tree >>>>> properties without knowing in some detail what kind of interrupt >>>>> needs to be built. >>>>> >>>>>> >>>>>>> 5. It combines naturally with ofw_bus_lookup_imap() and friends >>>>>>> in the interrupt-map case (e.g. for PCI). >>>>>> Again, I don't see anything different. Proper parsing of >>>>>> interrupt property is not a problem of INTRNG (but must be fixed, >>>>>> of course). >>>>> >>>>> But it is *already* fixed by the standard code that already >>>>> exists. You are introducing a less-functional parallel code path here. >>>> NO, its not fixed, at least not for ARM. >>> >>> Why not, concretely? I'm happy to write whatever code is missing if >>> there's a bug. It can't be more than a few tens of lines in arm/intr.c. >> Interrupt maps are not covered by current ARM code. > > This suggests otherwise: > files.arm:dev/ofw/ofwpci.c optional fdt pci > > But it's quite possible that code is not being used as widely as it > should, since it's a new introduction to the ARM tree. That the > existing code is not being used broadly enough is hardly a reasonable > to invent something new. > >>>>> >>>>>>> >>>>>>> I'm not sure what the right path forward is, but this code needs >>>>>>> to be fixed. The PowerPC code is fully MI, and was the template >>>>>>> for the original INTRNG, so it shouldn't be too bad to replace. >>>>>>> -Nathan >>>>>>> >>>>>> >>>>>> So, new INTRNG: >>>>>> - Introduces new more general bus method that can parse interrupt >>>>>> configuration >>>>>> data from any source. Is this step backward? >>>>> >>>>> Yes, since it is more general in some sense, while simultaneously >>>>> handling fewer cases than code that already exists and is implemented. >>>>> >>>>>> >>>>>> - Old INTRNG and PPC code stores unparsed and/or parsed interrupt >>>>>> data in >>>>>> INTRNG and each consumer must query for them. This data sharing >>>>>> also causes >>>>>> significant locking issues. New INTRNG stores interrupt >>>>>> configuration data into >>>>>> given resource, so each relevant bus method can access it >>>>>> immediately. >>>>>> Is this step backward? >>>>> >>>>> Which locking issues? And yes, it is. >>>>> >>>>>> >>>>>> - New INTRNG is not OFW centric, it can works with virtually >>>>>> unlimited number >>>>>> of configuration data sources. Is this step backward? >>>>> >>>>> Also yes, because it makes the interrupt handles less opaque, >>>>> which makes the infrastructure less flexible. >>>>> >>>>>> - New INTRNG correctly uses standard system infrastructure. Real >>>>>> IRQ number >>>>>> is reserved in rman within bus_alloc_resource() call, >>>>>> interrupt HW is >>>>>> configured (only!) within bus_setup_intr() call. Is this step >>>>>> backward? >>>>> >>>>> The "real" IRQ number is not well defined always, so requiring >>>>> that is a step backwards, yes. >>>>> >>>>>> - New INTRNG completely eliminates huge and not always working >>>>>> virtual >>>>>> IRQ concept. >>>>> >>>>> When does it "not always work"? It seems to, in fact, always work >>>>> on multiple platforms and have for a long time in the face of all >>>>> kinds of totally bizarre topologies and system architectures. >>>>> >>>>>> >>>>>> >>>>>> Don’t take me bad, I’m open to any change. But no, at this time, >>>>>> I’m not ready to completely revert someone else's work – although >>>>>> I am a co-author. >>>>> >>>>> I would urge, in the strongest possible terms, that this be backed >>>>> out from stable/11 at least. We can add the new API back for 11.1 >>>>> if we want it, but we totally lose the ability to change it later >>>>> in the stable/11 cycle if it stays in now. >>>>> -Nathan >>>>> >>>> The API is part of still unstable, experimental INTRNG, so its not >>>> fixed we we can change it at any time, I think. >>>> But yes, we forget to wrap new bus_map_intr() method (and >>>> associated code) by #ifdef INTRNG. Is this sufficient for you? >>> >>> For HEAD, yes. I would like it out of stable/11 entirely until this >>> discussion converges. >>> -Nathan >> The current code (in stable/11) works and is tested. I simple cannot >> commit any untested change for stable tree mainly if is in BETA2 >> stage. And I cannot fully test the requested change, at this time i >> have access to single ARM platform. >> But we're in the same situation - both have the same commit bit, >> neither one of us is the author of the disputed commit and neither of >> us are not able to fully test it. >> So feel free to commit what you want, if you have courage to commit >> untested code. I haven't it...\ >> Michal >> > > Well, the code isn't actually used anywhere in stable/11, or HEAD, so > it can't possibly be either tested or important for the functionality > of any current code. As such, I will revert from HEAD on Monday and > request an MFC from re@ following that if the author has not appeared > by that time. > -Nathan The code is, of course, already used by each of INTRNG enabled platforms. ------------------------------------------------------------------------------------------------------ diff --git a/sys/dev/ofw/ofwbus.c b/sys/dev/ofw/ofwbus.c index 1e048c4..14eb507 100644 --- a/sys/dev/ofw/ofwbus.c +++ b/sys/dev/ofw/ofwbus.c @@ -323,7 +323,7 @@ ofwbus_map_intr(device_t bus, device_t child, int *rid, rman_res_t *start, int ncells, rv; u_int irq; struct intr_map_data_fdt *fdt_data; - +printf(" *** %s: bus: %p\n", __func__, bus); node = ofw_bus_get_node(child); rv = ofw_bus_intr_by_rid(child, node, *rid, &iparent, &ncells, &cells); if (rv != 0) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index af3ca57..b381163 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -3960,6 +3960,7 @@ int bus_generic_map_intr(device_t dev, device_t child, int *rid, rman_res_t *start, rman_res_t *end, rman_res_t *count, struct intr_map_data **imd) { +printf(" *** %s: dev: %p\n", __func__, dev); /* Propagate up the bus hierarchy until someone handles it. */ if (dev->parent) return (BUS_MAP_INTR(dev->parent, child, rid, start, end, count, --------------------------------------------------------------------------------------------------- Result: *** ofwbus_map_intr: bus: 0xc4ce1880 *** ofwbus_map_intr: bus: 0xc4ce1880 *** ofwbus_map_intr: bus: 0xc4ce1880 *** ofwbus_map_intr: bus: 0xc4ce1880 *** ofwbus_map_intr: bus: 0xc4ce1880 *** ofwbus_map_intr: bus: 0xc4ce1880 *** ofwbus_map_intr: bus: 0xc4ce1880 *** ofwbus_map_intr: bus: 0xc4ce1880 *** ofwbus_map_intr: bus: 0xc4ce1880 *** ofwbus_map_intr: bus: 0xc4ce1880 *** ofwbus_map_intr: bus: 0xc4ce1880 *** ofwbus_map_intr: bus: 0xc4ce1880 *** ofwbus_map_intr: bus: 0xc4ce1880 *** ofwbus_map_intr: bus: 0xc4ce1880 *** ofwbus_map_intr: bus: 0xc4ce1880 *** ofwbus_map_intr: bus: 0xc4ce1880 *** ofwbus_map_intr: bus: 0xc4ce1880 *** ofwbus_map_intr: bus: 0xc4ce1880 *** bus_generic_map_intr: dev: 0xc4ce5780 *** bus_generic_map_intr: dev: 0xc4ce0980 *** ofwbus_map_intr: bus: 0xc4ce1880 *** ofwbus_map_intr: bus: 0xc4ce1880 *** ofwbus_map_intr: bus: 0xc4ce1880 *** ofwbus_map_intr: bus: 0xc4ce1880 *** bus_generic_map_intr: dev: 0xc4e52080 *** bus_generic_map_intr: dev: 0xc4e52480 *** bus_generic_map_intr: dev: 0xc4e52780 *** bus_generic_map_intr: dev: 0xc4ce1500 *** ofwbus_map_intr: bus: 0xc4ce1880 *** ofwbus_map_intr: bus: 0xc4ce1880 *** ofwbus_map_intr: bus: 0xc4ce1880 *** ofwbus_map_intr: bus: 0xc4ce1880 *** bus_generic_map_intr: dev: 0xc4ce0300 *** ofwbus_map_intr: bus: 0xc4ce1880 *** ofwbus_map_intr: bus: 0xc4ce1880 *** ofwbus_map_intr: bus: 0xc4ce1880 *** ofwbus_map_intr: bus: 0xc4ce1880 *** ofwbus_map_intr: bus: 0xc4ce1880 So its hard to say that code is unused. And, just for info, last "clean in PPC way" is initial commit INTRNG at r289529 (9 months ago). Michal From owner-svn-src-head@freebsd.org Sun Jul 24 08:35: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 B927EBA3EFD; Sun, 24 Jul 2016 08:35:46 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90EF31842; Sun, 24 Jul 2016 08:35:46 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6O8ZjZr078221; Sun, 24 Jul 2016 08:35:45 GMT (envelope-from mizhka@FreeBSD.org) Received: (from mizhka@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6O8ZjcP078217; Sun, 24 Jul 2016 08:35:45 GMT (envelope-from mizhka@FreeBSD.org) Message-Id: <201607240835.u6O8ZjcP078217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mizhka set sender to mizhka@FreeBSD.org using -f From: Michael Zhilin Date: Sun, 24 Jul 2016 08:35:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303258 - in head/sys: conf dev/nvram2env 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.22 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, 24 Jul 2016 08:35:46 -0000 Author: mizhka Date: Sun Jul 24 08:35:45 2016 New Revision: 303258 URL: https://svnweb.freebsd.org/changeset/base/303258 Log: [nvram2env] split implementation into generic & MIPS-based code Split implementation of nvram2env to generic (MI) & MIPS-based code: - removed includes like "*siba*", because they are unused - added nvram2env_mips.c file with MIPS-specific code, code moved from nvram2env.c - added header file to shared defines/structures/function prototypes between MI and MIPS code Also this fix allows to implement own nvram2env drivers. Reviewed by: ray, adrian (mentor) Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D6513 Added: head/sys/dev/nvram2env/nvram2env.h (contents, props changed) head/sys/dev/nvram2env/nvram2env_mips.c (contents, props changed) Modified: head/sys/conf/files.mips head/sys/dev/nvram2env/nvram2env.c Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Sun Jul 24 08:21:21 2016 (r303257) +++ head/sys/conf/files.mips Sun Jul 24 08:35:45 2016 (r303258) @@ -86,6 +86,7 @@ crypto/blowfish/bf_enc.c optional crypt crypto/des/des_enc.c optional crypto | ipsec | netsmb # AP common nvram interface MIPS specific, but maybe should be more generic +dev/nvram2env/nvram2env_mips.c optional nvram2env dev/nvram2env/nvram2env.c optional nvram2env # hwpmc support Modified: head/sys/dev/nvram2env/nvram2env.c ============================================================================== --- head/sys/dev/nvram2env/nvram2env.c Sun Jul 24 08:21:21 2016 (r303257) +++ head/sys/dev/nvram2env/nvram2env.c Sun Jul 24 08:35:45 2016 (r303258) @@ -46,50 +46,7 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#include - -#define nvram2env_read_1(sc, reg) \ - bus_space_read_1((sc)->sc_bt, (sc)->sc_bh,(reg)) - -#define nvram2env_read_2(sc, reg) \ - bus_space_read_2((sc)->sc_bt, (sc)->sc_bh,(reg)) - -#define nvram2env_read_4(sc, reg) \ - bus_space_read_4((sc)->sc_bt, (sc)->sc_bh,(reg)) - -#define nvram2env_write_1(sc, reg, val) \ - bus_space_write_1((sc)->sc_bt, (sc)->sc_bh, \ - (reg), (val)) - -#define nvram2env_write_2(sc, reg, val) \ - bus_space_write_2((sc)->sc_bt, (sc)->sc_bh, \ - (reg), (val)) - -#define nvram2env_write_4(sc, reg, val) \ - bus_space_write_4((sc)->sc_bt, (sc)->sc_bh, \ - (reg), (val)) - -struct nvram2env_softc { - bus_space_tag_t bst; - bus_space_handle_t bsh; - bus_addr_t addr; - int need_swap; - uint32_t sig; - uint32_t flags; -#define NVRAM_FLAGS_NOCHECK 0x0001 /* Do not check(CRC or somthing else)*/ -#define NVRAM_FLAGS_GENERIC 0x0002 /* Format Generic, skip 4b and read */ -#define NVRAM_FLAGS_BROADCOM 0x0004 /* Format Broadcom, use struct nvram */ -#define NVRAM_FLAGS_UBOOT 0x0008 /* Format Generic, skip 4b of CRC and read */ - uint32_t maxsize; - uint32_t crc; -}; - -static int nvram2env_attach(device_t); -static int nvram2env_probe(device_t); - -#define NVRAM_MAX_SIZE 0x10000 +#include "nvram2env.h" static void nvram2env_identify(driver_t * drv, device_t parent) @@ -100,34 +57,55 @@ nvram2env_identify(driver_t * drv, devic BUS_ADD_CHILD(parent, 0, "nvram2env", i); } -static int +int nvram2env_probe(device_t dev) { uint32_t i, ivar, sig; struct nvram2env_softc * sc = device_get_softc(dev); - sc->bst = mips_bus_space_generic; - if (resource_int_value("nvram", device_get_unit(dev), "sig", - &sc->sig) != 0 || sc->sig == 0) - sc->sig = 0x48534c46; - - if (resource_int_value("nvram", device_get_unit(dev), "maxsize", - &sc->maxsize) != 0 || sc->maxsize == 0) - sc->maxsize = NVRAM_MAX_SIZE; - - if (resource_int_value("nvram", device_get_unit(dev), "flags", - &sc->flags) != 0 || sc->flags == 0) - sc->flags = NVRAM_FLAGS_GENERIC; + /* + * Please ensure that your implementation of NVRAM->ENV specifies + * bus tag + */ + if (sc->bst == NULL) + return (ENXIO); + + if (sc->sig == 0) + if (resource_int_value("nvram", device_get_unit(dev), "sig", + &sc->sig) != 0 || sc->sig == 0) + sc->sig = CFE_NVRAM_SIGNATURE; + + if (sc->maxsize == 0) + if (resource_int_value("nvram", device_get_unit(dev), "maxsize", + &sc->maxsize) != 0 || sc->maxsize == 0) + sc->maxsize = NVRAM_MAX_SIZE; + + if (sc->flags == 0) + if (resource_int_value("nvram", device_get_unit(dev), "flags", + &sc->flags) != 0 || sc->flags == 0) + sc->flags = NVRAM_FLAGS_GENERIC; for (i = 0; i < 2; i ++) { - if (resource_int_value("nvram", device_get_unit(dev), - (!i)?"base":"fallbackbase", &ivar) != 0 || - ivar == 0) - continue; + switch (i) { + case 0: + break; + case 1: + case 2: + if (resource_int_value("nvram", device_get_unit(dev), + (i == 1) ? "base" : "fallbackbase", &ivar) != 0 || + ivar == 0) + continue; + + sc->addr = ivar; + break; + default: + break; + } - sc->addr = ivar; + if (sc->addr == 0) + continue; if (bootverbose) device_printf(dev, "base=0x%08x sig=0x%08x " @@ -172,15 +150,6 @@ unmap_done: } -struct nvram { - u_int32_t sig; - u_int32_t size; - u_int32_t unknown1; - u_int32_t unknown2; - u_int32_t unknown3; - char data[]; -}; - static uint32_t read_4(struct nvram2env_softc * sc, int offset) { if (sc->need_swap) @@ -190,7 +159,7 @@ static uint32_t read_4(struct nvram2env_ } -static int +int nvram2env_attach(device_t dev) { struct nvram2env_softc *sc; @@ -209,10 +178,11 @@ nvram2env_attach(device_t dev) sig = read_4(sc, 0); size = read_4(sc, 4); -#if 1 + if (bootverbose) - device_printf(dev, " size=0x%05x maxsize=0x%05x\n", size, sc->maxsize); -#endif + device_printf(dev, " size=0x%05x maxsize=0x%05x\n", size, + sc->maxsize); + size = (size > sc->maxsize)?sc->maxsize:size; @@ -265,12 +235,12 @@ nvram2env_attach(device_t dev) assign = strchr(pair,'='); assign[0] = '\0'; value = assign+1; -#if 1 + if (bootverbose) - printf("ENV: %s=%s\n", pair, value); -#else - printf("ENV: %s\n", pair); -#endif + printf("ENV[%p]: %s=%s\n", + (void*)((char*)pair - (char*)nv), + pair, value); + kern_setenv(pair, value); if (strcasecmp(pair, "WAN_MAC_ADDR") == 0) { @@ -313,12 +283,10 @@ static device_method_t nvram2env_methods DEVMETHOD_END }; -static driver_t nvram2env_driver = { +driver_t nvram2env_driver = { "nvram2env", nvram2env_methods, sizeof(struct nvram2env_softc), }; -static devclass_t nvram2env_devclass; - -DRIVER_MODULE(nvram2env, nexus, nvram2env_driver, nvram2env_devclass, 0, 0); +devclass_t nvram2env_devclass; Added: head/sys/dev/nvram2env/nvram2env.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/nvram2env/nvram2env.h Sun Jul 24 08:35:45 2016 (r303258) @@ -0,0 +1,88 @@ +/*- + * Copyright (c) 2010 Aleksandr Rybalko. + * Copyright (c) 2016 Michael Zhilin. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + + +#ifndef NVRAM2ENV_NVRAM2ENV_H_ +#define NVRAM2ENV_NVRAM2ENV_H_ + +#define nvram2env_read_1(sc, reg) \ + bus_space_read_1((sc)->sc_bt, (sc)->sc_bh,(reg)) + +#define nvram2env_read_2(sc, reg) \ + bus_space_read_2((sc)->sc_bt, (sc)->sc_bh,(reg)) + +#define nvram2env_read_4(sc, reg) \ + bus_space_read_4((sc)->sc_bt, (sc)->sc_bh,(reg)) + +#define nvram2env_write_1(sc, reg, val) \ + bus_space_write_1((sc)->sc_bt, (sc)->sc_bh, \ + (reg), (val)) + +#define nvram2env_write_2(sc, reg, val) \ + bus_space_write_2((sc)->sc_bt, (sc)->sc_bh, \ + (reg), (val)) + +#define nvram2env_write_4(sc, reg, val) \ + bus_space_write_4((sc)->sc_bt, (sc)->sc_bh, \ + (reg), (val)) + +struct nvram2env_softc { + bus_space_tag_t bst; + bus_space_handle_t bsh; + bus_addr_t addr; + int need_swap; + uint32_t sig; + uint32_t flags; +#define NVRAM_FLAGS_NOCHECK 0x0001 /* Do not check(CRC or somthing else)*/ +#define NVRAM_FLAGS_GENERIC 0x0002 /* Format Generic, skip 4b and read */ +#define NVRAM_FLAGS_BROADCOM 0x0004 /* Format Broadcom, use struct nvram */ +#define NVRAM_FLAGS_UBOOT 0x0008 /* Format Generic, skip 4b of CRC and read */ + uint32_t maxsize; + uint32_t crc; +}; + +#define NVRAM_MAX_SIZE 0x10000 +#define CFE_NVRAM_SIGNATURE 0x48534c46 + +struct nvram { + u_int32_t sig; + u_int32_t size; + u_int32_t unknown1; + u_int32_t unknown2; + u_int32_t unknown3; + char data[]; +}; + +int nvram2env_attach(device_t); +int nvram2env_probe(device_t); + +extern devclass_t nvram2env_devclass; +extern driver_t nvram2env_driver; + +#endif /* SYS_DEV_NVRAM2ENV_NVRAM2ENV_H_ */ Added: head/sys/dev/nvram2env/nvram2env_mips.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/nvram2env/nvram2env_mips.c Sun Jul 24 08:35:45 2016 (r303258) @@ -0,0 +1,69 @@ +/*- + * Copyright (c) 2010 Aleksandr Rybalko. + * Copyright (c) 2016 Michael Zhilin. + * 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. + */ + +/* + * Implementation of pseudo driver for MIPS to copy the NVRAM settings + * from various sources into the kernel environment. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include + +#include "nvram2env.h" + +static int +nvram2env_mips_probe(device_t dev) +{ + struct nvram2env_softc *sc; + + sc = device_get_softc(dev); + sc->bst = mips_bus_space_generic; + + return (nvram2env_probe(dev)); +} + +static device_method_t nvram2env_mips_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, nvram2env_mips_probe), + + DEVMETHOD_END +}; + +DEFINE_CLASS_1(nvram2env, nvram2env_mips_driver, nvram2env_mips_methods, + sizeof(struct nvram2env_softc), nvram2env_driver); +DRIVER_MODULE(nvram2env_mips, nexus, nvram2env_mips_driver, nvram2env_devclass, + NULL, NULL); + +MODULE_VERSION(nvram2env_mips, 1); +MODULE_DEPEND(nvram2env_mips, nvram2env, 1, 1, 1); From owner-svn-src-head@freebsd.org Sun Jul 24 08:50: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 B7842BA3342; Sun, 24 Jul 2016 08:50:11 +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 7E96F1375; Sun, 24 Jul 2016 08:50:11 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp (bcdf0033.skybroadband.com [188.223.0.51]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id AE629D78E6; Sun, 24 Jul 2016 08:49:34 +0000 (UTC) Date: Sun, 24 Jul 2016 09:49:33 +0100 From: Andrew Turner To: Luiz Otavio O Souza Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303253 - head/sys/arm/ti Message-ID: <20160724094933.294c4f4d@zapp> In-Reply-To: <201607240131.u6O1VfOH020387@repo.freebsd.org> References: <201607240131.u6O1VfOH020387@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.22 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, 24 Jul 2016 08:50:11 -0000 On Sun, 24 Jul 2016 01:31:41 +0000 (UTC) Luiz Otavio O Souza wrote: > Author: loos > Date: Sun Jul 24 01:31:41 2016 > New Revision: 303253 > URL: https://svnweb.freebsd.org/changeset/base/303253 > > Log: > Allow the use of micphy on am335x devices. > > The Micrel PHYs reads the optional external delays from DTB. > > Tested and used by uBMC and uFW. > > Sponsored by: Rubicon Communications (Netgate) > > Modified: > head/sys/arm/ti/files.ti > > Modified: head/sys/arm/ti/files.ti > ============================================================================== > --- head/sys/arm/ti/files.ti Sat Jul 23 22:50:59 2016 > (r303252) +++ head/sys/arm/ti/files.ti Sun Jul 24 01:31:41 > 2016 (r303253) @@ -20,6 +20,7 @@ > arm/ti/ti_i2c.c > optional ti_i2c arm/ti/ti_sdhci.c > optional sdhci > arm/ti/ti_spi.c > optional ti_spi > +dev/mii/micphy.c optional > micphy Why add it here and not sys/conf/files? It doesn't seem to be Ti specific. Andrew From owner-svn-src-head@freebsd.org Sun Jul 24 08:52: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 D272BBA366C; Sun, 24 Jul 2016 08:52:50 +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 835FC1AA1; Sun, 24 Jul 2016 08:52:50 +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 u6O8qniX085752; Sun, 24 Jul 2016 08:52:49 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6O8qn7c085751; Sun, 24 Jul 2016 08:52:49 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201607240852.u6O8qn7c085751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 24 Jul 2016 08:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303259 - 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.22 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, 24 Jul 2016 08:52:50 -0000 Author: andrew Date: Sun Jul 24 08:52:49 2016 New Revision: 303259 URL: https://svnweb.freebsd.org/changeset/base/303259 Log: Remove now unused functions from the FDT uart cpu driver. Obtained from: ABT Systems Ltd MFC after: 1 month X-MFC with: r303100 Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/uart/uart_cpu_fdt.c Modified: head/sys/dev/uart/uart_cpu_fdt.c ============================================================================== --- head/sys/dev/uart/uart_cpu_fdt.c Sun Jul 24 08:35:45 2016 (r303258) +++ head/sys/dev/uart/uart_cpu_fdt.c Sun Jul 24 08:52:49 2016 (r303259) @@ -70,53 +70,6 @@ uart_cpu_eqres(struct uart_bas *b1, stru return ((pmap_kextract(b1->bsh) == pmap_kextract(b2->bsh)) ? 1 : 0); } -static int -phandle_chosen_propdev(phandle_t chosen, const char *name, phandle_t *node) -{ - char buf[64]; - - if (OF_getprop(chosen, name, buf, sizeof(buf)) <= 0) - return (ENXIO); - if ((*node = OF_finddevice(buf)) == -1) - return (ENXIO); - - return (0); -} - -static const struct ofw_compat_data * -uart_fdt_find_compatible(phandle_t node, const struct ofw_compat_data *cd) -{ - const struct ofw_compat_data *ocd; - - for (ocd = cd; ocd->ocd_str != NULL; ocd++) { - if (fdt_is_compatible(node, ocd->ocd_str)) - return (ocd); - } - return (NULL); -} - -static uintptr_t -uart_fdt_find_by_node(phandle_t node, int class_list) -{ - struct ofw_compat_data **cd; - const struct ofw_compat_data *ocd; - - if (class_list) { - SET_FOREACH(cd, uart_fdt_class_set) { - ocd = uart_fdt_find_compatible(node, *cd); - if ((ocd != NULL) && (ocd->ocd_data != 0)) - return (ocd->ocd_data); - } - } else { - SET_FOREACH(cd, uart_fdt_class_and_device_set) { - ocd = uart_fdt_find_compatible(node, *cd); - if ((ocd != NULL) && (ocd->ocd_data != 0)) - return (ocd->ocd_data); - } - } - return (0); -} - int uart_cpu_getdev(int devtype, struct uart_devinfo *di) { From owner-svn-src-head@freebsd.org Sun Jul 24 09:15: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 247D6BA3CA9; Sun, 24 Jul 2016 09:15:13 +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 F056D168B; Sun, 24 Jul 2016 09:15:12 +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 u6O9FCJ1093292; Sun, 24 Jul 2016 09:15:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6O9FBk2093286; Sun, 24 Jul 2016 09:15:11 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201607240915.u6O9FBk2093286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 24 Jul 2016 09:15:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303261 - in head/sys: amd64/amd64 amd64/include/pc arm/arm arm64/arm64 i386/include/pc 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.22 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, 24 Jul 2016 09:15:13 -0000 Author: mav Date: Sun Jul 24 09:15:11 2016 New Revision: 303261 URL: https://svnweb.freebsd.org/changeset/base/303261 Log: Add more UEFI/e820 memory types from latest specifications. This is only cosmetics. MFC after: 2 weeks Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/include/pc/bios.h head/sys/arm/arm/machdep.c head/sys/arm64/arm64/machdep.c head/sys/i386/include/pc/bios.h head/sys/sys/efi.h Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Sun Jul 24 09:00:16 2016 (r303260) +++ head/sys/amd64/amd64/machdep.c Sun Jul 24 09:15:11 2016 (r303261) @@ -1090,7 +1090,8 @@ add_efi_map_entries(struct efi_map_heade "ACPIMemoryNVS", "MemoryMappedIO", "MemoryMappedIOPortSpace", - "PalCode" + "PalCode", + "PersistentMemory" }; /* @@ -1111,7 +1112,7 @@ add_efi_map_entries(struct efi_map_heade for (i = 0, p = map; i < ndesc; i++, p = efi_next_descriptor(p, efihdr->descriptor_size)) { if (boothowto & RB_VERBOSE) { - if (p->md_type <= EFI_MD_TYPE_PALCODE) + if (p->md_type < nitems(types)) type = types[p->md_type]; else type = ""; @@ -1133,6 +1134,12 @@ add_efi_map_entries(struct efi_map_heade printf("RP "); if (p->md_attr & EFI_MD_ATTR_XP) printf("XP "); + if (p->md_attr & EFI_MD_ATTR_NV) + printf("NV "); + if (p->md_attr & EFI_MD_ATTR_MORE_RELIABLE) + printf("MORE_RELIABLE "); + if (p->md_attr & EFI_MD_ATTR_RO) + printf("RO "); if (p->md_attr & EFI_MD_ATTR_RT) printf("RUNTIME"); printf("\n"); Modified: head/sys/amd64/include/pc/bios.h ============================================================================== --- head/sys/amd64/include/pc/bios.h Sun Jul 24 09:00:16 2016 (r303260) +++ head/sys/amd64/include/pc/bios.h Sun Jul 24 09:15:11 2016 (r303261) @@ -40,6 +40,9 @@ #define SMAP_TYPE_ACPI_RECLAIM 3 #define SMAP_TYPE_ACPI_NVS 4 #define SMAP_TYPE_ACPI_ERROR 5 +#define SMAP_TYPE_DISABLED 6 +#define SMAP_TYPE_PMEM 7 +#define SMAP_TYPE_PRAM 12 #define SMAP_XATTR_ENABLED 0x00000001 #define SMAP_XATTR_NON_VOLATILE 0x00000002 Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sun Jul 24 09:00:16 2016 (r303260) +++ head/sys/arm/arm/machdep.c Sun Jul 24 09:15:11 2016 (r303261) @@ -1424,7 +1424,8 @@ add_efi_map_entries(struct efi_map_heade "ACPIMemoryNVS", "MemoryMappedIO", "MemoryMappedIOPortSpace", - "PalCode" + "PalCode", + "PersistentMemory" }; *mrcnt = 0; @@ -1448,7 +1449,7 @@ add_efi_map_entries(struct efi_map_heade for (i = 0, j = 0, p = map; i < ndesc; i++, p = efi_next_descriptor(p, efihdr->descriptor_size)) { if (boothowto & RB_VERBOSE) { - if (p->md_type <= EFI_MD_TYPE_PALCODE) + if (p->md_type < nitems(types)) type = types[p->md_type]; else type = ""; @@ -1470,6 +1471,12 @@ add_efi_map_entries(struct efi_map_heade printf("RP "); if (p->md_attr & EFI_MD_ATTR_XP) printf("XP "); + if (p->md_attr & EFI_MD_ATTR_NV) + printf("NV "); + if (p->md_attr & EFI_MD_ATTR_MORE_RELIABLE) + printf("MORE_RELIABLE "); + if (p->md_attr & EFI_MD_ATTR_RO) + printf("RO "); if (p->md_attr & EFI_MD_ATTR_RT) printf("RUNTIME"); printf("\n"); Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Sun Jul 24 09:00:16 2016 (r303260) +++ head/sys/arm64/arm64/machdep.c Sun Jul 24 09:15:11 2016 (r303261) @@ -707,7 +707,8 @@ add_efi_map_entries(struct efi_map_heade "ACPIMemoryNVS", "MemoryMappedIO", "MemoryMappedIOPortSpace", - "PalCode" + "PalCode", + "PersistentMemory" }; /* @@ -728,7 +729,7 @@ add_efi_map_entries(struct efi_map_heade for (i = 0, p = map; i < ndesc; i++, p = efi_next_descriptor(p, efihdr->descriptor_size)) { if (boothowto & RB_VERBOSE) { - if (p->md_type <= EFI_MD_TYPE_PALCODE) + if (p->md_type < nitems(types)) type = types[p->md_type]; else type = ""; @@ -750,6 +751,12 @@ add_efi_map_entries(struct efi_map_heade printf("RP "); if (p->md_attr & EFI_MD_ATTR_XP) printf("XP "); + if (p->md_attr & EFI_MD_ATTR_NV) + printf("NV "); + if (p->md_attr & EFI_MD_ATTR_MORE_RELIABLE) + printf("MORE_RELIABLE "); + if (p->md_attr & EFI_MD_ATTR_RO) + printf("RO "); if (p->md_attr & EFI_MD_ATTR_RT) printf("RUNTIME"); printf("\n"); Modified: head/sys/i386/include/pc/bios.h ============================================================================== --- head/sys/i386/include/pc/bios.h Sun Jul 24 09:00:16 2016 (r303260) +++ head/sys/i386/include/pc/bios.h Sun Jul 24 09:15:11 2016 (r303261) @@ -210,6 +210,9 @@ struct PIR_table #define SMAP_TYPE_ACPI_RECLAIM 3 #define SMAP_TYPE_ACPI_NVS 4 #define SMAP_TYPE_ACPI_ERROR 5 +#define SMAP_TYPE_DISABLED 6 +#define SMAP_TYPE_PMEM 7 +#define SMAP_TYPE_PRAM 12 #define SMAP_XATTR_ENABLED 0x00000001 #define SMAP_XATTR_NON_VOLATILE 0x00000002 Modified: head/sys/sys/efi.h ============================================================================== --- head/sys/sys/efi.h Sun Jul 24 09:00:16 2016 (r303260) +++ head/sys/sys/efi.h Sun Jul 24 09:15:11 2016 (r303261) @@ -69,6 +69,7 @@ struct efi_md { #define EFI_MD_TYPE_IOMEM 11 /* Memory-mapped I/O. */ #define EFI_MD_TYPE_IOPORT 12 /* I/O port space. */ #define EFI_MD_TYPE_PALCODE 13 /* PAL */ +#define EFI_MD_TYPE_PERSISTENT 14 /* Persistent memory. */ uint32_t __pad; uint64_t md_phys; void *md_virt; @@ -82,6 +83,10 @@ struct efi_md { #define EFI_MD_ATTR_WP 0x0000000000001000UL #define EFI_MD_ATTR_RP 0x0000000000002000UL #define EFI_MD_ATTR_XP 0x0000000000004000UL +#define EFI_MD_ATTR_NV 0x0000000000008000UL +#define EFI_MD_ATTR_MORE_RELIABLE \ + 0x0000000000010000UL +#define EFI_MD_ATTR_RO 0x0000000000020000UL #define EFI_MD_ATTR_RT 0x8000000000000000UL }; From owner-svn-src-head@freebsd.org Sun Jul 24 10:10: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 20173B9BBB4; Sun, 24 Jul 2016 10:10:11 +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 D7E06131C; Sun, 24 Jul 2016 10:10:10 +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 u6OAAA2W012436; Sun, 24 Jul 2016 10:10:10 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6OAA9IJ012434; Sun, 24 Jul 2016 10:10:09 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201607241010.u6OAA9IJ012434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 24 Jul 2016 10:10:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303263 - in head/sys: compat/svr4 net 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.22 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, 24 Jul 2016 10:10:11 -0000 Author: glebius Date: Sun Jul 24 10:10:09 2016 New Revision: 303263 URL: https://svnweb.freebsd.org/changeset/base/303263 Log: Partially revert r257696/r257713, which have an issue with writing to user controlled address. Restore the old code that emulated OSIOCGIFCONF in if.c. Noticed by: C Turt Modified: head/sys/compat/svr4/svr4_sockio.c head/sys/net/if.c Modified: head/sys/compat/svr4/svr4_sockio.c ============================================================================== --- head/sys/compat/svr4/svr4_sockio.c Sun Jul 24 10:00:29 2016 (r303262) +++ head/sys/compat/svr4/svr4_sockio.c Sun Jul 24 10:10:09 2016 (r303263) @@ -73,6 +73,8 @@ bsd_to_svr4_flags(bf) return sf; } +#define OSIOCGIFCONF _IOWR('i', 20, struct ifconf) + int svr4_sock_ioctl(fp, td, retval, fd, cmd, data) struct file *fp; @@ -144,7 +146,6 @@ svr4_sock_ioctl(fp, td, retval, fd, cmd, case SVR4_SIOCGIFCONF: { struct svr4_ifconf sc; - struct ifconf *ifc; if ((error = copyin(data, &sc, sizeof(sc))) != 0) return error; @@ -153,19 +154,9 @@ svr4_sock_ioctl(fp, td, retval, fd, cmd, sizeof(struct ifreq), sizeof(struct svr4_ifreq), sc.svr4_ifc_len)); - ifc = (struct ifconf *)≻ - ifc->ifc_req->ifr_addr.sa_family = - sc.svr4_ifc_req->svr4_ifr_addr.sa_family; - ifc->ifc_req->ifr_addr.sa_len = - sizeof(struct osockaddr); - - error = fo_ioctl(fp, SIOCGIFCONF, &sc, td->td_ucred, - td); - - sc.svr4_ifc_req->svr4_ifr_addr.sa_family = - ifc->ifc_req->ifr_addr.sa_family; - - if (error != 0) + if ((error = fo_ioctl(fp, OSIOCGIFCONF, + (caddr_t) &sc, td->td_ucred, + td)) != 0) return error; DPRINTF(("SIOCGIFCONF\n")); Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun Jul 24 10:00:29 2016 (r303262) +++ head/sys/net/if.c Sun Jul 24 10:10:09 2016 (r303263) @@ -2699,6 +2699,9 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, return (error); } +/* COMPAT_SVR4 */ +#define OSIOCGIFCONF _IOWR('i', 20, struct ifconf) + #ifdef COMPAT_FREEBSD32 struct ifconf32 { int32_t ifc_len; @@ -2738,6 +2741,7 @@ ifioctl(struct socket *so, u_long cmd, c switch (cmd) { case SIOCGIFCONF: + case OSIOCGIFCONF: /* COMPAT_SVR4 */ error = ifconf(cmd, data); CURVNET_RESTORE(); return (error); @@ -3009,6 +3013,15 @@ again: if (prison_if(curthread->td_ucred, sa) != 0) continue; addrs++; + /* COMPAT_SVR4 */ + if (cmd == OSIOCGIFCONF) { + struct osockaddr *osa = + (struct osockaddr *)&ifr.ifr_addr; + ifr.ifr_addr = *sa; + osa->sa_family = sa->sa_family; + sbuf_bcat(sb, &ifr, sizeof(ifr)); + max_len += sizeof(ifr); + } else if (sa->sa_len <= sizeof(*sa)) { ifr.ifr_addr = *sa; sbuf_bcat(sb, &ifr, sizeof(ifr)); From owner-svn-src-head@freebsd.org Sun Jul 24 10:15:10 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 46D10B9BDF9; Sun, 24 Jul 2016 10:15:10 +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 31C3617E9; Sun, 24 Jul 2016 10:15:09 +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 u6OAF8C5036214 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 24 Jul 2016 03:15:08 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u6OAF8CS036213; Sun, 24 Jul 2016 03:15:08 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Sun, 24 Jul 2016 03:15:08 -0700 From: Gleb Smirnoff To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303263 - in head/sys: compat/svr4 net Message-ID: <20160724101508.GJ1076@FreeBSD.org> References: <201607241010.u6OAA9IJ012434@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201607241010.u6OAA9IJ012434@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 24 Jul 2016 10:15:10 -0000 On Sun, Jul 24, 2016 at 10:10:09AM +0000, Gleb Smirnoff wrote: T> Author: glebius T> Date: Sun Jul 24 10:10:09 2016 T> New Revision: 303263 T> URL: https://svnweb.freebsd.org/changeset/base/303263 T> T> Log: T> Partially revert r257696/r257713, which have an issue with writing to user T> controlled address. Restore the old code that emulated OSIOCGIFCONF in if.c. T> T> Noticed by: C Turt I believe no one on the planet uses compat_svr4, but better fix it for 11.0-RELEASE, since too late to remove it. Note that SVR4_SIOCGIFCONF actually won't work for FreeBSD 10.x, if you load in compat_svr4.ko, since it depends on COMPAT_43 functionality compiled in kernel, which isn't case for i386 GENERIC. Of course the change wasn't tested, since I don't know how to produce or where to take an SVR4 binary that does something useful with SVR4_SIOCGIFCONF. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Sun Jul 24 10:35: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 2984DBA14F5; Sun, 24 Jul 2016 10:35:46 +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 E83AC142B; Sun, 24 Jul 2016 10:35:45 +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 u6OAZjTD023472; Sun, 24 Jul 2016 10:35:45 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6OAZijR023467; Sun, 24 Jul 2016 10:35:44 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201607241035.u6OAZijR023467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 24 Jul 2016 10:35:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303264 - head/usr.bin/calendar/calendars/ru_RU.UTF-8 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.22 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, 24 Jul 2016 10:35:46 -0000 Author: glebius Date: Sun Jul 24 10:35:44 2016 New Revision: 303264 URL: https://svnweb.freebsd.org/changeset/base/303264 Log: The date format for ru_RU.UTF-8 locale has changed some time ago, adjust the ru_RU.UTF-8 calendar files. Modified: head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.common head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.holiday head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.military head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.orthodox head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan Modified: head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.common ============================================================================== --- head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.common Sun Jul 24 10:10:09 2016 (r303263) +++ head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.common Sun Jul 24 10:35:44 2016 (r303264) @@ -9,97 +9,97 @@ LANG=ru_RU.UTF-8 -12 янв День работника прокуратуры -13 янв День российской печати -14 янв Старый Новый год -21 янв День инженерных войск -25 янв Татьянин день. Студенческий праздник - 8 фев День российской науки -10 фев День дипломатического работника - 1 мар Всемирный день гражданской обороны +12 янв. День работника прокуратуры +13 янв. День российской печати +14 янв. Старый Новый год +21 янв. День инженерных войск +25 янв. Татьянин день. Студенческий праздник + 8 февр. День российской науки +10 февр. День дипломатического работника + 1 марта Всемирный день гражданской обороны 03/SunSecond День работников геодезии и картографии -11 мар День работника органов наркоконтроля -18 мар День налоговой полиции +11 марта День работника органов наркоконтроля +18 марта День налоговой полиции 03/SunThird День работников торговли, бытового обслуживания населения и жилищно-коммунального хозяйства -27 мар Международный день театра -27 мар День внутренних войск - 1 апр День смеха - 2 апр День единения народов +27 марта Международный день театра +27 марта День внутренних войск + 1 апр. День смеха + 2 апр. День единения народов 04/SunFirst День геолога -12 апр День космонавтики +12 апр. День космонавтики 04/SunSecond День войск противовоздушной обороны -26 апр День памяти погибших в радиационных авариях и катастрофах -30 апр День пожарной охраны - 7 май День радио -17 май Международный день телекоммуникаций -18 май Международный день музеев -24 май День славянской письменности и культуры -26 май День российского предпринимательства -27 май Общероссийский день библиотек -28 май День пограничника -30 май День пожарной охраны -31 май День Российской Адвокатуры +26 апр. День памяти погибших в радиационных авариях и катастрофах +30 апр. День пожарной охраны + 7 мая День радио +17 мая Международный день телекоммуникаций +18 мая Международный день музеев +24 мая День славянской письменности и культуры +26 мая День российского предпринимательства +27 мая Общероссийский день библиотек +28 мая День пограничника +30 мая День пожарной охраны +31 мая День Российской Адвокатуры 05/SunLast День химика - 1 июн День защиты детей - 5 июн День эколога - 6 июн Пушкинский день - 8 июн День социального работника + 1 июня День защиты детей + 5 июня День эколога + 6 июня Пушкинский день + 8 июня День социального работника 06/SunSecond День работников легкой промышленности 06/SunThird День медицинского работника -22 июн День памяти и скорби (Начало Великой Отечественной Войны, 1941 год) -27 июн День молодежи -29 июн День партизан и подпольщиков +22 июня День памяти и скорби (Начало Великой Отечественной Войны, 1941 год) +27 июня День молодежи +29 июня День партизан и подпольщиков 06/SatLast День изобретателя и рационализатора 07/SunFirst День работников морского и речного флота 07/SunSecond День рыбака 07/SunSecond День российской почты 07/SunThird День металлурга 07/SunLast День Военно-Морского Флота -28 июл День крещения Руси - 6 авг День железнодорожных войск +28 июля День крещения Руси + 6 авг. День железнодорожных войск 08/SunFirst День железнодорожника -12 авг День военно-воздушных сил +12 авг. День военно-воздушных сил 08/SunSecond День строителя 08/SunThird День Воздушного Флота -22 авг День государственного флага -27 авг День кино +22 авг. День государственного флага +27 авг. День кино 08/SunLast День шахтера - 1 сен День знаний - 2 сен День российской гвардии - 3 сен День солидарности в борьбе с терроризмом - 4 сен День специалиста по ядерному обеспечению + 1 сент. День знаний + 2 сент. День российской гвардии + 3 сент. День солидарности в борьбе с терроризмом + 4 сент. День специалиста по ядерному обеспечению 09/SunFirst День работников нефтяной и газовой промышленности 09/SunSecond День танкиста 09/SunThird День работников леса -28 сен День работника атомной промышленности +28 сент. День работника атомной промышленности 09/SunLast День машиностроителя - 1 окт День пожилых людей - 1 окт День сухопутных войск - 4 окт День космических войск - 5 окт День учителя -14 окт Международный день стандартизации + 1 окт. День пожилых людей + 1 окт. День сухопутных войск + 4 окт. День космических войск + 5 окт. День учителя +14 окт. Международный день стандартизации 10/SunSecond День работников сельского хозяйства и перерабатывающей промышленности 10/SunThird День работников дорожного хозяйства -24 окт Международный день ООН -25 окт День таможенника -30 окт День памяти жертв политических репрессий +24 окт. Международный день ООН +25 окт. День таможенника +30 окт. День памяти жертв политических репрессий 10/SunLast День работников автомобильного транспорта - 7 ноя День октябрьской революции 1917 года - 9 ноя Всемирный день качества -10 ноя День милиции -16 ноя День морской пехоты -17 ноя Международный день студентов -19 ноя День ракетных войск и артиллерии -21 ноя День работников налоговых органов -26 ноя Всемирный день информации + 7 нояб. День окт.ябрьской революции 1917 года + 9 нояб. Всемирный день качества +10 нояб. День милиции +16 нояб. День морской пехоты +17 нояб. Международный день студентов +19 нояб. День ракетных войск и артиллерии +21 нояб. День работников налоговых органов +26 нояб. Всемирный день информации 11/SunLast День матери - 1 дек Всемирный день борьбы со СПИДом - 3 дек День юриста - 9 дек День Героев Отечества -12 дек День Конституции -17 дек День ракетных войск стратегического назначения -20 дек День работника органов безопасности -22 дек День энергетика -27 дек День спасателя + 1 дек. Всемирный день борьбы со СПИДом + 3 дек. День юриста + 9 дек. День Героев Отечества +12 дек. День Конституции +17 дек. День ракетных войск стратегического назначения +20 дек. День работника органов безопасности +22 дек. День энергетика +27 дек. День спасателя #endif /* !_ru_RU_UTF_8_common_ */ Modified: head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.holiday ============================================================================== --- head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.holiday Sun Jul 24 10:10:09 2016 (r303263) +++ head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.holiday Sun Jul 24 10:35:44 2016 (r303264) @@ -9,17 +9,17 @@ LANG=ru_RU.UTF-8 - 1 янв Новый год - 2 янв Новогодние каникулы - 3 янв Новогодние каникулы - 4 янв Новогодние каникулы - 5 янв Новогодние каникулы - 7 янв Рождество Христово -23 фев День защитника Отечества - 8 мар Международный женский день - 1 май Праздник Весны и Труда - 9 май День Победы -12 июн День России - 4 ноя День народного единства + 1 янв. Новый год + 2 янв. Новогодние каникулы + 3 янв. Новогодние каникулы + 4 янв. Новогодние каникулы + 5 янв. Новогодние каникулы + 7 янв. Рождество Христово +23 февр. День защитника Отечества + 8 марта Международный женский день + 1 мая Праздник Весны и Труда + 9 мая День Победы +12 июня День России + 4 нояб. День народного единства #endif /* !_ru_RU_UTF_8_holiday_ */ Modified: head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.military ============================================================================== --- head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.military Sun Jul 24 10:10:09 2016 (r303263) +++ head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.military Sun Jul 24 10:35:44 2016 (r303264) @@ -9,20 +9,20 @@ LANG=ru_RU.UTF-8 -27 янв День снятия блокады города Ленинграда (1944 год) - 2 фев День разгрома советскими войсками немецко-фашистских войск в Сталинградской битве (1943 год) -23 фев День победы Красной Армии над кайзеровскими войсками Германии (1918 год) -18 апр День победы русских воинов князя Александра Невского над немецкими рыцарями на Чудском озере (Ледовое побоище, 1242 год) -10 июл День победы русской армии под командованием Петра Первого над шведами в Полтавском сражении (1709 год) - 9 авг День первой в российской истории морской победы русского флота под командованием Петра Первого над шведами у мыса Гангут (1714 год) -23 авг День разгрома советскими войсками немецко-фашистских войск в Курской битве (1943 год) - 2 сен День окончания Второй мировой войны (1945 год) - 8 сен День Бородинского сражения русской армии под командованием М.И. Кутузова с французской армией (1812 год) -11 сен День победы русской эскадры под командованием Ф.Ф. Ушакова над турецкой эскадрой у мыса Тендра (1790 год) -21 сен День победы русских полков во главе с великим князем Дмитрием Донским над монголо-татарскими войсками в Куликовской битве (1380 год) - 7 ноя День освобождения Москвы силами народного ополчения под руководством Кузьмы Минина и Дмитрия Пожарского от польских интервентов (1612 год) - 1 дек День победы русской эскадры под командованием П.С. Нахимова над турецкой эскадрой у мыса Синоп (1853 год) - 5 дек День начала контрнаступления советских войск против немецко-фашистских войск в битве под Москвой (1941 год) -24 дек День взятия турецкой крепости Измаил русскими войсками под командованием А.В. Суворова (1790 год) +27 янв. День снятия блокады города Ленинграда (1944 год) + 2 февр. День разгрома советскими войсками немецко-фашистских войск в Сталинградской битве (1943 год) +23 февр. День победы Красной Армии над кайзеровскими войсками Германии (1918 год) +18 апр. День победы русских воинов князя Александра Невского над немецкими рыцарями на Чудском озере (Ледовое побоище, 1242 год) +10 июля День победы русской армии под командованием Петра Первого над шведами в Полтавском сражении (1709 год) + 9 авг. День первой в российской истории морской победы русского флота под командованием Петра Первого над шведами у мыса Гангут (1714 год) +23 авг. День разгрома советскими войсками немецко-фашистских войск в Курской битве (1943 год) + 2 сент. День окончания Второй мировой войны (1945 год) + 8 сент. День Бородинского сражения русской армии под командованием М.И. Кутузова с французской армией (1812 год) +11 сент. День победы русской эскадры под командованием Ф.Ф. Ушакова над турецкой эскадрой у мыса Тендра (1790 год) +21 сент. День победы русских полков во главе с великим князем Дмитрием Донским над монголо-татарскими войсками в Куликовской битве (1380 год) + 7 нояб. День освобождения Москвы силами народного ополчения под руководством Кузьмы Минина и Дмитрия Пожарского от польских интервентов (1612 год) + 1 дек. День победы русской эскадры под командованием П.С. Нахимова над турецкой эскадрой у мыса Синоп (1853 год) + 5 дек. День начала контрнаступления советских войск против немецко-фашистских войск в битве под Москвой (1941 год) +24 дек. День взятия турецкой крепости Измаил русскими войсками под командованием А.В. Суворова (1790 год) #endif /* !_ru_RU_UTF_8_military_ */ Modified: head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.orthodox ============================================================================== --- head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.orthodox Sun Jul 24 10:10:09 2016 (r303263) +++ head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.orthodox Sun Jul 24 10:35:44 2016 (r303264) @@ -10,27 +10,27 @@ LANG=ru_RU.UTF-8 Paskha=Пасха -21 сен Рождество Пресвятой Богородицы -27 сен Воздвижение Креста Господня -14 окт Покров Пресвятой Богородицы - 4 дек Введение во храм Пресвятой Богородицы - 7 янв Рождество Христово -14 янв Обрезание Господне -19 янв Богоявление или Крещение Господне -15 фев Сретение Господне +21 сент. Рождество Пресвятой Богородицы +27 сент. Воздвижение Креста Господня +14 окт. Покров Пресвятой Богородицы + 4 дек. Введение во храм Пресвятой Богородицы + 7 янв. Рождество Христово +14 янв. Обрезание Господне +19 янв. Богоявление или Крещение Господне +15 февр. Сретение Господне Пасха-48 Великий Пост -Пасха-7 Вход Господень в Иерусалим. Вербное Воскресенье +Пасха-7 Вход Господень в Иерусалим. Вербное Воскресент.ье Пасха-3 Великий Четверг Пасха-2 Страстная Пятница -Пасха Воскресение Христово -Пасха+39 Вознесение +Пасха Воскресент.ие Христово +Пасха+39 Вознесент.ие Пасха+49 День Святой Троицы. Пятидесятница - 7 апр Благовещение Пресвятой Богородицы - 7 июл Рождество Иоанна Предтечи -12 июл День святых первоверховных апостолов Петра и Павла -19 авг Преображение Господне -28 авг Успение Пресвятой Богородицы -11 сен Усекновение главы Иоанна Предтечи + 7 апр. Благовещение Пресвятой Богородицы + 7 июля Рождество Иоанна Предтечи +12 июля День святых первоверховных апостолов Петра и Павла +19 авг. Преображение Господне +28 авг. Успение Пресвятой Богородицы +11 сент. Усекновение главы Иоанна Предтечи #endif /* !_ru_RU_UTF_8_orthodox_ */ Modified: head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan ============================================================================== --- head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan Sun Jul 24 10:10:09 2016 (r303263) +++ head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan Sun Jul 24 10:35:44 2016 (r303264) @@ -10,33 +10,33 @@ LANG=ru_RU.UTF-8 Paskha=Пасха -21 дек* Зимнее солнцестояние -25 дек Коляда (сдвинутое зимнее солнцестояние) - 6 янв День Кащея и Велеса -24 фев День Велеса -29 фев День Кащея - 1 мар День Марены -14 мар Новый Год, Овсень малый +21 дек.* Зимнее солнцестояние +25 дек. Коляда (сдвинутое зимнее солнцестояние) + 6 янв. День Кащея и Велеса +24 февр. День Велеса +29 февр. День Кащея + 1 марта День Марены +14 марта Новый Год, Овсент.ь малый Пасха-55 Масленица Пасха+7 Красная Горка Пасха+16 Радуница -20 мар* Весенние равноденствие - 7 апр День Марены (сдвинутое весеннее равноденствие) - 6 май День Дажьбога, Овсень большой -22 май Ярилин День -15 июн День Триглава -21 июн* Летнее солнцестояние - 1 июл Русальная Неделя - 7 июл Купала (сдвинутое летнее солнцестояние) -27 июл Отбор жертв Перуну, русалии - 2 авг Перунов День -21 авг День Стрибога -28 авг Успение Златогорки -14 сен День Волха Змеевича -22 сен* Поворот к зиме (осеннее равноденствие) -10 ноя День Макоши -21 ноя День Сварога и Семаргла - 9 дек День Дажьбога и Марены +20 марта* Весент.ние равноденствие + 7 апр. День Марены (сдвинутое весент.нее равноденствие) + 6 мая День Дажьбога, Овсент.ь большой +22 мая Ярилин День +15 июня День Триглава +21 июня* Летнее солнцестояние + 1 июля Русальная Неделя + 7 июля Купала (сдвинутое летнее солнцестояние) +27 июля Отбор жертв Перуну, русалии + 2 авг. Перунов День +21 авг. День Стрибога +28 авг. Успение Златогорки +14 сент. День Волха Змеевича +22 сент.* Поворот к зиме (осеннее равноденствие) +10 нояб. День Макоши +21 нояб. День Сварога и Семартагла + 9 дек. День Дажьбога и Марены #endif /* !_ru_RU_UTF_8_pagan_ */ From owner-svn-src-head@freebsd.org Sun Jul 24 11:05: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 9DA70BA1E42; Sun, 24 Jul 2016 11:05:24 +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 6EC1312FA; Sun, 24 Jul 2016 11:05:24 +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 u6OB5NHL034893; Sun, 24 Jul 2016 11:05:23 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6OB5Nbh034892; Sun, 24 Jul 2016 11:05:23 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201607241105.u6OB5Nbh034892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 24 Jul 2016 11:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303265 - head/usr.bin/calendar 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.22 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, 24 Jul 2016 11:05:24 -0000 Author: bapt Date: Sun Jul 24 11:05:23 2016 New Revision: 303265 URL: https://svnweb.freebsd.org/changeset/base/303265 Log: Remove reference cpp(1) which is not used anymore Modified: head/usr.bin/calendar/calendar.1 Modified: head/usr.bin/calendar/calendar.1 ============================================================================== --- head/usr.bin/calendar/calendar.1 Sun Jul 24 10:35:44 2016 (r303264) +++ head/usr.bin/calendar/calendar.1 Sun Jul 24 11:05:23 2016 (r303265) @@ -28,7 +28,7 @@ .\" @(#)calendar.1 8.1 (Berkeley) 6/29/93 .\" $FreeBSD$ .\" -.Dd April 6, 2013 +.Dd July 24, 2016 .Dt CALENDAR 1 .Os .Sh NAME @@ -295,7 +295,6 @@ This is no longer true, the date is only at the beginning of a line. .Sh SEE ALSO .Xr at 1 , -.Xr cpp 1 , .Xr mail 1 , .Xr cron 8 .Sh HISTORY From owner-svn-src-head@freebsd.org Sun Jul 24 14:42: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 01CF9BA3E74; Sun, 24 Jul 2016 14:42:13 +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 C85821A44; Sun, 24 Jul 2016 14:42:12 +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 u6OEgCrD017988; Sun, 24 Jul 2016 14:42:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6OEgCQb017987; Sun, 24 Jul 2016 14:42:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201607241442.u6OEgCQb017987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 24 Jul 2016 14:42:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303266 - 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.22 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, 24 Jul 2016 14:42:13 -0000 Author: mav Date: Sun Jul 24 14:42:11 2016 New Revision: 303266 URL: https://svnweb.freebsd.org/changeset/base/303266 Log: Postpone ntb_get_msix_info() till we need to negotiate MSIX. Calling it earlier increases the window when MSIX info may change. This change does not solve the problem completely, but seems logical. Complete solution should probably include link reset in case of MSIX remap to trigger new negotiation, but we have no way to get notified about that now. 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 Sun Jul 24 11:05:23 2016 (r303265) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Sun Jul 24 14:42:11 2016 (r303266) @@ -1084,8 +1084,6 @@ ntb_init_isr(struct ntb_softc *ntb) ntb_create_msix_vec(ntb, num_vectors); rc = ntb_setup_msix(ntb, num_vectors); - if (rc == 0 && HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) - ntb_get_msix_info(ntb); } if (rc != 0) { device_printf(ntb->device, @@ -2715,6 +2713,7 @@ ntb_exchange_msix(void *ctx) if (ntb->peer_msix_done) goto msix_done; + ntb_get_msix_info(ntb); for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { ntb_peer_spad_write(ntb->device, NTB_MSIX_DATA0 + i, ntb->msix_data[i].nmd_data); From owner-svn-src-head@freebsd.org Sun Jul 24 15: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 E90FBBA34AF for ; Sun, 24 Jul 2016 15:16:39 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.51]) (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 79BA11B9B for ; Sun, 24 Jul 2016 15:16:39 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f51.google.com with SMTP id l69so113609402lfg.1 for ; Sun, 24 Jul 2016 08:16:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=7EGgVD+0mWV+GsuzgyPstVKnmzrSIzzT1V7505SMruY=; b=IUUG4W3Ebo4OWALVDS4LCg3nIHZCTcRwb/rwA57sbCWaraTeP6eZMTEkEwjZhrWrU8 AunZ8qHPASyyZwOwWEkVmTzKNThForJbV95YhHXxcjFQNMHRsLIprZAnNy1mACg4QwNj mdL3P7jcBX8Z2eebVIdngWPABTb85C2MjH8iOGEEHkbZov+WLNPiQyOZINfhVmlUPFUe F2lfI6ILs2WZaVoN3oSS+V+TyZUVIpgdDuvV4UUEEnUuzErJudwS5pHVtXM4nqjjd0mz Nr9FGhCBYstTMJo3uJafFHfcm+hpT18peOsHjx4TRaWaXoaCboGNAFzFVkPf5QeqMRd/ zyTw== X-Gm-Message-State: AEkooutdhDs3nrsB2s9CG9o+S5O4ZQ2IiKIrb7v6svRYppVB0IgnD7b14RSmkc/LOtEIBg== X-Received: by 10.25.35.19 with SMTP id j19mr5416931lfj.106.1469373390819; Sun, 24 Jul 2016 08:16:30 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id h9sm4791355lfe.8.2016.07.24.08.16.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 Jul 2016 08:16:30 -0700 (PDT) Subject: Re: svn commit: r303264 - head/usr.bin/calendar/calendars/ru_RU.UTF-8 To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201607241035.u6OAZijR023467@repo.freebsd.org> From: Andrey Chernov Message-ID: <76ecf576-3b05-9a58-9c58-6b45f49b7286@freebsd.org> Date: Sun, 24 Jul 2016 18:16:26 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201607241035.u6OAZijR023467@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 24 Jul 2016 15:16:40 -0000 What happens with the lines below? On 24.07.2016 13:35, Gleb Smirnoff wrote: > Modified: head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.orthodox > -Пасха-7 Вход Господень в Иерусалим. Вербное Воскресенье > +Пасха-7 Вход Господень в Иерусалим. Вербное Воскресент.ье > +Пасха Воскресент.ие Христово > +Пасха+39 Вознесент.ие > Modified: head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan > -14 мар Новый Год, Овсень малый > +14 марта Новый Год, Овсент.ь малый > -20 мар* Весенние равноденствие > - 7 апр День Марены (сдвинутое весеннее равноденствие) > +20 марта* Весент.ние равноденствие > + 7 апр. День Марены (сдвинутое весент.нее равноденствие) > + 6 мая День Дажьбога, Овсент.ь большой From owner-svn-src-head@freebsd.org Sun Jul 24 15: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 B92ADBA37B5; Sun, 24 Jul 2016 15:32:12 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (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 9CCAD1333; Sun, 24 Jul 2016 15:32:12 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (75-101-50-44.static.sonic.net [75.101.50.44]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u6OFW3s5009249 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sun, 24 Jul 2016 08:32:03 -0700 Subject: Re: svn commit: r301453 - in head/sys: arm/arm arm64/arm64 dev/fdt dev/gpio dev/iicbus dev/ofw dev/pci dev/vnic kern mips/mips sys To: Michal Meloun , Svatopluk Kraus , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201606051620.u55GKD5S066398@repo.freebsd.org> <578E0B5D.3070105@FreeBSD.org> <578F6075.7010500@FreeBSD.org> <05a80ac6-4285-ec9d-36e9-2f92c609f746@freebsd.org> <57907B0F.9070204@FreeBSD.org> <9d2a224c-b787-2875-5984-a7a2354e8695@freebsd.org> <57934ABD.6010807@FreeBSD.org> <4e7a3e8f-cc21-f5f2-e3e0-4dbd554a4cd0@freebsd.org> <5794720F.4050303@FreeBSD.org> From: Nathan Whitehorn Message-ID: <8bfd8668-bc49-e109-e610-b5cd470be3ec@freebsd.org> Date: Sun, 24 Jul 2016 08:32:03 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <5794720F.4050303@FreeBSD.org> X-Sonic-CAuth: UmFuZG9tSVYdzuiyOMYhHmtpJiOj4me7bvjW1HbUZALJZSAt5XS0G0zkcMSyVU8RVH5EhuK/+F3bvj3PWenBLLHdx0qAWChdcG8/jm58ScE= X-Sonic-ID: C;qs1mxbNR5hGcBJNwxPCmMQ== M;vkOlxbNR5hGcBJNwxPCmMQ== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 24 Jul 2016 15:32:12 -0000 On 07/24/16 00:45, Michal Meloun wrote: > Dne 23.07.2016 v 20:35 Nathan Whitehorn napsal(a): >> >> >> On 07/23/16 03:45, Michal Meloun wrote: >>> Dne 21.07.2016 v 17:53 Nathan Whitehorn napsal(a): >>>> >>>> On PowerPC, GENERIC64 supports FDT systems (some IBM hardware), OFW >>>> systems (Macs, some IBM hardware), systems with no device trees at >>>> all (old-style PS3), and systems with a mixture of device tree and >>>> no device tree (new-style PS3). On these, there is a mixture of >>>> "real" interrupts and GPIO-type interrupts. There is no limitation >>>> that this be used only for device-tree-type systems. >>>> >>>> The system requires two things: an interrupt domain key and an >>>> arbitrary unique byte string describing the interrupt. When running >>>> with a device tree, these are set to the phandle of the >>>> interrupt-parent and the contents of the device tree interrupt >>>> specifier, respectively, and the system was of course developed >>>> with that in mind. But they don't need to be, and often aren't. You >>>> could make the domain an element of an enum (where "ACPI" is a >>>> choice, for instance -- this is what PS3 does), or set it to a >>>> pointer to a device_t, or really anything you like. Similarly, the >>>> interrupt specifier is totally free-form. >>> >>> Yes, I agree. and i think that we followed the same direction. But i >>> see two problems with this approach. >>> - in some cases (OFW, device_t) you don't have control over domain >>> key value, so you cannot guarantee its uniqueness. >>> Of course, probability of collision is low, but it is. >> >> We could solve this in a number of ways, for example widening to 64 >> bits, or adding another value (domain type, for example). You could >> also make an acpi_bus_map_intr() to go with the OFW one that connect >> in some machine-dependent code if you have fundamentally incompatible >> bus enumeration mechanisms that you expect to exist simultaneously -- >> but, of course, no systems like this seem to actually exist, so the >> problem is both easily solved and totally theoretical. >> >>> - within ofw_bus_map_intr() (or later - at the time when byte string >>> must be decoded) you are not able (easily) to differentiate >>> between different formats, thus you are not able to select >>> appropriate decoder. The GPIO controller, for example, >>> must be able to handle interrupts defined by standard OFW >>> property, or by pair concurrently. >> >> In principle, you could solve that as above, or by registering a >> second interrupt domain for the same controller. >> >> In practice, it doesn't matter since, in the GPIO case, for example, >> the GPIO controller is never itself also a normal interrupt >> controller (i.e. the GIC and GPIO controller are always different >> devices). As such, the theoretical does not occur in practice. > form > https://svnweb.freebsd.org/base/head/sys/gnu/dts/arm/tegra124-jetson-tk1.dts?revision=295436&view=markup#l1380 > "interrupts = ; " > Do you want more examples ? Those have the identical format to the GPIO properties, because they are the same thing. So it works out of the box. Do you have examples of something that *doesn't work*? > >> >>> For this reason we makes domain key composite, in our model, the >>> domain key consist of "domain key type" >>> and "domain key value". This composite key guarantees uniqueness >>> and it also allows to select proper parser for byte string. >> >> Yes, but this solves what is a nonexistant problem by making the >> system substantially less flexible and more invasive. Which is not a >> good tradeoff. >> > I think that existence of problem is confirmed in the above example . > Quote from previous paragraph: > "We could solve this in a number of ways, ... , or adding another > value (domain type, for example)." > What can I say more ... Except that the example you gave *is not an example* of the problem you are describing. You would only end up with a problem if: 1) You had interrupts in a GPIO property rather than in an interrupts property (or equivalent). 2) *And* you had interrupts on GPIOs in an interrupts property (or equivalent) 3) *and* those are encoded differently 4) *and* the different encodings use the same number of cells 5) *and* are not otherwise distinguishable Does that ever actually happen, in the real world, on any device tree? You could imagine any kind of messed up thing you want, but we shouldn't structure APIs around them, especially given that the current alternative you are proposing has real, concrete problems on real hardware that actually exists. > > [snip] >>> >>>> >>>>> >>>>>> >>>>>>>> It is much easier to do this correctly at bus attach time when >>>>>>>> the resource lists are made (how PPC does it). >>>>>>>> >>>>>>> I don't agree. I don't agree. Making this at bus attach time >>>>>>> leads into complicated 'virtual' IRQ infrastructure, with many >>>>>>> unresolved corner cases. >>>>>> >>>>>> Which unresolved corner cases? This has been working correctly on >>>>>> a number of platforms in both FreeBSD and Linux for many years. >>>>> Nope, it doesn't work for ARM yet (for GPIO interrupts for >>>>> example) and Linux uses EPROBE_DEFER mechanism for a long time. >>>>> See: http://lxr.free-electrons.com/source/drivers/base/platform.c#L87 >>>> >>>> There is some missing code on ARM (probably about 30 minutes of >>>> work to make it match PowerPC) to make it work in an ideal case, >>>> sure, but there is no reason you could not go out right now, with >>>> the existing code, and implement GPIO interrupts by declaring the >>>> GPIO driver as an interrupt controller. >>>> >>>> Can you give any concrete case of something that doesn't work? >>> GPIO again. How you can allocate interrupt associated with given >>> gpio pin installed by "cd-gpios = <&gpio TEGRA_GPIO(V, 2) >>> GPIO_ACTIVE_LOW>;" >> >> You parse that as an interrupt on a interrupt domain associated with >> the GPIO controller referenced by &gpio. In pseudo-code: >> >> int irq = ofw_bus_map_intr(dev, <&gpio>, ncells, > GPIO_ACTIVE_LOW>); >> The GPIO controller, meanwhile, has registered an interrupt domain >> for <&gpio> and is asked to decode and configure the interrupt >> defined by , which it knows how to >> parse. This is simple and straightforward. > And again and again: > We have > "cd-gpios = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_LOW>;" > and > interrupt-parent = <&gpio>; > "interrupts = ; " > in one tree. And we need to get a interrupt in both variants. Where, again, those are completely identical and there are not even two variants, so you are presenting this an example of a problem *that it does not exemplify*. > >>>>>> I would urge, in the strongest possible terms, that this be >>>>>> backed out from stable/11 at least. We can add the new API back >>>>>> for 11.1 if we want it, but we totally lose the ability to change >>>>>> it later in the stable/11 cycle if it stays in now. >>>>>> -Nathan >>>>>> >>>>> The API is part of still unstable, experimental INTRNG, so its not >>>>> fixed we we can change it at any time, I think. >>>>> But yes, we forget to wrap new bus_map_intr() method (and >>>>> associated code) by #ifdef INTRNG. Is this sufficient for you? >>>> >>>> For HEAD, yes. I would like it out of stable/11 entirely until this >>>> discussion converges. >>>> -Nathan >>> The current code (in stable/11) works and is tested. I simple >>> cannot commit any untested change for stable tree mainly if is in >>> BETA2 stage. And I cannot fully test the requested change, at this >>> time i have access to single ARM platform. >>> But we're in the same situation - both have the same commit bit, >>> neither one of us is the author of the disputed commit and neither >>> of us are not able to fully test it. >>> So feel free to commit what you want, if you have courage to commit >>> untested code. I haven't it...\ >>> Michal >>> >> >> Well, the code isn't actually used anywhere in stable/11, or HEAD, so >> it can't possibly be either tested or important for the functionality >> of any current code. As such, I will revert from HEAD on Monday and >> request an MFC from re@ following that if the author has not appeared >> by that time. >> -Nathan > > The code is, of course, already used by each of INTRNG enabled platforms. > > ------------------------------------------------------------------------------------------------------ > diff --git a/sys/dev/ofw/ofwbus.c b/sys/dev/ofw/ofwbus.c > index 1e048c4..14eb507 100644 > --- a/sys/dev/ofw/ofwbus.c > +++ b/sys/dev/ofw/ofwbus.c > @@ -323,7 +323,7 @@ ofwbus_map_intr(device_t bus, device_t child, int > *rid, rman_res_t *start, > int ncells, rv; > u_int irq; > struct intr_map_data_fdt *fdt_data; > - > +printf(" *** %s: bus: %p\n", __func__, bus); > node = ofw_bus_get_node(child); > rv = ofw_bus_intr_by_rid(child, node, *rid, &iparent, &ncells, > &cells); > if (rv != 0) > diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c > index af3ca57..b381163 100644 > --- a/sys/kern/subr_bus.c > +++ b/sys/kern/subr_bus.c > @@ -3960,6 +3960,7 @@ int > bus_generic_map_intr(device_t dev, device_t child, int *rid, > rman_res_t *start, > rman_res_t *end, rman_res_t *count, struct intr_map_data **imd) > { > +printf(" *** %s: dev: %p\n", __func__, dev); > /* Propagate up the bus hierarchy until someone handles it. */ > if (dev->parent) > return (BUS_MAP_INTR(dev->parent, child, rid, start, > end, count, > --------------------------------------------------------------------------------------------------- > Result: > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** bus_generic_map_intr: dev: 0xc4ce5780 > *** bus_generic_map_intr: dev: 0xc4ce0980 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** bus_generic_map_intr: dev: 0xc4e52080 > *** bus_generic_map_intr: dev: 0xc4e52480 > *** bus_generic_map_intr: dev: 0xc4e52780 > *** bus_generic_map_intr: dev: 0xc4ce1500 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** bus_generic_map_intr: dev: 0xc4ce0300 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** ofwbus_map_intr: bus: 0xc4ce1880 > *** ofwbus_map_intr: bus: 0xc4ce1880 > > So its hard to say that code is unused. > > And, just for info, last "clean in PPC way" is initial commit INTRNG > at r289529 (9 months ago). > Michal > > Ah, I see, it is called from bus_extend_resource(). Could you describe this one? It takes an arbitrary resource, but only actually works on interrupts and seems to be called from #ifdef-ed parts of the MI bus_alloc_resource(). Could you describe what is going on here some more? There doesn't appear to be any documentation of any of this. This will make this much harder to untangle, unfortunately, and probably means we are stuck with this as a rump API in stable/11. -Nathan From owner-svn-src-head@freebsd.org Sun Jul 24 15:45: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 BF62EBA3A07 for ; Sun, 24 Jul 2016 15:45:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x236.google.com (mail-it0-x236.google.com [IPv6:2607:f8b0:4001:c0b::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 7C4CC1A4B for ; Sun, 24 Jul 2016 15:45:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x236.google.com with SMTP id j124so86608311ith.1 for ; Sun, 24 Jul 2016 08:45:46 -0700 (PDT) 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:from:date:message-id :subject:to:cc; bh=k9auXX0sYeGMBzAsyPRJsLDOKykM4nK92ewWZsev6Yo=; b=EgjWdOiwwA7SQFh12VKaifZzKZjeXOWFzf+b178AFICC+7kH5OXu/WQ3SzMDYF19G6 bgIeaRtJM/wIkzp+4jqizQwMStyTRRtpaZLzt3GXbgXVqoeQ7BD0GmYucPRgFlPoC3PH na0XYRvKrrfuiqUiEus+hy97byzkZ4+p62V3cwU/RXOdKIxzl7HIKXQ4bYEfuptImAwv yaZZ8jG68AmSwp8L3izS/9EDruDsolM3CuCpfnQWloLHKsc8U1TCCMbdpctRDHGgZ7Yd Pt9lbcxGfgDnmVDXnZCypwjVMYkMr67GPpPMQn5JMtApGi3tN/5U8IJzLfme+iHquPPd C4zw== 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:from :date:message-id:subject:to:cc; bh=k9auXX0sYeGMBzAsyPRJsLDOKykM4nK92ewWZsev6Yo=; b=OssOqGltMwtdWAtG2gyb+GIIp4ltJMMy8rbjizMt8564Kt0vH1MonvZ4Xmx4zGSuUz ZMCaZdcLBjJbXUgofs7vBzAJl0ax9hb5NLrGgsPg1JWzWUbkAzlt14pgU/YdF76AgNVJ kWzEOcTVIPcLxTXKK5U7wznWocJB0MxFxOg7vfkLGYkIs5cHAPpl5RWMg5cWA8ue7L0C 6TJHRfhBu25ehSbayt2H+rD7GT7OHuxTdd4YwcVqYpm4GEayNl40SRL9eRDMyoW6G2fl 2pAYEPe3xT0hW0LoiogNd0ewgarKnVHmNI7HlCzH7KgVgAPCJGRji9IqvihDQ0AbF85X pcnQ== X-Gm-Message-State: AEkoousmYN+/BIRCMDtbBzwwBbFxCktdN97HqnMzlciEiw9cRfi5E1gxHfYeYyTaC3ZbKU7/svYpP57MOPQXLw== X-Received: by 10.36.11.2 with SMTP id 2mr16692316itd.60.1469375145788; Sun, 24 Jul 2016 08:45:45 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.137.131 with HTTP; Sun, 24 Jul 2016 08:45:44 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <8bfd8668-bc49-e109-e610-b5cd470be3ec@freebsd.org> References: <201606051620.u55GKD5S066398@repo.freebsd.org> <578E0B5D.3070105@FreeBSD.org> <578F6075.7010500@FreeBSD.org> <05a80ac6-4285-ec9d-36e9-2f92c609f746@freebsd.org> <57907B0F.9070204@FreeBSD.org> <9d2a224c-b787-2875-5984-a7a2354e8695@freebsd.org> <57934ABD.6010807@FreeBSD.org> <4e7a3e8f-cc21-f5f2-e3e0-4dbd554a4cd0@freebsd.org> <5794720F.4050303@FreeBSD.org> <8bfd8668-bc49-e109-e610-b5cd470be3ec@freebsd.org> From: Warner Losh Date: Sun, 24 Jul 2016 09:45:44 -0600 X-Google-Sender-Auth: nrFh_z-9N-8C0bJwbb8uofaALSw Message-ID: Subject: Re: svn commit: r301453 - in head/sys: arm/arm arm64/arm64 dev/fdt dev/gpio dev/iicbus dev/ofw dev/pci dev/vnic kern mips/mips sys To: Nathan Whitehorn Cc: Michal Meloun , Svatopluk Kraus , src-committers , "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.22 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, 24 Jul 2016 15:45:46 -0000 On Sun, Jul 24, 2016 at 9:32 AM, Nathan Whitehorn wrote: > This will make this much harder to untangle, unfortunately, and probably > means we are stuck with this as a rump API in stable/11. The time to have had this discussion was 9 months ago when it first started to appear in the tree and on differential and on the mailing lists. I'm also not convinced that 'planes' would be the right way to solve the interrupt issues. There's been talk about it for a long time, but no action. The relationships in FDT are DAGs, not trees, and newbus is inherently tree-based. Warner From owner-svn-src-head@freebsd.org Sun Jul 24 15:48: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 F3063BA3AFD for ; Sun, 24 Jul 2016 15:48:26 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f54.google.com (mail-lf0-f54.google.com [209.85.215.54]) (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 9E4131C9F for ; Sun, 24 Jul 2016 15:48:26 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f54.google.com with SMTP id b199so114076607lfe.0 for ; Sun, 24 Jul 2016 08:48:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=qB3TV5aWZcTPFV35QyZQ8MbxT3wdjsbtXCTdl0xDH+A=; b=Bobjwklr9sCEH8TlMiU7GV5vW2gQK/rts/u2tmmQFMjOL/v1D4oiQGneSgukLbe/om 60/OspdTRQKbXZpGeD7yGfP/PNcgA/Nsyt3P0ts/7AzIdvNWCrUkD0JhMGfhHiJ7BYCY kXQ7NIMzO+SUL96k8UmvnqO+Z9l1pfKyrbaJysaDgdcDg9ZIID2Fk5vM1o2Qn2Ya/aO9 fDNd+fszQK++bPtFdmu8S4c11FFYtVgUQm0YSid8ePhhJl5vhim6mbwBxDkGUI7Gp2wm n+kDIvGKU3nPNTGNI550A0eRK7i27A6ZTgqi3/gdPvW01QqgudPNBbEiJ2pH3sKnNoki oPGQ== X-Gm-Message-State: AEkoout70TSJIQbL6SDjB4A2YcJPw1r5ywhqlxGPVTT1mKhHRm2GIu+5lDmoMslJG/XUSw== X-Received: by 10.25.81.139 with SMTP id f133mr6074607lfb.78.1469375284982; Sun, 24 Jul 2016 08:48:04 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id c125sm4789119lfe.10.2016.07.24.08.48.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 Jul 2016 08:48:04 -0700 (PDT) Subject: Re: svn commit: r303218 - head/tools/tools/locale/tools To: Baptiste Daroussin References: <201607231124.u6NBO5aJ003824@repo.freebsd.org> <97566d46-1d37-8c95-f276-f55b190bddbb@freebsd.org> <20160723115244.76vhhzl55qoyw4kf@ivaldir.etoilebsd.net> <2ddb2814-9edf-82a9-350c-aebf34cdb4ab@freebsd.org> <20160723123228.i2tmxaklkoad6vkh@ivaldir.etoilebsd.net> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: Date: Sun, 24 Jul 2016 18:48:00 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160723123228.i2tmxaklkoad6vkh@ivaldir.etoilebsd.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4ELSWsHPTtIeDWI984PUX9wu0jMrAHKvg" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 24 Jul 2016 15:48:27 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --4ELSWsHPTtIeDWI984PUX9wu0jMrAHKvg Content-Type: multipart/mixed; boundary="jFl3RWirmM27nRf4sS3RKbOCKcJvbl8wg" From: Andrey Chernov To: Baptiste Daroussin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r303218 - head/tools/tools/locale/tools References: <201607231124.u6NBO5aJ003824@repo.freebsd.org> <97566d46-1d37-8c95-f276-f55b190bddbb@freebsd.org> <20160723115244.76vhhzl55qoyw4kf@ivaldir.etoilebsd.net> <2ddb2814-9edf-82a9-350c-aebf34cdb4ab@freebsd.org> <20160723123228.i2tmxaklkoad6vkh@ivaldir.etoilebsd.net> In-Reply-To: <20160723123228.i2tmxaklkoad6vkh@ivaldir.etoilebsd.net> --jFl3RWirmM27nRf4sS3RKbOCKcJvbl8wg Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 23.07.2016 15:32, Baptiste Daroussin wrote: > On Sat, Jul 23, 2016 at 02:58:31PM +0300, Andrey Chernov wrote: >> On 23.07.2016 14:52, Baptiste Daroussin wrote: >>> On Sat, Jul 23, 2016 at 02:41:39PM +0300, Andrey Chernov wrote: >>>> On 23.07.2016 14:24, Baptiste Daroussin wrote: >>>>> Author: bapt >>>>> Date: Sat Jul 23 11:24:05 2016 >>>>> New Revision: 303218 >>>>> URL: https://svnweb.freebsd.org/changeset/base/303218 >>>>> >>>>> Log: >>>>> Add another hack to add weekday to date format to more locales >>>>> >>>>> While here only initialize the iconv converter when needed >>>>> >>>>> Modified: >>>>> head/tools/tools/locale/tools/cldr2def.pl >>>> >>>> BTW, is there any progress in generating all collates with -m ${area= } as >>>> you planned? >>>> >>> you mean the @modifier? >> >> No, I mean that: >>>> Perhaps all uk_UA should be generated with -m ${area} too - Ukrainia= ns >>>> have extended Cyrillics in their alphabet and I am not sure that the= ir >>>> order match default Unicode order for Cyrillic. The same about be_BY= , >>>> bg_BG and sr_Cyrl_RS. They may match or may not, I don't check such >>> deeply. >>>> >>>> It seems the safest side will be to generate all with -m ${area} >>>> >>> Yes that is my plan, except for the 1 or 2 that cannot be generated >> >from cldr >>> directly >> >=20 > Nope I haven't made any progress, and I actually did a bunch of tests o= f some > (honnestly not all locales) trying to get a representative set and coul= d not > find differnce in ordering between locales generated with -m ${area}. >=20 > It would also needs lots of work on the generation tools. >=20 > I first need to write a tool that compares collation rules for various = ${area} > (not done yet) to see how much this is really needed and use it in the > generation tools. >=20 > I will try to do that for 12 if it is really worth it (based on the res= ult from > that comparison tools) IMHO we don't need comparison tools, just blindly adding -m ${area} to generating of every collate with different area be enough. CLDR may involve from time to time including national alphabets changes (which may happen often enough too), so it will be better to not run such tests every time with new CLDR import, but just the make code which do it correctly independently (-m ${area}) and forget about it, it will be much easier to maintain. Moreover, you'll spend more time writing such testing tool than adding -m ${area} :) --jFl3RWirmM27nRf4sS3RKbOCKcJvbl8wg-- --4ELSWsHPTtIeDWI984PUX9wu0jMrAHKvg Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJXlOMwAAoJEKUckv0MjfbKwfkIAMVYxgd0EEL94EYXtiaBpnL/ VdT0suOHkjYzXICMMkxH1Av9Luu7v9Oq1M11vYhcwiHJqTZMzIGvDgPugSDdbyx7 ilkCiTxJERPFsSQzn4YAuOMMZuJgFKvfKNXM5WUTYhv8A1R6FyHfmUDrP6Y7VUVK d3hrVX/Q4ZBYhVMlNT0zjxqkVk8xTMRiznCLHz4EmgSqzoLiBtm4VBXzanwghse5 ltP08tMj2dkF0UdqeswXugnyVeJ98FaT8Fzi1l8vN/tu9rv29jumj6pNsXxsC7Ds t3ayUmtMNWBsKrwfUKDSML1tsEJ2G45AsAGQHX8+MXykLrUcOU34QYlswkTIYrg= =ldlB -----END PGP SIGNATURE----- --4ELSWsHPTtIeDWI984PUX9wu0jMrAHKvg-- From owner-svn-src-head@freebsd.org Sun Jul 24 15:57: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 1233DBA3001; Sun, 24 Jul 2016 15:57:34 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9222E13BB; Sun, 24 Jul 2016 15:57:33 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wm0-x233.google.com with SMTP id o80so125706339wme.1; Sun, 24 Jul 2016 08:57:33 -0700 (PDT) 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-disposition:in-reply-to:user-agent; bh=59MItsMSN1zzYzUZAz2t6YFLmg7/ihIXr1uZXYvsFNU=; b=tFCgflqUy+B5qhBGegHH8cj6i1lxUugDmFIZZ0Z50DFxQnmdBbUHhzVvFaWwVBJNQo 7uyoWoYOCSdf0ei93IUPSs4t23IaLgpysWV+ay3zk8rpwLHhbLSw3drlDJ1oD0AnFa/5 szJOCbmUoZytec/5FEeKna8Z3TnwctDQCgJ2S7MY6FfOt8GIDrS6dEhieAdSED9vlLjZ PIFBVdZViJtffjmMztJlV5Kj67dt6K8nmxKguHEpAGJEjuez4YgrIkkT89HszUtwBeqE 4FtsPVqOrpbut2mTttsu1xfSDxTS7BgjMuU/W4iAL16XT/xHQxpQqtPlEsDxWPvW1tkA X/fw== 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-disposition:in-reply-to:user-agent; bh=59MItsMSN1zzYzUZAz2t6YFLmg7/ihIXr1uZXYvsFNU=; b=nHevRdM2edyYDGx6jZNBHmzoe53Uj5vT4YGB8HWWTQ9i13hAxLHWCdqN8lYKL0kHbw qr8SgEz8My/LBXaRPjtcoEroX7qkXt7OIHR0I1HijbLuQ+PbDPd9PwUDS9lzaJj4KurI DLglcOva320ZI5WmuKZpCrCCOPDzGpDj0Zz79kUkqfNRvPwxPioDQfPvEN0Lh/vzxF8p hN0bB3D/TfQus4Mo6BSV/Tgb1hXroA/2QpnuD1yG6bYFtPrsibn0erzCUHgDOH/qbZ2U IsSJlr70K/d+3JmPg+IVtDArv0C2t5L4c5lhNlboPvUvJ0rJGn+n3cy7tSd8Fln34Xr/ vcmg== X-Gm-Message-State: AEkoouvHH1GIc/RQSvca+lRHC9KQgPszFlqWF7SR6SlqGipMbobC3d2RDzR8aoxU7yQMkQ== X-Received: by 10.28.152.5 with SMTP id a5mr16149902wme.76.1469375851737; Sun, 24 Jul 2016 08:57:31 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id d80sm22874002wmd.14.2016.07.24.08.57.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 Jul 2016 08:57:30 -0700 (PDT) Sender: Baptiste Daroussin Date: Sun, 24 Jul 2016 17:57:30 +0200 From: Baptiste Daroussin To: Andrey Chernov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303218 - head/tools/tools/locale/tools Message-ID: <20160724155729.pscfwaqsrxj5wgll@ivaldir.etoilebsd.net> References: <201607231124.u6NBO5aJ003824@repo.freebsd.org> <97566d46-1d37-8c95-f276-f55b190bddbb@freebsd.org> <20160723115244.76vhhzl55qoyw4kf@ivaldir.etoilebsd.net> <2ddb2814-9edf-82a9-350c-aebf34cdb4ab@freebsd.org> <20160723123228.i2tmxaklkoad6vkh@ivaldir.etoilebsd.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="sdbmesofzgtbbqep" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1-neo (2016-06-11) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 24 Jul 2016 15:57:34 -0000 --sdbmesofzgtbbqep Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 24, 2016 at 06:48:00PM +0300, Andrey Chernov wrote: > On 23.07.2016 15:32, Baptiste Daroussin wrote: > > On Sat, Jul 23, 2016 at 02:58:31PM +0300, Andrey Chernov wrote: > >> On 23.07.2016 14:52, Baptiste Daroussin wrote: > >>> On Sat, Jul 23, 2016 at 02:41:39PM +0300, Andrey Chernov wrote: > >>>> On 23.07.2016 14:24, Baptiste Daroussin wrote: > >>>>> Author: bapt > >>>>> Date: Sat Jul 23 11:24:05 2016 > >>>>> New Revision: 303218 > >>>>> URL: https://svnweb.freebsd.org/changeset/base/303218 > >>>>> > >>>>> Log: > >>>>> Add another hack to add weekday to date format to more locales > >>>>> > >>>>> While here only initialize the iconv converter when needed > >>>>> > >>>>> Modified: > >>>>> head/tools/tools/locale/tools/cldr2def.pl > >>>> > >>>> BTW, is there any progress in generating all collates with -m ${area= } as > >>>> you planned? > >>>> > >>> you mean the @modifier? > >> > >> No, I mean that: > >>>> Perhaps all uk_UA should be generated with -m ${area} too - Ukrainia= ns > >>>> have extended Cyrillics in their alphabet and I am not sure that the= ir > >>>> order match default Unicode order for Cyrillic. The same about be_BY, > >>>> bg_BG and sr_Cyrl_RS. They may match or may not, I don't check such > >>> deeply. > >>>> > >>>> It seems the safest side will be to generate all with -m ${area} > >>>> > >>> Yes that is my plan, except for the 1 or 2 that cannot be generated > >> >from cldr > >>> directly > >> > >=20 > > Nope I haven't made any progress, and I actually did a bunch of tests o= f some > > (honnestly not all locales) trying to get a representative set and coul= d not > > find differnce in ordering between locales generated with -m ${area}. > >=20 > > It would also needs lots of work on the generation tools. > >=20 > > I first need to write a tool that compares collation rules for various = ${area} > > (not done yet) to see how much this is really needed and use it in the > > generation tools. > >=20 > > I will try to do that for 12 if it is really worth it (based on the res= ult from > > that comparison tools) >=20 > IMHO we don't need comparison tools, just blindly adding -m ${area} to > generating of every collate with different area be enough. CLDR may > involve from time to time including national alphabets changes (which > may happen often enough too), so it will be better to not run such tests > every time with new CLDR import, but just the make code which do it > correctly independently (-m ${area}) and forget about it, it will be > much easier to maintain. Moreover, you'll spend more time writing such > testing tool than adding -m ${area} :) >=20 Point taken, still the whole tooling has been made around not doing the -m ${area} thing which I worked around for a few collation, I need to rework (= aka greatly simplify those tools so good direction) to be able to do a full -m ${area}. I will do that for sure for 12.0 Best regards, Bapt --sdbmesofzgtbbqep Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXlOVmAAoJEGOJi9zxtz5arb8P/01fJWKIMh0eRreJNYowoFXS QoFyJpuxycL3v4lnzq/0s5GEy7rSE4HStGo+JyTIixp6u3aV+Z4J0CStuDAl5iHr NETqdraoQ46UE3mx0SNMwQBBAjcBLd7+5xf0f5BjFZV6eNcbO9/NRLwu6KcgSokt BfUM1QeBoB8JN/pFOeRyJahBZgUnqX/6K73FWDUqVLuM4R/wzM6YEFA2mrFZJziv JHoQYsrIRj0mgaZhcqTkcNu2oVYbOkLDE35YmqNezDVyiIa84mQPappDpo4vvi3a 1UMSoFPfDzBDhxBP8LiGfxOjb1OJ8FJJ/TThEvXJsmYjs6rc5vxR3PrOZsFFRdaK DQ7ooCFeqLXOxwo5XfokCeuHEh+5rjLA4uKdCCZ77dodKn4f9Ctu71QsKg0aYgjG JkKlZ4f8s6z5ERPqizsKquzW/04P84wMrFApq/4dUFfvfBLi89YbLISecxoE1vKK NLSvVwjwqcEeaQm1w8S9dIAN1GeZWBeLWLGGOYe3xrjT0JfEg7mT6l3k8DqwnYfM 9MXGN4Yb+qWi7N4siS8ubXk4ChfvFHjzorjO+Wn1F09ulnh/jErJ+828QPfDUTMu JV15LQJHpOGpQ69UoAa4vHMkhllyoo5N1ryjDqRjEe18RBAMZDfkcoHKec3+clel R+HmrrH9t/Px8JdLD0+U =DmXD -----END PGP SIGNATURE----- --sdbmesofzgtbbqep-- From owner-svn-src-head@freebsd.org Sun Jul 24 16:00: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 73D84BA3116; Sun, 24 Jul 2016 16:00:13 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (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 5B0FF160E; Sun, 24 Jul 2016 16:00:13 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (75-101-50-44.static.sonic.net [75.101.50.44]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u6OG05pM009715 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sun, 24 Jul 2016 09:00:06 -0700 Subject: Re: svn commit: r301453 - in head/sys: arm/arm arm64/arm64 dev/fdt dev/gpio dev/iicbus dev/ofw dev/pci dev/vnic kern mips/mips sys To: Warner Losh References: <201606051620.u55GKD5S066398@repo.freebsd.org> <578E0B5D.3070105@FreeBSD.org> <578F6075.7010500@FreeBSD.org> <05a80ac6-4285-ec9d-36e9-2f92c609f746@freebsd.org> <57907B0F.9070204@FreeBSD.org> <9d2a224c-b787-2875-5984-a7a2354e8695@freebsd.org> <57934ABD.6010807@FreeBSD.org> <4e7a3e8f-cc21-f5f2-e3e0-4dbd554a4cd0@freebsd.org> <5794720F.4050303@FreeBSD.org> <8bfd8668-bc49-e109-e610-b5cd470be3ec@freebsd.org> Cc: Michal Meloun , Svatopluk Kraus , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Nathan Whitehorn Message-ID: <4c7b76c3-42c3-6039-00dc-9ed08b885315@freebsd.org> Date: Sun, 24 Jul 2016 09:00:05 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVYy0vQj3PauRi/Yx7jlImhjDoBYJDD49v0ysoficYSOsSQtJHVIvLmpiCwAkcaYHYvJqDNYVPHAT+iegMjkE4YHwko5srxhqSM= X-Sonic-ID: C;4v3xr7dR5hG/9ptMTlz00w== M;zORIsLdR5hG/9ptMTlz00w== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 24 Jul 2016 16:00:13 -0000 On 07/24/16 08:45, Warner Losh wrote: > On Sun, Jul 24, 2016 at 9:32 AM, Nathan Whitehorn > wrote: >> This will make this much harder to untangle, unfortunately, and probably >> means we are stuck with this as a rump API in stable/11. > The time to have had this discussion was 9 months ago when it first started > to appear in the tree and on differential and on the mailing lists. > > I'm also not convinced that 'planes' would be the right way to solve the > interrupt issues. There's been talk about it for a long time, but no action. > The relationships in FDT are DAGs, not trees, and newbus is inherently > tree-based. > > Warner > I at least had never seen this code until it appeared in the tree and went through a phabricator review during code slush in which no one approved it. The general discussion of INTRNG 9 months ago was great, and I wrote some of the code. It is a big step forward. This particular code, however, is not consistent with the understanding of what INTRNG would be that I got from that discussion. The actual discussion on mailing lists seems to consist only of this cryptic email on an ARM list (https://lists.freebsd.org/pipermail/freebsd-arm/2016-June/013976.html) with no meaningful content right before the commit and some phabricator reviews that no one signed off on, that do not include all the relevant maintainers, and that end in one case with open questions followed by a commit. Since this fundamentally affects parts of kern/ and newbus, this needed to be on freebsd-arch for a month at the *very* least and to have positive approval. Given how this was handled and where we are in the release cycle, I don't know what the right course of action is; I see no good outcomes at this point. The core problem is that the code in this commit series duplicates an existing architecture that solves all the problems it purports, but can't ever be portable to other platforms because of its dependency model. As such, it will either (a) bitrot or (b) sit in the tree as a permanent, inflexible, ARM-only adjunct to the systems used on other platforms, filling kern and dev/ofw with progressively more #ifdef. We worked very hard to *remove* an API very similar from this on MIPS in the initial parts of INTRNG because it crippled the flexibility of the system. Having it appear again, under the radar, during code slush with no meaningful review and the author unreachable right before a major release is extremely disappointing. -Nathan From owner-svn-src-head@freebsd.org Sun Jul 24 17:09: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 9C93CBA32C9; Sun, 24 Jul 2016 17:09:33 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mail.miracle.cz (mail.miracle.cz [193.84.128.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.miracle.cz", Issuer "Miracle Group Root CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3738A1B8D; Sun, 24 Jul 2016 17:09:32 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from [193.84.128.50] (meloun.ad.miracle.cz [193.84.128.50]) by mail.miracle.cz (Postfix) with ESMTPSA id D54793ACB3; Sun, 24 Jul 2016 19:09:23 +0200 (CEST) Subject: Re: svn commit: r301453 - in head/sys: arm/arm arm64/arm64 dev/fdt dev/gpio dev/iicbus dev/ofw dev/pci dev/vnic kern mips/mips sys To: Nathan Whitehorn , Svatopluk Kraus , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201606051620.u55GKD5S066398@repo.freebsd.org> <578E0B5D.3070105@FreeBSD.org> <578F6075.7010500@FreeBSD.org> <05a80ac6-4285-ec9d-36e9-2f92c609f746@freebsd.org> <57907B0F.9070204@FreeBSD.org> <9d2a224c-b787-2875-5984-a7a2354e8695@freebsd.org> <57934ABD.6010807@FreeBSD.org> <4e7a3e8f-cc21-f5f2-e3e0-4dbd554a4cd0@freebsd.org> <5794720F.4050303@FreeBSD.org> <8bfd8668-bc49-e109-e610-b5cd470be3ec@freebsd.org> From: Michal Meloun Message-ID: <5794F643.4070207@FreeBSD.org> Date: Sun, 24 Jul 2016 19:09:23 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <8bfd8668-bc49-e109-e610-b5cd470be3ec@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.miracle.cz); Sun, 24 Jul 2016 19:09:23 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 24 Jul 2016 17:09:33 -0000 Dne 24.07.2016 v 17:32 Nathan Whitehorn napsal(a): > > > On 07/24/16 00:45, Michal Meloun wrote: >> Dne 23.07.2016 v 20:35 Nathan Whitehorn napsal(a): >>> >>> >>> On 07/23/16 03:45, Michal Meloun wrote: >>>> Dne 21.07.2016 v 17:53 Nathan Whitehorn napsal(a): >>>>> >>>>> On PowerPC, GENERIC64 supports FDT systems (some IBM hardware), >>>>> OFW systems (Macs, some IBM hardware), systems with no device >>>>> trees at all (old-style PS3), and systems with a mixture of device >>>>> tree and no device tree (new-style PS3). On these, there is a >>>>> mixture of "real" interrupts and GPIO-type interrupts. There is no >>>>> limitation that this be used only for device-tree-type systems. >>>>> >>>>> The system requires two things: an interrupt domain key and an >>>>> arbitrary unique byte string describing the interrupt. When >>>>> running with a device tree, these are set to the phandle of the >>>>> interrupt-parent and the contents of the device tree interrupt >>>>> specifier, respectively, and the system was of course developed >>>>> with that in mind. But they don't need to be, and often aren't. >>>>> You could make the domain an element of an enum (where "ACPI" is a >>>>> choice, for instance -- this is what PS3 does), or set it to a >>>>> pointer to a device_t, or really anything you like. Similarly, the >>>>> interrupt specifier is totally free-form. >>>> >>>> Yes, I agree. and i think that we followed the same direction. But >>>> i see two problems with this approach. >>>> - in some cases (OFW, device_t) you don't have control over >>>> domain key value, so you cannot guarantee its uniqueness. >>>> Of course, probability of collision is low, but it is. >>> >>> We could solve this in a number of ways, for example widening to 64 >>> bits, or adding another value (domain type, for example). You could >>> also make an acpi_bus_map_intr() to go with the OFW one that connect >>> in some machine-dependent code if you have fundamentally >>> incompatible bus enumeration mechanisms that you expect to exist >>> simultaneously -- but, of course, no systems like this seem to >>> actually exist, so the problem is both easily solved and totally >>> theoretical. >>> >>>> - within ofw_bus_map_intr() (or later - at the time when byte >>>> string must be decoded) you are not able (easily) to differentiate >>>> between different formats, thus you are not able to select >>>> appropriate decoder. The GPIO controller, for example, >>>> must be able to handle interrupts defined by standard OFW >>>> property, or by pair concurrently. >>> >>> In principle, you could solve that as above, or by registering a >>> second interrupt domain for the same controller. >>> >>> In practice, it doesn't matter since, in the GPIO case, for example, >>> the GPIO controller is never itself also a normal interrupt >>> controller (i.e. the GIC and GPIO controller are always different >>> devices). As such, the theoretical does not occur in practice. >> form >> https://svnweb.freebsd.org/base/head/sys/gnu/dts/arm/tegra124-jetson-tk1.dts?revision=295436&view=markup#l1380 >> "interrupts = ; " >> Do you want more examples ? > > Those have the identical format to the GPIO properties, because they > are the same thing. So it works out of the box. Do you have examples > of something that *doesn't work*? > >> >>> >>>> For this reason we makes domain key composite, in our model, the >>>> domain key consist of "domain key type" >>>> and "domain key value". This composite key guarantees uniqueness >>>> and it also allows to select proper parser for byte string. >>> >>> Yes, but this solves what is a nonexistant problem by making the >>> system substantially less flexible and more invasive. Which is not a >>> good tradeoff. >>> >> I think that existence of problem is confirmed in the above example . >> Quote from previous paragraph: >> "We could solve this in a number of ways, ... , or adding another >> value (domain type, for example)." >> What can I say more ... > > Except that the example you gave *is not an example* of the problem > you are describing. You would only end up with a problem if: > 1) You had interrupts in a GPIO property rather than in an interrupts > property (or equivalent). > 2) *And* you had interrupts on GPIOs in an interrupts property (or > equivalent) > 3) *and* those are encoded differently > 4) *and* the different encodings use the same number of cells > 5) *and* are not otherwise distinguishable > > Does that ever actually happen, in the real world, on any device tree? > You could imagine any kind of messed up thing you want, but we > shouldn't structure APIs around them, especially given that the > current alternative you are proposing has real, concrete problems on > real hardware that actually exists. > >> >> > > [snip] > >>>> >>>>> >>>>>> >>>>>>> >>>>>>>>> It is much easier to do this correctly at bus attach time when >>>>>>>>> the resource lists are made (how PPC does it). >>>>>>>>> >>>>>>>> I don't agree. I don't agree. Making this at bus attach time >>>>>>>> leads into complicated 'virtual' IRQ infrastructure, with many >>>>>>>> unresolved corner cases. >>>>>>> >>>>>>> Which unresolved corner cases? This has been working correctly >>>>>>> on a number of platforms in both FreeBSD and Linux for many years. >>>>>> Nope, it doesn't work for ARM yet (for GPIO interrupts for >>>>>> example) and Linux uses EPROBE_DEFER mechanism for a long time. >>>>>> See: http://lxr.free-electrons.com/source/drivers/base/platform.c#L87 >>>>> >>>>> There is some missing code on ARM (probably about 30 minutes of >>>>> work to make it match PowerPC) to make it work in an ideal case, >>>>> sure, but there is no reason you could not go out right now, with >>>>> the existing code, and implement GPIO interrupts by declaring the >>>>> GPIO driver as an interrupt controller. >>>>> >>>>> Can you give any concrete case of something that doesn't work? >>>> GPIO again. How you can allocate interrupt associated with given >>>> gpio pin installed by "cd-gpios = <&gpio TEGRA_GPIO(V, 2) >>>> GPIO_ACTIVE_LOW>;" >>> >>> You parse that as an interrupt on a interrupt domain associated with >>> the GPIO controller referenced by &gpio. In pseudo-code: >>> >>> int irq = ofw_bus_map_intr(dev, <&gpio>, ncells, >> GPIO_ACTIVE_LOW>); >>> The GPIO controller, meanwhile, has registered an interrupt domain >>> for <&gpio> and is asked to decode and configure the interrupt >>> defined by , which it knows how to >>> parse. This is simple and straightforward. >> And again and again: >> We have >> "cd-gpios = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_LOW>;" >> and >> interrupt-parent = <&gpio>; >> "interrupts = ; " >> in one tree. And we need to get a interrupt in both variants. > > Where, again, those are completely identical and there are not even > two variants, so you are presenting this an example of a problem *that > it does not exemplify*. > >> >>>>>>> I would urge, in the strongest possible terms, that this be >>>>>>> backed out from stable/11 at least. We can add the new API back >>>>>>> for 11.1 if we want it, but we totally lose the ability to >>>>>>> change it later in the stable/11 cycle if it stays in now. >>>>>>> -Nathan >>>>>>> >>>>>> The API is part of still unstable, experimental INTRNG, so its >>>>>> not fixed we we can change it at any time, I think. >>>>>> But yes, we forget to wrap new bus_map_intr() method (and >>>>>> associated code) by #ifdef INTRNG. Is this sufficient for you? >>>>> >>>>> For HEAD, yes. I would like it out of stable/11 entirely until >>>>> this discussion converges. >>>>> -Nathan >>>> The current code (in stable/11) works and is tested. I simple >>>> cannot commit any untested change for stable tree mainly if is in >>>> BETA2 stage. And I cannot fully test the requested change, at this >>>> time i have access to single ARM platform. >>>> But we're in the same situation - both have the same commit bit, >>>> neither one of us is the author of the disputed commit and neither >>>> of us are not able to fully test it. >>>> So feel free to commit what you want, if you have courage to commit >>>> untested code. I haven't it...\ >>>> Michal >>>> >>> >>> Well, the code isn't actually used anywhere in stable/11, or HEAD, >>> so it can't possibly be either tested or important for the >>> functionality of any current code. As such, I will revert from HEAD >>> on Monday and request an MFC from re@ following that if the author >>> has not appeared by that time. >>> -Nathan >> >> The code is, of course, already used by each of INTRNG enabled platforms. >> >> ------------------------------------------------------------------------------------------------------ >> diff --git a/sys/dev/ofw/ofwbus.c b/sys/dev/ofw/ofwbus.c >> index 1e048c4..14eb507 100644 >> --- a/sys/dev/ofw/ofwbus.c >> +++ b/sys/dev/ofw/ofwbus.c >> @@ -323,7 +323,7 @@ ofwbus_map_intr(device_t bus, device_t child, int >> *rid, rman_res_t *start, >> int ncells, rv; >> u_int irq; >> struct intr_map_data_fdt *fdt_data; >> - >> +printf(" *** %s: bus: %p\n", __func__, bus); >> node = ofw_bus_get_node(child); >> rv = ofw_bus_intr_by_rid(child, node, *rid, &iparent, >> &ncells, &cells); >> if (rv != 0) >> diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c >> index af3ca57..b381163 100644 >> --- a/sys/kern/subr_bus.c >> +++ b/sys/kern/subr_bus.c >> @@ -3960,6 +3960,7 @@ int >> bus_generic_map_intr(device_t dev, device_t child, int *rid, >> rman_res_t *start, >> rman_res_t *end, rman_res_t *count, struct intr_map_data **imd) >> { >> +printf(" *** %s: dev: %p\n", __func__, dev); >> /* Propagate up the bus hierarchy until someone handles it. */ >> if (dev->parent) >> return (BUS_MAP_INTR(dev->parent, child, rid, start, >> end, count, >> --------------------------------------------------------------------------------------------------- >> Result: >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** bus_generic_map_intr: dev: 0xc4ce5780 >> *** bus_generic_map_intr: dev: 0xc4ce0980 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** bus_generic_map_intr: dev: 0xc4e52080 >> *** bus_generic_map_intr: dev: 0xc4e52480 >> *** bus_generic_map_intr: dev: 0xc4e52780 >> *** bus_generic_map_intr: dev: 0xc4ce1500 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** bus_generic_map_intr: dev: 0xc4ce0300 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> >> So its hard to say that code is unused. >> >> And, just for info, last "clean in PPC way" is initial commit INTRNG >> at r289529 (9 months ago). >> Michal >> >> > > Ah, I see, it is called from bus_extend_resource(). Could you describe > this one? It takes an arbitrary resource, but only actually works on > interrupts and seems to be called from #ifdef-ed parts of the MI > bus_alloc_resource(). Could you describe what is going on here some > more? There doesn't appear to be any documentation of any of this. > > This will make this much harder to untangle, unfortunately, and > probably means we are stuck with this as a rump API in stable/11. > -Nathan > > From owner-svn-src-head@freebsd.org Sun Jul 24 17:51: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 3FBE8BA3A65; Sun, 24 Jul 2016 17:51:05 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mail.miracle.cz (mail.miracle.cz [193.84.128.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.miracle.cz", Issuer "Miracle Group Root CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CDF2C1C10; Sun, 24 Jul 2016 17:51:04 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from [193.84.128.50] (meloun.ad.miracle.cz [193.84.128.50]) by mail.miracle.cz (Postfix) with ESMTPSA id 36D6C3ACB5; Sun, 24 Jul 2016 19:51:02 +0200 (CEST) Subject: Re: svn commit: r301453 - in head/sys: arm/arm arm64/arm64 dev/fdt dev/gpio dev/iicbus dev/ofw dev/pci dev/vnic kern mips/mips sys To: Nathan Whitehorn , Svatopluk Kraus , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201606051620.u55GKD5S066398@repo.freebsd.org> <578E0B5D.3070105@FreeBSD.org> <578F6075.7010500@FreeBSD.org> <05a80ac6-4285-ec9d-36e9-2f92c609f746@freebsd.org> <57907B0F.9070204@FreeBSD.org> <9d2a224c-b787-2875-5984-a7a2354e8695@freebsd.org> <57934ABD.6010807@FreeBSD.org> <4e7a3e8f-cc21-f5f2-e3e0-4dbd554a4cd0@freebsd.org> <5794720F.4050303@FreeBSD.org> <8bfd8668-bc49-e109-e610-b5cd470be3ec@freebsd.org> From: Michal Meloun X-Enigmail-Draft-Status: N1110 Message-ID: <57950005.6070403@FreeBSD.org> Date: Sun, 24 Jul 2016 19:51:01 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <8bfd8668-bc49-e109-e610-b5cd470be3ec@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.miracle.cz); Sun, 24 Jul 2016 19:51:02 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 24 Jul 2016 17:51:05 -0000 I'm sorry for the blank response sent by mistake. Dne 24.07.2016 v 17:32 Nathan Whitehorn napsal(a): > > > On 07/24/16 00:45, Michal Meloun wrote: >> Dne 23.07.2016 v 20:35 Nathan Whitehorn napsal(a): >>> >>> >>> On 07/23/16 03:45, Michal Meloun wrote: >>>> Dne 21.07.2016 v 17:53 Nathan Whitehorn napsal(a): >>>>> >>>>> On PowerPC, GENERIC64 supports FDT systems (some IBM hardware), >>>>> OFW systems (Macs, some IBM hardware), systems with no device >>>>> trees at all (old-style PS3), and systems with a mixture of device >>>>> tree and no device tree (new-style PS3). On these, there is a >>>>> mixture of "real" interrupts and GPIO-type interrupts. There is no >>>>> limitation that this be used only for device-tree-type systems. >>>>> >>>>> The system requires two things: an interrupt domain key and an >>>>> arbitrary unique byte string describing the interrupt. When >>>>> running with a device tree, these are set to the phandle of the >>>>> interrupt-parent and the contents of the device tree interrupt >>>>> specifier, respectively, and the system was of course developed >>>>> with that in mind. But they don't need to be, and often aren't. >>>>> You could make the domain an element of an enum (where "ACPI" is a >>>>> choice, for instance -- this is what PS3 does), or set it to a >>>>> pointer to a device_t, or really anything you like. Similarly, the >>>>> interrupt specifier is totally free-form. >>>> >>>> Yes, I agree. and i think that we followed the same direction. But >>>> i see two problems with this approach. >>>> - in some cases (OFW, device_t) you don't have control over >>>> domain key value, so you cannot guarantee its uniqueness. >>>> Of course, probability of collision is low, but it is. >>> >>> We could solve this in a number of ways, for example widening to 64 >>> bits, or adding another value (domain type, for example). You could >>> also make an acpi_bus_map_intr() to go with the OFW one that connect >>> in some machine-dependent code if you have fundamentally >>> incompatible bus enumeration mechanisms that you expect to exist >>> simultaneously -- but, of course, no systems like this seem to >>> actually exist, so the problem is both easily solved and totally >>> theoretical. >>> >>>> - within ofw_bus_map_intr() (or later - at the time when byte >>>> string must be decoded) you are not able (easily) to differentiate >>>> between different formats, thus you are not able to select >>>> appropriate decoder. The GPIO controller, for example, >>>> must be able to handle interrupts defined by standard OFW >>>> property, or by pair concurrently. >>> >>> In principle, you could solve that as above, or by registering a >>> second interrupt domain for the same controller. >>> >>> In practice, it doesn't matter since, in the GPIO case, for example, >>> the GPIO controller is never itself also a normal interrupt >>> controller (i.e. the GIC and GPIO controller are always different >>> devices). As such, the theoretical does not occur in practice. >> form >> https://svnweb.freebsd.org/base/head/sys/gnu/dts/arm/tegra124-jetson-tk1.dts?revision=295436&view=markup#l1380 >> "interrupts = ; " >> Do you want more examples ? > > Those have the identical format to the GPIO properties, because they > are the same thing. So it works out of the box. Do you have examples > of something that *doesn't work*? >> >>> >>>> For this reason we makes domain key composite, in our model, the >>>> domain key consist of "domain key type" >>>> and "domain key value". This composite key guarantees uniqueness >>>> and it also allows to select proper parser for byte string. >>> >>> Yes, but this solves what is a nonexistant problem by making the >>> system substantially less flexible and more invasive. Which is not a >>> good tradeoff. >>> >> I think that existence of problem is confirmed in the above example . >> Quote from previous paragraph: >> "We could solve this in a number of ways, ... , or adding another >> value (domain type, for example)." >> What can I say more ... > > Except that the example you gave *is not an example* of the problem > you are describing. You would only end up with a problem if: > 1) You had interrupts in a GPIO property rather than in an interrupts > property (or equivalent). > 2) *And* you had interrupts on GPIOs in an interrupts property (or > equivalent) > 3) *and* those are encoded differently > 4) *and* the different encodings use the same number of cells > 5) *and* are not otherwise distinguishable > > Does that ever actually happen, in the real world, on any device tree? > You could imagine any kind of messed up thing you want, but we > shouldn't structure APIs around them, especially given that the > current alternative you are proposing has real, concrete problems on > real hardware that actually exists. > Allow me to respond to this issue only. I think that this main issue, everything else looks resolvable for me (or, in worst case, can be converted to MD code). from linux/arch/arm/boot/dts/am335x-evm.dts (it's first file that I'm searched) ---------------------------------------------------------------------------------------------------------------------------- &gpmc { status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&nandflash_pins_s0>; ranges = <0 0 0x08000000 0x1000000>; /* CS0: 16MB for NAND */ nand@0,0 { compatible = "ti,omap2-nand"; reg = <0 0 4>; /* CS0, offset 0, IO size 4 */ interrupt-parent = <&gpmc>; interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */ <1 IRQ_TYPE_NONE>; /* termcount */ rb-gpios = <&gpmc 0 GPIO_ACTIVE_HIGH>; /* gpmc_wait0 */ ---------------------------------------------------------------------------------------------------------------------------- so we have rb-gpios = <&gpmc 0 GPIO_ACTIVE_HIGH>; /* gpmc_wait0 */ and interrupt-parent = <&gpmc>; interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */ --- or --- from linux/arch/arm/boot/dts/exynos5420-peach-pit.dts max98090: codec@10 { compatible = "maxim,max98090"; reg = <0x10>; interrupts = <2 0>; interrupt-parent = <&gpx0>; pinctrl-names = "default"; and sleep-gpios = <&gpx3 5 GPIO_ACTIVE_HIGH>; also, in this case, first cell in 'interrupts' property have different meaning that second cell in 'sleep-gpio'. (on exynos, not all gpios supports interrrupts) In general, binding for 'interrupts ' and '-gpios ' are different, but can have same size . Michal >> >> > > [snip] > >>>> >>>>> >>>>>> >>>>>>> >>>>>>>>> It is much easier to do this correctly at bus attach time when >>>>>>>>> the resource lists are made (how PPC does it). >>>>>>>>> >>>>>>>> I don't agree. I don't agree. Making this at bus attach time >>>>>>>> leads into complicated 'virtual' IRQ infrastructure, with many >>>>>>>> unresolved corner cases. >>>>>>> >>>>>>> Which unresolved corner cases? This has been working correctly >>>>>>> on a number of platforms in both FreeBSD and Linux for many years. >>>>>> Nope, it doesn't work for ARM yet (for GPIO interrupts for >>>>>> example) and Linux uses EPROBE_DEFER mechanism for a long time. >>>>>> See: http://lxr.free-electrons.com/source/drivers/base/platform.c#L87 >>>>> >>>>> There is some missing code on ARM (probably about 30 minutes of >>>>> work to make it match PowerPC) to make it work in an ideal case, >>>>> sure, but there is no reason you could not go out right now, with >>>>> the existing code, and implement GPIO interrupts by declaring the >>>>> GPIO driver as an interrupt controller. >>>>> >>>>> Can you give any concrete case of something that doesn't work? >>>> GPIO again. How you can allocate interrupt associated with given >>>> gpio pin installed by "cd-gpios = <&gpio TEGRA_GPIO(V, 2) >>>> GPIO_ACTIVE_LOW>;" >>> >>> You parse that as an interrupt on a interrupt domain associated with >>> the GPIO controller referenced by &gpio. In pseudo-code: >>> >>> int irq = ofw_bus_map_intr(dev, <&gpio>, ncells, >> GPIO_ACTIVE_LOW>); >>> The GPIO controller, meanwhile, has registered an interrupt domain >>> for <&gpio> and is asked to decode and configure the interrupt >>> defined by , which it knows how to >>> parse. This is simple and straightforward. >> And again and again: >> We have >> "cd-gpios = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_LOW>;" >> and >> interrupt-parent = <&gpio>; >> "interrupts = ; " >> in one tree. And we need to get a interrupt in both variants. > > Where, again, those are completely identical and there are not even > two variants, so you are presenting this an example of a problem *that > it does not exemplify*. > >> >>>>>>> I would urge, in the strongest possible terms, that this be >>>>>>> backed out from stable/11 at least. We can add the new API back >>>>>>> for 11.1 if we want it, but we totally lose the ability to >>>>>>> change it later in the stable/11 cycle if it stays in now. >>>>>>> -Nathan >>>>>>> >>>>>> The API is part of still unstable, experimental INTRNG, so its >>>>>> not fixed we we can change it at any time, I think. >>>>>> But yes, we forget to wrap new bus_map_intr() method (and >>>>>> associated code) by #ifdef INTRNG. Is this sufficient for you? >>>>> >>>>> For HEAD, yes. I would like it out of stable/11 entirely until >>>>> this discussion converges. >>>>> -Nathan >>>> The current code (in stable/11) works and is tested. I simple >>>> cannot commit any untested change for stable tree mainly if is in >>>> BETA2 stage. And I cannot fully test the requested change, at this >>>> time i have access to single ARM platform. >>>> But we're in the same situation - both have the same commit bit, >>>> neither one of us is the author of the disputed commit and neither >>>> of us are not able to fully test it. >>>> So feel free to commit what you want, if you have courage to commit >>>> untested code. I haven't it...\ >>>> Michal >>>> >>> >>> Well, the code isn't actually used anywhere in stable/11, or HEAD, >>> so it can't possibly be either tested or important for the >>> functionality of any current code. As such, I will revert from HEAD >>> on Monday and request an MFC from re@ following that if the author >>> has not appeared by that time. >>> -Nathan >> >> The code is, of course, already used by each of INTRNG enabled platforms. >> >> ------------------------------------------------------------------------------------------------------ >> diff --git a/sys/dev/ofw/ofwbus.c b/sys/dev/ofw/ofwbus.c >> index 1e048c4..14eb507 100644 >> --- a/sys/dev/ofw/ofwbus.c >> +++ b/sys/dev/ofw/ofwbus.c >> @@ -323,7 +323,7 @@ ofwbus_map_intr(device_t bus, device_t child, int >> *rid, rman_res_t *start, >> int ncells, rv; >> u_int irq; >> struct intr_map_data_fdt *fdt_data; >> - >> +printf(" *** %s: bus: %p\n", __func__, bus); >> node = ofw_bus_get_node(child); >> rv = ofw_bus_intr_by_rid(child, node, *rid, &iparent, >> &ncells, &cells); >> if (rv != 0) >> diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c >> index af3ca57..b381163 100644 >> --- a/sys/kern/subr_bus.c >> +++ b/sys/kern/subr_bus.c >> @@ -3960,6 +3960,7 @@ int >> bus_generic_map_intr(device_t dev, device_t child, int *rid, >> rman_res_t *start, >> rman_res_t *end, rman_res_t *count, struct intr_map_data **imd) >> { >> +printf(" *** %s: dev: %p\n", __func__, dev); >> /* Propagate up the bus hierarchy until someone handles it. */ >> if (dev->parent) >> return (BUS_MAP_INTR(dev->parent, child, rid, start, >> end, count, >> --------------------------------------------------------------------------------------------------- >> Result: >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** bus_generic_map_intr: dev: 0xc4ce5780 >> *** bus_generic_map_intr: dev: 0xc4ce0980 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** bus_generic_map_intr: dev: 0xc4e52080 >> *** bus_generic_map_intr: dev: 0xc4e52480 >> *** bus_generic_map_intr: dev: 0xc4e52780 >> *** bus_generic_map_intr: dev: 0xc4ce1500 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** bus_generic_map_intr: dev: 0xc4ce0300 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> *** ofwbus_map_intr: bus: 0xc4ce1880 >> >> So its hard to say that code is unused. >> >> And, just for info, last "clean in PPC way" is initial commit INTRNG >> at r289529 (9 months ago). >> Michal >> >> > > Ah, I see, it is called from bus_extend_resource(). Could you describe > this one? It takes an arbitrary resource, but only actually works on > interrupts and seems to be called from #ifdef-ed parts of the MI > bus_alloc_resource(). Could you describe what is going on here some > more? There doesn't appear to be any documentation of any of this. > > This will make this much harder to untangle, unfortunately, and > probably means we are stuck with this as a rump API in stable/11. > -Nathan > > From owner-svn-src-head@freebsd.org Sun Jul 24 18:04: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 EDB07BA3F09; Sun, 24 Jul 2016 18:04:13 +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 A5C261538; Sun, 24 Jul 2016 18:04:13 +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 u6OI4C0C092845; Sun, 24 Jul 2016 18:04:12 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6OI4CIG092843; Sun, 24 Jul 2016 18:04:12 GMT (envelope-from br@FreeBSD.org) Message-Id: <201607241804.u6OI4CIG092843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Sun, 24 Jul 2016 18:04:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303271 - in head: share/mk 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.22 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, 24 Jul 2016 18:04:14 -0000 Author: br Date: Sun Jul 24 18:04:12 2016 New Revision: 303271 URL: https://svnweb.freebsd.org/changeset/base/303271 Log: Fix style. Modified: head/share/mk/bsd.sys.mk head/sys/conf/kern.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Sun Jul 24 17:07:39 2016 (r303270) +++ head/share/mk/bsd.sys.mk Sun Jul 24 18:04:12 2016 (r303271) @@ -111,12 +111,30 @@ CWARNFLAGS+= -Wno-format # GCC 5.2.0 .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 50200 -CWARNFLAGS+= -Wno-error=unused-function -Wno-error=enum-compare -Wno-error=logical-not-parentheses -Wno-error=bool-compare -Wno-error=uninitialized -Wno-error=array-bounds -Wno-error=clobbered -Wno-error=cast-align -Wno-error=extra -Wno-error=attributes -Wno-error=inline -Wno-error=unused-but-set-variable -Wno-error=unused-value -Wno-error=strict-aliasing -Wno-error=address +CWARNFLAGS+= -Wno-error=address \ + -Wno-error=array-bounds \ + -Wno-error=attributes \ + -Wno-error=bool-compare \ + -Wno-error=cast-align \ + -Wno-error=clobbered \ + -Wno-error=enum-compare \ + -Wno-error=extra \ + -Wno-error=inline \ + -Wno-error=logical-not-parentheses \ + -Wno-error=strict-aliasing \ + -Wno-error=uninitialized \ + -Wno-error=unused-but-set-variable \ + -Wno-error=unused-function \ + -Wno-error=unused-value .endif # GCC 6.1.0 .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100 -CWARNFLAGS+= -Wno-error=unused-const-variable= -Wno-error=nonnull-compare -Wno-error=shift-negative-value -Wno-error=misleading-indentation -Wno-error=tautological-compare +CWARNFLAGS+= -Wno-error=misleading-indentation \ + -Wno-error=nonnull-compare \ + -Wno-error=shift-negative-value \ + -Wno-error=tautological-compare \ + -Wno-error=unused-const-variable .endif # How to handle FreeBSD custom printf format specifiers. Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Sun Jul 24 17:07:39 2016 (r303270) +++ head/sys/conf/kern.mk Sun Jul 24 18:04:12 2016 (r303271) @@ -51,7 +51,7 @@ CWARNEXTRA?= -Wno-error=inline -Wno-erro -Wno-error=cast-qual -Wno-error=sequence-point -Wno-error=attributes \ -Wno-error=strict-overflow -Wno-error=overflow .if ${COMPILER_VERSION} >= 60100 -CWARNEXTRA+= -Wno-error=nonnull-compare -Wno-error=shift-overflow= +CWARNEXTRA+= -Wno-error=nonnull-compare -Wno-error=shift-overflow .endif .else # For gcc 4.2, eliminate the too-often-wrong warnings about uninitialized vars. From owner-svn-src-head@freebsd.org Sun Jul 24 18:05: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 F284EBA3F83; Sun, 24 Jul 2016 18:05:06 +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 D002E16B5; Sun, 24 Jul 2016 18:05:06 +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 u6OI56LH092926; Sun, 24 Jul 2016 18:05:06 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6OI55np092924; Sun, 24 Jul 2016 18:05:05 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201607241805.u6OI55np092924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 24 Jul 2016 18:05:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303272 - 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.22 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, 24 Jul 2016 18:05:07 -0000 Author: bdrewery Date: Sun Jul 24 18:05:05 2016 New Revision: 303272 URL: https://svnweb.freebsd.org/changeset/base/303272 Log: SYSTEM_COMPILER: Rework the logic to allow a 'make test-system-compiler'. 1. Always calculate what the expected values are. 2. Add 'make test-system-compiler' to show all of the computed values vs the wanted values. 3. Extend the .info line to buildkernel/kernel-toolchain/toolchain/_cross-tools. 4. Consolidate all of the logic to one condition. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile head/Makefile.inc1 Modified: head/Makefile ============================================================================== --- head/Makefile Sun Jul 24 18:04:12 2016 (r303271) +++ head/Makefile Sun Jul 24 18:05:05 2016 (r303272) @@ -131,7 +131,8 @@ TGTS= all all-man buildenv buildenvvars builddtb xdev xdev-build xdev-install \ xdev-links native-xtools stageworld stagekernel stage-packages \ create-world-packages create-kernel-packages create-packages \ - packages installconfig real-packages sign-packages package-pkg + packages installconfig real-packages sign-packages package-pkg \ + test-system-compiler # XXX: r156740: This can't work since bsd.subdir.mk is not included ever. # It will only work for SUBDIR_TARGETS in make.conf. @@ -151,7 +152,8 @@ TGTS+= ${BITGTS} META_TGT_WHITELIST+= \ _* build32 buildfiles buildincludes buildkernel buildsoft \ buildworld everything kernel-toolchain kernel-toolchains kernel \ - kernels libraries native-xtools showconfig tinderbox toolchain \ + kernels libraries native-xtools showconfig test-system-compiler \ + tinderbox toolchain \ toolchains universe world worlds xdev xdev-build .ORDER: buildworld installworld Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Jul 24 18:04:12 2016 (r303271) +++ head/Makefile.inc1 Sun Jul 24 18:05:05 2016 (r303272) @@ -82,50 +82,66 @@ MK_CROSS_COMPILER= no .include "share/mk/src.opts.mk" # Check if there is a local compiler that can satisfy as an external compiler. -.if ${MK_SYSTEM_COMPILER} == "yes" && ${MK_CROSS_COMPILER} == "yes" && \ - (${MK_CLANG_BOOTSTRAP} == "yes" || ${MK_GCC_BOOTSTRAP} == "yes") && \ - !make(showconfig) && !make(native-xtools) && !make(xdev*) # Which compiler is expected to be used? .if ${MK_CLANG_BOOTSTRAP} == "yes" -_expected_compiler_type= clang +WANT_COMPILER_TYPE= clang .elif ${MK_GCC_BOOTSTRAP} == "yes" -_expected_compiler_type= gcc +WANT_COMPILER_TYPE= gcc .endif -# If the expected vs CC is different then we can't skip. -# GCC cannot be used for cross-arch yet. For clang we pass -target later if -# TARGET_ARCH!=MACHINE_ARCH. -.if ${_expected_compiler_type} == ${COMPILER_TYPE} && \ - (${COMPILER_TYPE} == "clang" || ${TARGET_ARCH} == ${MACHINE_ARCH}) -# It needs to be the same revision as we would build for the bootstrap. -.if !defined(CROSS_COMPILER_FREEBSD_VERSION) -.if ${_expected_compiler_type} == "clang" -CROSS_COMPILER_FREEBSD_VERSION!= \ +.if !defined(WANT_COMPILER_FREEBSD_VERSION) +.if ${WANT_COMPILER_TYPE} == "clang" +WANT_COMPILER_FREEBSD_VERSION_FILE= lib/clang/freebsd_cc_version.h +WANT_COMPILER_FREEBSD_VERSION!= \ awk '$$2 == "FREEBSD_CC_VERSION" {printf("%d\n", $$3)}' \ - ${SRCDIR}/lib/clang/freebsd_cc_version.h || echo unknown -CROSS_COMPILER_VERSION!= \ + ${SRCDIR}/${WANT_COMPILER_FREEBSD_VERSION_FILE} || echo unknown +WANT_COMPILER_VERSION_FILE= lib/clang/include/clang/Basic/Version.inc +WANT_COMPILER_VERSION!= \ awk '$$2 == "CLANG_VERSION" {split($$3, a, "."); print a[1] * 10000 + a[2] * 100 + a[3]}' \ - ${SRCDIR}/lib/clang/include/clang/Basic/Version.inc || echo unknown -.elif ${_expected_compiler_type} == "gcc" -CROSS_COMPILER_FREEBSD_VERSION!= \ + ${SRCDIR}/${WANT_COMPILER_VERSION_FILE} || echo unknown +.elif ${WANT_COMPILER_TYPE} == "gcc" +WANT_COMPILER_FREEBSD_VERSION_FILE= gnu/usr.bin/cc/cc_tools/freebsd-native.h +WANT_COMPILER_FREEBSD_VERSION!= \ awk '$$2 == "FBSD_CC_VER" {printf("%d\n", $$3)}' \ - ${SRCDIR}/gnu/usr.bin/cc/cc_tools/freebsd-native.h || echo unknown -CROSS_COMPILER_VERSION!= \ + ${SRCDIR}/${WANT_COMPILER_FREEBSD_VERSION_FILE} || echo unknown +WANT_COMPILER_VERSION_FILE= contrib/gcc/BASE-VER +WANT_COMPILER_VERSION!= \ awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3}' \ - ${SRCDIR}/contrib/gcc/BASE-VER || echo unknown + ${SRCDIR}/${WANT_COMPILER_VERSION_FILE} || echo unknown .endif -.export CROSS_COMPILER_FREEBSD_VERSION CROSS_COMPILER_VERSION -.endif # !defined(CROSS_COMPILER_FREEBSD_VERSION) -.if ${COMPILER_VERSION} == ${CROSS_COMPILER_VERSION} && \ - ${COMPILER_FREEBSD_VERSION} == ${CROSS_COMPILER_FREEBSD_VERSION} +.export WANT_COMPILER_FREEBSD_VERSION WANT_COMPILER_VERSION +.endif # !defined(WANT_COMPILER_FREEBSD_VERSION) +# It needs to be the same revision as we would build for the bootstrap. +# If the expected vs CC is different then we can't skip. +# GCC cannot be used for cross-arch yet. For clang we pass -target later if +# TARGET_ARCH!=MACHINE_ARCH. +.if ${MK_SYSTEM_COMPILER} == "yes" && ${MK_CROSS_COMPILER} == "yes" && \ + (${MK_CLANG_BOOTSTRAP} == "yes" || ${MK_GCC_BOOTSTRAP} == "yes") && \ + !make(showconfig) && !make(native-xtools) && !make(xdev*) && \ + ${WANT_COMPILER_TYPE} == ${COMPILER_TYPE} && \ + (${COMPILER_TYPE} == "clang" || ${TARGET_ARCH} == ${MACHINE_ARCH}) && \ + ${COMPILER_VERSION} == ${WANT_COMPILER_VERSION} && \ + ${COMPILER_FREEBSD_VERSION} == ${WANT_COMPILER_FREEBSD_VERSION} # Everything matches, disable the bootstrap compiler. MK_CLANG_BOOTSTRAP= no MK_GCC_BOOTSTRAP= no -.if make(buildworld) +USING_SYSTEM_COMPILER= yes +.endif # ${WANT_COMPILER_TYPE} == ${COMPILER_TYPE} +USING_SYSTEM_COMPILER?= no +TEST_SYSTEM_COMPILER_VARS= \ + USING_SYSTEM_COMPILER MK_SYSTEM_COMPILER \ + MK_CROSS_COMPILER MK_CLANG_BOOTSTRAP MK_GCC_BOOTSTRAP \ + WANT_COMPILER_TYPE WANT_COMPILER_VERSION WANT_COMPILER_VERSION_FILE \ + WANT_COMPILER_FREEBSD_VERSION WANT_COMPILER_FREEBSD_VERSION_FILE \ + CC COMPILER_TYPE COMPILER_VERSION COMPILER_FREEBSD_VERSION +test-system-compiler: .PHONY +.for v in ${TEST_SYSTEM_COMPILER_VARS} + ${_+_}@printf "%-35s= %s\n" "${v}" "${${v}}" +.endfor +.if ${USING_SYSTEM_COMPILER} == "yes" && \ + (make(buildworld) || make(buildkernel) || make(kernel-toolchain) || \ + make(toolchain) || make(_cross-tools)) .info SYSTEM_COMPILER: Determined that CC=${CC} matches the source tree. Not bootstrapping a cross-compiler. .endif -.endif # ${COMPILER_VERSION} == ${CROSS_COMPILER_VERSION} -.endif # ${_expected_compiler_type} == ${COMPILER_TYPE} -.endif # ${XCC:N${CCACHE_BIN}:M/*} # For installworld need to ensure that the looked-up compiler metadata is # passed along rather than trying to run cc from the restricted From owner-svn-src-head@freebsd.org Sun Jul 24 18:28: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 C6135BA1639; Sun, 24 Jul 2016 18:28:15 +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 965C411C4; Sun, 24 Jul 2016 18:28:15 +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 u6OISEuq000376; Sun, 24 Jul 2016 18:28:14 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6OISE5j000375; Sun, 24 Jul 2016 18:28:14 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201607241828.u6OISE5j000375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 24 Jul 2016 18:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303273 - 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.22 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, 24 Jul 2016 18:28:15 -0000 Author: bdrewery Date: Sun Jul 24 18:28:14 2016 New Revision: 303273 URL: https://svnweb.freebsd.org/changeset/base/303273 Log: Fix empty WANT_COMPILER_TYPE when neither compiler is bootstrapped. Bug in r303272. MFC after: 3 days X-MFC-With: r303272 Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Jul 24 18:05:05 2016 (r303272) +++ head/Makefile.inc1 Sun Jul 24 18:28:14 2016 (r303273) @@ -87,6 +87,8 @@ MK_CROSS_COMPILER= no WANT_COMPILER_TYPE= clang .elif ${MK_GCC_BOOTSTRAP} == "yes" WANT_COMPILER_TYPE= gcc +.else +WANT_COMPILER_TYPE= .endif .if !defined(WANT_COMPILER_FREEBSD_VERSION) .if ${WANT_COMPILER_TYPE} == "clang" From owner-svn-src-head@freebsd.org Sun Jul 24 18:48: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 5A626BA1A0E; Sun, 24 Jul 2016 18:48:36 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x244.google.com (mail-it0-x244.google.com [IPv6:2607:f8b0:4001:c0b::244]) (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 170881AC2; Sun, 24 Jul 2016 18:48:36 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x244.google.com with SMTP id f6so6280758ith.2; Sun, 24 Jul 2016 11:48:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:message-id:subject:to:cc; bh=Nmf7rnZcEO64yIpAR61ZIvtM4iaaOwaEsT8+q0KNOpI=; b=ZebUpuak1scR+qOc3+eTyl8b6A3T+7XmaDobblJK5A+6qy+x0ThIqyLuiFudzOHdv5 cWury5mV0yDoa3lFlGFIPLbio1u4HXY4LHmeMAEg4+eT136rBzya9hj+v4LEZMYOXC3d IoaX01kSkgZM9Z11rWvtT1CljRY4RkQMcLxxbuuVw6Z4REi4GVyxTSpO0paF/jcWOh8v SctbmnibLv+m6MK4r3Nd/qb2zFT1qNjrYTQvFw9nm8pUQ1UhnEWANAQHtXnjr4TA1KKp K7ZxWbxxbCYnUv51u1+22OJf/w6oYd917zQdiCxy7KWVoEb7vXxkCauAZOzWT+BJd7pl VZPA== 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:from:date:message-id:subject :to:cc; bh=Nmf7rnZcEO64yIpAR61ZIvtM4iaaOwaEsT8+q0KNOpI=; b=gwqLtpAF69dSrxRGvtxpPFZI39OV/HTqBfrDNOiq70WMb/8wRh9Rkw/z0GvEw/Emky egBJ1Oe2DI9Ds34Wb6c2M74qdE7VSJTrAKxz+qt1lcywRgakwDDcenIBQH4Q9rI2YK86 Pq5v8aZ6w6QzqEM4g5wl5U0pgQICDYfNisqnTYDHB9gFC533NzlfLhtnqfkHRxYWMIJP Z184ZnrFcW4KHNkuiaX3bYTBWQiw3EoXhtLG5nCQKqe7Gn6UrfT13fwpAp0v0Vq47jP1 WWDdnw8bCWGmk6TjmjFVKA347JVW6dzI2zzsr+wD7YDErwihSOQlD9S8Qma0AWLyYDPD uEuQ== X-Gm-Message-State: ALyK8tIykUH31Ae1VCo2FmD92qwRIauLms9NqZN4bl1t7Q0QkyqPReYAoMe/hwdM5Y+gR5ZoS1mcjOrrK4LDjQ== X-Received: by 10.36.150.70 with SMTP id z67mr53606780itd.80.1469386115328; Sun, 24 Jul 2016 11:48:35 -0700 (PDT) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.36.141.129 with HTTP; Sun, 24 Jul 2016 11:48:34 -0700 (PDT) From: Adrian Chadd Date: Sun, 24 Jul 2016 11:48:34 -0700 X-Google-Sender-Auth: isEh3Jzx09f8ZjvTsCEChlRvIkk Message-ID: Subject: Re: svn commit: r301453 - in head/sys: arm/arm arm64/arm64 dev/fdt dev/gpio dev/iicbus dev/ofw dev/pci dev/vnic kern mips/mips sys To: Michal Meloun Cc: Nathan Whitehorn , Svatopluk Kraus , "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.22 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, 24 Jul 2016 18:48:36 -0000 [snip] Hi, I think a lot of this whole discussion stems from a reasonably unclear shared idea of where intrng is supposed to be going and what it's supposed to be doing. I'm sure everyone has their own ideas of what it is for their own needs, but this thread shows a clear separation between the original writers and people working on supporting their own platforms. So, my suggestion - also so I can understand it, since I kinda need it now for the atheros mips ports! - is maybe something gets written up in the wiki that's a more detailed technical overview of intrng, including the problems its trying to solve. Then, instead of flinging things around on the commit mailing list, people edit the wiki and discuss on -arm about the specific details. I think that'll avoid a lot of what's going on. (And honestly, I'd like it more sorted out sooner rather than later, as I really want to start attacking the QCA ARM ports (IPQ4019) if it's not already done, and that's all interrupt/gpio/etc gymnastics we need INTRNG for.) So, Nathan, wanna start a wiki page with the /current/ implementation that's in -HEAD and what the intention was from the PPC side? -adrian From owner-svn-src-head@freebsd.org Sun Jul 24 18: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 4BAE3BA1B8F; Sun, 24 Jul 2016 18:50:12 +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 298031C8B; Sun, 24 Jul 2016 18:50:12 +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 u6OIoB04007868; Sun, 24 Jul 2016 18:50:11 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6OIoBgg007866; Sun, 24 Jul 2016 18:50:11 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201607241850.u6OIoBgg007866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 24 Jul 2016 18:50:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303274 - 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.22 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, 24 Jul 2016 18:50:12 -0000 Author: bdrewery Date: Sun Jul 24 18:50:11 2016 New Revision: 303274 URL: https://svnweb.freebsd.org/changeset/base/303274 Log: Don't disable binutils/elftoolchain bootstrapping with external compiler. This was a regression from r300349. Setting MK_CROSS_COMPILER=no forces the compiler bootstraping *and* the binutils/elftoolchain bootstrapping to be disabled in share/mk/src.opts.mk. The only intent with using an external compiler is to disable bootstrapping of the compiler. The binutils/elftoolchain bootstrapping must still occur unless XAS is set. This did not affect WITH_SYSTEM_COMPILER. Now that setting an external compiler sets both MK_CLANG_BOOTSTRAP and MK_GCC_BOOTSTRAP to no, and MK_CROSS_COMPILER does the same via share/mk/src/opts.mk, remove redundant logic that checks for MK_CROSS_COMPILER. It will not always be true now that MK_CROSS_COMPILER==no when an external compiler is used and --sysroot/-target is needed. Reported by: sbruno Pointyhat to: bdrewery MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 head/Makefile.libcompat Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Jul 24 18:28:14 2016 (r303273) +++ head/Makefile.inc1 Sun Jul 24 18:50:11 2016 (r303274) @@ -74,7 +74,8 @@ X${COMPILER}?= ${${COMPILER}} # If a full path to an external cross compiler is given, don't build # a cross compiler. .if ${XCC:N${CCACHE_BIN}:M/*} -MK_CROSS_COMPILER= no +MK_CLANG_BOOTSTRAP= no +MK_GCC_BOOTSTRAP= no .endif # Pull in COMPILER_TYPE and COMPILER_FREEBSD_VERSION early. @@ -116,7 +117,7 @@ WANT_COMPILER_VERSION!= \ # If the expected vs CC is different then we can't skip. # GCC cannot be used for cross-arch yet. For clang we pass -target later if # TARGET_ARCH!=MACHINE_ARCH. -.if ${MK_SYSTEM_COMPILER} == "yes" && ${MK_CROSS_COMPILER} == "yes" && \ +.if ${MK_SYSTEM_COMPILER} == "yes" && \ (${MK_CLANG_BOOTSTRAP} == "yes" || ${MK_GCC_BOOTSTRAP} == "yes") && \ !make(showconfig) && !make(native-xtools) && !make(xdev*) && \ ${WANT_COMPILER_TYPE} == ${COMPILER_TYPE} && \ @@ -550,8 +551,7 @@ BFLAGS+= -B${CROSS_BINUTILS_PREFIX} .endif # External compiler needs sysroot and target flags. -.if ${MK_CROSS_COMPILER} == "no" || \ - (${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no") +.if ${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no" .if !defined(CROSS_BINUTILS_PREFIX) || !exists(${CROSS_BINUTILS_PREFIX}) BFLAGS+= -B${WORLDTMP}/usr/bin .endif @@ -579,7 +579,7 @@ TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x8 XCFLAGS+= -target ${TARGET_TRIPLE} .endif XCFLAGS+= --sysroot=${WORLDTMP} -.endif # ${MK_CROSS_COMPILER} == "no" +.endif # ${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no" .if !empty(BFLAGS) XCFLAGS+= ${BFLAGS} @@ -1820,7 +1820,6 @@ _elftctools= lib/libelftc \ usr.bin/elfcopy .endif -.if ${MK_CROSS_COMPILER} != "no" .if ${MK_CLANG_BOOTSTRAP} != "no" _clang= usr.bin/clang _clang_libs= lib/clang @@ -1828,7 +1827,6 @@ _clang_libs= lib/clang .if ${MK_GCC_BOOTSTRAP} != "no" _cc= gnu/usr.bin/cc .endif -.endif .if ${MK_USB} != "no" _usb_tools= sys/boot/usb/tools .endif Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Sun Jul 24 18:28:14 2016 (r303273) +++ head/Makefile.libcompat Sun Jul 24 18:50:11 2016 (r303274) @@ -81,8 +81,8 @@ LIBCOMPATCFLAGS+= -B${LIBCOMPATTMP}/usr/ LIBCOMPATCFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include # Force using libc++ for external GCC. # XXX: This should be checking MK_GNUCXX == no -.if ${X_COMPILER_VERSION} >= 40800 && (${MK_CROSS_COMPILER} == "no" || \ - (${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no")) +.if ${X_COMPILER_VERSION} >= 40800 && \ + (${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no") LIBCOMPATCXXFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include/c++/v1 -std=c++11 \ -nostdinc++ -L${LIBCOMPAT_OBJTREE}${.CURDIR}/lib/libc++ .endif From owner-svn-src-head@freebsd.org Sun Jul 24 20:44: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 990F2BA3DBA; Sun, 24 Jul 2016 20:44:33 +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 81CA91E08; Sun, 24 Jul 2016 20:44:32 +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 u6OKiV59038456 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 24 Jul 2016 13:44:31 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u6OKiVrC038455; Sun, 24 Jul 2016 13:44:31 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Sun, 24 Jul 2016 13:44:31 -0700 From: Gleb Smirnoff To: Andrey Chernov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303264 - head/usr.bin/calendar/calendars/ru_RU.UTF-8 Message-ID: <20160724204431.GM1076@FreeBSD.org> References: <201607241035.u6OAZijR023467@repo.freebsd.org> <76ecf576-3b05-9a58-9c58-6b45f49b7286@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <76ecf576-3b05-9a58-9c58-6b45f49b7286@freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 24 Jul 2016 20:44:33 -0000 Andrey, thanks, I will fix that. Trusting script and not checking results was stupid. On Sun, Jul 24, 2016 at 06:16:26PM +0300, Andrey Chernov wrote: A> What happens with the lines below? A> A> On 24.07.2016 13:35, Gleb Smirnoff wrote: A> > Modified: head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.orthodox A> > -Пасха-7 Вход Господень в Иерусалим. Вербное Воскресенье A> > +Пасха-7 Вход Господень в Иерусалим. Вербное Воскресент.ье A> > +Пасха Воскресент.ие Христово A> > +Пасха+39 Вознесент.ие A> A> > Modified: head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan A> > -14 мар Новый Год, Овсень малый A> > +14 марта Новый Год, Овсент.ь малый A> > -20 мар* Весенние равноденствие A> > - 7 апр День Марены (сдвинутое весеннее равноденствие) A> > +20 марта* Весент.ние равноденствие A> > + 7 апр. День Марены (сдвинутое весент.нее равноденствие) A> > + 6 мая День Дажьбога, Овсент.ь большой A> -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Sun Jul 24 20: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 6D34FBA3E58; Sun, 24 Jul 2016 20:47:58 +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 2E8D1114D; Sun, 24 Jul 2016 20:47:58 +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 u6OKlvv7052870; Sun, 24 Jul 2016 20:47:57 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6OKlvBg052868; Sun, 24 Jul 2016 20:47:57 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201607242047.u6OKlvBg052868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 24 Jul 2016 20:47:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303277 - head/usr.bin/calendar/calendars/ru_RU.UTF-8 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.22 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, 24 Jul 2016 20:47:58 -0000 Author: glebius Date: Sun Jul 24 20:47:57 2016 New Revision: 303277 URL: https://svnweb.freebsd.org/changeset/base/303277 Log: Fix failures of scripted conversion. Noticed by: ache Pointy hat to: glebius Modified: head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.orthodox head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan Modified: head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.orthodox ============================================================================== --- head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.orthodox Sun Jul 24 20:43:02 2016 (r303276) +++ head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.orthodox Sun Jul 24 20:47:57 2016 (r303277) @@ -19,11 +19,11 @@ Paskha=Пасха 19 янв. Богоявление или Крещение Господне 15 февр. Сретение Господне Пасха-48 Великий Пост -Пасха-7 Вход Господень в Иерусалим. Вербное Воскресент.ье +Пасха-7 Вход Господень в Иерусалим. Вербное Воскресенье Пасха-3 Великий Четверг Пасха-2 Страстная Пятница -Пасха Воскресент.ие Христово -Пасха+39 Вознесент.ие +Пасха Воскресение Христово +Пасха+39 Вознесение Пасха+49 День Святой Троицы. Пятидесятница 7 апр. Благовещение Пресвятой Богородицы 7 июля Рождество Иоанна Предтечи Modified: head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan ============================================================================== --- head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan Sun Jul 24 20:43:02 2016 (r303276) +++ head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan Sun Jul 24 20:47:57 2016 (r303277) @@ -16,13 +16,13 @@ Paskha=Пасха 24 февр. День Велеса 29 февр. День Кащея 1 марта День Марены -14 марта Новый Год, Овсент.ь малый +14 марта Новый Год, Овсень малый Пасха-55 Масленица Пасха+7 Красная Горка Пасха+16 Радуница -20 марта* Весент.ние равноденствие - 7 апр. День Марены (сдвинутое весент.нее равноденствие) - 6 мая День Дажьбога, Овсент.ь большой +20 марта* Весеннее равноденствие + 7 апр. День Марены (сдвинутое весеннее равноденствие) + 6 мая День Дажьбога, Овсень большой 22 мая Ярилин День 15 июня День Триглава 21 июня* Летнее солнцестояние From owner-svn-src-head@freebsd.org Sun Jul 24 22:30: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 A606FBA3122; Sun, 24 Jul 2016 22:30:33 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (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 90B391DAE; Sun, 24 Jul 2016 22:30:33 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (75-101-50-44.static.sonic.net [75.101.50.44]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u6OMUUWb006969 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sun, 24 Jul 2016 15:30:31 -0700 Subject: Re: svn commit: r301453 - in head/sys: arm/arm arm64/arm64 dev/fdt dev/gpio dev/iicbus dev/ofw dev/pci dev/vnic kern mips/mips sys To: Adrian Chadd , Michal Meloun References: Cc: Svatopluk Kraus , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Nathan Whitehorn Message-ID: Date: Sun, 24 Jul 2016 15:30:30 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVYYCl8yo2QZAdO5/oQMzTZ8mDP5sYWLodHaRXMGRI/Bp0p8B4Lo+nztEMOPSrDcX3JtDVuV+aY6KyyyRSnHMuVwKHFmHyHPMcY= X-Sonic-ID: C;jol2Ou5R5hGjE5tMTlz00w== M;dlTSOu5R5hGjE5tMTlz00w== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 24 Jul 2016 22:30:33 -0000 That's a good idea, Adrian. I've made a wiki page at https://wiki.freebsd.org/Complicated_Interrupts describing this and moved the discussion to freebsd-arch@ -Nathan On 07/24/16 11:48, Adrian Chadd wrote: > [snip] > > Hi, > > I think a lot of this whole discussion stems from a reasonably unclear > shared idea of where intrng is supposed to be going and what it's > supposed to be doing. I'm sure everyone has their own ideas of what it > is for their own needs, but this thread shows a clear separation > between the original writers and people working on supporting their > own platforms. > > So, my suggestion - also so I can understand it, since I kinda need it > now for the atheros mips ports! - is maybe something gets written up > in the wiki that's a more detailed technical overview of intrng, > including the problems its trying to solve. Then, instead of flinging > things around on the commit mailing list, people edit the wiki and > discuss on -arm about the specific details. > > I think that'll avoid a lot of what's going on. > > (And honestly, I'd like it more sorted out sooner rather than later, > as I really want to start attacking the QCA ARM ports (IPQ4019) if > it's not already done, and that's all interrupt/gpio/etc gymnastics we > need INTRNG for.) > > So, Nathan, wanna start a wiki page with the /current/ implementation > that's in -HEAD and what the intention was from the PPC side? > > > > -adrian > From owner-svn-src-head@freebsd.org Sun Jul 24 23:40: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 0BC76BA3FC6; Sun, 24 Jul 2016 23:40:35 +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 CF7D418CE; Sun, 24 Jul 2016 23:40:34 +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 u6ONeYXj015721; Sun, 24 Jul 2016 23:40:34 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6ONeYwD015720; Sun, 24 Jul 2016 23:40:34 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201607242340.u6ONeYwD015720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 24 Jul 2016 23:40:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303279 - head/contrib/elftoolchain/libelftc 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.22 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, 24 Jul 2016 23:40:35 -0000 Author: emaste Date: Sun Jul 24 23:40:33 2016 New Revision: 303279 URL: https://svnweb.freebsd.org/changeset/base/303279 Log: libelftc: fix demangling of wchar_t "wchar_t" is 7 characters long, not 6. PR: 208661 Submitted by: Daniel McRobb Obtained from: ELF Tool Chain r3480 MFC after: 3 days Modified: head/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c Modified: head/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c ============================================================================== --- head/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c Sun Jul 24 20:54:30 2016 (r303278) +++ head/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c Sun Jul 24 23:40:33 2016 (r303279) @@ -2551,7 +2551,7 @@ again: case 'w': /* wchar_t */ - if (!cpp_demangle_push_str(ddata, "wchar_t", 6)) + if (!cpp_demangle_push_str(ddata, "wchar_t", 7)) goto clean; ++ddata->cur; goto rtn; From owner-svn-src-head@freebsd.org Mon Jul 25 00:49: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 71B3DBA32D4; Mon, 25 Jul 2016 00:49:28 +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 3E6E0173C; Mon, 25 Jul 2016 00:49:28 +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 u6P0nRbs041503; Mon, 25 Jul 2016 00:49:27 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6P0nR5k041502; Mon, 25 Jul 2016 00:49:27 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201607250049.u6P0nR5k041502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 25 Jul 2016 00:49:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303282 - head/sys/modules 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.22 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, 25 Jul 2016 00:49:28 -0000 Author: emaste Date: Mon Jul 25 00:49:27 2016 New Revision: 303282 URL: https://svnweb.freebsd.org/changeset/base/303282 Log: avoid building otusfw when WITHOUT_SOURCELESS_UCODE set PR: 204748 Submitted by: Fabian Keil Obtained from: ElectroBSD MFC after: 1 week Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Jul 25 00:46:45 2016 (r303281) +++ head/sys/modules/Makefile Mon Jul 25 00:49:27 2016 (r303282) @@ -279,7 +279,7 @@ SUBDIR= \ ${_nxge} \ oce \ otus \ - otusfw \ + ${_otusfw} \ ow \ ${_padlock} \ ${_padlock_rng} \ @@ -498,6 +498,7 @@ _fatm= fatm _fxp= fxp _ispfw= ispfw _mwlfw= mwlfw +_otusfw= otusfw _ralfw= ralfw _rtwnfw= rtwnfw _urtwnfw= urtwnfw From owner-svn-src-head@freebsd.org Mon Jul 25 03:12: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 BCA79BA4E68; Mon, 25 Jul 2016 03:12:42 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EBA9123C; Mon, 25 Jul 2016 03:12:42 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6P3CfCU097107; Mon, 25 Jul 2016 03:12:41 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6P3CfAx097099; Mon, 25 Jul 2016 03:12:41 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201607250312.u6P3CfAx097099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 25 Jul 2016 03:12:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303283 - in head/sys/dev/hyperv: netvsc vmbus 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.22 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, 25 Jul 2016 03:12:42 -0000 Author: sephe Date: Mon Jul 25 03:12:40 2016 New Revision: 303283 URL: https://svnweb.freebsd.org/changeset/base/303283 Log: hyperv/vmbus: Rename hv_vmbus_priv.h to vmbus_brvar.h It only contains bufring related bits for a while. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D7281 Added: head/sys/dev/hyperv/vmbus/vmbus_brvar.h - copied unchanged from r303282, head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Deleted: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/vmbus/hv_ring_buffer.c head/sys/dev/hyperv/vmbus/hyperv.c head/sys/dev/hyperv/vmbus/hyperv_reg.h head/sys/dev/hyperv/vmbus/vmbus.c head/sys/dev/hyperv/vmbus/vmbus_chan.c Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Jul 25 00:49:27 2016 (r303282) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Jul 25 03:12:40 2016 (r303283) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include "hv_net_vsc.h" #include "hv_rndis.h" #include "hv_rndis_filter.h" Modified: head/sys/dev/hyperv/vmbus/hv_ring_buffer.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Mon Jul 25 00:49:27 2016 (r303282) +++ head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Mon Jul 25 03:12:40 2016 (r303283) @@ -31,8 +31,8 @@ #include #include -#include "hv_vmbus_priv.h" #include +#include /* Amount of space to write to */ #define HV_BYTES_AVAIL_TO_WRITE(r, w, z) \ Modified: head/sys/dev/hyperv/vmbus/hyperv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hyperv.c Mon Jul 25 00:49:27 2016 (r303282) +++ head/sys/dev/hyperv/vmbus/hyperv.c Mon Jul 25 03:12:40 2016 (r303283) @@ -43,12 +43,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include -#include #include #include #include +#if 0 #include +#endif #define HYPERV_FREEBSD_BUILD 0ULL #define HYPERV_FREEBSD_VERSION ((uint64_t)__FreeBSD_version) Modified: head/sys/dev/hyperv/vmbus/hyperv_reg.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hyperv_reg.h Mon Jul 25 00:49:27 2016 (r303282) +++ head/sys/dev/hyperv/vmbus/hyperv_reg.h Mon Jul 25 03:12:40 2016 (r303283) @@ -30,6 +30,7 @@ #define _HYPERV_REG_H_ #include +#include /* * Hyper-V Synthetic MSRs Modified: head/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus.c Mon Jul 25 00:49:27 2016 (r303282) +++ head/sys/dev/hyperv/vmbus/vmbus.c Mon Jul 25 03:12:40 2016 (r303283) @@ -60,11 +60,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include #include +#include #include #include "acpi_if.h" Copied: head/sys/dev/hyperv/vmbus/vmbus_brvar.h (from r303282, head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/vmbus/vmbus_brvar.h Mon Jul 25 03:12:40 2016 (r303283, copy of r303282, head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h) @@ -0,0 +1,85 @@ +/*- + * Copyright (c) 2009-2012,2016 Microsoft Corp. + * Copyright (c) 2012 NetApp Inc. + * Copyright (c) 2012 Citrix 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __HYPERV_PRIV_H__ +#define __HYPERV_PRIV_H__ + +#include +#include +#include +#include +#include + +#include + +struct vmbus_softc; + +/* + * Private, VM Bus functions + */ +struct sysctl_ctx_list; +struct sysctl_oid; + +void vmbus_br_sysctl_create(struct sysctl_ctx_list *ctx, + struct sysctl_oid *br_tree, hv_vmbus_ring_buffer_info *br, + const char *name); + +int hv_vmbus_ring_buffer_init( + hv_vmbus_ring_buffer_info *ring_info, + void *buffer, + uint32_t buffer_len); + +void hv_ring_buffer_cleanup( + hv_vmbus_ring_buffer_info *ring_info); + +int hv_ring_buffer_write( + hv_vmbus_ring_buffer_info *ring_info, + const struct iovec iov[], + uint32_t iovlen, + boolean_t *need_sig); + +int hv_ring_buffer_peek( + hv_vmbus_ring_buffer_info *ring_info, + void *buffer, + uint32_t buffer_len); + +int hv_ring_buffer_read( + hv_vmbus_ring_buffer_info *ring_info, + void *buffer, + uint32_t buffer_len, + uint32_t offset); + +void hv_ring_buffer_read_begin( + hv_vmbus_ring_buffer_info *ring_info); + +uint32_t hv_ring_buffer_read_end( + hv_vmbus_ring_buffer_info *ring_info); + +#endif /* __HYPERV_PRIV_H__ */ Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_chan.c Mon Jul 25 00:49:27 2016 (r303282) +++ head/sys/dev/hyperv/vmbus/vmbus_chan.c Mon Jul 25 03:12:40 2016 (r303283) @@ -46,10 +46,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include +#include +#include static void vmbus_chan_update_evtflagcnt(struct vmbus_softc *, const struct vmbus_channel *); From owner-svn-src-head@freebsd.org Mon Jul 25 03:30: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 76E1EBA31AC; Mon, 25 Jul 2016 03:30:27 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E9AB1A33; Mon, 25 Jul 2016 03:30:27 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6P3UQD1001588; Mon, 25 Jul 2016 03:30:26 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6P3UQhb001586; Mon, 25 Jul 2016 03:30:26 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201607250330.u6P3UQhb001586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 25 Jul 2016 03:30:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303284 - head/sys/dev/hyperv/vmbus 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.22 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, 25 Jul 2016 03:30:27 -0000 Author: sephe Date: Mon Jul 25 03:30:26 2016 New Revision: 303284 URL: https://svnweb.freebsd.org/changeset/base/303284 Log: hyperv/vmbus: Move bufring info definition to vmbus_brvar.h MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D7282 Modified: head/sys/dev/hyperv/vmbus/vmbus_brvar.h head/sys/dev/hyperv/vmbus/vmbus_chanvar.h Modified: head/sys/dev/hyperv/vmbus/vmbus_brvar.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_brvar.h Mon Jul 25 03:12:40 2016 (r303283) +++ head/sys/dev/hyperv/vmbus/vmbus_brvar.h Mon Jul 25 03:30:26 2016 (r303284) @@ -28,22 +28,20 @@ * $FreeBSD$ */ -#ifndef __HYPERV_PRIV_H__ -#define __HYPERV_PRIV_H__ +#ifndef _VMBUS_BRVAR_H_ +#define _VMBUS_BRVAR_H_ #include #include #include -#include #include -#include +typedef struct { + struct vmbus_bufring *ring_buffer; + struct mtx ring_lock; + uint32_t ring_data_size; /* ring_size */ +} hv_vmbus_ring_buffer_info; -struct vmbus_softc; - -/* - * Private, VM Bus functions - */ struct sysctl_ctx_list; struct sysctl_oid; @@ -82,4 +80,4 @@ void hv_ring_buffer_read_begin( uint32_t hv_ring_buffer_read_end( hv_vmbus_ring_buffer_info *ring_info); -#endif /* __HYPERV_PRIV_H__ */ +#endif /* _VMBUS_BRVAR_H_ */ Modified: head/sys/dev/hyperv/vmbus/vmbus_chanvar.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_chanvar.h Mon Jul 25 03:12:40 2016 (r303283) +++ head/sys/dev/hyperv/vmbus/vmbus_chanvar.h Mon Jul 25 03:30:26 2016 (r303284) @@ -39,12 +39,7 @@ #include #include #include - -typedef struct { - struct vmbus_bufring *ring_buffer; - struct mtx ring_lock; - uint32_t ring_data_size; /* ring_size */ -} hv_vmbus_ring_buffer_info; +#include struct vmbus_channel { /* From owner-svn-src-head@freebsd.org Mon Jul 25 03:58: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 4A81CBA39B5; Mon, 25 Jul 2016 03:58:21 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07FB91863; Mon, 25 Jul 2016 03:58:20 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6P3wKhN012270; Mon, 25 Jul 2016 03:58:20 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6P3wJtw012266; Mon, 25 Jul 2016 03:58:19 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201607250358.u6P3wJtw012266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 25 Jul 2016 03:58:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303285 - in head: contrib/libdivsufsort contrib/libdivsufsort/CMakeModules contrib/libdivsufsort/examples contrib/libdivsufsort/include contrib/libdivsufsort/lib contrib/libdivsufsort/... 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.22 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, 25 Jul 2016 03:58:21 -0000 Author: delphij Date: Mon Jul 25 03:58:19 2016 New Revision: 303285 URL: https://svnweb.freebsd.org/changeset/base/303285 Log: Change bsdiff to use divsufsort suffix sort library instead of qsufsort, which is more efficient. Note that for now we do not create a separate library for libdivsufsort because it's not used anywhere else. Obtained from: Chromium MFC after: 2 months Added: head/contrib/libdivsufsort/ - copied from r303279, vendor/libdivsufsort/dist/ head/usr.bin/bsdiff/bsdiff/config.h (contents, props changed) head/usr.bin/bsdiff/bsdiff/divsufsort64.h (contents, props changed) Deleted: head/contrib/libdivsufsort/.gitignore head/contrib/libdivsufsort/CMakeLists.txt head/contrib/libdivsufsort/CMakeModules/ head/contrib/libdivsufsort/VERSION.cmake head/contrib/libdivsufsort/examples/ head/contrib/libdivsufsort/include/CMakeLists.txt head/contrib/libdivsufsort/include/lfs.h.cmake head/contrib/libdivsufsort/lib/CMakeLists.txt head/contrib/libdivsufsort/pkgconfig/ Modified: head/usr.bin/bsdiff/bsdiff/Makefile head/usr.bin/bsdiff/bsdiff/bsdiff.c Modified: head/usr.bin/bsdiff/bsdiff/Makefile ============================================================================== --- head/usr.bin/bsdiff/bsdiff/Makefile Mon Jul 25 03:30:26 2016 (r303284) +++ head/usr.bin/bsdiff/bsdiff/Makefile Mon Jul 25 03:58:19 2016 (r303285) @@ -1,6 +1,17 @@ # $FreeBSD$ -PROG= bsdiff +PROG= bsdiff + +# libdivsufsort configured with: +# cmake -DCMAKE_BUILD_TYPE="Release" -DBUILD_DIVSUFSORT64=ON +.PATH: ${.CURDIR}/../../../contrib/libdivsufsort/lib +CFLAGS+= -DHAVE_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE +CFLAGS+= -D_LARGE_FILES -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS +CFLAGS+= -D__STDC_LIMIT_MACROS -DBUILD_DIVSUFSORT64 +CFLAGS+= -I${.CURDIR}/../../../contrib/libdivsufsort/include -I${.CURDIR} +SRCS= divsufsort.c sssort.c trsort.c utils.c + +SRCS+= bsdiff.c LIBADD= bz2 Modified: head/usr.bin/bsdiff/bsdiff/bsdiff.c ============================================================================== --- head/usr.bin/bsdiff/bsdiff/bsdiff.c Mon Jul 25 03:30:26 2016 (r303284) +++ head/usr.bin/bsdiff/bsdiff/bsdiff.c Mon Jul 25 03:58:19 2016 (r303285) @@ -44,106 +44,11 @@ __FBSDID("$FreeBSD$"); #define O_BINARY 0 #endif -#define MIN(x,y) (((x)<(y)) ? (x) : (y)) - -static void split(off_t *I,off_t *V,off_t start,off_t len,off_t h) -{ - off_t i,j,k,x,tmp,jj,kk; - - if(len<16) { - for(k=start;kstart) split(I,V,start,jj-start,h); - - for(i=0;ikk) split(I,V,kk,start+len-kk,h); -} - -static void qsufsort(off_t *I,off_t *V,u_char *old,off_t oldsize) -{ - off_t buckets[256]; - off_t i,h,len; - - for(i=0;i<256;i++) buckets[i]=0; - for(i=0;i0;i--) buckets[i]=buckets[i-1]; - buckets[0]=0; - - for(i=0;i + +#ifndef DIVSUFSORT_API +# ifdef DIVSUFSORT_BUILD_DLL +# define DIVSUFSORT_API +# else +# define DIVSUFSORT_API +# endif +#endif + +/*- Datatypes -*/ +#ifndef SAUCHAR_T +#define SAUCHAR_T +typedef uint8_t sauchar_t; +#endif /* SAUCHAR_T */ +#ifndef SAINT_T +#define SAINT_T +typedef int32_t saint_t; +#endif /* SAINT_T */ +#ifndef SAIDX64_T +#define SAIDX64_T +typedef int64_t saidx64_t; +#endif /* SAIDX64_T */ +#ifndef PRIdSAINT_T +#define PRIdSAINT_T PRId32 +#endif /* PRIdSAINT_T */ +#ifndef PRIdSAIDX64_T +#define PRIdSAIDX64_T PRId64 +#endif /* PRIdSAIDX64_T */ + + +/*- Prototypes -*/ + +/** + * Constructs the suffix array of a given string. + * @param T[0..n-1] The input string. + * @param SA[0..n-1] The output array of suffixes. + * @param n The length of the given string. + * @return 0 if no error occurred, -1 or -2 otherwise. + */ +DIVSUFSORT_API +saint_t +divsufsort64(const sauchar_t *T, saidx64_t *SA, saidx64_t n); + +/** + * Constructs the burrows-wheeler transformed string of a given string. + * @param T[0..n-1] The input string. + * @param U[0..n-1] The output string. (can be T) + * @param A[0..n-1] The temporary array. (can be NULL) + * @param n The length of the given string. + * @return The primary index if no error occurred, -1 or -2 otherwise. + */ +DIVSUFSORT_API +saidx64_t +divbwt64(const sauchar_t *T, sauchar_t *U, saidx64_t *A, saidx64_t n); + +/** + * Returns the version of the divsufsort library. + * @return The version number string. + */ +DIVSUFSORT_API +const char * +divsufsort64_version(void); + + +/** + * Constructs the burrows-wheeler transformed string of a given string and suffix array. + * @param T[0..n-1] The input string. + * @param U[0..n-1] The output string. (can be T) + * @param SA[0..n-1] The suffix array. (can be NULL) + * @param n The length of the given string. + * @param idx The output primary index. + * @return 0 if no error occurred, -1 or -2 otherwise. + */ +DIVSUFSORT_API +saint_t +bw_transform64(const sauchar_t *T, sauchar_t *U, + saidx64_t *SA /* can NULL */, + saidx64_t n, saidx64_t *idx); + +/** + * Inverse BW-transforms a given BWTed string. + * @param T[0..n-1] The input string. + * @param U[0..n-1] The output string. (can be T) + * @param A[0..n-1] The temporary array. (can be NULL) + * @param n The length of the given string. + * @param idx The primary index. + * @return 0 if no error occurred, -1 or -2 otherwise. + */ +DIVSUFSORT_API +saint_t +inverse_bw_transform64(const sauchar_t *T, sauchar_t *U, + saidx64_t *A /* can NULL */, + saidx64_t n, saidx64_t idx); + +/** + * Checks the correctness of a given suffix array. + * @param T[0..n-1] The input string. + * @param SA[0..n-1] The input suffix array. + * @param n The length of the given string. + * @param verbose The verbose mode. + * @return 0 if no error occurred. + */ +DIVSUFSORT_API +saint_t +sufcheck64(const sauchar_t *T, const saidx64_t *SA, saidx64_t n, saint_t verbose); + +/** + * Search for the pattern P in the string T. + * @param T[0..Tsize-1] The input string. + * @param Tsize The length of the given string. + * @param P[0..Psize-1] The input pattern string. + * @param Psize The length of the given pattern string. + * @param SA[0..SAsize-1] The input suffix array. + * @param SAsize The length of the given suffix array. + * @param idx The output index. + * @return The count of matches if no error occurred, -1 otherwise. + */ +DIVSUFSORT_API +saidx64_t +sa_search64(const sauchar_t *T, saidx64_t Tsize, + const sauchar_t *P, saidx64_t Psize, + const saidx64_t *SA, saidx64_t SAsize, + saidx64_t *left); + +/** + * Search for the character c in the string T. + * @param T[0..Tsize-1] The input string. + * @param Tsize The length of the given string. + * @param SA[0..SAsize-1] The input suffix array. + * @param SAsize The length of the given suffix array. + * @param c The input character. + * @param idx The output index. + * @return The count of matches if no error occurred, -1 otherwise. + */ +DIVSUFSORT_API +saidx64_t +sa_simplesearch64(const sauchar_t *T, saidx64_t Tsize, + const saidx64_t *SA, saidx64_t SAsize, + saint_t c, saidx64_t *left); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* _DIVSUFSORT64_H */ From owner-svn-src-head@freebsd.org Mon Jul 25 08:13: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 5D6CFBA3EDF; Mon, 25 Jul 2016 08:13:51 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CB8F1AAD; Mon, 25 Jul 2016 08:13:51 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6P8DoHp006896; Mon, 25 Jul 2016 08:13:50 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6P8DoAl006895; Mon, 25 Jul 2016 08:13:50 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201607250813.u6P8DoAl006895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Mon, 25 Jul 2016 08:13:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303287 - 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.22 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, 25 Jul 2016 08:13:51 -0000 Author: julian Date: Mon Jul 25 08:13:50 2016 New Revision: 303287 URL: https://svnweb.freebsd.org/changeset/base/303287 Log: Split MAKE_SYSENT into two parts so that the initializer part can be used separately if one wants to embed the sysent into a larger structure. MFC after: 1 week Modified: head/sys/sys/sysent.h Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Mon Jul 25 05:33:19 2016 (r303286) +++ head/sys/sys/sysent.h Mon Jul 25 08:13:50 2016 (r303287) @@ -175,13 +175,21 @@ struct syscall_module_data { int flags; /* flags for syscall_register */ }; -#define MAKE_SYSENT(syscallname) \ -static struct sysent syscallname##_sysent = { \ - (sizeof(struct syscallname ## _args ) \ +/* separate initialization vector so it can be used in a substructure */ +#define SYSENT_INIT_VALS(_syscallname) { \ + .sy_narg = (sizeof(struct _syscallname ## _args ) \ / sizeof(register_t)), \ - (sy_call_t *)& sys_##syscallname, \ - SYS_AUE_##syscallname \ -} + .sy_call = (sy_call_t *)&sys_##_syscallname, \ + .sy_auevent = SYS_AUE_##_syscallname, \ + .sy_systrace_args_func = NULL, \ + .sy_entry = 0, \ + .sy_return = 0, \ + .sy_flags = 0, \ + .sy_thrcnt = 0 \ +} + +#define MAKE_SYSENT(syscallname) \ +static struct sysent syscallname##_sysent = SYSENT_INIT_VALS(syscallname); #define MAKE_SYSENT_COMPAT(syscallname) \ static struct sysent syscallname##_sysent = { \ From owner-svn-src-head@freebsd.org Mon Jul 25 09:12: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 A59B4BA4E55; Mon, 25 Jul 2016 09:12:09 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F3F21753; Mon, 25 Jul 2016 09:12:09 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6P9C8mi028517; Mon, 25 Jul 2016 09:12:08 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6P9C8wq028516; Mon, 25 Jul 2016 09:12:08 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201607250912.u6P9C8wq028516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 25 Jul 2016 09:12:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303288 - head/sys/geom 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.22 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, 25 Jul 2016 09:12:09 -0000 Author: ae Date: Mon Jul 25 09:12:08 2016 New Revision: 303288 URL: https://svnweb.freebsd.org/changeset/base/303288 Log: Do not invoke resize method if geom is being withered. PR: 211028 MFC after: 2 weeks Modified: head/sys/geom/geom_subr.c Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Mon Jul 25 08:13:50 2016 (r303287) +++ head/sys/geom/geom_subr.c Mon Jul 25 09:12:08 2016 (r303288) @@ -636,7 +636,7 @@ g_resize_provider_event(void *arg, int f LIST_FOREACH_SAFE(cp, &pp->consumers, consumers, cp2) { gp = cp->geom; - if (gp->resize != NULL) + if ((gp->flags & G_GEOM_WITHER) == 0 && gp->resize != NULL) gp->resize(cp); } From owner-svn-src-head@freebsd.org Mon Jul 25 11:25: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 5473ABA399B; Mon, 25 Jul 2016 11:25:35 +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 11B9B1AAE; Mon, 25 Jul 2016 11:25:34 +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 u6PBPY1n076838; Mon, 25 Jul 2016 11:25:34 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PBPYWa076837; Mon, 25 Jul 2016 11:25:34 GMT (envelope-from des@FreeBSD.org) Message-Id: <201607251125.u6PBPYWa076837@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: Mon, 25 Jul 2016 11:25:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303289 - head/sbin/geom/class/part 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.22 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, 25 Jul 2016 11:25:35 -0000 Author: des Date: Mon Jul 25 11:25:33 2016 New Revision: 303289 URL: https://svnweb.freebsd.org/changeset/base/303289 Log: Rewrite the GPT and MBR examples. For GPT, ensure that the boot partition is large enough for gptzfsboot, which has doubled in size since 10. PR: 211361 MFC after: 3 days Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Mon Jul 25 09:12:08 2016 (r303288) +++ head/sbin/geom/class/part/gpart.8 Mon Jul 25 11:25:33 2016 (r303289) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 10, 2015 +.Dd July 25, 2016 .Dt GPART 8 .Os .Sh NAME @@ -1193,86 +1193,112 @@ Otherwise the values will be left unchan .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command fails. .Sh EXAMPLES -Create a GPT scheme on -.Pa ada0 : +The examples below assume that the disk's logical block size is 512 +bytes, regardless of its physical block size. +.Ss GPT +In this example, we will format +.Pa ada0 +with the GPT scheme and create boot, swap and root partitions. +First, we need to create the partition table: .Bd -literal -offset indent /sbin/gpart create -s GPT ada0 .Ed .Pp -Embed GPT bootstrap code into a protective MBR: +Next, we install a protective MBR with the first-stage bootstrap code. +The protective MBR lists a single, bootable partition spanning the +entire disk, thus allowing non-GPT-aware BIOSes to boot from the disk +and preventing tools which do not understand the GPT scheme from +considering the disk to be unformatted. .Bd -literal -offset indent /sbin/gpart bootcode -b /boot/pmbr ada0 .Ed .Pp -Create a dedicated +We then create a dedicated .Cm freebsd-boot -partition that can boot +partition to hold the second-stage boot loader, which will load the .Fx -from a -.Cm freebsd-ufs -partition, and install bootstrap code into it. +kernel and modules from a UFS or ZFS filesystem. This partition must be larger than the bootstrap code .Po -usually either +either .Pa /boot/gptboot -or +for UFS or .Pa /boot/gptzfsboot +for ZFS .Pc , but smaller than 545 kB since the first-stage loader will load the entire partition into memory during boot, regardless of how much data it actually contains. -This example uses 88 blocks (44 kB) so the next partition will be -aligned on a 64 kB boundary without the need to specify an explicit -offset or alignment. -The boot partition itself is aligned on a 4 kB boundary. +We create a 472-block (236 kB) boot partition at offset 40, which is +the size of the partition table (34 blocks or 17 kB) rounded up to the +nearest 4 kB boundary. .Bd -literal -offset indent -/sbin/gpart add -b 40 -s 88 -t freebsd-boot ada0 +/sbin/gpart add -b 40 -s 472 -t freebsd-boot ada0 /sbin/gpart bootcode -p /boot/gptboot -i 1 ada0 .Ed .Pp -Create a 512MB-sized +We now create a 4 GB swap partition at the first available offset, +which is 40 + 472 = 512 blocks (256 kB). +.Bd -literal -offset indent +/sbin/gpart add -s 4G -t freebsd-swap ada0 +.Ed +.Pp +Aligning the swap partition and all subsequent partitions on a 256 kB +boundary ensures optimal performance on a wide range of media, from +plain old disks with 512-byte blocks, through modern +.Dq advanced format +disks with 4096-byte physical blocks, to RAID volumes with stripe +sizes of up to 256 kB. +.Pp +Finally, we create and format an 8 GB .Cm freebsd-ufs -partition to contain a UFS filesystem from which the system can boot. +partition for the root filesystem, leaving the rest of the slice free +for additional filesystems: .Bd -literal -offset indent -/sbin/gpart add -s 512M -t freebsd-ufs ada0 +/sbin/gpart add -s 8G -t freebsd-ufs ada0 +/sbin/newfs -Uj /dev/ada0p3 .Ed +.Ss MBR +In this example, we will format +.Pa ada0 +with the MBR scheme and create a single partition which we subdivide +using a traditional +.Bx +disklabel. .Pp -Create an MBR scheme on -.Pa ada0 , -then create a 30GB-sized -.Fx -slice, mark it active and -install the -.Nm boot0 -boot manager: +First, we create the partition table and a single 64 GB partition, +then we mark that partition active (bootable) and install the +first-stage boot loader: .Bd -literal -offset indent /sbin/gpart create -s MBR ada0 -/sbin/gpart add -t freebsd -s 30G ada0 +/sbin/gpart add -t freebsd -s 64G ada0 /sbin/gpart set -a active -i 1 ada0 /sbin/gpart bootcode -b /boot/boot0 ada0 .Ed .Pp -Now create a -.Bx -scheme -.Pf ( Bx -label) with space for up to 20 partitions: +Next, we create a disklabel in that partition +.Po +.Dq slice +in disklabel terminology +.Pc +with room for up to 20 partitions: .Bd -literal -offset indent /sbin/gpart create -s BSD -n 20 ada0s1 .Ed .Pp -Create a 1GB-sized UFS partition and a 4GB-sized swap partition: +We then create an 8 GB root partition and a 4 GB swap partition: .Bd -literal -offset indent -/sbin/gpart add -t freebsd-ufs -s 1G ada0s1 +/sbin/gpart add -t freebsd-ufs -s 8G ada0s1 /sbin/gpart add -t freebsd-swap -s 4G ada0s1 .Ed .Pp -Install bootstrap code for the +Finally, we install the appropriate boot loader for the .Bx label: .Bd -literal -offset indent /sbin/gpart bootcode -b /boot/boot ada0s1 .Ed +.Ss VTOC8 .Pp Create a VTOC8 scheme on .Pa da0 : @@ -1298,6 +1324,7 @@ After creating all required partitions, .Bd -literal -offset indent /sbin/gpart bootcode -p /boot/boot1 da0 .Ed +.Ss Backup and Restore .Pp Create a backup of the partition table from .Pa da0 : From owner-svn-src-head@freebsd.org Mon Jul 25 11:42: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 D3BC2BA3D98; Mon, 25 Jul 2016 11:42:44 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: from mail-pf0-x22d.google.com (mail-pf0-x22d.google.com [IPv6:2607:f8b0:400e:c00::22d]) (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 A128D13A1; Mon, 25 Jul 2016 11:42:44 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: by mail-pf0-x22d.google.com with SMTP id x72so63541585pfd.2; Mon, 25 Jul 2016 04:42:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Jv0NnXwhzRLHxp8dSXZjMLaXsBReGknnCYg7+0VITfU=; b=X2NvHZZ2x02DGubYvhQAZmhKnoTzEMQaTvir4LWFgkrLhogRB4Rw+Xbhg0qDSp1mEY enru0Y9gDU07wow3JdAIocA84nt318LDMOyJxft3sfX2dJQecsG1fmXkqbeUMynWfHiE nZgavBlBHV9vSWEWr/cNXoS5ZLuKBK23hJry7qZXogBDEWtDScEPNtHeuFhozzw7hUZU hiCQt7j1ZzUDLzqRpiAEDA4LHC6NHSj4UivIh4niSAiCsQmHIIgbjRP5iic6XiR+MFNT Cjit4PC/LictbaDiHvX8g4kZtNccpSsXURaKcLr79/mfkYVdkJE5o0OD1P8ks4IweQiN Jypw== 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:from:date :message-id:subject:to:cc; bh=Jv0NnXwhzRLHxp8dSXZjMLaXsBReGknnCYg7+0VITfU=; b=OzZr6NzpO3So1jAh3WaWAbErdvkJq98unJLRuThD2osuslXEa5AFLcXporZtSPV930 WGW+32LYFafowytshffCkDMWPZkd3O0UTYSHKL3YA8rhbw1gE8RvBFTxGGKBCNi52/sg vLqe4YhKCpB8mnY26BW007u3I4o46dq8SPorE+pVhdhyLrZ3MnXywiMrgdjZsTodUpf1 r5Jz4+YBlK8hxv2jtZw7uJkyu+wAx2cVqu+azj22cspOA1iozUDsqOCBcKkDwzQFF89L 2OgBi1vLNWZaL1z1YHcKSm0YgY+Kkh3ibpkybzjpxigHU+Qbb1QW2QC+DIMBFKIH3ztG pxrA== X-Gm-Message-State: AEkoousT4boUF1xjdRiuWdVDRxXWQbPnN2VAqNPzgoU3xtTWe9h3tbTbceaZnInH72fjRQBtEtQNT5fkib5eBA== X-Received: by 10.98.43.68 with SMTP id r65mr28599657pfr.148.1469446964083; Mon, 25 Jul 2016 04:42:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.66.5.67 with HTTP; Mon, 25 Jul 2016 04:42:43 -0700 (PDT) In-Reply-To: <20160724204431.GM1076@FreeBSD.org> References: <201607241035.u6OAZijR023467@repo.freebsd.org> <76ecf576-3b05-9a58-9c58-6b45f49b7286@freebsd.org> <20160724204431.GM1076@FreeBSD.org> From: Michael Zhilin Date: Mon, 25 Jul 2016 14:42:43 +0300 Message-ID: Subject: Re: svn commit: r303264 - head/usr.bin/calendar/calendars/ru_RU.UTF-8 To: Gleb Smirnoff Cc: Andrey Chernov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 25 Jul 2016 11:42:44 -0000 SGkgR2xlYiwgQW5kcmV5LA0KDQpDb3VsZCB5b3UgcGxlYXNlIGZpeCBvbmUgbW9yZSBsaW5lIGlu DQp1c3IuYmluL2NhbGVuZGFyL2NhbGVuZGFycy9ydV9SVS5VVEYtOC9jYWxlbmRhci5jb21tb246 DQogPj4gNyDQvdC+0Y/QsS4gICAg0JTQtdC90Ywg0L7QutGCLtGP0LHRgNGM0YHQutC+0Lkg0YDQ tdCy0L7Qu9GO0YbQuNC4IDE5MTcg0LPQvtC00LANCg0KQlRXLCB0aGUgbGluZSBvZiAidXNyLmJp bi9jYWxlbmRhci9jYWxlbmRhcnMvcnVfUlUuVVRGLTgvY2FsZW5kYXIubWlsaXRhcnkiDQpwcm9i YWJseSBoYXMgaW5jb3JyZWN0IGRhdGU6DQogPj4gNyDQvdC+0Y/QsS4gICAg0JTQtdC90Ywg0L7R gdCy0L7QsdC+0LbQtNC10L3QuNGPINCc0L7RgdC60LLRiyDRgdC40LvQsNC80Lgg0L3QsNGA0L7Q tNC90L7Qs9C+INC+0L/QvtC70YfQtdC90LjRjyDQv9C+0LQNCtGA0YPQutC+0LLQvtC00YHRgtCy 0L7QvCDQmtGD0LfRjNC80Ysg0JzQuNC90LjQvdCwINC4INCU0LzQuNGC0YDQuNGPINCf0L7QttCw 0YDRgdC60L7Qs9C+INC+0YIg0L/QvtC70YzRgdC60LjRhSDQuNC90YLQtdGA0LLQtdC90YLQvtCy DQooMTYxMiDQs9C+0LQpDQoNCkkgc3VwcG9zZSBpdCBzaG91bGQgYmUgNHRoIG9mIE5vdmVtYmVy IDopDQoNClRoYW5rIHlvdSwNCiAgTWljaGFlbCENCg0KMjAxNi0wNy0yNCAyMzo0NCBHTVQrMDM6 MDAgR2xlYiBTbWlybm9mZiA8Z2xlYml1c0BmcmVlYnNkLm9yZz46DQoNCj4gICBBbmRyZXksDQo+ DQo+ICAgdGhhbmtzLCBJIHdpbGwgZml4IHRoYXQuIFRydXN0aW5nIHNjcmlwdCBhbmQgbm90IGNo ZWNraW5nIHJlc3VsdHMgd2FzDQo+IHN0dXBpZC4NCj4NCj4gT24gU3VuLCBKdWwgMjQsIDIwMTYg YXQgMDY6MTY6MjZQTSArMDMwMCwgQW5kcmV5IENoZXJub3Ygd3JvdGU6DQo+IEE+IFdoYXQgaGFw cGVucyB3aXRoIHRoZSBsaW5lcyBiZWxvdz8NCj4gQT4NCj4gQT4gT24gMjQuMDcuMjAxNiAxMzoz NSwgR2xlYiBTbWlybm9mZiB3cm90ZToNCj4gQT4gPiBNb2RpZmllZDoNCj4gaGVhZC91c3IuYmlu L2NhbGVuZGFyL2NhbGVuZGFycy9ydV9SVS5VVEYtOC9jYWxlbmRhci5vcnRob2RveA0KPiBBPiA+ IC3Qn9Cw0YHRhdCwLTcgICDQktGF0L7QtCDQk9C+0YHQv9C+0LTQtdC90Ywg0LIg0JjQtdGA0YPR gdCw0LvQuNC8LiDQktC10YDQsdC90L7QtSDQktC+0YHQutGA0LXRgdC10L3RjNC1DQo+IEE+ID4g K9Cf0LDRgdGF0LAtNyAgINCS0YXQvtC0INCT0L7RgdC/0L7QtNC10L3RjCDQsiDQmNC10YDRg9GB 0LDQu9C40LwuINCS0LXRgNCx0L3QvtC1INCS0L7RgdC60YDQtdGB0LXQvdGCLtGM0LUNCj4gQT4g PiAr0J/QsNGB0YXQsCAgICAg0JLQvtGB0LrRgNC10YHQtdC90YIu0LjQtSDQpdGA0LjRgdGC0L7Q stC+DQo+IEE+ID4gK9Cf0LDRgdGF0LArMzkgINCS0L7Qt9C90LXRgdC10L3Rgi7QuNC1DQo+IEE+ DQo+IEE+ID4gTW9kaWZpZWQ6IGhlYWQvdXNyLmJpbi9jYWxlbmRhci9jYWxlbmRhcnMvcnVfUlUu VVRGLTgvY2FsZW5kYXIucGFnYW4NCj4gQT4gPiAtMTQg0LzQsNGAICAgINCd0L7QstGL0Lkg0JPQ vtC0LCDQntCy0YHQtdC90Ywg0LzQsNC70YvQuQ0KPiBBPiA+ICsxNCDQvNCw0YDRgtCwICDQndC+ 0LLRi9C5INCT0L7QtCwg0J7QstGB0LXQvdGCLtGMINC80LDQu9GL0LkNCj4gQT4gPiAtMjAg0LzQ sNGAKiAgINCS0LXRgdC10L3QvdC40LUg0YDQsNCy0L3QvtC00LXQvdGB0YLQstC40LUNCj4gQT4g PiAtIDcg0LDQv9GAICAgINCU0LXQvdGMINCc0LDRgNC10L3RiyAo0YHQtNCy0LjQvdGD0YLQvtC1 INCy0LXRgdC10L3QvdC10LUg0YDQsNCy0L3QvtC00LXQvdGB0YLQstC40LUpDQo+IEE+ID4gKzIw INC80LDRgNGC0LAqINCS0LXRgdC10L3Rgi7QvdC40LUg0YDQsNCy0L3QvtC00LXQvdGB0YLQstC4 0LUNCj4gQT4gPiArIDcg0LDQv9GALiAgINCU0LXQvdGMINCc0LDRgNC10L3RiyAo0YHQtNCy0LjQ vdGD0YLQvtC1INCy0LXRgdC10L3Rgi7QvdC10LUg0YDQsNCy0L3QvtC00LXQvdGB0YLQstC40LUp DQo+IEE+ID4gKyA2INC80LDRjyAgICDQlNC10L3RjCDQlNCw0LbRjNCx0L7Qs9CwLCDQntCy0YHQ tdC90YIu0Ywg0LHQvtC70YzRiNC+0LkNCj4gQT4NCj4NCj4gLS0NCj4gVG90dXMgdHV1cywgR2xl Yml1cy4NCj4NCj4NCg== From owner-svn-src-head@freebsd.org Mon Jul 25 14:45: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 47865BA332B; Mon, 25 Jul 2016 14:45:49 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19693136F; Mon, 25 Jul 2016 14:45:49 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6PEjmSB050344; Mon, 25 Jul 2016 14:45:48 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PEjmOp050343; Mon, 25 Jul 2016 14:45:48 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201607251445.u6PEjmOp050343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 25 Jul 2016 14:45:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303298 - head/usr.bin/bsdiff/bspatch 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.22 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, 25 Jul 2016 14:45:49 -0000 Author: delphij Date: Mon Jul 25 14:45:48 2016 New Revision: 303298 URL: https://svnweb.freebsd.org/changeset/base/303298 Log: Fix bspatch heap overflow vulnerability. Obtained from: Chromium Reported by: Lu Tung-Pin Security: FreeBSD-SA-16:25.bspatch Modified: head/usr.bin/bsdiff/bspatch/bspatch.c Modified: head/usr.bin/bsdiff/bspatch/bspatch.c ============================================================================== --- head/usr.bin/bsdiff/bspatch/bspatch.c Mon Jul 25 14:36:55 2016 (r303297) +++ head/usr.bin/bsdiff/bspatch/bspatch.c Mon Jul 25 14:45:48 2016 (r303298) @@ -164,6 +164,10 @@ int main(int argc,char * argv[]) } /* Sanity-check */ + if ((ctrl[0] < 0) || (ctrl[1] < 0)) + errx(1,"Corrupt patch\n"); + + /* Sanity-check */ if(newpos+ctrl[0]>newsize) errx(1,"Corrupt patch\n"); From owner-svn-src-head@freebsd.org Mon Jul 25 14: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 D8C94BA33CD; Mon, 25 Jul 2016 14:49: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 A59CD15C5; Mon, 25 Jul 2016 14:49: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 u6PEnF81050509; Mon, 25 Jul 2016 14:49:15 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PEnFmL050508; Mon, 25 Jul 2016 14:49:15 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201607251449.u6PEnFmL050508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 25 Jul 2016 14:49:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303299 - head/sys/arm64/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.22 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, 25 Jul 2016 14:49:16 -0000 Author: andrew Date: Mon Jul 25 14:49:15 2016 New Revision: 303299 URL: https://svnweb.freebsd.org/changeset/base/303299 Log: Enable the generic OHCI driver on arm64 Obtained from: ABT Systems Ltd MFC after: 1 month Relnotes: yes Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/conf/GENERIC Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Mon Jul 25 14:45:48 2016 (r303298) +++ head/sys/arm64/conf/GENERIC Mon Jul 25 14:49:15 2016 (r303299) @@ -130,6 +130,7 @@ device pl011 # USB support options USB_DEBUG # enable debug msgs device dwcotg # DWC OTG controller +device ohci # OHCI PCI->USB interface device xhci # XHCI PCI->USB interface (USB 3.0) device usb # USB Bus (required) device ukbd # Keyboard From owner-svn-src-head@freebsd.org Mon Jul 25 15: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 08FC2BA45B9; Mon, 25 Jul 2016 15:57:15 +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 CD2F115BA; Mon, 25 Jul 2016 15:57:14 +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 u6PFvEjb077320; Mon, 25 Jul 2016 15:57:14 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PFvEle077319; Mon, 25 Jul 2016 15:57:14 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201607251557.u6PFvEle077319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 25 Jul 2016 15:57:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303307 - 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.22 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, 25 Jul 2016 15:57:15 -0000 Author: andrew Date: Mon Jul 25 15:57:13 2016 New Revision: 303307 URL: https://svnweb.freebsd.org/changeset/base/303307 Log: Rework how we number CPUs on arm64 to try and keep clusters together. Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/mp_machdep.c Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Mon Jul 25 15:56:37 2016 (r303306) +++ head/sys/arm64/arm64/mp_machdep.c Mon Jul 25 15:57:13 2016 (r303307) @@ -454,9 +454,16 @@ cpu_init_fdt(u_int id, phandle_t node, u if (id == cpu0) return (1); + /* + * Rotate the CPU IDs to put the boot CPU as CPU 0. We keep the other + * CPUs ordered as the are likely grouped into clusters so it can be + * useful to keep that property, e.g. for the GICv3 driver to send + * an IPI to all CPUs in the cluster. + */ cpuid = id; if (cpuid < cpu0) - cpuid++; + cpuid += mp_maxid + 1; + cpuid -= cpu0; pcpup = &__pcpu[cpuid]; pcpu_init(pcpup, cpuid, sizeof(struct pcpu)); From owner-svn-src-head@freebsd.org Mon Jul 25 15:59: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 E9C0FBA4629; Mon, 25 Jul 2016 15:59: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 B9DE117AD; Mon, 25 Jul 2016 15:59: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 u6PFxVW1077433; Mon, 25 Jul 2016 15:59:31 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PFxV6S077432; Mon, 25 Jul 2016 15:59:31 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201607251559.u6PFxV6S077432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 25 Jul 2016 15:59:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303308 - 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.22 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, 25 Jul 2016 15:59:33 -0000 Author: andrew Date: Mon Jul 25 15:59:31 2016 New Revision: 303308 URL: https://svnweb.freebsd.org/changeset/base/303308 Log: Fix a typo in a string in a KASSERT to sanity check the CPU IDs. Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/mp_machdep.c Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Mon Jul 25 15:57:13 2016 (r303307) +++ head/sys/arm64/arm64/mp_machdep.c Mon Jul 25 15:59:31 2016 (r303308) @@ -441,7 +441,7 @@ cpu_init_fdt(u_int id, phandle_t node, u if (id > mp_maxid) return (0); - KASSERT(id < MAXCPU, ("Too mant CPUs")); + KASSERT(id < MAXCPU, ("Too many CPUs")); KASSERT(addr_size == 1 || addr_size == 2, ("Invalid register size")); #ifdef INVARIANTS From owner-svn-src-head@freebsd.org Mon Jul 25 16:18: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 07474BA4B3A; Mon, 25 Jul 2016 16:18: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 CBB6613A7; Mon, 25 Jul 2016 16:18:21 +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 u6PGIL0C084623; Mon, 25 Jul 2016 16:18:21 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PGILmw084622; Mon, 25 Jul 2016 16:18:21 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201607251618.u6PGILmw084622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 25 Jul 2016 16:18:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303309 - 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.22 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, 25 Jul 2016 16:18:22 -0000 Author: andrew Date: Mon Jul 25 16:18:20 2016 New Revision: 303309 URL: https://svnweb.freebsd.org/changeset/base/303309 Log: Remove an unused variable. Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/mp_machdep.c Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Mon Jul 25 15:59:31 2016 (r303308) +++ head/sys/arm64/arm64/mp_machdep.c Mon Jul 25 16:18:20 2016 (r303309) @@ -112,9 +112,6 @@ static int ipi_handler(void *arg); struct mtx ap_boot_mtx; struct pcb stoppcbs[MAXCPU]; -#ifdef INVARIANTS -static uint32_t cpu_reg[MAXCPU][2]; -#endif static device_t cpu_list[MAXCPU]; /* @@ -443,13 +440,6 @@ cpu_init_fdt(u_int id, phandle_t node, u KASSERT(id < MAXCPU, ("Too many CPUs")); - KASSERT(addr_size == 1 || addr_size == 2, ("Invalid register size")); -#ifdef INVARIANTS - cpu_reg[id][0] = reg[0]; - if (addr_size == 2) - cpu_reg[id][1] = reg[1]; -#endif - /* We are already running on cpu 0 */ if (id == cpu0) return (1); From owner-svn-src-head@freebsd.org Mon Jul 25 16:28: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 A3F9FBA4029; Mon, 25 Jul 2016 16:28:03 +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 7BD571C81; Mon, 25 Jul 2016 16:28:03 +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 u6PGS2MW088245; Mon, 25 Jul 2016 16:28:02 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PGS2Ga088243; Mon, 25 Jul 2016 16:28:02 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201607251628.u6PGS2Ga088243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Mon, 25 Jul 2016 16:28:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303310 - in head/sys: fs/devfs 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.22 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, 25 Jul 2016 16:28:03 -0000 Author: cem Date: Mon Jul 25 16:28:02 2016 New Revision: 303310 URL: https://svnweb.freebsd.org/changeset/base/303310 Log: devfs: Move most ioctl logic down to vnode layer Devfs' file layer ioctl is now just a thin shim around the vnode layer. Reviewed by: kib Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D7286 Modified: head/sys/fs/devfs/devfs_vnops.c head/sys/kern/vfs_vnops.c Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Mon Jul 25 16:18:20 2016 (r303309) +++ head/sys/fs/devfs/devfs_vnops.c Mon Jul 25 16:28:02 2016 (r303310) @@ -779,47 +779,61 @@ devfs_getattr(struct vop_getattr_args *a static int devfs_ioctl_f(struct file *fp, u_long com, void *data, struct ucred *cred, struct thread *td) { - struct cdev *dev; - struct cdevsw *dsw; - struct vnode *vp; - struct vnode *vpold; - int error, i, ref; - const char *p; - struct fiodgname_arg *fgn; struct file *fpop; + int error; fpop = td->td_fpop; - error = devfs_fp_check(fp, &dev, &dsw, &ref); - if (error != 0) { - error = vnops.fo_ioctl(fp, com, data, cred, td); - return (error); - } + td->td_fpop = fp; + error = vnops.fo_ioctl(fp, com, data, cred, td); + td->td_fpop = fpop; + return (error); +} + +static int +devfs_ioctl(struct vop_ioctl_args *ap) +{ + struct fiodgname_arg *fgn; + struct vnode *vpold, *vp; + struct cdevsw *dsw; + struct thread *td; + struct cdev *dev; + int error, ref, i; + const char *p; + u_long com; + + vp = ap->a_vp; + com = ap->a_command; + td = ap->a_td; + + dsw = devvn_refthread(vp, &dev, &ref); + if (dsw == NULL) + return (ENXIO); + KASSERT(dev->si_refcount > 0, + ("devfs: un-referenced struct cdev *(%s)", devtoname(dev))); if (com == FIODTYPE) { - *(int *)data = dsw->d_flags & D_TYPEMASK; - td->td_fpop = fpop; - dev_relthread(dev, ref); - return (0); + *(int *)ap->a_data = dsw->d_flags & D_TYPEMASK; + error = 0; + goto out; } else if (com == FIODGNAME) { - fgn = data; + fgn = ap->a_data; p = devtoname(dev); i = strlen(p) + 1; if (i > fgn->len) error = EINVAL; else error = copyout(p, fgn->buf, i); - td->td_fpop = fpop; - dev_relthread(dev, ref); - return (error); + goto out; } - error = dsw->d_ioctl(dev, com, data, fp->f_flag, td); - td->td_fpop = NULL; + + error = dsw->d_ioctl(dev, com, ap->a_data, ap->a_fflag, td); + +out: dev_relthread(dev, ref); if (error == ENOIOCTL) error = ENOTTY; - if (error == 0 && com == TIOCSCTTY) { - vp = fp->f_vnode; + if (error == 0 && com == TIOCSCTTY) { /* Do nothing if reassigning same control tty */ sx_slock(&proctree_lock); if (td->td_proc->p_session->s_ttyvp == vp) { @@ -1862,6 +1876,7 @@ static struct fileops devfs_ops_f = { .fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE }; +/* Vops for non-CHR vnodes in /dev. */ static struct vop_vector devfs_vnodeops = { .vop_default = &default_vnodeops, @@ -1885,6 +1900,7 @@ static struct vop_vector devfs_vnodeops .vop_vptocnp = devfs_vptocnp, }; +/* Vops for VCHR vnodes in /dev. */ static struct vop_vector devfs_specops = { .vop_default = &default_vnodeops, @@ -1894,6 +1910,7 @@ static struct vop_vector devfs_specops = .vop_create = VOP_PANIC, .vop_fsync = devfs_fsync, .vop_getattr = devfs_getattr, + .vop_ioctl = devfs_ioctl, .vop_link = VOP_PANIC, .vop_mkdir = VOP_PANIC, .vop_mknod = VOP_PANIC, Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Mon Jul 25 16:18:20 2016 (r303309) +++ head/sys/kern/vfs_vnops.c Mon Jul 25 16:28:02 2016 (r303310) @@ -1492,6 +1492,10 @@ vn_ioctl(fp, com, data, active_cred, td) return (VOP_IOCTL(vp, com, data, fp->f_flag, active_cred, td)); } + break; + case VCHR: + return (VOP_IOCTL(vp, com, data, fp->f_flag, + active_cred, td)); default: return (ENOTTY); } From owner-svn-src-head@freebsd.org Mon Jul 25 19:16: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 C07AEBA0E5D; Mon, 25 Jul 2016 19:16:31 +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 937551D67; Mon, 25 Jul 2016 19:16:31 +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 u6PJGUOB051806; Mon, 25 Jul 2016 19:16:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PJGUGd051805; Mon, 25 Jul 2016 19:16:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201607251916.u6PJGUGd051805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 25 Jul 2016 19:16:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303315 - head/sys/cam/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.22 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, 25 Jul 2016 19:16:31 -0000 Author: imp Date: Mon Jul 25 19:16:30 2016 New Revision: 303315 URL: https://svnweb.freebsd.org/changeset/base/303315 Log: Remove some extraneous printfs. Modified: head/sys/cam/nvme/nvme_xpt.c Modified: head/sys/cam/nvme/nvme_xpt.c ============================================================================== --- head/sys/cam/nvme/nvme_xpt.c Mon Jul 25 18:25:19 2016 (r303314) +++ head/sys/cam/nvme/nvme_xpt.c Mon Jul 25 19:16:30 2016 (r303315) @@ -538,13 +538,8 @@ nvme_action(union ccb *start_ccb) switch (start_ccb->ccb_h.func_code) { case XPT_SCAN_BUS: - printf("NVME scan BUS started -- ignored\n"); -// break; case XPT_SCAN_TGT: - printf("NVME scan TGT started -- ignored\n"); -// break; case XPT_SCAN_LUN: - printf("NVME scan started\n"); nvme_scan_lun(start_ccb->ccb_h.path->periph, start_ccb->ccb_h.path, start_ccb->crcn.flags, start_ccb); From owner-svn-src-head@freebsd.org Mon Jul 25 20:49:17 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 5B781BA4AA8; Mon, 25 Jul 2016 20:49:17 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B1441795; Mon, 25 Jul 2016 20:49:17 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6PKnGhA089426; Mon, 25 Jul 2016 20:49:16 GMT (envelope-from rene@FreeBSD.org) Received: (from rene@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PKnGGJ089425; Mon, 25 Jul 2016 20:49:16 GMT (envelope-from rene@FreeBSD.org) Message-Id: <201607252049.u6PKnGGJ089425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rene set sender to rene@FreeBSD.org using -f From: Rene Ladan Date: Mon, 25 Jul 2016 20:49:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303320 - head/share/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.22 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, 25 Jul 2016 20:49:17 -0000 Author: rene (doc,ports committer) Date: Mon Jul 25 20:49:16 2016 New Revision: 303320 URL: https://svnweb.freebsd.org/changeset/base/303320 Log: miwi resigned from FreeBSD, update the graph Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot ============================================================================== --- head/share/misc/organization.dot Mon Jul 25 20:02:11 2016 (r303319) +++ head/share/misc/organization.dot Mon Jul 25 20:49:16 2016 (r303320) @@ -30,11 +30,11 @@ coresecretary [label="Core Team Secretar doccommitters [label="Doc/www Committers\ndoc-committers@FreeBSD.org"] doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\ngjb, blackend,\ngabor, hrs"] portscommitters [label="Ports Committers\nports-committers@FreeBSD.org"] -portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nantoine, bapt, bdrewery,\nmat, swills, miwi"] +portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nantoine, bapt, bdrewery,\nmat, swills"] portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\nrene"] re [label="Primary Release Engineering Team\nre@FreeBSD.org\nkib, blackend, jpaetzel, hrs, kensmith"] secteam [label="Security Team\nsecteam@FreeBSD.org\ndelphij,\ndes, gavin, gjb,\nglebius, remko"] -portssecteam [label="Ports Security Team\nports-secteam@FreeBSD.org\ndelphij, eadler, feld, jgh, junovitch, miwi, rea, sbz, simon, swills, zi"] +portssecteam [label="Ports Security Team\nports-secteam@FreeBSD.org\ndelphij, eadler, feld, jgh, junovitch, rea, sbz, simon, swills, zi"] secteamsecretary [label="Security Team Secretary\nsecteam-secretary@FreeBSD.org\nremko"] securityofficer [label="Security Officer Team\nsecurity-officer@FreeBSD.org\ncperciva, simon, nectar"] srccommitters [label="Src Committers\nsrc-committers@FreeBSD.org"] From owner-svn-src-head@freebsd.org Mon Jul 25 21:07: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 50405BA4F58 for ; Mon, 25 Jul 2016 21:07:15 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) 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 DDB0D1450 for ; Mon, 25 Jul 2016 21:07:14 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x22f.google.com with SMTP id o80so174381103wme.1 for ; Mon, 25 Jul 2016 14:07:14 -0700 (PDT) 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:from:date:message-id:subject:to :cc; bh=FAWMfwkadTr31u2STBe+gTDT9htQmCxlrMTSePbRvHQ=; b=1ovZZPJHwpEd4+fF2td/Pur1Uizaj0K7qHPnpcReOtu/gRl/6kSFlwFi2fhdqnqmPY QxpHcs4rhU4x4Yr1zaVRAQgkXwowhlP0mSPY6/q8tFoQOi/CkuggMAu/7ZAGeR5PydW9 N8uGpUEXHgtfx7NYvQOH/GUzzjRGq+iZAhI4LxcddhvyiTYgkG9/GQynzbpN+3UIITeG YQ59Q3VbDj7k1ZX8Qbs2Dyx2dONYbSNIgd9bpo0c13eFbGLc53lN0jIY5MBeMjPYZzuo pW41gfNt0Ezj0TZSFAmpISZrQAMHo3lkSv0zH+P2ryOjoOxc0HyPUbOKVMFHp8aj9r2l o3Xg== 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:from:date :message-id:subject:to:cc; bh=FAWMfwkadTr31u2STBe+gTDT9htQmCxlrMTSePbRvHQ=; b=ll2K9NrlXMG1BlCJvs0rKKUFkQm9PG8GxwjaBf6LRw1l8yYLudMjEB0mc/Nmy4WERh mL0PeFw6+jUA916RsP038hBohpvh2eHIzzNQiZBR/UP6nyu2RGRmCFq5Cvfi8IiNRMtJ fp9Rrr3q4Jb6eHOFv9Jd6OTaDiJyYhTIB2s4yjAJM4rqW6Duqc6gWkRE+OO68Oxmkd34 MpGeXsn0ljcveeULLy5d3ZQRYyVWbB1oH2Xjc9hwSTqXwC0dx/rGXkM8K8/J9EBzpljH CHuSnnQz060/uG9Dhra4z7DhWv4EJs1w2dG27LeOR62PEyIFupDm7JkylrwrIl6z6Jzv doYQ== X-Gm-Message-State: AEkoouuRhfYlX2DxJZ9aG1m/wX0mQrfyypLuC9BQU5+GgXvo+E6Gbxp4JBknXFFk/PR703n5mCYhaYibT2gPdnId X-Received: by 10.28.17.138 with SMTP id 132mr21272949wmr.81.1469480833366; Mon, 25 Jul 2016 14:07:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.73.99 with HTTP; Mon, 25 Jul 2016 14:07:12 -0700 (PDT) In-Reply-To: <201505091911.t49JB2gh067512@svn.freebsd.org> References: <201505091911.t49JB2gh067512@svn.freebsd.org> From: Oliver Pinter Date: Mon, 25 Jul 2016 23:07:12 +0200 Message-ID: Subject: Re: svn commit: r282684 - in head/sys: amd64/amd64 amd64/include x86/include x86/xen 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.22 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, 25 Jul 2016 21:07:15 -0000 On Sat, May 9, 2015 at 9:11 PM, Konstantin Belousov wrote: > Author: kib > Date: Sat May 9 19:11:01 2015 > New Revision: 282684 > URL: https://svnweb.freebsd.org/changeset/base/282684 > > Log: > Rewrite amd64 PCID implementation to follow an algorithm described in > the Vahalia' "Unix Internals" section 15.12 "Other TLB Consistency > Algorithms". The same algorithm is already utilized by the MIPS pmap > to handle ASIDs. > > The PCID for the address space is now allocated per-cpu during context > switch to the thread using pmap, when no PCID on the cpu was ever > allocated, or the current PCID is invalidated. If the PCID is reused, > bit 63 of %cr3 can be set to avoid TLB flush. > > Each cpu has PCID' algorithm generation count, which is saved in the > pmap pcpu block when pcpu PCID is allocated. On invalidation, the > pmap generation count is zeroed, which signals the context switch code > that already allocated PCID is no longer valid. The implication is > the TLB shootdown for the given cpu/address space, due to the > allocation of new PCID. > > The pm_save mask is no longer has to be tracked, which (significantly) > reduces the targets of the TLB shootdown IPIs. Previously, pm_save > was reset only on pmap_invalidate_all(), which made it accumulate the > cpuids of all processors on which the thread was scheduled between > full TLB shootdowns. > > Besides reducing the amount of TLB shootdowns and removing atomics to > update pm_saves in the context switch code, the algorithm is much > simpler than the maintanence of pm_save and selection of the right > address space in the shootdown IPI handler. > > Reviewed by: alc > Tested by: pho > Sponsored by: The FreeBSD Foundation > MFC after: 3 weeks > > Modified: > head/sys/amd64/amd64/apic_vector.S > head/sys/amd64/amd64/cpu_switch.S > head/sys/amd64/amd64/genassym.c > head/sys/amd64/amd64/machdep.c > head/sys/amd64/amd64/mp_machdep.c > head/sys/amd64/amd64/pmap.c > head/sys/amd64/amd64/vm_machdep.c > head/sys/amd64/include/cpufunc.h > head/sys/amd64/include/pcpu.h > head/sys/amd64/include/pmap.h > head/sys/amd64/include/smp.h > head/sys/x86/include/specialreg.h > head/sys/x86/xen/xen_apic.c > > Modified: head/sys/amd64/amd64/apic_vector.S > [snip] Hi! Are you still plan to MFC back these PCID related changes to 10-STABLE, or there is a good reason no merge them back or the MFC was just have forgotten? Thanks, Oliver From owner-svn-src-head@freebsd.org Mon Jul 25 21:19: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 8D7ABBA47B7 for ; Mon, 25 Jul 2016 21:19:55 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (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 238D21446 for ; Mon, 25 Jul 2016 21:19:55 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x22b.google.com with SMTP id q128so149926366wma.1 for ; Mon, 25 Jul 2016 14:19:55 -0700 (PDT) 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:from:date:message-id:subject:to :cc; bh=/iyFrrgRtn3DZd4k39rmr+AhEHaazQ3i6f0lv9KKZkI=; b=SYnzf8zUYOf/SSS8dWTWTRe3ynsegsIy4JV0F3vNY+Yp10SluWYNQ+oJ765e+r9nI9 HdSI9eiKq5cYU7nhkbbLvkRtW3QehF01/splg1jel/5O/Z73eCk5NxrZCUAIq/euKklC +D07p2280Zz0z/BCvE4TFUIJWgJ2JhyaDibM4+pcR3nHWTCcXCf0j18zDK4NvUD9GDgx EJ7Za6+cAz6bj/SgudTDlzzMDjyN8QriMg9God8TNpyKfI6wkQtc/G7US8YUfauiekOJ pYzoy+VtnFaXw1y34Xl26M9PWQxpLtz8Hy5FX4yHq0IVrLkTQQ9DCf/pgwNFAc6KKdRO kuKw== 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:from:date :message-id:subject:to:cc; bh=/iyFrrgRtn3DZd4k39rmr+AhEHaazQ3i6f0lv9KKZkI=; b=awJN3Cinv5SfOBoSZjRcwtQ21D9fdgqh1MjFGFV3VoLS6tRuGl8ptD6wO2lXl1y4uW xBH1yVzKsacLvO7OHXUtAtjlKhDBKDEGWNoeweGvLhyIPi+XdTzm8ZNmlJkPm0+gVICL it9Y57UgAdppv2AsDH2dd+6rHbpMLleZOpEJQUVlr14fuDq3vXibg3JVT4HPqOWBMOjR R8yAzWjTfYlJkjHC4YTMlxC/fdgQhlU/qxfbPBQfCmChT5VC6WCibsAz6tHzG26AbR7r G5/KSWhmnAvx6GUzLoxfFN3HQoHvVDXljOIfDgrI9dYy0aZ5ouiGJYmKwHIgvRQKnD3w FEbQ== X-Gm-Message-State: AEkoousr4Hp0r/upuZ16Y4TMxBbSysnUAeS3HxhdgIFB1uc+8bwx40ExM6NOCLyBOEFavp5RwdfPiPy5a30xfrbQ X-Received: by 10.28.182.84 with SMTP id g81mr3800063wmf.20.1469481593656; Mon, 25 Jul 2016 14:19:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.73.99 with HTTP; Mon, 25 Jul 2016 14:19:53 -0700 (PDT) In-Reply-To: <201510291907.t9TJ70UN004616@repo.freebsd.org> References: <201510291907.t9TJ70UN004616@repo.freebsd.org> From: Oliver Pinter Date: Mon, 25 Jul 2016 23:19:53 +0200 Message-ID: Subject: Re: svn commit: r290156 - head/sys/amd64/amd64 To: Konstantin Belousov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , "Conrad E. Meyer" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 25 Jul 2016 21:19:55 -0000 On Thu, Oct 29, 2015 at 8:07 PM, Conrad E. Meyer wrote: > Author: cem > Date: Thu Oct 29 19:07:00 2015 > New Revision: 290156 > URL: https://svnweb.freebsd.org/changeset/base/290156 > > Log: > pmap_change_attr: Only fixup DMAP for DMAPed ranges > > pmap_change_attr must change the memory type of both the requested KVA > and the corresponding DMAP mappings (if such mappings exist), to satisfy > an Intel requirement that two or more mappings to the same physical > pages must have the same memory type. > > However, not all kernel mapped pages have corresponding DMAP mappings -- > for example, 64-bit BARs. Skip fixing up the DMAP for out-of-bounds > addresses. > > Submitted by: Steve Wahl > Reviewed by: alc, jhb > Sponsored by: Dell Compellent > Differential Revision: https://reviews.freebsd.org/D4030 > > Modified: > head/sys/amd64/amd64/pmap.c Hi Konstantin! MFC back this to 10-STABLE? Sure, it was never marked as MFC, but cem@ never mark them. Thanks, Oliver > > Modified: head/sys/amd64/amd64/pmap.c > ============================================================================== > --- head/sys/amd64/amd64/pmap.c Thu Oct 29 19:02:24 2015 (r290155) > +++ head/sys/amd64/amd64/pmap.c Thu Oct 29 19:07:00 2015 (r290156) > @@ -6411,7 +6411,7 @@ pmap_change_attr_locked(vm_offset_t va, > */ > for (tmpva = base; tmpva < base + size; ) { > pdpe = pmap_pdpe(kernel_pmap, tmpva); > - if (*pdpe == 0) > + if (pdpe == NULL || *pdpe == 0) > return (EINVAL); > if (*pdpe & PG_PS) { > /* > @@ -6484,7 +6484,8 @@ pmap_change_attr_locked(vm_offset_t va, > X86_PG_PDE_CACHE); > changed = TRUE; > } > - if (tmpva >= VM_MIN_KERNEL_ADDRESS) { > + if (tmpva >= VM_MIN_KERNEL_ADDRESS && > + (*pdpe & PG_PS_FRAME) < dmaplimit) { > if (pa_start == pa_end) { > /* Start physical address run. */ > pa_start = *pdpe & PG_PS_FRAME; > @@ -6513,7 +6514,8 @@ pmap_change_attr_locked(vm_offset_t va, > X86_PG_PDE_CACHE); > changed = TRUE; > } > - if (tmpva >= VM_MIN_KERNEL_ADDRESS) { > + if (tmpva >= VM_MIN_KERNEL_ADDRESS && > + (*pde & PG_PS_FRAME) < dmaplimit) { > if (pa_start == pa_end) { > /* Start physical address run. */ > pa_start = *pde & PG_PS_FRAME; > @@ -6540,7 +6542,8 @@ pmap_change_attr_locked(vm_offset_t va, > X86_PG_PTE_CACHE); > changed = TRUE; > } > - if (tmpva >= VM_MIN_KERNEL_ADDRESS) { > + if (tmpva >= VM_MIN_KERNEL_ADDRESS && > + (*pte & PG_PS_FRAME) < dmaplimit) { > if (pa_start == pa_end) { > /* Start physical address run. */ > pa_start = *pte & PG_FRAME; > _______________________________________________ > 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 Mon Jul 25 23:05: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 34D0CBA47A4; Mon, 25 Jul 2016 23:05:27 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5EC91619; Mon, 25 Jul 2016 23:05:26 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6PN5PYj044101; Mon, 25 Jul 2016 23:05:25 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PN5PMa044097; Mon, 25 Jul 2016 23:05:25 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201607252305.u6PN5PMa044097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 25 Jul 2016 23:05:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303322 - in head: share/man/man4 sys/conf sys/contrib/dev/iwm sys/modules/iwmfw sys/modules/iwmfw/iwm3160fw sys/modules/iwmfw/iwm7260fw sys/modules/iwmfw/iwm7265fw sys/modules/iwmfw/iw... 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.22 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, 25 Jul 2016 23:05:27 -0000 Author: sbruno Date: Mon Jul 25 23:05:25 2016 New Revision: 303322 URL: https://svnweb.freebsd.org/changeset/base/303322 Log: Update iwmfw(4) to include support for 8260 series units and update f/w for the other devices supported by this driver. Patch linked in https://reviews.freebsd.org/D6967 but not actually a part of the review. Obtained from DragonflyBSD. Submitted by: Kevin Bowling MFC after: 2 weeks Relnotes: yes Added: head/sys/contrib/dev/iwm/iwm-3160-16.fw.uu head/sys/contrib/dev/iwm/iwm-7260-16.fw.uu head/sys/contrib/dev/iwm/iwm-7265-16.fw.uu head/sys/contrib/dev/iwm/iwm-8000C-16.fw.uu head/sys/modules/iwmfw/iwm8000Cfw/ head/sys/modules/iwmfw/iwm8000Cfw/Makefile (contents, props changed) Modified: head/share/man/man4/iwmfw.4 head/sys/conf/files head/sys/contrib/dev/iwm/iwm-3160-9.fw.uu head/sys/contrib/dev/iwm/iwm-7260-9.fw.uu head/sys/contrib/dev/iwm/iwm-7265-9.fw.uu head/sys/modules/iwmfw/Makefile head/sys/modules/iwmfw/iwm3160fw/Makefile head/sys/modules/iwmfw/iwm7260fw/Makefile head/sys/modules/iwmfw/iwm7265fw/Makefile Modified: head/share/man/man4/iwmfw.4 ============================================================================== --- head/share/man/man4/iwmfw.4 Mon Jul 25 23:04:21 2016 (r303321) +++ head/share/man/man4/iwmfw.4 Mon Jul 25 23:05:25 2016 (r303322) @@ -22,7 +22,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 28, 2015 +.Dd June 25, 2016 .Dt IWMFW 4 .Os .Sh NAME @@ -45,6 +45,7 @@ of the following: .Cd "device iwm3160fw" .Cd "device iwm7260fw" .Cd "device iwm7265fw" +.Cd "device iwm8000Cfw" .Ed .Pp Alternatively, to load the driver as a @@ -54,10 +55,11 @@ module at boot time, place the following iwm3160fw_load="YES" iwm7260fw_load="YES" iwm7265fw_load="YES" +iwm8000Cfw_load="YES" .Ed .Sh DESCRIPTION This module provides access to firmware sets for the -Intel Dual Band Wireless WiFi 3160, 7260 and 7265 series of +Intel Dual Band Wireless WiFi 3160, 7260, 7265 and 8260 series of IEEE 802.11n/11ac adapters. It may be statically linked into the kernel, or loaded as a module. Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Jul 25 23:04:21 2016 (r303321) +++ head/sys/conf/files Mon Jul 25 23:05:25 2016 (r303322) @@ -1735,7 +1735,7 @@ iwm3160fw.fwo optional iwm3160fw | iwm no-implicit-rule \ clean "iwm3160fw.fwo" iwm3160.fw optional iwm3160fw | iwmfw \ - dependency "$S/contrib/dev/iwm/iwm-3160-9.fw.uu" \ + dependency "$S/contrib/dev/iwm/iwm-3160-16.fw.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwm3160.fw" @@ -1749,7 +1749,7 @@ iwm7260fw.fwo optional iwm7260fw | iwm no-implicit-rule \ clean "iwm7260fw.fwo" iwm7260.fw optional iwm7260fw | iwmfw \ - dependency "$S/contrib/dev/iwm/iwm-7260-9.fw.uu" \ + dependency "$S/contrib/dev/iwm/iwm-7260-16.fw.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwm7260.fw" @@ -1763,10 +1763,24 @@ iwm7265fw.fwo optional iwm7265fw | iwm no-implicit-rule \ clean "iwm7265fw.fwo" iwm7265.fw optional iwm7265fw | iwmfw \ - dependency "$S/contrib/dev/iwm/iwm-7265-9.fw.uu" \ + dependency "$S/contrib/dev/iwm/iwm-7265-16.fw.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwm7265.fw" +iwm8000Cfw.c optional iwm8000Cfw | iwmfw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk iwm8000C.fw:iwm8000Cfw -miwm8000Cfw -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "iwm8000Cfw.c" +iwm8000Cfw.fwo optional iwm8000Cfw | iwmfw \ + dependency "iwm8000C.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "iwm8000Cfw.fwo" +iwm8000C.fw optional iwm8000Cfw | iwmfw \ + dependency "$S/contrib/dev/iwm/iwm-8000C-16.fw.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "iwm8000C.fw" dev/iwn/if_iwn.c optional iwn iwn1000fw.c optional iwn1000fw | iwnfw \ compile-with "${AWK} -f $S/tools/fw_stub.awk iwn1000.fw:iwn1000fw -miwn1000fw -c${.TARGET}" \ Added: head/sys/contrib/dev/iwm/iwm-3160-16.fw.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dev/iwm/iwm-3160-16.fw.uu Mon Jul 25 23:05:25 2016 (r303322) @@ -0,0 +1,20408 @@ +begin 644 iwm-3160-16.fw +M`````$E73`IS=')E86TZ0V]R94-Y8VQE,3-?0=P!'8!,`2`0`;<`@``&$/'!TB!``=)N@=P!`!`!LPZ!W`$8($&R0(`!LE +M!"C`$>D/`&$``!LE``$;)%P$7`$)!% +MP!!@``!AX`3`$N@=P!$!`%(DM!_`$`(`$W`#``!A"`!8,`@`9#$'``!A#Q-2 +M(H($$R0(`!,E`0!2;@$``&$!``!A````80@`6&[H#P!A```3)0``$R0D$,`1 +M`(`3)#@!,B!`#*$0```20```$E"0`` +M84``$R4&`1,D!"C`$0]V$R(L2,<1#W@3(@``QA$#``$D```!)0]%`"(`7``Y +M[_\`,A@``&0``!,D`0`3)3@@=P!#F_Q,R__\3,^@=P!$```$D"``!)0\!8R(! +M`%(D"``';@(``&$``!4D````(0X``&'8!,`2Z!W`$0$`4B2T'\`0`@`3<`(` +M`&$(`&0QY@\`80\34B(/$U(B`0!2;@$``&$!``!A````81PJ@($``,`6`@$3 +M9$(!$R0$*,`18'Z`@0``P!8&`1-B!`C`$`0`$V0/7``B"@``0``&`'`:``!A +M```3)```$R4``,`7`$!8,,@@P!!P1<`0$`C`$```$R4#`!,D'`C`$1P(P!$` +M`!,D!`C`$0\4%2($`!4F#S`@(OO_,#(#`!,D&`C`$0\4%2("`!4F#R`P(@`` +M$R001<`1&`C`$0`06#`/`!,B`0`3,`0HP!$/?!,B"`#,$0``$R4``!,D-$C' +M$4``$R4'`1,D!"C`$0][$R(!`!,P!"C`$0\4%2("`!4F#TT3(@00Q1$"`!,D +M\!S`$0$`$R3L',`1```3)'``$R40',`1```3)0``$R3@',`14'Z`@0``P!8" +M`1-B#Q05(AL`%28``!,E`0`3)"00P!$``!,D``#`%P``%20````A```;)0`` +M&R0!`&1N`0`;)`(`9&X"`!LD!`!D;@0`&R0,`!MB#QL+(@\+8R(!`!M``@`; +M00```&$``!LE"`B`@0`;&B@``,`6```;)0(`&T```!MQ#V1C(@``'20````A +M```````````(```````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````1`"`````````````#!`0``0!$`X0$!`0$!`0$!`0$!`0$!`0$!`0 +M$!`0$!`/$`D0$`4*$`L0$!`0`A`0#1`0$!`0$!`0$!`0!@,0$!`0$!`0$!`0 +M$!`0$`@0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0 +M$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0 +M$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0 +M$!`0$!`0$!`0$!`0$!`'$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0 +M$!`0$`````````0`S`,!``X`[`8%`,0`2`0&`$``#`4'`-@`9`4(`&@`/`8) +M`$``I`8*`#P`T`,+`#P`#`0/``@`Y`81`!@`3`42`*0!```3``P`_`84``,` +M"`<5``0`#`<````````````````````````````````````````````````` +M```````>````'H@>B%H```!6````5HA6B`(!``"J````JHBJB/X!``","@`` +M5(Q4C*0?````````````````_@```0#_``(!_P$`_P$!`/X"`0,"_P$!`/\! +M`0'_`@#_`P(`_@0"`P+_`@(`_P("`?\#`/\%`P#^!@,``_\#`P#_`P,!_P`` +M`````````````)1)```*````!````'A]@`````````````````#T20``!0`` +M``0```!X?8````````$```"8^```&/D``+#X``#T^```U/4``-#U``!D-P`` +M%#8``&0V```````````````!"_\```4#```$`@``!O\```#_```,_P``!_\` +M``C_```)_P``"O\```+_`0#_``$"`!$!`0(!`0$#_P$!!`(!`04#`0$&!`$! +M!P4!`0@&`0$)#P$!"A`!``S_`0#^_P(`_P<"`0'_`@(""`("`PD"`@0*`@(% +M"P("!@P"`@<-`@((#@(""0X"`@H-`@`,_P(`_O\````````````````````` +M``#_!P```/\```?_``$)"```"O\!`@```0,!_P$#`O\!`P/_`0$$_P$"!0`! +M`0O_`0(,_P$$!@8!`0?_`0`(_P$`"O\"`@#_`@,!_P(#`O\"`P/_`@$$`0(" +M!0`"`0L!`@(,`0($!@8"`@<``@`(`0(`"@$#`/\"`P,`_P,#`?\#`P+_`P,# +M!`,!!`4#`@4``P$+!0,"#`4#!`8&`P,'_P,`"`4#``H%`P#^`P0$`/\$!`'_ +M!`0"_P0$`_\$!`3_!`0%_P0$"_\$!`S_!`0&!@0$!P8$``C_!``*_P`````` +M``````#_`````0,``@("``,``@``!?\```;_```$_P``!P0```C_`0#_`0$! +M``,!`@$"`0("`@$`!/\!`0<$`0`(_P(#``8"`@(&`@`%_P(`!O\"``3_`@`' +M!P(`"`<#`P`&`P`!!0,"`@8#`07_`P`&_P,`!`<#``<'`P`(!P```````0#_ +M`0#_``$``?\!`@+_`@#_`0(``?\"`0/_`@,$_P(""O\"`@G_`@((_P,``?\# +M`0,*`P4%"@,$!O\#!@H(`P,)_P0`_P,$``'_!`$#"P0"!PL$`@@$!`,$_P0" +M"@D$!`G_!`0&_P4`_P(%!`;_!0$#!@4``?\%!0K_!04)!08`__\&!`;_!@$# +M!@8``?\&`P3_!@8)!P8&"O\```````````````````````@$#`(*!@X!"04- +M`PL'#P&1```!/P```I$``#X]```#D0``/3T```21```_`P``!9$```D0```& +MD0``%AP```>1```?'P``")$``!P6```)D0``$`D```J1```#/P``"Y$``#T] +M```,D0``/3X```V1```_`0``$1`^2$A(X!`$````#2`$````($,Y`````."$ +M`0``X1`!`````A"7RP4`,&`+````#]($````&-+\__\?">")AH2$"N"$A``` +M"^"F5=<@#.`BBRPR#>"JB8>^PQ%^"2C(N*&."*B@``&>!^2><@&N`B +MBRPR&^"33;>^PQ)&```````G,`````$2`4A0$``F#^%````V`1%``` +M!F`1%```&1`$`````7,P`0``81`@````$B"4`P``UA`<8P``UQ`<8P``V!`< +M8P``V1!Z@(``VA!X@(``VQ!X@(``"1!N7P``&A``````,1"&`0``,A"0`0`` +M,Q#(````-!!0````-1"`````.A!I````.Q#`````P1``````*N#YY>`>>^PQ*."+BXF)*>")B0```D'AX;%Q02"AX> +M'AX>'AX;%Q02"AX>'AX>'AX;%Q02"AX>````````````````(+'V````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````#0,H`!`#*``5`R@`%`,H`!,#*``'!R@`$`@H``H)*``;!"@`!@DH`!X +M)*``?"2@`(`DH`"$)*``4!"@`$@FH`!@$*``3":@`&00H`!H$*``6!"@`#`0 +MH``\$*``-!"@`"P,H```@:0``8&D``.!I`"()*``C"2@`)`DH`"4)*``F"2@ +M`)PDH`"@)*``I"2@``````````````````````!Q&PT`X($!`!:?`@`````` +M``````````!Q`0G?``#H``#B```^`5<_`69``7=!`9A"`0`/C.``*^`!;/``C3``C0``C4``C1``C5``C2`!C6```Q`"0$`$PX``#E +M`7/F`02/`?^#`6F.`0^0`0"1`7V2`7V3`7U9``;]``'^`!/_``9N``1\`0V` +M`0VY`07.`0*]`0G'`1_(`1:D`1"E`1"K`1"J`1"R`1.S`1/?`0'7`0!Z`0`` +M``````,!!0`0``0`$0`2``,`"@`T`34!-@$E``H`!``/``,!.``0`!(````' +M#!,`!!.``.P2@``H$X``Z!*```,!`@$%``0`$``*``8`?`&``7,!=P&7`9D! +ME@&8`=P!)0":`9P!```````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````0````(`````````+A$O%S`0,2@R$3/R-B(X$3D7.A`[*#P1 +M/?)`(D$!2#A).$HN2RY4'%4<5AQ7'%HX6SA<.%TX8%AA6'@X>3B('(DP``M'L``(P7``!L&```Z!<``&P7``!H&```9!<``%@7``!<%P``8!<` +M`$QP``"D<```?'```'1P``#_____________________!````/__________ +M_____P,```#_____``````````#_____``````````#_____```````````# +M````$`````,`````````````````````````_P``````````````_P`````` +M`````````````````````0`````!_P```O\```,!```%_P``!O\```C_```' +M_P``"?\```K_```+_P``#/\!`/\#`0$```$!`@H!`@4$`0$&_P$!!_\!`PH' +M`0$+_P$!#/\#`/\"`P,```,$!00#!0;_`P,*!P,!"_\#`PS_`@#_`P("```" +M`@0&`@(%_P("!O\"`@?_`@0*!P(""_\"`0P%!`#_`@0$```$`0$)!`0$!@0$ +M!?\$!0;_!`0*!P0""_\$`0P%!0#_`P4%```%!`C_!04'"`4#"?\%!0;_!04$ +M_P`````````````````````%```````````````>````$````!``````(@`B +M$3,1,_#P\/#`P,#`_/S\_/[^_OZJJJJJJJJJJJJJJJZJJJJJ*/\`S*JJ``"J +MJ@#,JJH```!``,```````%``\`!0`/"JJJJJJJJJJJJJJJJJJJJJ*/\`S*JJ +M``"JJ@#,JJH``````````````%``\`!0`/"JJJJJJJJJJJJJJNZJJJJJ*/\` +MS*JJ``"JJ@#,JJH```!``,``0`#``%``\`!0`/`'````#P`````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````__\``/__`````````````/__``#__P````````````#__P``__]@)P`` +MY"<``*@G``"D)P``C"<``&PG``!,*```D"@``&PH``#,)P``K"<````````` +M````````````````````````````````````````````````````!P```````````````!`0X.````````,@@"#P,` +M`0`````````!`0X.````````(P0""@````````````#T`0`````````````` +M`````````'Q/@``````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````````$`````"0`0```*``$"<` +M`.@#``#H`P``]".``/0C@``0A(``#(2```R$@``,A(``$(2```R$@``,A(`` +M#(2```R$@``0A(``$(2```R$@``0A(``#(2``/__```!``````````````!$ +M)`$`1"0!`$0D`0`H!@$`1"0!`$0D`0!<"`$`1"0!`$S^```0!0$`1"0!`$0D +M`0!$)`$`1"0!`$0D`0!$)`$`1"0!`$0D`0!$)`$`1"0!`$0D`0!$)`$`1"0! +M`/@>`0`@'`$`4!\!`$0D`0!$)`$`1"0!`-@5`0#0(P$`"!@!`,08`0#`%P$` +MV`P!`"@,`0"($0$`7!L!`&0D`0!$)`$`P$`Z'L!`)1[`0#8>@$`$'L!`*1Z`0"<>P$``0`````````` +M``````````````````````````-````4``````$```````!4*(`````````` +M`````````````````````````````)PQ`0`%```"!````'A]@``````````` +M``$``````````@````````!G12,!!0````("`@("`@("`@("`@("`@("`@(" +M`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@(" +M`@("`@("`@("`@("`@("`@("`@$"`@("`@("`0$"`@("`@("`@("`@("`@`` +M```0`@``````````````````````````````````Z,J````````````````` +M````````````````````````````"](.T@W2"-()T@K2$M(3TA32&](`8```#_!P!4!P```/\@```````8A(`````` +M```````````````````````````````````````````````````````````` +M_P```/__________________________```````````````````````````` +M````````````````````````````````````````````````````3+$!`-`[ +M`0`4MP$`T#L!`&1N`@#0.P$`W"D!`!Q.`@!L7`$`T#L!`-`[`0`L4@(`+%(" +M`"Q2`@`L4@(`+%("`"Q2`@`L4@(`T#L!`-`[`0#0.P$`T#L!`*2;``#0.P$` +MT#L!`-`[`0#0.P$`T#L!`#Q<`0`D7`$`T#L!`-`[`0`````````````````` +M```````````````````````````````!`````0`````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````0````(````#`````````/\```#_````_P```/\````````` +M``````````````````````````#_````B!,````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````/____\````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`(``````````````````````````_____P`````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````@`````````````````````````#_____```````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````"``````````````````````````/____\````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````(``````````````````````````_____P`````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````@``````````````````````````````` +M`````````````````````/\````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``#_____`````/____\`````_____P````#_____```````````/`#\``0`` +M``\`/P`!````#P`_``$````/`#\``0````\`/P`!``````````\`/P`!```` +M#P`_``$````/`#\``0````\`/P`!````#P`_``$`````````#P`_``$````/ +M`#\``0````\`/P`!````#P`_``$````/`#\``0`````````/`#\``0````\` +M/P`!````#P`_``$````/`#\``0````\`/P`!``````````\`/P`!````#P`_ +M``$````/`#\``0````\`/P`!````#P`_``$``````````````*L````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````````````````````````.H* +MH@I>"AT*X`FE"6T)-PD$"=,(I`AW"$L((@CZ!],'K@>*!P`````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````%1,```"````!````'A]@`````````````````"P +M3```!0````0```!X?8``````````````!0```PD#"0````````````````<` +M```>`````P```/____\````````````````````````````````````````` +M``````````````````````!F9@X``````&9F"@!F9@8`9F8&`&9F`@!F9@(` +M9F8^`&9F/@!F9CH`9F8Z``````!F9C8``````&9F,@``````9F8.```````` +M````9F8&```````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````````````D`"0D) +M"0D)"0D)``D`"0`)```)```````````````````````````````````````` +M``````````````````````````````````````````````#(!8`````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````#['8P`,Q$``````````!$````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````0%!@<("0H+#`T.#Q`J*RPM+B]*2TQ-3D]0:FML;6YO<(J+C(V. +MCY"JJZRMKJ^PR\S-SL_0T=+3U-76U]C9VMO#C($&QY?#C(%(!Y@#C(&)1YB#C('*AYC#C((+QYD#C()-!YE +M#C(*.1YG#C(+/AYH#C(,0QYI#C(-2!YJ#C(.31YL#C(B4$`-(``D8$`/(#$F +M<$`2(#0H`$$4(#$J$$$7(#$L($$9(#$N,$$<(#,P0$$>(#$R4$$A(#$T8$$C +M(#$V<$$F(#,X`$(H(#$Z$$(K(#$\($(M(#$^,$(P(#-`0$(R(#%D8$1?(C!F +M<$1B(C)H`$5D(B]J$$5G(B]L($5I(B]N,$5L(C)P0$5N(B]R4$5Q(B]T8$5S +M(B]V<$5V(C)X`$9X(B]Z$$9[(B]\($9](B]^,$:`(C&`0$:"(B^"4$:%(@"$ +M8$:'(BZ&<$:*(C&(`$>,(BZ*$$>/(BZ,($>1(BZ.,$>4(C"00$>6(BV12$>8 +M(@"5:$>=(BV7>$>?(C"9"$BB)"V;&$BD)"V=*$BG)"V?.$BI)#"A2$BL)"VE +M:$BQ)"T````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````/``\`#P`/``\`#P`/``\````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````````0`!``````#``)``T``` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````#_____H,2`````````````0$(/`$!"#P!`0@\`0$(/`$!" +M#P!`0@\`0$(/`$!"#P!`0@\`0$(/`.`'``!``0``X`<``$`!```@)P``X`<` +M`.`'``!``0``X`<``$`!```"``````````(````````````````````````` +M````````````````````````````````_&R``#SB@``8```````````````` +M`````````/____\````````````````````````````````````````````` +M````````````````````````````````````````^!,"`!P4`@`L%`(`!!0" +M`/03`@`P%`(`W!,"````````4````#`````````````````````````````` +M`$```(`Q``"`#@``````````````````````````````+@```#(````@```` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````H!X"```;`@"0'@(`C!T"`'`>`@#PJ0$`,!X"`#`;`@"X'`(`Y!H"`.@: +M`@`````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````"````````````` +M````````@````("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("` +M@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("` +M@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("` +M@("```(```````````````````````````````"```````#_```````````" +M````````````````````````````````@```````_P```````````@`````` +M`````````````````````````(```````/\```````````(````````````` +M``````````````````"```````#_```````````"```````````````````` +M````````````@```````_P```````````@`````````````````````````` +M`````(```````/\```````````(```````````````````````````````"` +M``````#_```````````"````````````````````````````````@``````` +M_P```````````@```````````````````````````````(```````/\````` +M``````(```````````````````````````````"```````#_```````````" +M````````````````````````````````@```````_P```````````@`````` +M`````````````````````````(```````/\```````````(````````````` +M``````````````````"```````#_```````````"```````````````````` +M````````````@```````_P```````````@`````````````````````````` +M`````(```````/\```````````(```````````````````````````````"` +M``````#_``````````````````"!`````````((`````````@P````````"$ +M`````````(4`````````A@````````"'`````````(@`````````B0`````` +M``"*`````````(L`````````C`````````"-`````````(X`````````CP`` +M``````#``0`````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````!(<0``&'$``)QQ +M```P<0``H'$``!!Q``!,<0``_P```/\```#_````_P```/\```#_````_P`` +M`/\```#_````_P```/\```#_````_P```/\```#_````_P```/\```#_```` +M_P```/\```#_````_P```/\```#_````_P```/\```#_````_P```/\```#_ +M````_P`````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````!@@H``<(*``*""@`"P@H``X(*``(""@`"0@H``P(*`` +M-""@`#P@H`!`(:``1"&@`&@AH`!L(:``>"&@`$@AH`!,(:``<"&@`'0AH`!\ +M(:```````/\````````````````````````````````````````````````` +M````````""T"``4```($````>'V``````````````````*QQ```&````!``` +M`'A]@`````````````````!(+@$`"@````0```!X?8`````````````````` +MM&L```4```($````>'V``````````````````$"``0`%```"!````'A]@``` +M```````````````,@0$`!0```@0```!X?8``````````````````]"P"``8` +M````````>'V``'A]@`!X?8``M""@`&P@H```,```_X___P``````````F'V` +M`)A]@`"D(*``.""@``$```#X____``````````"X?8``N'V``*@@H``\(*`` +M$````,?___\``````````-A]@`#8?8``K""@`'@AH`!``0``/_[__P`````` +M````^'V``/A]@`"P(*``?"&@```,``#_\?__``````````#_````_P`````` +M`````````````````````````````````````````````````0#_```````` +M````````````````````````````,"R``,#3@``8``````````$````````` +M`````%`K@`"(TX``&``````````!``````````````!0;(``P.&``!@````` +M`````0`````````````````````````````````````````````````````` +M``#80(``B-F``!@``````````0`````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````__\``/__```````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````\`/P`!````#P`_``$````/`#\``0````\` +M/P`!````#P`_``$````/`#\``0````\`/P`!````#P`_``(`````"P`0``L` +M"P`*``L`!H`!``@`"``(``@````(``:``0`(``@`"``(````"``&@`$````` +M``````````!(2#P\````````````````````````````````2$@\/``````` +M``````````````#_?P```````/]_````````_W\```````#_?P```````/]_ +M````````_W\``/]_``````````````````!]>79Y;WEI>7UW=G=O=VEW?75V +M=6]U:75]R%T(8\% +MAP5_!7@%CP.'`W\#>`-]>79Y;WEI>7UW=G=O=VEW?75V=6]U:75]4-R0VQ#9D-Y +M07)!;$%F07HEB-S(VTC9R-Z(7,A;2%G(7T%=@5O!6D%?0-V`V\# +M:0-]>79Y;WEI>7UW=G=O=VEW?75V=6]U:75]7EY8!W +M>7=R=VQW@'5Y=7)U;'6`7%R<6QQ@&]Y;W)O;&^`;7EM6MR:VQK@&EY:7)I;&F`9WEG65R96QE@&-Y8W)C;&.`87EA +M$5Q16M%?T-X0W%#:T-_07A!<4%K080E?25V)6\EA"-](W8C;R.$ +M(7TA=B%O(8<%?P5X!7(%AP-_`W@#<@,``````````/X```#0T+JYM[>XM[@` +M````````````````````````[[ZMWN^^K=[OOJW>[[ZMW@`````````````` +M````````````/'L```H````$````>'V```````#<"P$``````/\````$```` +M````````````````__\``#@Y``!,.0``8#D``.PX``#D.```]#@``&`X``!8 +M.```V.P``/#H``#LZ0``2.H``&SI``#,Z0``).H``"#M```T\P``?/,``"ST +M``"$]```X/,``!CT``!\]```M.D``)CI``#DZ``````````````"`@7_`@,` +M``(!`0$#`P#_`P$!`0,``@(#`@4&```"_P````,```$#``$$!``#`P4``@4& +M`0$!_P$``@(!`P`%`0(%!@````````````````````#L+`(`!@````0```!X +M?8``````````````````#"T"``8````$````>'V````````Q.3HS-CHS-@`` +M``#)``````````4"#0`(!#D4.0``.2,Y`!`,.3DY'!@Y(``*(#F70F!W/#@T +M,"PH)"`<&!00#`@$``0%!00"`@``'049`!,`````2D9-&`````3>W]\$W@`` +M`P`&!@8&!@8```````````,-,(J*.$>*BHJ*BG2*6F0`5H-L3HJ*BHJ*1TX= +MBGIZ9QIV+0`````&%!04!!04%`(4%!0`````!`8`!@0&!@8&!@8&!@8&!@8& +M`@8$``````L'`P`[-S,O*R____'____R#___\A_____R+___\C____)/___R7___\F +M`````````````````````````````(0Q````````A#$``````````````@`` +M``(````4AP$`J(P````````````````````````````````````````/`#\` +M`@````\`/P`"````#P`_``(````/`#\``@````\`/P`"(`````````$```"J +MJJJJJJJJJJJJJNZJJJJJ*/\`S*JJ``"JJ@#,JJH```!``,``0`#``%``\`!0 +M`/`````````````````````````````````````````````````````````` +M``````"JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ@`````````` +M````````````;&UN;W!QP$`).,``/Q[`0`DXP``4)(!`.@L`@```````````````````````````%CE +M````````6.4``-23`0``````('P!`(R2```@?`$`('P!`"1-`0"HY0``('P! +M`*CE``"(E`$`('P!````````````````````````````U.8```````#4Y@`` +M``````````````````````````!DHP$`3$T!`*CG``"`C0$`J.<``,24`0`` +M``````````\`/P`!````#P`_``$````/`#\``0````\`/P`!````#P`_``$` +M`````````````````````````````!SY``"(C0$`'/D``*B5`0`````````` +M``````````````````````!$_````````$3\``!LF`$``````"@`*``P`"P` +M+``H`#P`-``L`"P`/``T`#``+`!4`$0`?_\'#Q\_`0,%``<"`P0&!@T%!0D) +M"0D)"0D```$'#Q\_?_____\``/____\```"`555550```$#07D)[:"^A/9H? +M%BFTE]`>.([C.!S'<1R]A/82CN,X#AS'<1R.XS@.7D)["<=Q'`&8``-AE``#890```````*CX`0`@ +M^P$`J`$"`.P"`@`$````'!$``!PR```<,P``'!0```0````<`@``I<:$^)GN +MC?8-_[W6L=Y4D5!@`P*ISGU6&>=BM>9-FNQ%CYT?0(F'^A7OZ[+)C@O[[$%G +ML_U?ZD6_(_=3EN1;F\)U'.&N/6I,6FQ!?@+U3X-<:/11--$(^9/B5/%NW%AM>:56:4$<^*$.D&!('^\*!$>+HEXTOSHOY=P("* +M!:T_O"%(<`3QWV/!=W6O8T(P(!KE#OUMOTR!%!@U)B_#X;ZB-JS(Y[HK,I7FH,"8&=&>?Z-F1'Y4JSN#"\J,*:?BO!T6=JT[ +MVU9D3G0>%-N2"@QL2.2X79]NO>]#IL2H.:0Q-].+\C+50XM9;K?:C`%DL=*< +MX$FTV/JL!_,ESZ_*CO3I1Q@0U6^(\&]*RWO\J-9M.BP``0($!`8&`!$```````````````````!D````$````/\` +M#"`(````$@```````````````````"P!```0````_P`,(`(````3```````` +M````````````+`$``!````#_``P@!P```!0`````````0`8````````!```` +M$`````$`#$`$````%0````````!`!@````````$````0`````0`,0`,````6 +M`````````$`&`````````0```!`````!``Q``P```!<````````````````` +M```!````$````/\`!``$````&`````````!`!@```````#(````R`````0', +M0`,````9`````````````````````0````$````!`0"``0```!H````````` +M```````````!`````0```/__`*`%````&P`````````0``````````$````0 +M`````0($``8````<``````````0``````````0````$````!``P``0```!T` +M````````!``````````!`````0````$`#``!````'@`````````$```````` +M``$````!`````0``@`$````?`````````````````````0````@```#_``P@ +M!@```"`````````````````````!````"````/\`#"`"````(0`````````` +M``````````$````!````_P`,H`,````B`````````````````````0````$` +M```!`@R``0```",````````````````````!`````0```/\``*`&````)``` +M``````````````````$````!`````0)$``(````E```````````````````` +M`0```!````#_``P@`P```"8`````````V``````````!````9`````$`"``" +M````)P`````````L`0````````$````!`````0`,0`0````H`````````"P! +M`````````0````$```#_``Q`!````"D`````````+`$````````!`````0`` +M``$`#$`$````*@`````````L`0````````$````!`````0`,0`,````K```` +M`````"P!`````````0````$````!``Q`!0```"P``````````@`````````! +M`````0````$`!``%````+0`````````$``````````$````!`````0`,0`$` +M```N`````````"P!`````````0```&D````!``Q``P```"\````````````` +M`````````@``$@```/\`#&`"````,``````````R`````````&0````0```` +M_P`,8`8````Q`````````"P!`````````0```&X````!``Q`!`````0,#`@4 +M!`0$0````(```````0````(````$``!`````0````$````#_0555%0````"` +MB(@(`````0``'/____\`$```!`$`&/[__W\`"```!`(!&/____\`$````0$! +M&/____\`$````P``'/S_4M55#0```@``'/S_I^JK#@``!0(!&/S_4M55#0`` +M`@$!&/S_I^JK#@```P$!&/S_4M55#0``!0$`&/S_J6JK!@```$```!<```#L +MM@``%``````````!````,((!``````#TVP```P```-"[```$````A-8```@` +M```TU```#````##'```1`````````!,```!XMP``%@```&1P`@``````K-L` +M``0```#D;0(`!0```#C"```(````.-0```P```#'V````````````````````````````````````````!``````#0_@`````` +M````````````````````````````````````$``````````0```````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Jul 25 23:44: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 407D5BA540E; Mon, 25 Jul 2016 23:44:46 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBA3A1F17; Mon, 25 Jul 2016 23:44:45 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6PNijql059465; Mon, 25 Jul 2016 23:44:45 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PNijea059463; Mon, 25 Jul 2016 23:44:45 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201607252344.u6PNijea059463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 25 Jul 2016 23:44:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303326 - head/sys/dev/iwm 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.22 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, 25 Jul 2016 23:44:46 -0000 Author: sbruno Date: Mon Jul 25 23:44:44 2016 New Revision: 303326 URL: https://svnweb.freebsd.org/changeset/base/303326 Log: iwm(4): switch to ieee80211_runtask() Submitted by: Andiry Voskoboinyk (s3erios@gmail.com) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D5054 Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Mon Jul 25 23:38:14 2016 (r303325) +++ head/sys/dev/iwm/if_iwm.c Mon Jul 25 23:44:44 2016 (r303326) @@ -4092,6 +4092,7 @@ do { \ static void iwm_notif_intr(struct iwm_softc *sc) { + struct ieee80211com *ic = &sc->sc_ic; uint16_t hw; bus_dmamap_sync(sc->rxq.stat_dma.tag, sc->rxq.stat_dma.map, @@ -4145,7 +4146,6 @@ iwm_notif_intr(struct iwm_softc *sc) int missed; /* XXX look at mac_id to determine interface ID */ - struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); SYNC_RESP_STRUCT(resp, pkt); @@ -4253,7 +4253,7 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_SCAN_COMPLETE_NOTIFICATION: { struct iwm_scan_complete_notif *notif; SYNC_RESP_STRUCT(notif, pkt); - taskqueue_enqueue(sc->sc_tq, &sc->sc_es_task); + ieee80211_runtask(ic, &sc->sc_es_task); break; } case IWM_REPLY_ERROR: { @@ -4627,14 +4627,6 @@ iwm_attach(device_t dev) callout_init_mtx(&sc->sc_watchdog_to, &sc->sc_mtx, 0); callout_init_mtx(&sc->sc_led_blink_to, &sc->sc_mtx, 0); TASK_INIT(&sc->sc_es_task, 0, iwm_endscan_cb, sc); - sc->sc_tq = taskqueue_create("iwm_taskq", M_WAITOK, - taskqueue_thread_enqueue, &sc->sc_tq); - error = taskqueue_start_threads(&sc->sc_tq, 1, 0, "iwm_taskq"); - if (error != 0) { - device_printf(dev, "can't start threads, error %d\n", - error); - goto fail; - } /* PCI attach */ error = iwm_pci_attach(dev); @@ -5015,10 +5007,8 @@ iwm_detach_local(struct iwm_softc *sc, i device_t dev = sc->sc_dev; int i; - if (sc->sc_tq) { - taskqueue_drain_all(sc->sc_tq); - taskqueue_free(sc->sc_tq); - } + ieee80211_draintask(&sc->sc_ic, &sc->sc_es_task); + callout_drain(&sc->sc_led_blink_to); callout_drain(&sc->sc_watchdog_to); iwm_stop_device(sc); Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Mon Jul 25 23:38:14 2016 (r303325) +++ head/sys/dev/iwm/if_iwmvar.h Mon Jul 25 23:44:44 2016 (r303326) @@ -495,7 +495,6 @@ struct iwm_softc { uint8_t sc_cmd_resp[IWM_CMD_RESP_MAX]; int sc_wantresp; - struct taskqueue *sc_tq; struct task sc_es_task; struct iwm_rx_phy_info sc_last_phy_info; From owner-svn-src-head@freebsd.org Tue Jul 26 00:02: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 6B2DEBA59E7; Tue, 26 Jul 2016 00:02:18 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 026EC19E2; Tue, 26 Jul 2016 00:02:17 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6Q02HFF066812; Tue, 26 Jul 2016 00:02:17 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6Q02HKn066810; Tue, 26 Jul 2016 00:02:17 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201607260002.u6Q02HKn066810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 26 Jul 2016 00:02:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303327 - head/sys/dev/iwm 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.22 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, 26 Jul 2016 00:02:18 -0000 Author: sbruno Date: Tue Jul 26 00:02:17 2016 New Revision: 303327 URL: https://svnweb.freebsd.org/changeset/base/303327 Log: iwm(4) synchronize driver to DragonFlyBSD version and recent f/w update. Submitted by: Kevin Bowling (kevin.bowling@kev009.com) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6967 Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_led.c head/sys/dev/iwm/if_iwm_led.h head/sys/dev/iwm/if_iwm_mac_ctxt.c head/sys/dev/iwm/if_iwm_pcie_trans.c head/sys/dev/iwm/if_iwm_phy_ctxt.c head/sys/dev/iwm/if_iwm_phy_db.c head/sys/dev/iwm/if_iwm_power.c head/sys/dev/iwm/if_iwm_scan.c head/sys/dev/iwm/if_iwm_scan.h head/sys/dev/iwm/if_iwm_time_event.c head/sys/dev/iwm/if_iwm_util.c head/sys/dev/iwm/if_iwm_util.h head/sys/dev/iwm/if_iwmreg.h head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Mon Jul 25 23:44:44 2016 (r303326) +++ head/sys/dev/iwm/if_iwm.c Tue Jul 26 00:02:17 2016 (r303327) @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwm.c,v 1.39 2015/03/23 00:35:19 jsg Exp $ */ +/* $OpenBSD: if_iwm.c,v 1.42 2015/05/30 02:49:23 deraadt Exp $ */ /* * Copyright (c) 2014 genua mbh @@ -173,11 +173,23 @@ const uint8_t iwm_nvm_channels[] = { 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 149, 153, 157, 161, 165 }; -#define IWM_NUM_2GHZ_CHANNELS 14 - _Static_assert(nitems(iwm_nvm_channels) <= IWM_NUM_CHANNELS, "IWM_NUM_CHANNELS is too small"); +const uint8_t iwm_nvm_channels_8000[] = { + /* 2.4 GHz */ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + /* 5 GHz */ + 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 84, 88, 92, + 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, + 149, 153, 157, 161, 165, 169, 173, 177, 181 +}; +_Static_assert(nitems(iwm_nvm_channels_8000) <= IWM_NUM_CHANNELS_8000, + "IWM_NUM_CHANNELS_8000 is too small"); + +#define IWM_NUM_2GHZ_CHANNELS 14 +#define IWM_N_HW_ADDR_MASK 0xF + /* * XXX For now, there's simply a fixed set of rate table entries * that are populated. @@ -205,6 +217,11 @@ const struct iwm_rate { #define IWM_RIDX_IS_CCK(_i_) ((_i_) < IWM_RIDX_OFDM) #define IWM_RIDX_IS_OFDM(_i_) ((_i_) >= IWM_RIDX_OFDM) +struct iwm_nvm_section { + uint16_t length; + uint8_t *data; +}; + static int iwm_store_cscheme(struct iwm_softc *, const uint8_t *, size_t); static int iwm_firmware_store_section(struct iwm_softc *, enum iwm_ucode_type, @@ -242,27 +259,45 @@ static void iwm_mvm_nic_config(struct iw static int iwm_nic_rx_init(struct iwm_softc *); static int iwm_nic_tx_init(struct iwm_softc *); static int iwm_nic_init(struct iwm_softc *); -static void iwm_enable_txq(struct iwm_softc *, int, int); +static int iwm_enable_txq(struct iwm_softc *, int, int, int); static int iwm_post_alive(struct iwm_softc *); static int iwm_nvm_read_chunk(struct iwm_softc *, uint16_t, uint16_t, uint16_t, uint8_t *, uint16_t *); static int iwm_nvm_read_section(struct iwm_softc *, uint16_t, uint8_t *, - uint16_t *); + uint16_t *, size_t); static uint32_t iwm_eeprom_channel_flags(uint16_t); static void iwm_add_channel_band(struct iwm_softc *, - struct ieee80211_channel[], int, int *, int, int, + struct ieee80211_channel[], int, int *, int, size_t, const uint8_t[]); static void iwm_init_channel_map(struct ieee80211com *, int, int *, struct ieee80211_channel[]); static int iwm_parse_nvm_data(struct iwm_softc *, const uint16_t *, - const uint16_t *, const uint16_t *, uint8_t, - uint8_t); -struct iwm_nvm_section; + const uint16_t *, const uint16_t *, + const uint16_t *, const uint16_t *, + const uint16_t *); +static void iwm_set_hw_address_8000(struct iwm_softc *, + struct iwm_nvm_data *, + const uint16_t *, const uint16_t *); +static int iwm_get_sku(const struct iwm_softc *, const uint16_t *, + const uint16_t *); +static int iwm_get_nvm_version(const struct iwm_softc *, const uint16_t *); +static int iwm_get_radio_cfg(const struct iwm_softc *, const uint16_t *, + const uint16_t *); +static int iwm_get_n_hw_addrs(const struct iwm_softc *, + const uint16_t *); +static void iwm_set_radio_cfg(const struct iwm_softc *, + struct iwm_nvm_data *, uint32_t); static int iwm_parse_nvm_sections(struct iwm_softc *, struct iwm_nvm_section *); static int iwm_nvm_init(struct iwm_softc *); +static int iwm_firmware_load_sect(struct iwm_softc *, uint32_t, + const uint8_t *, uint32_t); static int iwm_firmware_load_chunk(struct iwm_softc *, uint32_t, const uint8_t *, uint32_t); +static int iwm_load_firmware_7000(struct iwm_softc *, enum iwm_ucode_type); +static int iwm_load_cpu_sections_8000(struct iwm_softc *, + struct iwm_fw_sects *, int , int *); +static int iwm_load_firmware_8000(struct iwm_softc *, enum iwm_ucode_type); static int iwm_load_firmware(struct iwm_softc *, enum iwm_ucode_type); static int iwm_start_fw(struct iwm_softc *, enum iwm_ucode_type); static int iwm_send_tx_ant_cfg(struct iwm_softc *, uint8_t); @@ -297,10 +332,8 @@ static int iwm_tx(struct iwm_softc *, st struct ieee80211_node *, int); static int iwm_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); -static void iwm_mvm_add_sta_cmd_v6_to_v5(struct iwm_mvm_add_sta_cmd_v6 *, - struct iwm_mvm_add_sta_cmd_v5 *); static int iwm_mvm_send_add_sta_cmd_status(struct iwm_softc *, - struct iwm_mvm_add_sta_cmd_v6 *, + struct iwm_mvm_add_sta_cmd_v7 *, int *); static int iwm_mvm_sta_send_to_fw(struct iwm_softc *, struct iwm_node *, int); @@ -321,6 +354,13 @@ static void iwm_setrates(struct iwm_soft static int iwm_media_change(struct ifnet *); static int iwm_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void iwm_endscan_cb(void *, int); +static void iwm_mvm_fill_sf_command(struct iwm_softc *, + struct iwm_sf_cfg_cmd *, + struct ieee80211_node *); +static int iwm_mvm_sf_config(struct iwm_softc *, enum iwm_sf_state); +static int iwm_send_bt_init_conf(struct iwm_softc *); +static int iwm_send_update_mcc_cmd(struct iwm_softc *, const char *); +static void iwm_mvm_tt_tx_backoff(struct iwm_softc *, uint32_t); static int iwm_init_hw(struct iwm_softc *); static void iwm_init(struct iwm_softc *); static void iwm_start(struct iwm_softc *); @@ -331,10 +371,12 @@ static void iwm_parent(struct ieee80211c static const char * iwm_desc_lookup(uint32_t); static void iwm_nic_error(struct iwm_softc *); +static void iwm_nic_umac_error(struct iwm_softc *); #endif static void iwm_notif_intr(struct iwm_softc *); static void iwm_intr(void *); static int iwm_attach(device_t); +static int iwm_is_valid_ether_addr(uint8_t *); static void iwm_preinit(void *); static int iwm_detach_local(struct iwm_softc *sc, int); static void iwm_init_task(void *); @@ -477,6 +519,12 @@ iwm_read_firmware(struct iwm_softc *sc, } fw->fw_fp = fwp; + /* (Re-)Initialize default values. */ + sc->sc_capaflags = 0; + sc->sc_capa_n_scan_channels = IWM_MAX_NUM_SCAN_CHANNELS; + memset(sc->sc_enabled_capa, 0, sizeof(sc->sc_enabled_capa)); + memset(sc->sc_fw_mcc, 0, sizeof(sc->sc_fw_mcc)); + /* * Parse firmware contents */ @@ -490,7 +538,10 @@ iwm_read_firmware(struct iwm_softc *sc, goto out; } - sc->sc_fwver = le32toh(uhdr->ver); + snprintf(sc->sc_fwver, sizeof(sc->sc_fwver), "%d.%d (API ver %d)", + IWM_UCODE_MAJOR(le32toh(uhdr->ver)), + IWM_UCODE_MINOR(le32toh(uhdr->ver)), + IWM_UCODE_API(le32toh(uhdr->ver))); data = uhdr->data; len = fw->fw_fp->datasize - sizeof(*uhdr); @@ -527,7 +578,8 @@ iwm_read_firmware(struct iwm_softc *sc, sc->sc_capa_max_probe_len = le32toh(*(const uint32_t *)tlv_data); /* limit it to something sensible */ - if (sc->sc_capa_max_probe_len > (1<<16)) { + if (sc->sc_capa_max_probe_len > + IWM_SCAN_OFFLOAD_PROBE_REQ_SIZE) { IWM_DPRINTF(sc, IWM_DEBUG_FIRMWARE_TLV, "%s: IWM_UCODE_TLV_PROBE_MAX_LEN " "ridiculous\n", __func__); @@ -578,7 +630,8 @@ iwm_read_firmware(struct iwm_softc *sc, goto parse_out; } break; - case IWM_UCODE_TLV_NUM_OF_CPU: + case IWM_UCODE_TLV_NUM_OF_CPU: { + uint32_t num_cpu; if (tlv_len != sizeof(uint32_t)) { device_printf(sc->sc_dev, "%s: IWM_UCODE_TLV_NUM_OF_CPU: tlv_len (%d) < sizeof(uint32_t)\n", @@ -587,15 +640,16 @@ iwm_read_firmware(struct iwm_softc *sc, error = EINVAL; goto parse_out; } - if (le32toh(*(const uint32_t*)tlv_data) != 1) { + num_cpu = le32toh(*(const uint32_t *)tlv_data); + if (num_cpu < 1 || num_cpu > 2) { device_printf(sc->sc_dev, - "%s: driver supports " - "only TLV_NUM_OF_CPU == 1", + "%s: Driver supports only 1 or 2 CPUs\n", __func__); error = EINVAL; goto parse_out; } break; + } case IWM_UCODE_TLV_SEC_RT: if ((error = iwm_firmware_store_section(sc, IWM_UCODE_TYPE_REGULAR, tlv_data, tlv_len)) != 0) { @@ -657,11 +711,80 @@ iwm_read_firmware(struct iwm_softc *sc, le32toh(*(const uint32_t *)tlv_data); break; - case IWM_UCODE_TLV_API_CHANGES_SET: - case IWM_UCODE_TLV_ENABLED_CAPABILITIES: + case IWM_UCODE_TLV_API_CHANGES_SET: { + const struct iwm_ucode_api *api; + if (tlv_len != sizeof(*api)) { + error = EINVAL; + goto parse_out; + } + api = (const struct iwm_ucode_api *)tlv_data; + /* Flags may exceed 32 bits in future firmware. */ + if (le32toh(api->api_index) > 0) { + device_printf(sc->sc_dev, + "unsupported API index %d\n", + le32toh(api->api_index)); + goto parse_out; + } + sc->sc_ucode_api = le32toh(api->api_flags); + break; + } + + case IWM_UCODE_TLV_ENABLED_CAPABILITIES: { + const struct iwm_ucode_capa *capa; + int idx, i; + if (tlv_len != sizeof(*capa)) { + error = EINVAL; + goto parse_out; + } + capa = (const struct iwm_ucode_capa *)tlv_data; + idx = le32toh(capa->api_index); + if (idx > howmany(IWM_NUM_UCODE_TLV_CAPA, 32)) { + device_printf(sc->sc_dev, + "unsupported API index %d\n", idx); + goto parse_out; + } + for (i = 0; i < 32; i++) { + if ((le32toh(capa->api_capa) & (1U << i)) == 0) + continue; + setbit(sc->sc_enabled_capa, i + (32 * idx)); + } + break; + } + + case 48: /* undocumented TLV */ + case IWM_UCODE_TLV_SDIO_ADMA_ADDR: + case IWM_UCODE_TLV_FW_GSCAN_CAPA: /* ignore, not used by current driver */ break; + case IWM_UCODE_TLV_SEC_RT_USNIFFER: + if ((error = iwm_firmware_store_section(sc, + IWM_UCODE_TYPE_REGULAR_USNIFFER, tlv_data, + tlv_len)) != 0) + goto parse_out; + break; + + case IWM_UCODE_TLV_N_SCAN_CHANNELS: + if (tlv_len != sizeof(uint32_t)) { + error = EINVAL; + goto parse_out; + } + sc->sc_capa_n_scan_channels = + le32toh(*(const uint32_t *)tlv_data); + break; + + case IWM_UCODE_TLV_FW_VERSION: + if (tlv_len != sizeof(uint32_t) * 3) { + error = EINVAL; + goto parse_out; + } + snprintf(sc->sc_fwver, sizeof(sc->sc_fwver), + "%d.%d.%d", + le32toh(((const uint32_t *)tlv_data)[0]), + le32toh(((const uint32_t *)tlv_data)[1]), + le32toh(((const uint32_t *)tlv_data)[2])); + break; + default: device_printf(sc->sc_dev, "%s: unknown firmware section %d, abort\n", @@ -710,7 +833,7 @@ iwm_dma_map_addr(void *arg, bus_dma_segm if (error != 0) return; KASSERT(nsegs == 1, ("too many DMA segments, %d should be 1", nsegs)); - *(bus_addr_t *)arg = segs[0].ds_addr; + *(bus_addr_t *)arg = segs[0].ds_addr; } static int @@ -720,6 +843,7 @@ iwm_dma_contig_alloc(bus_dma_tag_t tag, int error; dma->tag = NULL; + dma->map = NULL; dma->size = size; dma->vaddr = NULL; @@ -739,14 +863,16 @@ iwm_dma_contig_alloc(bus_dma_tag_t tag, if (error != 0) { bus_dmamem_free(dma->tag, dma->vaddr, dma->map); dma->vaddr = NULL; - goto fail; + goto fail; } bus_dmamap_sync(dma->tag, dma->map, BUS_DMASYNC_PREWRITE); return 0; -fail: iwm_dma_contig_free(dma); +fail: + iwm_dma_contig_free(dma); + return error; } @@ -764,7 +890,6 @@ iwm_dma_contig_free(struct iwm_dma_info bus_dma_tag_destroy(dma->tag); dma->tag = NULL; } - } /* fwmem is used to load firmware onto the card */ @@ -901,7 +1026,7 @@ fail: iwm_free_rx_ring(sc, ring); static void iwm_disable_rx_dma(struct iwm_softc *sc) { - + /* XXX conditional nic locks are stupid */ /* XXX print out if we can't lock the NIC? */ if (iwm_nic_lock(sc)) { /* XXX handle if RX stop doesn't finish? */ @@ -915,6 +1040,11 @@ iwm_reset_rx_ring(struct iwm_softc *sc, { /* Reset the ring state */ ring->cur = 0; + + /* + * The hw rx ring index in shared memory must also be cleared, + * otherwise the discrepancy can cause reprocessing chaos. + */ memset(sc->rxq.stat, 0, sizeof(*sc->rxq.stat)); } @@ -1125,6 +1255,7 @@ iwm_ict_reset(struct iwm_softc *sc) /* Set physical address of ICT table (4KB aligned). */ IWM_WRITE(sc, IWM_CSR_DRAM_INT_TBL_REG, IWM_CSR_DRAM_INT_TBL_ENABLE + | IWM_CSR_DRAM_INIT_TBL_WRITE_POINTER | IWM_CSR_DRAM_INIT_TBL_WRAP_CHECK | sc->ict_dma.paddr >> IWM_ICT_PADDR_SHIFT); @@ -1217,7 +1348,7 @@ iwm_stop_device(struct iwm_softc *sc) */ iwm_disable_interrupts(sc); /* stop and reset the on-board processor */ - IWM_WRITE(sc, IWM_CSR_RESET, IWM_CSR_RESET_REG_FLAG_NEVO_RESET); + IWM_WRITE(sc, IWM_CSR_RESET, IWM_CSR_RESET_REG_FLAG_SW_RESET); /* * Even if we stop the HW, we still want the RF kill @@ -1263,9 +1394,11 @@ iwm_mvm_nic_config(struct iwm_softc *sc) * (PCIe power is lost before PERST# is asserted), causing ME FW * to lose ownership and not being able to obtain it back. */ - iwm_set_bits_mask_prph(sc, IWM_APMG_PS_CTRL_REG, - IWM_APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS, - ~IWM_APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS); + if (sc->sc_device_family == IWM_DEVICE_FAMILY_7000) { + iwm_set_bits_mask_prph(sc, IWM_APMG_PS_CTRL_REG, + IWM_APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS, + ~IWM_APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS); + } } static int @@ -1295,16 +1428,12 @@ iwm_nic_rx_init(struct iwm_softc *sc) IWM_FH_RSCSR_CHNL0_STTS_WPTR_REG, sc->rxq.stat_dma.paddr >> 4); /* Enable RX. */ - /* - * Note: Linux driver also sets this: - * (IWM_RX_RB_TIMEOUT << IWM_FH_RCSR_RX_CONFIG_REG_IRQ_RBTH_POS) | - * - * It causes weird behavior. YMMV. - */ IWM_WRITE(sc, IWM_FH_MEM_RCSR_CHNL0_CONFIG_REG, IWM_FH_RCSR_RX_CONFIG_CHNL_EN_ENABLE_VAL | IWM_FH_RCSR_CHNL0_RX_IGNORE_RXF_EMPTY | /* HW bug */ IWM_FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_INT_HOST_VAL | + IWM_FH_RCSR_CHNL0_RX_CONFIG_SINGLE_FRAME_MSK | + (IWM_RX_RB_TIMEOUT << IWM_FH_RCSR_RX_CONFIG_REG_IRQ_RBTH_POS) | IWM_FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_4K | IWM_RX_QUEUE_SIZE_LOG << IWM_FH_RCSR_RX_CONFIG_RBDCB_SIZE_POS); @@ -1318,7 +1447,7 @@ iwm_nic_rx_init(struct iwm_softc *sc) * Thus sayeth el jefe (iwlwifi) via a comment: * * This value should initially be 0 (before preparing any - * RBs), should be 8 after preparing the first 8 RBs (for example) + * RBs), should be 8 after preparing the first 8 RBs (for example) */ IWM_WRITE(sc, IWM_FH_RSCSR_CHNL0_WPTR, 8); @@ -1354,6 +1483,9 @@ iwm_nic_tx_init(struct iwm_softc *sc) qid, txq->desc, (unsigned long) (txq->desc_dma.paddr >> 8)); } + + iwm_write_prph(sc, IWM_SCD_GP_CTRL, IWM_SCD_GP_CTRL_AUTO_ACTIVE_MODE); + iwm_nic_unlock(sc); return 0; @@ -1365,7 +1497,8 @@ iwm_nic_init(struct iwm_softc *sc) int error; iwm_apm_init(sc); - iwm_set_pwr(sc); + if (sc->sc_device_family == IWM_DEVICE_FAMILY_7000) + iwm_set_pwr(sc); iwm_mvm_nic_config(sc); @@ -1392,52 +1525,79 @@ const uint8_t iwm_mvm_ac_to_tx_fifo[] = IWM_MVM_TX_FIFO_BK, }; -static void -iwm_enable_txq(struct iwm_softc *sc, int qid, int fifo) +static int +iwm_enable_txq(struct iwm_softc *sc, int sta_id, int qid, int fifo) { if (!iwm_nic_lock(sc)) { device_printf(sc->sc_dev, "%s: cannot enable txq %d\n", __func__, qid); - return; /* XXX return EBUSY */ + return EBUSY; } - /* unactivate before configuration */ - iwm_write_prph(sc, IWM_SCD_QUEUE_STATUS_BITS(qid), - (0 << IWM_SCD_QUEUE_STTS_REG_POS_ACTIVE) - | (1 << IWM_SCD_QUEUE_STTS_REG_POS_SCD_ACT_EN)); + IWM_WRITE(sc, IWM_HBUS_TARG_WRPTR, qid << 8 | 0); - if (qid != IWM_MVM_CMD_QUEUE) { - iwm_set_bits_prph(sc, IWM_SCD_QUEUECHAIN_SEL, (1 << qid)); - } + if (qid == IWM_MVM_CMD_QUEUE) { + /* unactivate before configuration */ + iwm_write_prph(sc, IWM_SCD_QUEUE_STATUS_BITS(qid), + (0 << IWM_SCD_QUEUE_STTS_REG_POS_ACTIVE) + | (1 << IWM_SCD_QUEUE_STTS_REG_POS_SCD_ACT_EN)); + + iwm_clear_bits_prph(sc, IWM_SCD_AGGR_SEL, (1 << qid)); + + iwm_write_prph(sc, IWM_SCD_QUEUE_RDPTR(qid), 0); + + iwm_write_mem32(sc, sc->sched_base + IWM_SCD_CONTEXT_QUEUE_OFFSET(qid), 0); + /* Set scheduler window size and frame limit. */ + iwm_write_mem32(sc, + sc->sched_base + IWM_SCD_CONTEXT_QUEUE_OFFSET(qid) + + sizeof(uint32_t), + ((IWM_FRAME_LIMIT << IWM_SCD_QUEUE_CTX_REG2_WIN_SIZE_POS) & + IWM_SCD_QUEUE_CTX_REG2_WIN_SIZE_MSK) | + ((IWM_FRAME_LIMIT << IWM_SCD_QUEUE_CTX_REG2_FRAME_LIMIT_POS) & + IWM_SCD_QUEUE_CTX_REG2_FRAME_LIMIT_MSK)); + + iwm_write_prph(sc, IWM_SCD_QUEUE_STATUS_BITS(qid), + (1 << IWM_SCD_QUEUE_STTS_REG_POS_ACTIVE) | + (fifo << IWM_SCD_QUEUE_STTS_REG_POS_TXF) | + (1 << IWM_SCD_QUEUE_STTS_REG_POS_WSL) | + IWM_SCD_QUEUE_STTS_REG_MSK); + } else { + struct iwm_scd_txq_cfg_cmd cmd; + int error; - iwm_clear_bits_prph(sc, IWM_SCD_AGGR_SEL, (1 << qid)); + iwm_nic_unlock(sc); - IWM_WRITE(sc, IWM_HBUS_TARG_WRPTR, qid << 8 | 0); - iwm_write_prph(sc, IWM_SCD_QUEUE_RDPTR(qid), 0); + memset(&cmd, 0, sizeof(cmd)); + cmd.scd_queue = qid; + cmd.enable = 1; + cmd.sta_id = sta_id; + cmd.tx_fifo = fifo; + cmd.aggregate = 0; + cmd.window = IWM_FRAME_LIMIT; + + error = iwm_mvm_send_cmd_pdu(sc, IWM_SCD_QUEUE_CFG, IWM_CMD_SYNC, + sizeof(cmd), &cmd); + if (error) { + device_printf(sc->sc_dev, + "cannot enable txq %d\n", qid); + return error; + } + + if (!iwm_nic_lock(sc)) + return EBUSY; + } - iwm_write_mem32(sc, sc->sched_base + IWM_SCD_CONTEXT_QUEUE_OFFSET(qid), 0); - /* Set scheduler window size and frame limit. */ - iwm_write_mem32(sc, - sc->sched_base + IWM_SCD_CONTEXT_QUEUE_OFFSET(qid) + - sizeof(uint32_t), - ((IWM_FRAME_LIMIT << IWM_SCD_QUEUE_CTX_REG2_WIN_SIZE_POS) & - IWM_SCD_QUEUE_CTX_REG2_WIN_SIZE_MSK) | - ((IWM_FRAME_LIMIT << IWM_SCD_QUEUE_CTX_REG2_FRAME_LIMIT_POS) & - IWM_SCD_QUEUE_CTX_REG2_FRAME_LIMIT_MSK)); - - iwm_write_prph(sc, IWM_SCD_QUEUE_STATUS_BITS(qid), - (1 << IWM_SCD_QUEUE_STTS_REG_POS_ACTIVE) | - (fifo << IWM_SCD_QUEUE_STTS_REG_POS_TXF) | - (1 << IWM_SCD_QUEUE_STTS_REG_POS_WSL) | - IWM_SCD_QUEUE_STTS_REG_MSK); + iwm_write_prph(sc, IWM_SCD_EN_CTRL, + iwm_read_prph(sc, IWM_SCD_EN_CTRL) | qid); iwm_nic_unlock(sc); - IWM_DPRINTF(sc, IWM_DEBUG_XMIT, - "%s: enabled txq %d FIFO %d\n", + IWM_DPRINTF(sc, IWM_DEBUG_XMIT, "%s: enabled txq %d FIFO %d\n", __func__, qid, fifo); + + return 0; } static int @@ -1445,16 +1605,16 @@ iwm_post_alive(struct iwm_softc *sc) { int nwords; int error, chnl; + uint32_t base; if (!iwm_nic_lock(sc)) return EBUSY; - if (sc->sched_base != iwm_read_prph(sc, IWM_SCD_SRAM_BASE_ADDR)) { + base = iwm_read_prph(sc, IWM_SCD_SRAM_BASE_ADDR); + if (sc->sched_base != base) { device_printf(sc->sc_dev, - "%s: sched addr mismatch", - __func__); - error = EINVAL; - goto out; + "%s: sched addr mismatch: alive: 0x%x prph: 0x%x\n", + __func__, sc->sched_base, base); } iwm_ict_reset(sc); @@ -1474,8 +1634,15 @@ iwm_post_alive(struct iwm_softc *sc) iwm_write_prph(sc, IWM_SCD_CHAINEXT_EN, 0); + iwm_nic_unlock(sc); + /* enable command channel */ - iwm_enable_txq(sc, IWM_MVM_CMD_QUEUE, 7); + error = iwm_enable_txq(sc, 0 /* unused */, IWM_MVM_CMD_QUEUE, 7); + if (error) + return error; + + if (!iwm_nic_lock(sc)) + return EBUSY; iwm_write_prph(sc, IWM_SCD_TXFACT, 0xff); @@ -1490,11 +1657,13 @@ iwm_post_alive(struct iwm_softc *sc) IWM_FH_TX_CHICKEN_BITS_SCD_AUTO_RETRY_EN); /* Enable L1-Active */ - iwm_clear_bits_prph(sc, IWM_APMG_PCIDEV_STT_REG, - IWM_APMG_PCIDEV_STT_VAL_L1_ACT_DIS); + if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) { + iwm_clear_bits_prph(sc, IWM_APMG_PCIDEV_STT_REG, + IWM_APMG_PCIDEV_STT_VAL_L1_ACT_DIS); + } out: - iwm_nic_unlock(sc); + iwm_nic_unlock(sc); return error; } @@ -1508,17 +1677,25 @@ iwm_post_alive(struct iwm_softc *sc) const int nvm_to_read[] = { IWM_NVM_SECTION_TYPE_HW, IWM_NVM_SECTION_TYPE_SW, + IWM_NVM_SECTION_TYPE_REGULATORY, IWM_NVM_SECTION_TYPE_CALIBRATION, IWM_NVM_SECTION_TYPE_PRODUCTION, + IWM_NVM_SECTION_TYPE_HW_8000, + IWM_NVM_SECTION_TYPE_MAC_OVERRIDE, + IWM_NVM_SECTION_TYPE_PHY_SKU, }; /* Default NVM size to read */ -#define IWM_NVM_DEFAULT_CHUNK_SIZE (2*1024) -#define IWM_MAX_NVM_SECTION_SIZE 7000 +#define IWM_NVM_DEFAULT_CHUNK_SIZE (2*1024) +#define IWM_MAX_NVM_SECTION_SIZE 8192 #define IWM_NVM_WRITE_OPCODE 1 #define IWM_NVM_READ_OPCODE 0 +/* load nvm chunk response */ +#define IWM_READ_NVM_CHUNK_SUCCEED 0 +#define IWM_READ_NVM_CHUNK_INVALID_ADDRESS 1 + static int iwm_nvm_read_chunk(struct iwm_softc *sc, uint16_t section, uint16_t offset, uint16_t length, uint8_t *data, uint16_t *len) @@ -1538,20 +1715,24 @@ iwm_nvm_read_chunk(struct iwm_softc *sc, IWM_CMD_SEND_IN_RFKILL, .data = { &nvm_access_cmd, }, }; - int ret, bytes_read, offset_read; + int ret, offset_read; + size_t bytes_read; uint8_t *resp_data; cmd.len[0] = sizeof(struct iwm_nvm_access_cmd); ret = iwm_send_cmd(sc, &cmd); - if (ret) + if (ret) { + device_printf(sc->sc_dev, + "Could not send NVM_ACCESS command (error=%d)\n", ret); return ret; + } pkt = cmd.resp_pkt; if (pkt->hdr.flags & IWM_CMD_FAILED_MSK) { device_printf(sc->sc_dev, - "%s: Bad return from IWM_NVM_ACCES_COMMAND (0x%08X)\n", - __func__, pkt->hdr.flags); + "Bad return from IWM_NVM_ACCES_COMMAND (0x%08X)\n", + pkt->hdr.flags); ret = EIO; goto exit; } @@ -1564,17 +1745,25 @@ iwm_nvm_read_chunk(struct iwm_softc *sc, offset_read = le16toh(nvm_resp->offset); resp_data = nvm_resp->data; if (ret) { - device_printf(sc->sc_dev, - "%s: NVM access command failed with status %d\n", - __func__, ret); + IWM_DPRINTF(sc, IWM_DEBUG_RESET, + "NVM access command failed with status %d\n", ret); ret = EINVAL; goto exit; } if (offset_read != offset) { device_printf(sc->sc_dev, - "%s: NVM ACCESS response with invalid offset %d\n", - __func__, offset_read); + "NVM ACCESS response with invalid offset %d\n", + offset_read); + ret = EINVAL; + goto exit; + } + + if (bytes_read > length) { + device_printf(sc->sc_dev, + "NVM ACCESS response with too much data " + "(%d bytes requested, %zd bytes received)\n", + length, bytes_read); ret = EINVAL; goto exit; } @@ -1589,7 +1778,7 @@ iwm_nvm_read_chunk(struct iwm_softc *sc, /* * Reads an NVM section completely. - * NICs prior to 7000 family doesn't have a real NVM, but just read + * NICs prior to 7000 family don't have a real NVM, but just read * section 0 which is the EEPROM. Because the EEPROM reading is unlimited * by uCode, we need to manually check in this case that we don't * overflow and try to read more than the EEPROM size. @@ -1599,32 +1788,34 @@ iwm_nvm_read_chunk(struct iwm_softc *sc, */ static int iwm_nvm_read_section(struct iwm_softc *sc, - uint16_t section, uint8_t *data, uint16_t *len) + uint16_t section, uint8_t *data, uint16_t *len, size_t max_len) { - uint16_t length, seglen; - int error; + uint16_t chunklen, seglen; + int error = 0; + + IWM_DPRINTF(sc, IWM_DEBUG_RESET, + "reading NVM section %d\n", section); - /* Set nvm section read length */ - length = seglen = IWM_NVM_DEFAULT_CHUNK_SIZE; + chunklen = seglen = IWM_NVM_DEFAULT_CHUNK_SIZE; *len = 0; - /* Read the NVM until exhausted (reading less than requested) */ - while (seglen == length) { + /* Read NVM chunks until exhausted (reading less than requested) */ + while (seglen == chunklen && *len < max_len) { error = iwm_nvm_read_chunk(sc, - section, *len, length, data, &seglen); + section, *len, chunklen, data, &seglen); if (error) { - device_printf(sc->sc_dev, - "Cannot read NVM from section " - "%d offset %d, length %d\n", - section, *len, length); + IWM_DPRINTF(sc, IWM_DEBUG_RESET, + "Cannot read from NVM section " + "%d at offset %d\n", section, *len); return error; } *len += seglen; } IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "NVM section %d read completed\n", section); - return 0; + "NVM section %d read completed (%d bytes, error=%d)\n", + section, *len, error); + return error; } /* @@ -1634,7 +1825,7 @@ iwm_nvm_read_section(struct iwm_softc *s /* iwlwifi/iwl-nvm-parse.c */ /* NVM offsets (in words) definitions */ -enum wkp_nvm_offsets { +enum iwm_nvm_offsets { /* NVM HW-Section offset (in words) definitions */ IWM_HW_ADDR = 0x15, @@ -1651,6 +1842,32 @@ enum wkp_nvm_offsets { IWM_XTAL_CALIB = 0x316 - IWM_NVM_CALIB_SECTION }; +enum iwm_8000_nvm_offsets { + /* NVM HW-Section offset (in words) definitions */ + IWM_HW_ADDR0_WFPM_8000 = 0x12, + IWM_HW_ADDR1_WFPM_8000 = 0x16, + IWM_HW_ADDR0_PCIE_8000 = 0x8A, + IWM_HW_ADDR1_PCIE_8000 = 0x8E, + IWM_MAC_ADDRESS_OVERRIDE_8000 = 1, + + /* NVM SW-Section offset (in words) definitions */ + IWM_NVM_SW_SECTION_8000 = 0x1C0, + IWM_NVM_VERSION_8000 = 0, + IWM_RADIO_CFG_8000 = 0, + IWM_SKU_8000 = 2, + IWM_N_HW_ADDRS_8000 = 3, + + /* NVM REGULATORY -Section offset (in words) definitions */ + IWM_NVM_CHANNELS_8000 = 0, + IWM_NVM_LAR_OFFSET_8000_OLD = 0x4C7, + IWM_NVM_LAR_OFFSET_8000 = 0x507, + IWM_NVM_LAR_ENABLED_8000 = 0x7, + + /* NVM calibration section offset (in words) definitions */ + IWM_NVM_CALIB_SECTION_8000 = 0x2B8, + IWM_XTAL_CALIB_8000 = 0x316 - IWM_NVM_CALIB_SECTION_8000 +}; + /* SKU Capabilities (actual values from NVM definition) */ enum nvm_sku_bits { IWM_NVM_SKU_CAP_BAND_24GHZ = (1 << 0), @@ -1667,6 +1884,13 @@ enum nvm_sku_bits { #define IWM_NVM_RF_CFG_TX_ANT_MSK(x) ((x >> 8) & 0xF) /* bits 8-11 */ #define IWM_NVM_RF_CFG_RX_ANT_MSK(x) ((x >> 12) & 0xF) /* bits 12-15 */ +#define IWM_NVM_RF_CFG_FLAVOR_MSK_8000(x) (x & 0xF) +#define IWM_NVM_RF_CFG_DASH_MSK_8000(x) ((x >> 4) & 0xF) +#define IWM_NVM_RF_CFG_STEP_MSK_8000(x) ((x >> 8) & 0xF) +#define IWM_NVM_RF_CFG_TYPE_MSK_8000(x) ((x >> 12) & 0xFFF) +#define IWM_NVM_RF_CFG_TX_ANT_MSK_8000(x) ((x >> 24) & 0xF) +#define IWM_NVM_RF_CFG_RX_ANT_MSK_8000(x) ((x >> 28) & 0xF) + #define DEFAULT_MAX_TX_POWER 16 /** @@ -1718,7 +1942,8 @@ iwm_eeprom_channel_flags(uint16_t ch_fla static void iwm_add_channel_band(struct iwm_softc *sc, struct ieee80211_channel chans[], - int maxchans, int *nchans, int ch_idx, int ch_num, const uint8_t bands[]) + int maxchans, int *nchans, int ch_idx, size_t ch_num, + const uint8_t bands[]) { const uint16_t * const nvm_ch_flags = sc->sc_nvm.nvm_ch_flags; uint32_t nflags; @@ -1728,7 +1953,10 @@ iwm_add_channel_band(struct iwm_softc *s for (; ch_idx < ch_num; ch_idx++) { ch_flags = le16_to_cpup(nvm_ch_flags + ch_idx); - ieee = iwm_nvm_channels[ch_idx]; + if (sc->sc_device_family == IWM_DEVICE_FAMILY_7000) + ieee = iwm_nvm_channels[ch_idx]; + else + ieee = iwm_nvm_channels_8000[ch_idx]; if (!(ch_flags & IWM_NVM_CHANNEL_VALID)) { IWM_DPRINTF(sc, IWM_DEBUG_EEPROM, @@ -1760,6 +1988,7 @@ iwm_init_channel_map(struct ieee80211com struct iwm_softc *sc = ic->ic_softc; struct iwm_nvm_data *data = &sc->sc_nvm; uint8_t bands[IEEE80211_MODE_BYTES]; + size_t ch_num; memset(bands, 0, sizeof(bands)); /* 1-13: 11b/g channels. */ @@ -1774,51 +2003,182 @@ iwm_init_channel_map(struct ieee80211com IWM_NUM_2GHZ_CHANNELS - 1, IWM_NUM_2GHZ_CHANNELS, bands); if (data->sku_cap_band_52GHz_enable) { + if (sc->sc_device_family == IWM_DEVICE_FAMILY_7000) + ch_num = nitems(iwm_nvm_channels); + else + ch_num = nitems(iwm_nvm_channels_8000); memset(bands, 0, sizeof(bands)); setbit(bands, IEEE80211_MODE_11A); iwm_add_channel_band(sc, chans, maxchans, nchans, - IWM_NUM_2GHZ_CHANNELS, nitems(iwm_nvm_channels), bands); + IWM_NUM_2GHZ_CHANNELS, ch_num, bands); } } +static void +iwm_set_hw_address_8000(struct iwm_softc *sc, struct iwm_nvm_data *data, + const uint16_t *mac_override, const uint16_t *nvm_hw) +{ + const uint8_t *hw_addr; + + if (mac_override) { + static const uint8_t reserved_mac[] = { + 0x02, 0xcc, 0xaa, 0xff, 0xee, 0x00 + }; + + hw_addr = (const uint8_t *)(mac_override + + IWM_MAC_ADDRESS_OVERRIDE_8000); + + /* + * Store the MAC address from MAO section. + * No byte swapping is required in MAO section + */ + IEEE80211_ADDR_COPY(data->hw_addr, hw_addr); + + /* + * Force the use of the OTP MAC address in case of reserved MAC + * address in the NVM, or if address is given but invalid. + */ + if (!IEEE80211_ADDR_EQ(reserved_mac, hw_addr) && + !IEEE80211_ADDR_EQ(ieee80211broadcastaddr, data->hw_addr) && + iwm_is_valid_ether_addr(data->hw_addr) && + !IEEE80211_IS_MULTICAST(data->hw_addr)) + return; + + IWM_DPRINTF(sc, IWM_DEBUG_RESET, + "%s: mac address from nvm override section invalid\n", + __func__); + } + + if (nvm_hw) { + /* read the mac address from WFMP registers */ + uint32_t mac_addr0 = + htole32(iwm_read_prph(sc, IWM_WFMP_MAC_ADDR_0)); + uint32_t mac_addr1 = + htole32(iwm_read_prph(sc, IWM_WFMP_MAC_ADDR_1)); + + hw_addr = (const uint8_t *)&mac_addr0; + data->hw_addr[0] = hw_addr[3]; + data->hw_addr[1] = hw_addr[2]; + data->hw_addr[2] = hw_addr[1]; + data->hw_addr[3] = hw_addr[0]; + + hw_addr = (const uint8_t *)&mac_addr1; + data->hw_addr[4] = hw_addr[1]; + data->hw_addr[5] = hw_addr[0]; + + return; + } + + device_printf(sc->sc_dev, "%s: mac address not found\n", __func__); + memset(data->hw_addr, 0, sizeof(data->hw_addr)); +} + +static int +iwm_get_sku(const struct iwm_softc *sc, const uint16_t *nvm_sw, + const uint16_t *phy_sku) +{ + if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) + return le16_to_cpup(nvm_sw + IWM_SKU); + + return le32_to_cpup((const uint32_t *)(phy_sku + IWM_SKU_8000)); +} + +static int +iwm_get_nvm_version(const struct iwm_softc *sc, const uint16_t *nvm_sw) +{ + if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) + return le16_to_cpup(nvm_sw + IWM_NVM_VERSION); + else + return le32_to_cpup((const uint32_t *)(nvm_sw + + IWM_NVM_VERSION_8000)); +} + +static int +iwm_get_radio_cfg(const struct iwm_softc *sc, const uint16_t *nvm_sw, + const uint16_t *phy_sku) +{ + if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) + return le16_to_cpup(nvm_sw + IWM_RADIO_CFG); + + return le32_to_cpup((const uint32_t *)(phy_sku + IWM_RADIO_CFG_8000)); +} + +static int +iwm_get_n_hw_addrs(const struct iwm_softc *sc, const uint16_t *nvm_sw) +{ + int n_hw_addr; + + if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) + return le16_to_cpup(nvm_sw + IWM_N_HW_ADDRS); + + n_hw_addr = le32_to_cpup((const uint32_t *)(nvm_sw + IWM_N_HW_ADDRS_8000)); + + return n_hw_addr & IWM_N_HW_ADDR_MASK; +} + +static void +iwm_set_radio_cfg(const struct iwm_softc *sc, struct iwm_nvm_data *data, + uint32_t radio_cfg) +{ + if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) { + data->radio_cfg_type = IWM_NVM_RF_CFG_TYPE_MSK(radio_cfg); + data->radio_cfg_step = IWM_NVM_RF_CFG_STEP_MSK(radio_cfg); + data->radio_cfg_dash = IWM_NVM_RF_CFG_DASH_MSK(radio_cfg); + data->radio_cfg_pnum = IWM_NVM_RF_CFG_PNUM_MSK(radio_cfg); + return; + } + + /* set the radio configuration for family 8000 */ + data->radio_cfg_type = IWM_NVM_RF_CFG_TYPE_MSK_8000(radio_cfg); + data->radio_cfg_step = IWM_NVM_RF_CFG_STEP_MSK_8000(radio_cfg); + data->radio_cfg_dash = IWM_NVM_RF_CFG_DASH_MSK_8000(radio_cfg); + data->radio_cfg_pnum = IWM_NVM_RF_CFG_FLAVOR_MSK_8000(radio_cfg); + data->valid_tx_ant = IWM_NVM_RF_CFG_TX_ANT_MSK_8000(radio_cfg); + data->valid_rx_ant = IWM_NVM_RF_CFG_RX_ANT_MSK_8000(radio_cfg); +} + static int iwm_parse_nvm_data(struct iwm_softc *sc, - const uint16_t *nvm_hw, const uint16_t *nvm_sw, - const uint16_t *nvm_calib, uint8_t tx_chains, uint8_t rx_chains) + const uint16_t *nvm_hw, const uint16_t *nvm_sw, + const uint16_t *nvm_calib, const uint16_t *mac_override, + const uint16_t *phy_sku, const uint16_t *regulatory) { struct iwm_nvm_data *data = &sc->sc_nvm; uint8_t hw_addr[IEEE80211_ADDR_LEN]; - uint16_t radio_cfg, sku; + uint32_t sku, radio_cfg; - data->nvm_version = le16_to_cpup(nvm_sw + IWM_NVM_VERSION); + data->nvm_version = iwm_get_nvm_version(sc, nvm_sw); - radio_cfg = le16_to_cpup(nvm_sw + IWM_RADIO_CFG); - data->radio_cfg_type = IWM_NVM_RF_CFG_TYPE_MSK(radio_cfg); - data->radio_cfg_step = IWM_NVM_RF_CFG_STEP_MSK(radio_cfg); - data->radio_cfg_dash = IWM_NVM_RF_CFG_DASH_MSK(radio_cfg); - data->radio_cfg_pnum = IWM_NVM_RF_CFG_PNUM_MSK(radio_cfg); + radio_cfg = iwm_get_radio_cfg(sc, nvm_sw, phy_sku); + iwm_set_radio_cfg(sc, data, radio_cfg); - sku = le16_to_cpup(nvm_sw + IWM_SKU); + sku = iwm_get_sku(sc, nvm_sw, phy_sku); data->sku_cap_band_24GHz_enable = sku & IWM_NVM_SKU_CAP_BAND_24GHZ; data->sku_cap_band_52GHz_enable = sku & IWM_NVM_SKU_CAP_BAND_52GHZ; data->sku_cap_11n_enable = 0; - data->n_hw_addrs = le16_to_cpup(nvm_sw + IWM_N_HW_ADDRS); - - data->xtal_calib[0] = *(nvm_calib + IWM_XTAL_CALIB); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Jul 26 03:47:17 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 45310BA5185; Tue, 26 Jul 2016 03:47:17 +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 17DFC183A; Tue, 26 Jul 2016 03:47:17 +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 u6Q3lG3p049506; Tue, 26 Jul 2016 03:47:16 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6Q3lGI8049505; Tue, 26 Jul 2016 03:47:16 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201607260347.u6Q3lGI8049505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 26 Jul 2016 03:47:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303328 - head/share/man/man3 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.22 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, 26 Jul 2016 03:47:17 -0000 Author: bdrewery Date: Tue Jul 26 03:47:16 2016 New Revision: 303328 URL: https://svnweb.freebsd.org/changeset/base/303328 Log: Add links for bit_ffc_at(3) and bit_ffs_at(3). MFC after: 3 days Modified: head/share/man/man3/Makefile Modified: head/share/man/man3/Makefile ============================================================================== --- head/share/man/man3/Makefile Tue Jul 26 00:02:17 2016 (r303327) +++ head/share/man/man3/Makefile Tue Jul 26 03:47:16 2016 (r303328) @@ -49,7 +49,9 @@ MLINKS+= bitstring.3 bit_alloc.3 \ bitstring.3 bit_clear.3 \ bitstring.3 bit_decl.3 \ bitstring.3 bit_ffc.3 \ + bitstring.3 bit_ffc_at.3 \ bitstring.3 bit_ffs.3 \ + bitstring.3 bit_ffs_at.3 \ bitstring.3 bit_nclear.3 \ bitstring.3 bit_nset.3 \ bitstring.3 bit_set.3 \ From owner-svn-src-head@freebsd.org Tue Jul 26 05:06: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 539D9BA5DD1; Tue, 26 Jul 2016 05:06:01 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07971172F; Tue, 26 Jul 2016 05:06:00 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6Q560wB079239; Tue, 26 Jul 2016 05:06:00 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6Q5601h079238; Tue, 26 Jul 2016 05:06:00 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201607260506.u6Q5601h079238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 26 Jul 2016 05:06:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303329 - head/sys/dev/hyperv/vmbus 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.22 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, 26 Jul 2016 05:06:01 -0000 Author: sephe Date: Tue Jul 26 05:06:00 2016 New Revision: 303329 URL: https://svnweb.freebsd.org/changeset/base/303329 Log: hyperv/vmbus: Nuke unnecessary accessor functions. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D7303 Modified: head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Modified: head/sys/dev/hyperv/vmbus/hv_ring_buffer.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Tue Jul 26 03:47:16 2016 (r303328) +++ head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Tue Jul 26 05:06:00 2016 (r303329) @@ -136,86 +136,6 @@ get_ring_buffer_avail_bytes(hv_vmbus_rin *read = rbi->ring_data_size - *write; } -/** - * @brief Get the next write location for the specified ring buffer - */ -static __inline uint32_t -get_next_write_location(hv_vmbus_ring_buffer_info *ring_info) -{ - return ring_info->ring_buffer->br_windex; -} - -/** - * @brief Set the next write location for the specified ring buffer - */ -static __inline void -set_next_write_location(hv_vmbus_ring_buffer_info *ring_info, - uint32_t next_write_location) -{ - ring_info->ring_buffer->br_windex = next_write_location; -} - -/** - * @brief Get the next read location for the specified ring buffer - */ -static __inline uint32_t -get_next_read_location(hv_vmbus_ring_buffer_info *ring_info) -{ - return ring_info->ring_buffer->br_rindex; -} - -/** - * @brief Get the next read location + offset for the specified ring buffer. - * This allows the caller to skip. - */ -static __inline uint32_t -get_next_read_location_with_offset(hv_vmbus_ring_buffer_info *ring_info, - uint32_t offset) -{ - uint32_t next = ring_info->ring_buffer->br_rindex; - - next += offset; - next %= ring_info->ring_data_size; - return (next); -} - -/** - * @brief Set the next read location for the specified ring buffer - */ -static __inline void -set_next_read_location(hv_vmbus_ring_buffer_info *ring_info, - uint32_t next_read_location) -{ - ring_info->ring_buffer->br_rindex = next_read_location; -} - -/** - * @brief Get the start of the ring buffer - */ -static __inline void * -get_ring_buffer(hv_vmbus_ring_buffer_info *ring_info) -{ - return ring_info->ring_buffer->br_data; -} - -/** - * @brief Get the size of the ring buffer. - */ -static __inline uint32_t -get_ring_buffer_size(hv_vmbus_ring_buffer_info *ring_info) -{ - return ring_info->ring_data_size; -} - -/** - * Get the read and write indices as uint64_t of the specified ring buffer. - */ -static __inline uint64_t -get_ring_buffer_indices(hv_vmbus_ring_buffer_info *ring_info) -{ - return ((uint64_t)ring_info->ring_buffer->br_windex) << 32; -} - void hv_ring_buffer_read_begin(hv_vmbus_ring_buffer_info *ring_info) { @@ -341,7 +261,7 @@ hv_ring_buffer_write(hv_vmbus_ring_buffe /* * Write to the ring buffer */ - next_write_location = get_next_write_location(out_ring_info); + next_write_location = out_ring_info->ring_buffer->br_windex; old_write_location = next_write_location; @@ -353,7 +273,7 @@ hv_ring_buffer_write(hv_vmbus_ring_buffe /* * Set previous packet start */ - prev_indices = get_ring_buffer_indices(out_ring_info); + prev_indices = ((uint64_t)out_ring_info->ring_buffer->br_windex) << 32; next_write_location = copy_to_ring_buffer(out_ring_info, next_write_location, (char *)&prev_indices, sizeof(uint64_t)); @@ -366,7 +286,7 @@ hv_ring_buffer_write(hv_vmbus_ring_buffe /* * Now, update the write location */ - set_next_write_location(out_ring_info, next_write_location); + out_ring_info->ring_buffer->br_windex = next_write_location; mtx_unlock_spin(&out_ring_info->ring_lock); @@ -403,7 +323,7 @@ hv_ring_buffer_peek(hv_vmbus_ring_buffer /* * Convert to byte offset */ - nextReadLocation = get_next_read_location(in_ring_info); + nextReadLocation = in_ring_info->ring_buffer->br_rindex; nextReadLocation = copy_from_ring_buffer(in_ring_info, (char *)buffer, buffer_len, nextReadLocation); @@ -441,8 +361,8 @@ hv_ring_buffer_read(hv_vmbus_ring_buffer return (EAGAIN); } - next_read_location = get_next_read_location_with_offset(in_ring_info, - offset); + next_read_location = (in_ring_info->ring_buffer->br_rindex + offset) % + in_ring_info->ring_data_size; next_read_location = copy_from_ring_buffer(in_ring_info, (char *)buffer, buffer_len, next_read_location); @@ -460,7 +380,7 @@ hv_ring_buffer_read(hv_vmbus_ring_buffer /* * Update the read index */ - set_next_read_location(in_ring_info, next_read_location); + in_ring_info->ring_buffer->br_rindex = next_read_location; mtx_unlock_spin(&in_ring_info->ring_lock); @@ -476,8 +396,8 @@ static uint32_t copy_to_ring_buffer(hv_vmbus_ring_buffer_info *ring_info, uint32_t start_write_offset, const uint8_t *src, uint32_t src_len) { - char *ring_buffer = get_ring_buffer(ring_info); - uint32_t ring_buffer_size = get_ring_buffer_size(ring_info); + char *ring_buffer = ring_info->ring_buffer->br_data; + uint32_t ring_buffer_size = ring_info->ring_data_size; uint32_t fragLen; if (src_len > ring_buffer_size - start_write_offset) { @@ -505,8 +425,8 @@ copy_from_ring_buffer(hv_vmbus_ring_buff uint32_t dest_len, uint32_t start_read_offset) { uint32_t fragLen; - char *ring_buffer = get_ring_buffer(ring_info); - uint32_t ring_buffer_size = get_ring_buffer_size(ring_info); + char *ring_buffer = ring_info->ring_buffer->br_data; + uint32_t ring_buffer_size = ring_info->ring_data_size; if (dest_len > ring_buffer_size - start_read_offset) { /* wrap-around detected at the src */ From owner-svn-src-head@freebsd.org Tue Jul 26 07:56: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 21D2DBA51BE for ; Tue, 26 Jul 2016 07:56:40 +0000 (UTC) (envelope-from vu700404@s7.unas.hu) Received: from s7.unas.hu (ip18.unas.hu [78.24.185.61]) by mx1.freebsd.org (Postfix) with ESMTP id 4C7AD18C9 for ; Tue, 26 Jul 2016 07:56:37 +0000 (UTC) (envelope-from vu700404@s7.unas.hu) Received: from localhost.localdomain (localhost [127.0.0.1]) by s7.unas.hu (Postfix) with ESMTP id AF1327A4F93 for ; Tue, 26 Jul 2016 09:49:35 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by s7.unas.hu (Postfix) with ESMTP id 96B707A4F3C for ; Tue, 26 Jul 2016 09:49:35 +0200 (CEST) X-Virus-Scanned: by Unas Amavis at s7.unas.hu Received: from s7.unas.hu ([127.0.0.1]) by localhost (s7.unas.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bR-cE+Qnpbw6 for ; Tue, 26 Jul 2016 09:49:27 +0200 (CEST) Received: by s7.unas.hu (Postfix, from userid 700404) id 07EDC7A4F8A; Tue, 26 Jul 2016 09:49:26 +0200 (CEST) To: svn-src-head@freebsd.org Subject: Courier was unable to deliver the parcel, ID00185998 Date: Tue, 26 Jul 2016 09:49:26 +0200 From: "FedEx Standard Overnight" Reply-To: "FedEx Standard Overnight" Message-ID: <793b63b9fbf88c704053169abd5de24a@ajkafoto.hu> X-Priority: 3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 26 Jul 2016 07:56:40 -0000 Dear Customer, Courier was unable to deliver the parcel to you. Please, download Delivery Label attached to this email. Warm regards, Daniel Blanchard, FedEx Delivery Manager. From owner-svn-src-head@freebsd.org Tue Jul 26 13:36: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 6211DBA5878; Tue, 26 Jul 2016 13:36:29 +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 2EDC617D1; Tue, 26 Jul 2016 13:36:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6QDaSbI070810; Tue, 26 Jul 2016 13:36:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6QDaS5d070809; Tue, 26 Jul 2016 13:36:28 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201607261336.u6QDaS5d070809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 26 Jul 2016 13:36:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303335 - head/sys/dev/kbd 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.22 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, 26 Jul 2016 13:36:29 -0000 Author: emaste Date: Tue Jul 26 13:36:28 2016 New Revision: 303335 URL: https://svnweb.freebsd.org/changeset/base/303335 Log: apply some style(9) to kbd: make function name start in column 1 Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/kbd/kbd.c Modified: head/sys/dev/kbd/kbd.c ============================================================================== --- head/sys/dev/kbd/kbd.c Tue Jul 26 08:58:44 2016 (r303334) +++ head/sys/dev/kbd/kbd.c Tue Jul 26 13:36:28 2016 (r303335) @@ -284,8 +284,8 @@ kbd_unregister(keyboard_t *kbd) } /* find a function table by the driver name */ -keyboard_switch_t -*kbd_get_switch(char *driver) +keyboard_switch_t * +kbd_get_switch(char *driver) { const keyboard_driver_t **list; const keyboard_driver_t *p; @@ -419,8 +419,8 @@ kbd_change_callback(keyboard_t *kbd, voi } /* get a keyboard structure */ -keyboard_t -*kbd_get_keyboard(int index) +keyboard_t * +kbd_get_keyboard(int index) { if ((index < 0) || (index >= keyboards)) return (NULL); @@ -1118,8 +1118,8 @@ fkey_change_ok(fkeytab_t *oldkey, fkeyar #endif /* get a pointer to the string associated with the given function key */ -u_char -*genkbd_get_fkeystr(keyboard_t *kbd, int fkey, size_t *len) +u_char * +genkbd_get_fkeystr(keyboard_t *kbd, int fkey, size_t *len) { if (kbd == NULL) return (NULL); @@ -1131,8 +1131,8 @@ u_char } /* diagnostic dump */ -static char -*get_kbd_type_name(int type) +static char * +get_kbd_type_name(int type) { static struct { int type; From owner-svn-src-head@freebsd.org Tue Jul 26 15:34: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 E825ABA5AF2; Tue, 26 Jul 2016 15:34:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B79C51192; Tue, 26 Jul 2016 15:34:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6QFYQ5K017046; Tue, 26 Jul 2016 15:34:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6QFYQ9L017045; Tue, 26 Jul 2016 15:34:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201607261534.u6QFYQ9L017045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 26 Jul 2016 15:34:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303338 - head/sys/dev/vt 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.22 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, 26 Jul 2016 15:34:28 -0000 Author: emaste Date: Tue Jul 26 15:34:26 2016 New Revision: 303338 URL: https://svnweb.freebsd.org/changeset/base/303338 Log: vt: lock Giant around kbd calls in CONS_GETINFO Note that keyboards are stored in an array and are not freed (just "unregistered" by clearing some fields) so a race would be limited to obtaining stale information about an unregistered keyboard. Reported by: CTurt MFC after: 3 days Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Tue Jul 26 15:22:21 2016 (r303337) +++ head/sys/dev/vt/vt_core.c Tue Jul 26 15:34:26 2016 (r303338) @@ -2228,9 +2228,11 @@ skip_thunk: return (EINVAL); if (vw == vd->vd_curwindow) { + mtx_lock(&Giant); kbd = kbd_get_keyboard(vd->vd_keyboard); if (kbd != NULL) vt_save_kbd_state(vw, kbd); + mtx_unlock(&Giant); } vi->m_num = vd->vd_curwindow->vw_number + 1; From owner-svn-src-head@freebsd.org Tue Jul 26 16:27: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 0A24FBA49C5 for ; Tue, 26 Jul 2016 16:27:09 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x22f.google.com (mail-yw0-x22f.google.com [IPv6:2607:f8b0:4002:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4052135C for ; Tue, 26 Jul 2016 16:27:08 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x22f.google.com with SMTP id j12so20241922ywb.2 for ; Tue, 26 Jul 2016 09:27:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=b9mGP9yGdTjyyI2p6Ra7fz6LSu6YuLmZFDQsOyNG1PI=; b=jGO5IUlSpsVX2o2qFz2oWb+Ynsq4jTnyVREKrfBM1W44Kg2LVNm8TyuA9Yw/cY9Da8 IiGnMwQAkwl5EE0nYkbIJL6OnnWzzSfnOEvLvtecpW+PUQrJnXrQKLm/G+ErxA8+AsRe zDbln9kuNIOr3/7w1pFDLkxKJWw5nG103R7Cgd0xCJGtBa3CxwUO08f1x3ypCDm8kffm 2YFhUHctul6eUxTPOTHUxo8jD9p2uyL8VTmCJiRuT8rfmFNpV2Zbb+T/As68DwhrheC2 +EwxmFKRLPSZRVuhGHJfmFm9NlA9QJ0TxK+UprYPAEhp4xtdh/WKNcygaUffk3YWdhQC hPlQ== 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:from:date :message-id:subject:to:cc; bh=b9mGP9yGdTjyyI2p6Ra7fz6LSu6YuLmZFDQsOyNG1PI=; b=dNrOJXY3uK/AJTWsxACjGGRXNh4KL5PVv8vMaedN4kPCqFn4IBVXu+1A8DEJ8GTg3H QEN+I0R75e4PbQDLwBEJW5338/ywE88eh/KVYTRtbkbaW8Bb8wm2QK/IcbRdlpJLCON/ ZUSUUk0Cqq5Hk3kF4eTY3akOF6kEd6TrC+JoeX5+1yDTnmG6CaRpFO+CHoWfMoZQcDDj ALhxDbI5vh7V151Xlr0QzU7aKMF6ReQzUeD/uYAMZOT45t4ABPECvowoeMoF1hnnxAqp IHf4pGjoTI6O1DH0T0rt9Hibi8iMhDYXhTRw5wbqhK6nIzNjoMlsTp5p1bDbb0LyEQRD Za0w== X-Gm-Message-State: AEkooutdtk6P/TsuCHn+mHw6qB4yfucRE+SjUeSZ878B1zavE2+GULa5ntV2WlHLjYF/jBfz3F9K3ac5cpEEvA== X-Received: by 10.129.90.7 with SMTP id o7mr20971687ywb.313.1469550427634; Tue, 26 Jul 2016 09:27:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.201.71 with HTTP; Tue, 26 Jul 2016 09:27:07 -0700 (PDT) In-Reply-To: <201607261534.u6QFYQ9L017045@repo.freebsd.org> References: <201607261534.u6QFYQ9L017045@repo.freebsd.org> From: Ed Schouten Date: Tue, 26 Jul 2016 18:27:07 +0200 Message-ID: Subject: Re: svn commit: r303338 - head/sys/dev/vt To: Ed Maste Cc: src-committers , 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.22 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, 26 Jul 2016 16:27:09 -0000 Hi Ed, 2016-07-26 17:34 GMT+02:00 Ed Maste : > if (vw == vd->vd_curwindow) { > + mtx_lock(&Giant); > kbd = kbd_get_keyboard(vd->vd_keyboard); > if (kbd != NULL) > vt_save_kbd_state(vw, kbd); > + mtx_unlock(&Giant); > } Would it make sense to put an mtx_assert(&Giant, MA_OWNED) in kbd_get_keyboard()? -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Tue Jul 26 16:40: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 7B6DDBA4E59; Tue, 26 Jul 2016 16:40: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 3AAF81BDC; Tue, 26 Jul 2016 16:40: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 u6QGe38l040696; Tue, 26 Jul 2016 16:40:03 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6QGe3Hq040694; Tue, 26 Jul 2016 16:40:03 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201607261640.u6QGe3Hq040694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 26 Jul 2016 16:40:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303339 - head/sys/dev/etherswitch/arswitch 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.22 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, 26 Jul 2016 16:40:04 -0000 Author: adrian Date: Tue Jul 26 16:40:03 2016 New Revision: 303339 URL: https://svnweb.freebsd.org/changeset/base/303339 Log: Update my TODO items. Modified: head/sys/dev/etherswitch/arswitch/arswitch_7240.c head/sys/dev/etherswitch/arswitch/arswitch_8316.c Modified: head/sys/dev/etherswitch/arswitch/arswitch_7240.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_7240.c Tue Jul 26 15:34:26 2016 (r303338) +++ head/sys/dev/etherswitch/arswitch/arswitch_7240.c Tue Jul 26 16:40:03 2016 (r303339) @@ -97,6 +97,8 @@ ar7240_hw_global_setup(struct arswitch_s AR7240_GLOBAL_CTRL_MTU_MASK, SM(1536, AR7240_GLOBAL_CTRL_MTU_MASK)); + /* XXX ARP? Frame Age enable? */ + /* Service Tag */ arswitch_modifyreg(sc->sc_dev, AR8X16_REG_SERVICE_TAG, AR8X16_SERVICE_TAG_MASK, 0); Modified: head/sys/dev/etherswitch/arswitch/arswitch_8316.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8316.c Tue Jul 26 15:34:26 2016 (r303338) +++ head/sys/dev/etherswitch/arswitch/arswitch_8316.c Tue Jul 26 16:40:03 2016 (r303339) @@ -137,6 +137,7 @@ ar8316_hw_global_setup(struct arswitch_s arswitch_writereg(sc->sc_dev, AR8X16_REG_TAG_PRIO, 0xfa50); /* Enable ARP frame acknowledge. */ + /* XXX TODO: aging? */ arswitch_modifyreg(sc->sc_dev, AR8X16_REG_AT_CTRL, 0, AR8X16_AT_CTRL_ARP_EN); From owner-svn-src-head@freebsd.org Tue Jul 26 17:03: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 140E8BA58EA; Tue, 26 Jul 2016 17:03:22 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::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 D1B0A145B; Tue, 26 Jul 2016 17:03:21 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x230.google.com with SMTP id b62so30638118iod.3; Tue, 26 Jul 2016 10:03:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=QM4KblAYYqx1k+G3FW/oEc1yX44N71IvM7pbxnQFUaU=; b=n3ahKjl2fMpWGLp+i6g+ql+5caRHsDo7fH2J2I9xJMTGCqOA7pP/J/VUj2XIfJ2X7z o+oLfCgoL1AiBJ7WOovtanCDSxPiFNnLAJfPI1XoHeRqFJjjeFFsyxxfz0+9QVBnV5Yc wM/IdFw1CVi6qWrrOGKzG3Cli1xrxRXonnTnO+F9gAk8RAS7w5Ihc0VYV2gpNsGFnB9q p8ybg2WQh3Qt2oQ2wKhV9zzK8aYDUbJT1hYjn20gvoUGHkNgIUIoKIpTfdURr5TKsA8f drT+tAzHosgFxdycTEcZwXmLAYAWJGtv2oDZNXwn8sAcC8bpzBhMbf78HESOl6TMOtek tsfA== 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:from :date:message-id:subject:to:cc; bh=QM4KblAYYqx1k+G3FW/oEc1yX44N71IvM7pbxnQFUaU=; b=WQWuq7A/NA8pCk9NPvA/ym+cfklgIV2QqUMevnNoveZL/g5AfGDPUyW72rg1ee6Tt/ sTfsvXIZu3irWmTBiTkrJzvftbso/HDHGnoywE5tXKnSlRU+3RGNvNvUvUXz8Cz2TwzC K1mRb0WLImtXXJ7S0W6qHQrNOPHvo9rah6+qqhySjYQObJXUtJWHFSpnLV8VCNIkkxy3 lrfPf7UKtG+szPmS2GOS0X0DHj/8Rgjc4QQcot4zmQP9v1K4xyelCOFFhZX12T+QcPpn UQ2oMh2dExpldBkyIZxWqKEan6K5yJ+VV/AfMBQIAjjvD/p9Blt4UAZvgoGReoG5g7YB y1FQ== X-Gm-Message-State: AEkoouufwP4aapIoDoN4iNc3pHqGInc+AF+RAxnWUOK0/Vwit/jIFr3eCEvhBY//cY4QpxdKTIRfV4FCw9eKiw== X-Received: by 10.107.141.213 with SMTP id p204mr26248294iod.38.1469552601270; Tue, 26 Jul 2016 10:03:21 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.138.28 with HTTP; Tue, 26 Jul 2016 10:03:01 -0700 (PDT) In-Reply-To: References: <201607261534.u6QFYQ9L017045@repo.freebsd.org> From: Ed Maste Date: Tue, 26 Jul 2016 13:03:01 -0400 X-Google-Sender-Auth: RhxQS8URF5hFBuO8NxiF_1cZQMs Message-ID: Subject: Re: svn commit: r303338 - head/sys/dev/vt To: Ed Schouten Cc: src-committers , "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.22 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, 26 Jul 2016 17:03:22 -0000 On 26 July 2016 at 12:27, Ed Schouten wrote: > Hi Ed, > > 2016-07-26 17:34 GMT+02:00 Ed Maste : >> if (vw == vd->vd_curwindow) { >> + mtx_lock(&Giant); >> kbd = kbd_get_keyboard(vd->vd_keyboard); >> if (kbd != NULL) >> vt_save_kbd_state(vw, kbd); >> + mtx_unlock(&Giant); >> } > > Would it make sense to put an mtx_assert(&Giant, MA_OWNED) in > kbd_get_keyboard()? Yes, I made that change locally and also intend to review kbd_get_keyboard's callers. I didn't commit it to HEAD right away to avoid mass breakage if there's missing locking. From owner-svn-src-head@freebsd.org Tue Jul 26 17:23: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 744E0BA52A9; Tue, 26 Jul 2016 17:23:50 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 395BF17B7; Tue, 26 Jul 2016 17:23:50 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6QHNnxM080079; Tue, 26 Jul 2016 17:23:49 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6QHNnhm080076; Tue, 26 Jul 2016 17:23:49 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201607261723.u6QHNnhm080076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 26 Jul 2016 17:23:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303340 - in head/sys: compat/freebsd32 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.22 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, 26 Jul 2016 17:23:50 -0000 Author: ed Date: Tue Jul 26 17:23:49 2016 New Revision: 303340 URL: https://svnweb.freebsd.org/changeset/base/303340 Log: Add shmatt_t. It looks like our "struct shmid_ds::shm_nattch" deviates from the standard in the sense that it is a signed integer, whereas POSIX requires that it is unsigned, having a special type shmatt_t. Patch up our native and 32-bit copies to use a new shmatt_t that is an unsigned integer. As it's unsigned, we can relax the comparisons that are performed on it. Leave the Linux, iBCS2, etc. copies of the structure alone. Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D6655 Modified: head/sys/compat/freebsd32/freebsd32_ipc.h head/sys/kern/sysv_shm.c head/sys/sys/shm.h Modified: head/sys/compat/freebsd32/freebsd32_ipc.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_ipc.h Tue Jul 26 16:40:03 2016 (r303339) +++ head/sys/compat/freebsd32/freebsd32_ipc.h Tue Jul 26 17:23:49 2016 (r303340) @@ -72,7 +72,7 @@ struct shmid_ds32 { int32_t shm_segsz; pid_t shm_lpid; pid_t shm_cpid; - int shm_nattch; + unsigned int shm_nattch; int32_t shm_atime; int32_t shm_dtime; int32_t shm_ctime; Modified: head/sys/kern/sysv_shm.c ============================================================================== --- head/sys/kern/sysv_shm.c Tue Jul 26 16:40:03 2016 (r303339) +++ head/sys/kern/sysv_shm.c Tue Jul 26 17:23:49 2016 (r303340) @@ -275,7 +275,7 @@ shm_delete_mapping(struct vmspace *vm, s return (EINVAL); shmmap_s->shmid = -1; shmseg->u.shm_dtime = time_second; - if ((--shmseg->u.shm_nattch <= 0) && + if (--shmseg->u.shm_nattch == 0 && (shmseg->u.shm_perm.mode & SHMSEG_REMOVED)) { shm_deallocate_segment(shmseg); shm_last_free = segnum; @@ -289,7 +289,7 @@ shm_remove(struct shmid_kernel *shmseg, shmseg->u.shm_perm.key = IPC_PRIVATE; shmseg->u.shm_perm.mode |= SHMSEG_REMOVED; - if (shmseg->u.shm_nattch <= 0) { + if (shmseg->u.shm_nattch == 0) { shm_deallocate_segment(shmseg); shm_last_free = segnum; } Modified: head/sys/sys/shm.h ============================================================================== --- head/sys/sys/shm.h Tue Jul 26 16:40:03 2016 (r303339) +++ head/sys/sys/shm.h Tue Jul 26 17:23:49 2016 (r303340) @@ -92,12 +92,14 @@ struct shmid_ds_old { }; #endif +typedef unsigned int shmatt_t; + struct shmid_ds { struct ipc_perm shm_perm; /* operation permission structure */ size_t shm_segsz; /* size of segment in bytes */ pid_t shm_lpid; /* process ID of last shared memory op */ pid_t shm_cpid; /* process ID of creator */ - int shm_nattch; /* number of current attaches */ + shmatt_t shm_nattch; /* number of current attaches */ time_t shm_atime; /* time of last shmat() */ time_t shm_dtime; /* time of last shmdt() */ time_t shm_ctime; /* time of last change by shmctl() */ From owner-svn-src-head@freebsd.org Tue Jul 26 18:27: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 F3D80BA594E; Tue, 26 Jul 2016 18:27:49 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C42BE1293; Tue, 26 Jul 2016 18:27:49 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6QIRmcr002914; Tue, 26 Jul 2016 18:27:48 GMT (envelope-from phil@FreeBSD.org) Received: (from phil@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6QIRmx7002913; Tue, 26 Jul 2016 18:27:48 GMT (envelope-from phil@FreeBSD.org) Message-Id: <201607261827.u6QIRmx7002913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phil set sender to phil@FreeBSD.org using -f From: Phil Shafer Date: Tue, 26 Jul 2016 18:27:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303341 - head/share/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.22 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, 26 Jul 2016 18:27:50 -0000 Author: phil Date: Tue Jul 26 18:27:48 2016 New Revision: 303341 URL: https://svnweb.freebsd.org/changeset/base/303341 Log: Fix start date to not be in the future. Submitted by: phil Reviewed by: sjg (mentor) Approved by: sjg Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Tue Jul 26 17:23:49 2016 (r303340) +++ head/share/misc/committers-src.dot Tue Jul 26 18:27:48 2016 (r303341) @@ -259,7 +259,7 @@ peadar [label="Peter Edwards\npeadar@Fre peter [label="Peter Wemm\npeter@FreeBSD.org\n1995/07/04"] peterj [label="Peter Jeremy\npeterj@FreeBSD.org\n2012/09/14"] pfg [label="Pedro Giffuni\npfg@FreeBSD.org\n2011/12/01"] -phil [label="Phil Shafer\nphil@FreeBSD.ogr\n2016/12/30"] +phil [label="Phil Shafer\nphil@FreeBSD.ogr\n2015/12/30"] philip [label="Philip Paeps\nphilip@FreeBSD.org\n2004/01/21"] phk [label="Poul-Henning Kamp\nphk@FreeBSD.org\n1994/02/21"] pho [label="Peter Holm\npho@FreeBSD.org\n2008/11/16"] From owner-svn-src-head@freebsd.org Tue Jul 26 20:11: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 D4726BA414D; Tue, 26 Jul 2016 20:11:30 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 987D218EA; Tue, 26 Jul 2016 20:11:30 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6QKBTAi043259; Tue, 26 Jul 2016 20:11:29 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6QKBTDp043256; Tue, 26 Jul 2016 20:11:29 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201607262011.u6QKBTDp043256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 26 Jul 2016 20:11:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303342 - in head: include lib/libc/stdlib 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.22 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, 26 Jul 2016 20:11:30 -0000 Author: ed Date: Tue Jul 26 20:11:29 2016 New Revision: 303342 URL: https://svnweb.freebsd.org/changeset/base/303342 Log: Fix typing of srandom() and initstate(). POSIX requires that these functions have an unsigned int for their first argument; not an unsigned long. My reasoning is that we can safely change these functions without breaking the ABI. As far as I know, our supported architectures either use registers for passing function arguments that are at least as big as long (e.g., amd64), or int and long are of the same size (e.g., i386). Reviewed by: ache Differential Revision: https://reviews.freebsd.org/D6644 Modified: head/include/stdlib.h head/lib/libc/stdlib/random.3 head/lib/libc/stdlib/random.c Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Tue Jul 26 18:27:48 2016 (r303341) +++ head/include/stdlib.h Tue Jul 26 20:11:29 2016 (r303342) @@ -204,7 +204,7 @@ double erand48(unsigned short[3]); /* char *fcvt(double, int, int * __restrict, int * __restrict); */ /* char *gcvt(double, int, int * __restrict, int * __restrict); */ int grantpt(int); -char *initstate(unsigned long /* XSI requires u_int */, char *, long); +char *initstate(unsigned int, char *, size_t); long jrand48(unsigned short[3]); char *l64a(long); void lcong48(unsigned short[7]); @@ -227,7 +227,7 @@ int setkey(const char *); #endif char *setstate(/* const */ char *); void srand48(long); -void srandom(unsigned long); +void srandom(unsigned int); int unlockpt(int); #endif /* __XSI_VISIBLE */ Modified: head/lib/libc/stdlib/random.3 ============================================================================== --- head/lib/libc/stdlib/random.3 Tue Jul 26 18:27:48 2016 (r303341) +++ head/lib/libc/stdlib/random.3 Tue Jul 26 20:11:29 2016 (r303342) @@ -28,7 +28,7 @@ .\" @(#)random.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 2, 2013 +.Dd July 26, 2016 .Dt RANDOM 3 .Os .Sh NAME @@ -45,11 +45,11 @@ .Ft long .Fn random void .Ft void -.Fn srandom "unsigned long seed" +.Fn srandom "unsigned int seed" .Ft void .Fn srandomdev void .Ft char * -.Fn initstate "unsigned long seed" "char *state" "long n" +.Fn initstate "unsigned int seed" "char *state" "size_t n" .Ft char * .Fn setstate "char *state" .Sh DESCRIPTION Modified: head/lib/libc/stdlib/random.c ============================================================================== --- head/lib/libc/stdlib/random.c Tue Jul 26 18:27:48 2016 (r303341) +++ head/lib/libc/stdlib/random.c Tue Jul 26 20:11:29 2016 (r303342) @@ -236,7 +236,7 @@ good_rand(uint32_t ctx) * for default usage relies on values produced by this routine. */ void -srandom(unsigned long x) +srandom(unsigned int x) { int i, lim; @@ -311,7 +311,7 @@ srandomdev(void) * complain about mis-alignment, but you should disregard these messages. */ char * -initstate(unsigned long seed, char *arg_state, long n) +initstate(unsigned int seed, char *arg_state, size_t n) { char *ostate = (char *)(&state[-1]); uint32_t *int_arg_state = (uint32_t *)arg_state; From owner-svn-src-head@freebsd.org Tue Jul 26 20:15: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 CFFBEBA41F2; Tue, 26 Jul 2016 20:15:02 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (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 995E91BED; Tue, 26 Jul 2016 20:15:02 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-it0-x234.google.com with SMTP id u186so126219974ita.0; Tue, 26 Jul 2016 13:15:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=I9Bnk9TD3/DcKcpcCLXCB/Cbbs9Qh2sfDGER7cKvFFY=; b=o28zjNEhoNvfyH2BGHBGrk6ZAaURH+7u3J9946dJh6rJx05sQtdG2O/lwUck8MIXN6 05M3NKo5YXQ8LxAcbJUFuAFkLVj/p6FszsgpHMCx0AL+BKiuVcyvIx8T85NYB7d8PyQ1 1LWudDJZF/kPOKxJW0D2+Zo5xc5dG6HW7vjAXMdZpO35jMKkzhVQb+rWV549dBfuN1QI VLa00wUj32YXtJM9T2QYXDz3wnwCso2v+M2yWFt0pEnKGvG2+b3dUJtBXU2vmWmssl9C ImMn1cXDvw00W+LdruMCMn3W/65IQPPG7305gi9EuLHtCBT7zlRsAK3kopATs1LCxeL0 h0mQ== 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:from:date :message-id:subject:to:cc; bh=I9Bnk9TD3/DcKcpcCLXCB/Cbbs9Qh2sfDGER7cKvFFY=; b=SwAT8VRRYICygod5LXD/HWL5tq3XgX241ZXW/PZz061Q66dFeqSVdqyNAzJ2RdI9HN I38vnh6NqtJietucqSp5aBcp7G/QB1eJoYlJA3quS5muaNVEbuhSY/SNghrQzL/TzKfE jQ/G/HtF8S/wNpF7sUtrsAV+BAcnOtSwV8/YbFisw8F6QA3b6EtxDwcGwY2ql+oopnoJ oj5fyPNEcA/UmB0imqoU838Jv+4LjhpCZjYaKayRlixqDh+A+6lTxG7j4lvmKACXytHg U2NvXdvuetMxqDQoUrva6xpwY+qaExx1sET2V2sRW38WEDLiKnjDd6knIbC6pw7OYmjS EhOQ== X-Gm-Message-State: AEkoouuwgGUGxCkbpIyeFE7rkyG5mSejDElUEb9dCvC7n+uuqLms4ttX0KgaOClZZfS4pHpPro0FWevtuLbSeQ== X-Received: by 10.202.193.195 with SMTP id r186mr12903284oif.109.1469564101436; Tue, 26 Jul 2016 13:15:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.44.176 with HTTP; Tue, 26 Jul 2016 13:14:59 -0700 (PDT) In-Reply-To: <201607262011.u6QKBTDp043256@repo.freebsd.org> References: <201607262011.u6QKBTDp043256@repo.freebsd.org> From: Benjamin Kaduk Date: Tue, 26 Jul 2016 15:14:59 -0500 Message-ID: Subject: Re: svn commit: r303342 - in head: include lib/libc/stdlib To: Ed Schouten 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.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 26 Jul 2016 20:15:02 -0000 On Tue, Jul 26, 2016 at 3:11 PM, Ed Schouten wrote: > Author: ed > Date: Tue Jul 26 20:11:29 2016 > New Revision: 303342 > URL: https://svnweb.freebsd.org/changeset/base/303342 > > Log: > Fix typing of srandom() and initstate(). > > POSIX requires that these functions have an unsigned int for their first > argument; not an unsigned long. > > My reasoning is that we can safely change these functions without > breaking the ABI. As far as I know, our supported architectures either > use registers for passing function arguments that are at least as big as > long (e.g., amd64), or int and long are of the same size (e.g., i386). > Is a __FreeBSD_version bump planned? (Third-party software might want to be warning-clean.) -Ben From owner-svn-src-head@freebsd.org Tue Jul 26 20:20:10 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 76DA9BA42AF; Tue, 26 Jul 2016 20:20:10 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 481901139; Tue, 26 Jul 2016 20:20:10 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6QKK9V4044850; Tue, 26 Jul 2016 20:20:09 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6QKK9Ab044849; Tue, 26 Jul 2016 20:20:09 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201607262020.u6QKK9Ab044849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Tue, 26 Jul 2016 20:20:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303343 - head/sys/netinet/cc 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.22 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, 26 Jul 2016 20:20:10 -0000 Author: brd (doc,ports committer) Date: Tue Jul 26 20:20:09 2016 New Revision: 303343 URL: https://svnweb.freebsd.org/changeset/base/303343 Log: Fix the case for some sysctl descriptions. Reviewed by: gnn Modified: head/sys/netinet/cc/cc.c Modified: head/sys/netinet/cc/cc.c ============================================================================== --- head/sys/netinet/cc/cc.c Tue Jul 26 20:11:29 2016 (r303342) +++ head/sys/netinet/cc/cc.c Tue Jul 26 20:20:09 2016 (r303343) @@ -316,12 +316,12 @@ SYSINIT(cc, SI_SUB_PROTO_IFATTACHDOMAIN, /* Declare sysctl tree and populate it. */ SYSCTL_NODE(_net_inet_tcp, OID_AUTO, cc, CTLFLAG_RW, NULL, - "congestion control related settings"); + "Congestion control related settings"); SYSCTL_PROC(_net_inet_tcp_cc, OID_AUTO, algorithm, CTLFLAG_VNET | CTLTYPE_STRING | CTLFLAG_RW, - NULL, 0, cc_default_algo, "A", "default congestion control algorithm"); + NULL, 0, cc_default_algo, "A", "Default congestion control algorithm"); SYSCTL_PROC(_net_inet_tcp_cc, OID_AUTO, available, CTLTYPE_STRING|CTLFLAG_RD, NULL, 0, cc_list_available, "A", - "list available congestion control algorithms"); + "List available congestion control algorithms"); From owner-svn-src-head@freebsd.org Tue Jul 26 20:35: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 0A7B2BA486E for ; Tue, 26 Jul 2016 20:35:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm17-vm1.bullet.mail.bf1.yahoo.com (nm17-vm1.bullet.mail.bf1.yahoo.com [98.139.213.55]) (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 ADD471B30 for ; Tue, 26 Jul 2016 20:35:50 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1469565343; bh=0V9ii7F6hFlhvJHmq1CKecaKf8dUaGSTpv9/ONjmNfQ=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=tUVJEOzUlT/RPu1fmbCxWJpk7miNSHc+T5YRs9tNbppbMFCzSpUl0N3lnnraduHPZ9pKbxizHKBwBu41XGNuCOMlCipwXF2aCyiBjY3yaZ/b5BgqVy6znm1U7u31dwQj0vTsKaqBapTiPvPW2MyVxNUZlyLtuJI2v76fKmF5tiVmgau2e997yQIaLEGCirJJPcDkQK1C0NqyfGZ+6ieOIGVXH/iJHj5qR04jspH76e39TpS0p3ODKkKKVb7DqnMOGcL5wST/wtC2CSmrFvuTJXX8cSr4b4wkF3FPseijn1FSmR1ef0VqZlE0dqZ8uI4B3PyC6wM07hAdnljnnWdlxA== Received: from [98.139.215.143] by nm17.bullet.mail.bf1.yahoo.com with NNFMP; 26 Jul 2016 20:35:43 -0000 Received: from [98.139.213.11] by tm14.bullet.mail.bf1.yahoo.com with NNFMP; 26 Jul 2016 20:35:43 -0000 Received: from [127.0.0.1] by smtp111.mail.bf1.yahoo.com with NNFMP; 26 Jul 2016 20:35:43 -0000 X-Yahoo-Newman-Id: 121759.14839.bm@smtp111.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: AAmnQssVM1mufmGEOCW9u7SlJZ.CG_XSIDDszhZ.8o4idTy BFvA1oN1BqqxHp_dtMgX6CoqUhekIj.iIJfODnkJrtUiFZnLzO6aWqD0Oehv D9dTKPpCw1lQsPD7GmxoTj.vlBa2ksz_UU6EjCgnVBczzYFD8zdia8Mhxnmc LsXIySumYaBUWT0aNcTOtQsJByZ5iXm.8Wh1v3JuUA_w81x75E85EE.sdHeu 5elbDDQ5XR5_uBayJVsqQTkk3E0g3HbiG._HksWCTnsct6zslur9fk5IJfLy o.EA13cSiwR5ZC2spGSEeKSIDtmnedk1Ple.xIO0T8mfT0OxgJvsITdkoJP. I7ftQRUR0NLDger7dNcTSZIEMot9z0SVLsMhv0LIPXZLZWDIUqLesuyB1dTi K3EG3Rj1Fd567aWiLYlMDDiFH5L6s_gz1sizsieSqNWB36xI_ATIV8k4tNso 6vDsRHTAGzPzaYd05KLMSskNGIlqCX7BUYLuInFhukdkcUY6lfWcxjh9_p2T nV1KIFfHCreON3Eg4WuXUqqB0IggIw38eIXDEeZ9srmqiwg-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r303342 - in head: include lib/libc/stdlib To: Benjamin Kaduk , Ed Schouten References: <201607262011.u6QKBTDp043256@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Pedro Giffuni Message-ID: <5f0367b2-6916-b300-bba5-c3d3f3699a91@FreeBSD.org> Date: Tue, 26 Jul 2016 15:35:47 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.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.22 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, 26 Jul 2016 20:35:51 -0000 On 07/26/16 15:14, Benjamin Kaduk wrote: > On Tue, Jul 26, 2016 at 3:11 PM, Ed Schouten > wrote: > > Author: ed > Date: Tue Jul 26 20:11:29 2016 > New Revision: 303342 > URL: https://svnweb.freebsd.org/changeset/base/303342 > > Log: > Fix typing of srandom() and initstate(). > > POSIX requires that these functions have an unsigned int for their > first > argument; not an unsigned long. > > My reasoning is that we can safely change these functions without > breaking the ABI. As far as I know, our supported architectures either > use registers for passing function arguments that are at least as > big as > long (e.g., amd64), or int and long are of the same size (e.g., i386). > > > Is a __FreeBSD_version bump planned? (Third-party software might want > to be warning-clean.) > Third party software should already follow standards ;). Pedro. From owner-svn-src-head@freebsd.org Tue Jul 26 21:27: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 7A23DBA53A7; Tue, 26 Jul 2016 21:27:03 +0000 (UTC) (envelope-from ivadasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 309A9164F; Tue, 26 Jul 2016 21:27:03 +0000 (UTC) (envelope-from ivadasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6QLR2b0070373; Tue, 26 Jul 2016 21:27:02 GMT (envelope-from ivadasz@FreeBSD.org) Received: (from ivadasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6QLR284070371; Tue, 26 Jul 2016 21:27:02 GMT (envelope-from ivadasz@FreeBSD.org) Message-Id: <201607262127.u6QLR284070371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ivadasz set sender to ivadasz@FreeBSD.org using -f From: =?UTF-8?Q?Imre_Vad=c3=a1sz?= Date: Tue, 26 Jul 2016 21:27:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303345 - 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.22 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, 26 Jul 2016 21:27:03 -0000 Author: ivadasz Date: Tue Jul 26 21:27:02 2016 New Revision: 303345 URL: https://svnweb.freebsd.org/changeset/base/303345 Log: Mention AC3165 and AC8260 chipsets in iwm(4) and mention AC3165 in iwmfw(4) - Support for the AC3165 and AC8260 chipsets was added by r303322 and r303327. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D7322 Modified: head/share/man/man4/iwm.4 head/share/man/man4/iwmfw.4 Modified: head/share/man/man4/iwm.4 ============================================================================== --- head/share/man/man4/iwm.4 Tue Jul 26 20:26:03 2016 (r303344) +++ head/share/man/man4/iwm.4 Tue Jul 26 21:27:02 2016 (r303345) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 1, 2015 +.Dd July 26, 2016 .Dt IWM 4 .Os .Sh NAME @@ -48,6 +48,7 @@ Choose one from: .Cd "device iwm3160fw" .Cd "device iwm7260fw" .Cd "device iwm7265fw" +.Cd "device iwm8000Cfw" .Ed .Pp Or you can use @@ -65,6 +66,7 @@ if_iwm_load="YES" iwm3160fw_load="YES" iwm7260fw_load="YES" iwm7265fw_load="YES" +iwm8000Cfw_load="YES" .Ed .Sh DESCRIPTION The @@ -73,8 +75,10 @@ driver provides support for: .Pp .Bl -tag -width Ds -offset indent -compact .It Intel Dual Band Wireless AC 3160 +.It Intel Dual Band Wireless AC 3165 .It Intel Dual Band Wireless AC 7260 .It Intel Dual Band Wireless AC 7265 +.It Intel Dual Band Wireless AC 8260 .El .Pp .Nm Modified: head/share/man/man4/iwmfw.4 ============================================================================== --- head/share/man/man4/iwmfw.4 Tue Jul 26 20:26:03 2016 (r303344) +++ head/share/man/man4/iwmfw.4 Tue Jul 26 21:27:02 2016 (r303345) @@ -22,7 +22,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 25, 2016 +.Dd July 26, 2016 .Dt IWMFW 4 .Os .Sh NAME @@ -59,7 +59,7 @@ iwm8000Cfw_load="YES" .Ed .Sh DESCRIPTION This module provides access to firmware sets for the -Intel Dual Band Wireless WiFi 3160, 7260, 7265 and 8260 series of +Intel Dual Band Wireless WiFi 3160, 3165, 7260, 7265 and 8260 series of IEEE 802.11n/11ac adapters. It may be statically linked into the kernel, or loaded as a module. From owner-svn-src-head@freebsd.org Tue Jul 26 21:41: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 AAC9ABA5905 for ; Tue, 26 Jul 2016 21:41:03 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x22b.google.com (mail-yw0-x22b.google.com [IPv6:2607:f8b0:4002:c05::22b]) (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 679461E30 for ; Tue, 26 Jul 2016 21:41:03 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x22b.google.com with SMTP id j12so34709975ywb.2 for ; Tue, 26 Jul 2016 14:41:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Rych/9kc9q2ybcio3Xtc4u+l5BlUOnoJdN2ufrxVkv8=; b=TyW6/+NqbeiPuOKCoWL+NDPSTL0HSR2sGT49C14LllCuuGNygmRcvRTzUsk4MC+57G NXuyWYgt7WoYhvdN9/ClmZHZdKims5+LnZnjEaPqW+VzCjoi6QxwFK6iS/Ofyu56WyUr 8fCDoGHFVA2vaimFruHN4LKcDrYTpGxWYEKsfqlvzCdO1+gHi3hGdNFVKNHo5UXUGNZd mKaDg3PXWAv1TK1aBYkroSNE/iFGv2Qs/+IQ0URCo77CjRFYhtnG7GqEaHAFHJauQCMY q/NoFg0gwFC4mVuatlOT1euFh9UeUNIQmCVHbIpwHyKKdOv6XmkdE0DDaxEtzcixmXiX 61nA== 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:from:date :message-id:subject:to:cc; bh=Rych/9kc9q2ybcio3Xtc4u+l5BlUOnoJdN2ufrxVkv8=; b=HcDgjUPbXJctJjyNe6FzQldZj9sgBDcr6puSsTkhT45cWPzARf8zmehOwZAE7UwzuN pKqcrLMRM9byolmpDixfcMdPzcIW7FbFqQ5Q5vuXWSV3VxfhWX2WyjKdmjoTqY59NTYm uajVK85rH+QOb2yECHqA+7PfZRAZ16bkYRr3izm/Y4sGtZg95Af31K+akT76M+oxvCgP /izsQU9PDskv50vyEJE6wNL8OYiRHk+bfjUwzKrmzRWanbGXCstNy27WxdcxndAyE7ad FY3QSy44sIVDzUdFe5Jisp5osmZeRfR7vWsvxvtDSr/OZBgHrYVt59j+7FnqzaTyta+X mEDw== X-Gm-Message-State: AEkoouuH564A+827q2nHIDlGMG8RxPsectWHFX6jeMYyz179By0RwNJiMwZVC4KQnLN8mlsXNGuzamg9189oRw== X-Received: by 10.129.122.7 with SMTP id v7mr21718972ywc.219.1469569262020; Tue, 26 Jul 2016 14:41:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.201.71 with HTTP; Tue, 26 Jul 2016 14:41:01 -0700 (PDT) In-Reply-To: <5f0367b2-6916-b300-bba5-c3d3f3699a91@FreeBSD.org> References: <201607262011.u6QKBTDp043256@repo.freebsd.org> <5f0367b2-6916-b300-bba5-c3d3f3699a91@FreeBSD.org> From: Ed Schouten Date: Tue, 26 Jul 2016 23:41:01 +0200 Message-ID: Subject: Re: svn commit: r303342 - in head: include lib/libc/stdlib To: Pedro Giffuni Cc: Benjamin Kaduk , Ed Schouten , "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.22 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, 26 Jul 2016 21:41:03 -0000 Hi Pedro, Benjamin, 2016-07-26 22:35 GMT+02:00 Pedro Giffuni : > On 07/26/16 15:14, Benjamin Kaduk wrote: >> Is a __FreeBSD_version bump planned? (Third-party software might want >> to be warning-clean.) > > Third party software should already follow standards ;). Not only that. This change only changes arguments from one integer type to the other. As far as I know, such a change would not cause a compiler to generate (substantially) different diagnostics. If it turns out I'm mistaken I'll reconsider, but for now this should do. :-) -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Tue Jul 26 22:26: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 66B9ABA6169; Tue, 26 Jul 2016 22:26:50 +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 3956116C4; Tue, 26 Jul 2016 22:26:50 +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 u6QMQn9L092694; Tue, 26 Jul 2016 22:26:49 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6QMQn15092693; Tue, 26 Jul 2016 22:26:49 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201607262226.u6QMQn15092693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 26 Jul 2016 22:26:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303346 - head/sys/dev/usb/serial 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.22 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, 26 Jul 2016 22:26:50 -0000 Author: ian Date: Tue Jul 26 22:26:49 2016 New Revision: 303346 URL: https://svnweb.freebsd.org/changeset/base/303346 Log: Actually return line status register values from umoscom_cfg_get_status(). The hardware delivers ns16550-compatible status bits, which is what the usb_serial code expects, so no need for translation, no need for a local variable to hold a temporary lsr result. Modified: head/sys/dev/usb/serial/umoscom.c Modified: head/sys/dev/usb/serial/umoscom.c ============================================================================== --- head/sys/dev/usb/serial/umoscom.c Tue Jul 26 21:27:02 2016 (r303345) +++ head/sys/dev/usb/serial/umoscom.c Tue Jul 26 22:26:49 2016 (r303346) @@ -523,14 +523,16 @@ static void umoscom_cfg_get_status(struct ucom_softc *ucom, uint8_t *p_lsr, uint8_t *p_msr) { struct umoscom_softc *sc = ucom->sc_parent; - uint8_t lsr; uint8_t msr; DPRINTFN(5, "\n"); - /* read status registers */ + /* + * Read status registers. MSR bits need translation from ns16550 to + * SER_* values. LSR bits are ns16550 in hardware and ucom. + */ - lsr = umoscom_cfg_read(sc, UMOSCOM_LSR); + *p_lsr = umoscom_cfg_read(sc, UMOSCOM_LSR); msr = umoscom_cfg_read(sc, UMOSCOM_MSR); /* translate bits */ From owner-svn-src-head@freebsd.org Tue Jul 26 23:27: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 351EABA6E4F; Tue, 26 Jul 2016 23:27:29 +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 07FBB1272; Tue, 26 Jul 2016 23:27:28 +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 u6QNRS4C014973; Tue, 26 Jul 2016 23:27:28 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6QNRS9h014972; Tue, 26 Jul 2016 23:27:28 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201607262327.u6QNRS9h014972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 26 Jul 2016 23:27:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303347 - head/sys/dev/usb/serial 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.22 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, 26 Jul 2016 23:27:29 -0000 Author: ian Date: Tue Jul 26 23:27:28 2016 New Revision: 303347 URL: https://svnweb.freebsd.org/changeset/base/303347 Log: Translate modem status reg bits from ns16550 to SER_* values used by the tty layer. Also, the line status reg bits are already ns16550 as expected by the ucom layer, so no need for translation or a local var to hold them. Modified: head/sys/dev/usb/serial/umcs.c Modified: head/sys/dev/usb/serial/umcs.c ============================================================================== --- head/sys/dev/usb/serial/umcs.c Tue Jul 26 22:26:49 2016 (r303346) +++ head/sys/dev/usb/serial/umcs.c Tue Jul 26 23:27:28 2016 (r303347) @@ -743,15 +743,26 @@ umcs7840_cfg_get_status(struct ucom_soft { struct umcs7840_softc *sc = ucom->sc_parent; uint8_t pn = ucom->sc_portno; - uint8_t hw_lsr = 0; /* local line status register */ uint8_t hw_msr = 0; /* local modem status register */ - /* Read LSR & MSR */ - umcs7840_get_UART_reg_sync(sc, pn, MCS7840_UART_REG_LSR, &hw_lsr); + /* + * Read status registers. MSR bits need translation from ns16550 to + * SER_* values. LSR bits are ns16550 in hardware and ucom. + */ + umcs7840_get_UART_reg_sync(sc, pn, MCS7840_UART_REG_LSR, lsr); umcs7840_get_UART_reg_sync(sc, pn, MCS7840_UART_REG_MSR, &hw_msr); - *lsr = hw_lsr; - *msr = hw_msr; + if (hw_msr & MCS7840_UART_MSR_NEGCTS) + *msr |= SER_CTS; + + if (hw_msr & MCS7840_UART_MSR_NEGDCD) + *msr |= SER_DCD; + + if (hw_msr & MCS7840_UART_MSR_NEGRI) + *msr |= SER_RI; + + if (hw_msr & MCS7840_UART_MSR_NEGDSR) + *msr |= SER_DSR; DPRINTF("Port %d status: LSR=%02x MSR=%02x\n", ucom->sc_portno, *lsr, *msr); } From owner-svn-src-head@freebsd.org Tue Jul 26 23:29: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 82754BA6EB5; Tue, 26 Jul 2016 23:29:38 +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 52CC51436; Tue, 26 Jul 2016 23:29:38 +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 u6QNTbXV015087; Tue, 26 Jul 2016 23:29:37 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6QNTbkp015086; Tue, 26 Jul 2016 23:29:37 GMT (envelope-from np@FreeBSD.org) Message-Id: <201607262329.u6QNTbkp015086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 26 Jul 2016 23:29:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303348 - head/sys/dev/cxgbe 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.22 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, 26 Jul 2016 23:29:38 -0000 Author: np Date: Tue Jul 26 23:29:37 2016 New Revision: 303348 URL: https://svnweb.freebsd.org/changeset/base/303348 Log: cxgbe(4): Initialize the adapter queues (fwq and mgmtq) instead of returning EAGAIN if they aren't available when the user tries to program a filter. Do this after validating the filter so that the driver doesn't bring up the queues if it doesn't have to. Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Jul 26 23:27:28 2016 (r303347) +++ head/sys/dev/cxgbe/t4_main.c Tue Jul 26 23:29:37 2016 (r303348) @@ -7909,11 +7909,6 @@ set_filter(struct adapter *sc, struct t4 goto done; } - if (!(sc->flags & FULL_INIT_DONE)) { - rc = EAGAIN; - goto done; - } - if (t->idx >= nfilters) { rc = EINVAL; goto done; @@ -7947,6 +7942,10 @@ set_filter(struct adapter *sc, struct t4 goto done; } + if (!(sc->flags & FULL_INIT_DONE) && + ((rc = adapter_full_init(sc)) != 0)) + goto done; + if (sc->tids.ftid_tab == NULL) { KASSERT(sc->tids.ftids_in_use == 0, ("%s: no memory allocated but filters_in_use > 0", From owner-svn-src-head@freebsd.org Tue Jul 26 23:40: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 0F021BA5102; Tue, 26 Jul 2016 23:40:27 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D255C19E3; Tue, 26 Jul 2016 23:40:26 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6QNeQQd019123; Tue, 26 Jul 2016 23:40:26 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6QNeQBV019122; Tue, 26 Jul 2016 23:40:26 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201607262340.u6QNeQBV019122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Tue, 26 Jul 2016 23:40:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303349 - head/usr.sbin/bhyve 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.22 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, 26 Jul 2016 23:40:27 -0000 Author: grehan Date: Tue Jul 26 23:40:25 2016 New Revision: 303349 URL: https://svnweb.freebsd.org/changeset/base/303349 Log: Catch another case where an XHCI interrupt was being injected without state being set up. This fixes a core dump when dropping to the UEFI prompt with graphics enabled and moving the mouse around. Discussed with: Leon Dang MFC after: 3 days Modified: head/usr.sbin/bhyve/pci_xhci.c Modified: head/usr.sbin/bhyve/pci_xhci.c ============================================================================== --- head/usr.sbin/bhyve/pci_xhci.c Tue Jul 26 23:29:37 2016 (r303348) +++ head/usr.sbin/bhyve/pci_xhci.c Tue Jul 26 23:40:25 2016 (r303349) @@ -2559,7 +2559,8 @@ pci_xhci_dev_intr(struct usb_hci *hci, i /* check if device is ready; OS has to initialise it */ if (sc->rtsregs.erstba_p == NULL || - (sc->opregs.usbcmd & XHCI_CMD_RS) == 0) + (sc->opregs.usbcmd & XHCI_CMD_RS) == 0 || + dev->dev_ctx == NULL) return (0); p = XHCI_PORTREG_PTR(sc, hci->hci_port); From owner-svn-src-head@freebsd.org Tue Jul 26 23:42: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 925BDBA537A; Tue, 26 Jul 2016 23:42:43 +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 654541E39; Tue, 26 Jul 2016 23:42: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 u6QNggd1022443; Tue, 26 Jul 2016 23:42:42 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6QNggsp022442; Tue, 26 Jul 2016 23:42:42 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201607262342.u6QNggsp022442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 26 Jul 2016 23:42:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303350 - head/sys/dev/usb/serial 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.22 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, 26 Jul 2016 23:42:43 -0000 Author: ian Date: Tue Jul 26 23:42:42 2016 New Revision: 303350 URL: https://svnweb.freebsd.org/changeset/base/303350 Log: Translate modem status reg bits from ns16550 to SER_* values used by the tty layer. Also annotate a switch case fall-through per style(9). Modified: head/sys/dev/usb/serial/umct.c Modified: head/sys/dev/usb/serial/umct.c ============================================================================== --- head/sys/dev/usb/serial/umct.c Tue Jul 26 23:40:25 2016 (r303349) +++ head/sys/dev/usb/serial/umct.c Tue Jul 26 23:42:42 2016 (r303350) @@ -86,6 +86,15 @@ __FBSDID("$FreeBSD$"); #define UMCT_SET_MCR 10 /* Set Modem Control Register */ #define UMCT_SET_MCR_SIZE 1 +#define UMCT_MSR_CTS_CHG 0x01 +#define UMCT_MSR_DSR_CHG 0x02 +#define UMCT_MSR_RI_CHG 0x04 +#define UMCT_MSR_CD_CHG 0x08 +#define UMCT_MSR_CTS 0x10 +#define UMCT_MSR_RTS 0x20 +#define UMCT_MSR_RI 0x40 +#define UMCT_MSR_CD 0x80 + #define UMCT_INTR_INTERVAL 100 #define UMCT_IFACE_INDEX 0 #define UMCT_CONFIG_INDEX 0 @@ -384,11 +393,23 @@ umct_intr_callback_sub(struct usb_xfer * pc = usbd_xfer_get_frame(xfer, 0); usbd_copy_out(pc, 0, buf, sizeof(buf)); - sc->sc_msr = buf[0]; + /* + * MSR bits need translation from ns16550 to SER_* values. + * LSR bits are ns16550 in hardware and ucom. + */ + sc->sc_msr = 0; + if (buf[0] & UMCT_MSR_CTS) + sc->sc_msr |= SER_CTS; + if (buf[0] & UMCT_MSR_CD) + sc->sc_msr |= SER_DCD; + if (buf[0] & UMCT_MSR_RI) + sc->sc_msr |= SER_RI; + if (buf[0] & UMCT_MSR_RTS) + sc->sc_msr |= SER_DSR; sc->sc_lsr = buf[1]; ucom_status_change(&sc->sc_ucom); - + /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); From owner-svn-src-head@freebsd.org Wed Jul 27 00:03: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 791CABA5A7D; Wed, 27 Jul 2016 00:03:19 +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 497F517A6; Wed, 27 Jul 2016 00:03:19 +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 u6R03Iek029997; Wed, 27 Jul 2016 00:03:18 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6R03I4o029996; Wed, 27 Jul 2016 00:03:18 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201607270003.u6R03I4o029996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 27 Jul 2016 00:03:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303351 - head/sys/dev/usb/serial 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.22 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, 27 Jul 2016 00:03:19 -0000 Author: ian Date: Wed Jul 27 00:03:18 2016 New Revision: 303351 URL: https://svnweb.freebsd.org/changeset/base/303351 Log: Translate modem status reg bits from ns16550 to SER_* values used by the tty layer. Also annotate a switch case fall-through per style(9). Modified: head/sys/dev/usb/serial/ubsa.c Modified: head/sys/dev/usb/serial/ubsa.c ============================================================================== --- head/sys/dev/usb/serial/ubsa.c Tue Jul 26 23:42:42 2016 (r303350) +++ head/sys/dev/usb/serial/ubsa.c Wed Jul 27 00:03:18 2016 (r303351) @@ -650,11 +650,19 @@ ubsa_intr_callback(struct usb_xfer *xfer usbd_copy_out(pc, 0, buf, sizeof(buf)); /* - * incidentally, Belkin adapter status bits match - * UART 16550 bits + * MSR bits need translation from ns16550 to SER_* values. + * LSR bits are ns16550 in hardware and ucom. */ + sc->sc_msr = 0; + if (buf[3] & UBSA_MSR_CTS) + sc->sc_msr |= SER_CTS; + if (buf[3] & UBSA_MSR_DCD) + sc->sc_msr |= SER_DCD; + if (buf[3] & UBSA_MSR_RI) + sc->sc_msr |= SER_RI; + if (buf[3] & UBSA_MSR_DSR) + sc->sc_msr |= SER_DSR; sc->sc_lsr = buf[2]; - sc->sc_msr = buf[3]; DPRINTF("lsr = 0x%02x, msr = 0x%02x\n", sc->sc_lsr, sc->sc_msr); @@ -663,7 +671,7 @@ ubsa_intr_callback(struct usb_xfer *xfer } else { DPRINTF("ignoring short packet, %d bytes\n", actlen); } - + /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); From owner-svn-src-head@freebsd.org Wed Jul 27 00:03: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 EFFB0BA5AB7; Wed, 27 Jul 2016 00:03:30 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC206195B; Wed, 27 Jul 2016 00:03:30 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6R03UVU030048; Wed, 27 Jul 2016 00:03:30 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6R03UAI030047; Wed, 27 Jul 2016 00:03:30 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201607270003.u6R03UAI030047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Wed, 27 Jul 2016 00:03:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303352 - head/usr.sbin/bhyve 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.22 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, 27 Jul 2016 00:03:31 -0000 Author: grehan Date: Wed Jul 27 00:03:29 2016 New Revision: 303352 URL: https://svnweb.freebsd.org/changeset/base/303352 Log: - Change the fbuf "vga" parameter to "vga=on|io|off". "io" is the default, and allows VGA i/o registers to be accessed. This is required by Win7/2k8 graphics guests that use a combination of BIOS int10 and UEFI. "off" disables all VGA i/o and mem accesses. "on" is not yet hooked up, but will enable full VGA rendering. OpenBSD/UEFI >= 5.9 graphics guests can be booted using "vga=off" - Allow "rfb" to be used instead of "tcp" for the fbuf VNC description. "tcp" will be removed at a future point and is kept as an alias. Discussed with: Leon Dang MFC after: 3 days Modified: head/usr.sbin/bhyve/pci_fbuf.c Modified: head/usr.sbin/bhyve/pci_fbuf.c ============================================================================== --- head/usr.sbin/bhyve/pci_fbuf.c Wed Jul 27 00:03:18 2016 (r303351) +++ head/usr.sbin/bhyve/pci_fbuf.c Wed Jul 27 00:03:29 2016 (r303352) @@ -95,7 +95,8 @@ struct pci_fbuf_softc { char *rfb_host; int rfb_port; int rfb_wait; - int use_vga; + int vga_enabled; + int vga_full; uint32_t fbaddr; char *fb_base; @@ -114,7 +115,7 @@ pci_fbuf_usage(char *opt) { fprintf(stderr, "Invalid fbuf emulation \"%s\"\r\n", opt); - fprintf(stderr, "fbuf: {wait,}tcp=:port\r\n"); + fprintf(stderr, "fbuf: {wait,}{vga=on|io|off,}rfb=:port\r\n"); } static void @@ -234,13 +235,6 @@ pci_fbuf_parse_opts(struct pci_fbuf_soft continue; } -#if 0 /* notyet */ - if (strcmp(xopts, "vga") == 0) { - sc->use_vga = 1; - continue; - } -#endif - if ((config = strchr(xopts, '=')) == NULL) { pci_fbuf_usage(xopts); ret = -1; @@ -252,17 +246,31 @@ pci_fbuf_parse_opts(struct pci_fbuf_soft DPRINTF(DEBUG_VERBOSE, ("pci_fbuf option %s = %s\r\n", xopts, config)); - if (!strcmp(xopts, "tcp")) { + if (!strcmp(xopts, "tcp") || !strcmp(xopts, "rfb")) { /* parse host-ip:port */ - tmpstr = strsep(&config, ":"); + tmpstr = strsep(&config, ":"); if (!config) sc->rfb_port = atoi(tmpstr); else { sc->rfb_port = atoi(config); sc->rfb_host = tmpstr; } - } else if (!strcmp(xopts, "w")) { - sc->memregs.width = atoi(config); + } else if (!strcmp(xopts, "vga")) { + if (!strcmp(config, "off")) { + sc->vga_enabled = 0; + } else if (!strcmp(config, "io")) { + sc->vga_enabled = 1; + sc->vga_full = 0; + } else if (!strcmp(config, "on")) { + sc->vga_enabled = 1; + sc->vga_full = 1; + } else { + pci_fbuf_usage(opts); + ret = -1; + goto done; + } + } else if (!strcmp(xopts, "w")) { + sc->memregs.width = atoi(config); if (sc->memregs.width > COLS_MAX) { pci_fbuf_usage(xopts); ret = -1; @@ -299,7 +307,7 @@ pci_fbuf_render(struct bhyvegc *gc, void sc = arg; - if (sc->use_vga && sc->gc_image->vgamode) { + if (sc->vga_full && sc->gc_image->vgamode) { /* TODO: mode switching to vga and vesa should use the special * EFI-bhyve protocol port. */ @@ -352,12 +360,21 @@ pci_fbuf_init(struct vmctx *ctx, struct sc->memregs.height = ROWS_DEFAULT; sc->memregs.depth = 32; + sc->vga_enabled = 1; + sc->vga_full = 0; + sc->fsc_pi = pi; error = pci_fbuf_parse_opts(sc, opts); if (error != 0) goto done; + /* XXX until VGA rendering is enabled */ + if (sc->vga_full != 0) { + fprintf(stderr, "pci_fbuf: VGA rendering not enabled"); + goto done; + } + sc->fb_base = vm_create_devmem(ctx, VM_FRAMEBUFFER, "framebuffer", FB_SIZE); if (sc->fb_base == MAP_FAILED) { error = -1; @@ -382,7 +399,8 @@ pci_fbuf_init(struct vmctx *ctx, struct console_init(sc->memregs.width, sc->memregs.height, sc->fb_base); console_fb_register(pci_fbuf_render, sc); - sc->vgasc = vga_init(!sc->use_vga); + if (sc->vga_enabled) + sc->vgasc = vga_init(!sc->vga_full); sc->gc_image = console_get_image(); fbuf_sc = sc; From owner-svn-src-head@freebsd.org Wed Jul 27 00:08: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 55666BA5BC8; Wed, 27 Jul 2016 00:08:03 +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 2302B1B5D; Wed, 27 Jul 2016 00:08:03 +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 u6R082ld030358; Wed, 27 Jul 2016 00:08:02 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6R081o5030351; Wed, 27 Jul 2016 00:08:01 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201607270008.u6R081o5030351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 27 Jul 2016 00:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303353 - head/sys/dev/usb/serial 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.22 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, 27 Jul 2016 00:08:03 -0000 Author: ian Date: Wed Jul 27 00:08:01 2016 New Revision: 303353 URL: https://svnweb.freebsd.org/changeset/base/303353 Log: Annotate the usb-serial drivers which always return 0 for line status, so that it'll be easier to find and fix them in the future. Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/serial/uark.c head/sys/dev/usb/serial/uchcom.c head/sys/dev/usb/serial/ufoma.c head/sys/dev/usb/serial/umodem.c head/sys/dev/usb/serial/uplcom.c head/sys/dev/usb/serial/uslcom.c Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Wed Jul 27 00:03:29 2016 (r303352) +++ head/sys/dev/usb/serial/u3g.c Wed Jul 27 00:08:01 2016 (r303353) @@ -1100,6 +1100,7 @@ u3g_cfg_get_status(struct ucom_softc *uc { struct u3g_softc *sc = ucom->sc_parent; + /* XXX Note: sc_lsr is always zero */ *lsr = sc->sc_lsr[ucom->sc_subunit]; *msr = sc->sc_msr[ucom->sc_subunit]; } Modified: head/sys/dev/usb/serial/uark.c ============================================================================== --- head/sys/dev/usb/serial/uark.c Wed Jul 27 00:03:29 2016 (r303352) +++ head/sys/dev/usb/serial/uark.c Wed Jul 27 00:08:01 2016 (r303353) @@ -427,6 +427,7 @@ uark_cfg_get_status(struct ucom_softc *u { struct uark_softc *sc = ucom->sc_parent; + /* XXX Note: sc_lsr is always zero */ *lsr = sc->sc_lsr; *msr = sc->sc_msr; } Modified: head/sys/dev/usb/serial/uchcom.c ============================================================================== --- head/sys/dev/usb/serial/uchcom.c Wed Jul 27 00:03:29 2016 (r303352) +++ head/sys/dev/usb/serial/uchcom.c Wed Jul 27 00:08:01 2016 (r303353) @@ -625,6 +625,7 @@ uchcom_cfg_get_status(struct ucom_softc DPRINTF("\n"); + /* XXX Note: sc_lsr is always zero */ *lsr = sc->sc_lsr; *msr = sc->sc_msr; } Modified: head/sys/dev/usb/serial/ufoma.c ============================================================================== --- head/sys/dev/usb/serial/ufoma.c Wed Jul 27 00:03:29 2016 (r303352) +++ head/sys/dev/usb/serial/ufoma.c Wed Jul 27 00:08:01 2016 (r303353) @@ -900,6 +900,7 @@ ufoma_cfg_get_status(struct ucom_softc * { struct ufoma_softc *sc = ucom->sc_parent; + /* XXX Note: sc_lsr is always zero */ *lsr = sc->sc_lsr; *msr = sc->sc_msr; } Modified: head/sys/dev/usb/serial/umodem.c ============================================================================== --- head/sys/dev/usb/serial/umodem.c Wed Jul 27 00:03:29 2016 (r303352) +++ head/sys/dev/usb/serial/umodem.c Wed Jul 27 00:08:01 2016 (r303353) @@ -558,6 +558,7 @@ umodem_cfg_get_status(struct ucom_softc DPRINTF("\n"); + /* XXX Note: sc_lsr is always zero */ *lsr = sc->sc_lsr; *msr = sc->sc_msr; } Modified: head/sys/dev/usb/serial/uplcom.c ============================================================================== --- head/sys/dev/usb/serial/uplcom.c Wed Jul 27 00:03:29 2016 (r303352) +++ head/sys/dev/usb/serial/uplcom.c Wed Jul 27 00:08:01 2016 (r303353) @@ -807,6 +807,7 @@ uplcom_cfg_get_status(struct ucom_softc DPRINTF("\n"); + /* XXX Note: sc_lsr is always zero */ *lsr = sc->sc_lsr; *msr = sc->sc_msr; } Modified: head/sys/dev/usb/serial/uslcom.c ============================================================================== --- head/sys/dev/usb/serial/uslcom.c Wed Jul 27 00:03:29 2016 (r303352) +++ head/sys/dev/usb/serial/uslcom.c Wed Jul 27 00:08:01 2016 (r303353) @@ -704,6 +704,7 @@ uslcom_get_status(struct ucom_softc *uco DPRINTF("\n"); + /* XXX Note: sc_lsr is always zero */ *lsr = sc->sc_lsr; *msr = sc->sc_msr; } From owner-svn-src-head@freebsd.org Wed Jul 27 00:46: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 DE685BA36D4; Wed, 27 Jul 2016 00:46:49 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB15D1E4C; Wed, 27 Jul 2016 00:46:49 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6R0kmtP045151; Wed, 27 Jul 2016 00:46:48 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6R0kmWK045150; Wed, 27 Jul 2016 00:46:48 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201607270046.u6R0kmWK045150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Wed, 27 Jul 2016 00:46:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303354 - head/share/timedef 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.22 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, 27 Jul 2016 00:46:50 -0000 Author: kevlo Date: Wed Jul 27 00:46:48 2016 New Revision: 303354 URL: https://svnweb.freebsd.org/changeset/base/303354 Log: Add weekday to the date format. Modified: head/share/timedef/zh_TW.UTF-8.src Modified: head/share/timedef/zh_TW.UTF-8.src ============================================================================== --- head/share/timedef/zh_TW.UTF-8.src Wed Jul 27 00:08:01 2016 (r303353) +++ head/share/timedef/zh_TW.UTF-8.src Wed Jul 27 00:46:48 2016 (r303354) @@ -56,14 +56,14 @@ %Y/%m/%d # # c_fmt -%Y年%m月%e日 %p%I:%M:%S [%Z] +%Y年%m月%e日%A %p%I:%M:%S [%Z] # # AM/PM 上午 下午 # # date_fmt -%Y年%m月%e日 %p%I:%M:%S [%Z] +%Y年%m月%e日%A %p%I:%M:%S [%Z] # # Long month names (without case ending) 1月 From owner-svn-src-head@freebsd.org Wed Jul 27 00:55: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 4E3D1BA387E for ; Wed, 27 Jul 2016 00:55:55 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) (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 00D9113DB for ; Wed, 27 Jul 2016 00:55:54 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f48.google.com with SMTP id b199so16556480lfe.0 for ; Tue, 26 Jul 2016 17:55:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=zZMdYZ6M1V8VoXnnL7EL1e8IrULIqQhzmnekuO+cFKo=; b=YpCPBPb7gCcWnmWoc1YdbaTEr5tXQZ1vnvVhMig6D7WzlCAwolg5dYywnbictlAsy0 o5P7OzyHsKYikCN5sgDiONPrXRQyAf3U1Ll2Pkm1d10BWwgvoXPszDb1I0S+5xwasv0R NcvknMJz9F8TI8dd1/IjXFR8yL7ekDBzxcWZBr2e2ztE0M+6GRV/qcBoGqsM3ZylLVDn cExznz8pydnG400/AaIkMcJmf4jsVYy9hA58q55DH7b1HV1njyBlKgFSakwNdHIa335B 83FMEjAGqOKS76FhMSJ6e2jwUERtqZhK4JdnMqGkLV6KOUb3CXjh9mxIXO+2FkIiZoPw 7Hog== X-Gm-Message-State: AEkooutd2lGo3UEcj7ECnrlBMVMeBNfF7kdpBiixWj8cH/T3CvlAjEdKziLyg5ntvBXybQ== X-Received: by 10.25.125.7 with SMTP id y7mr11481872lfc.140.1469580946441; Tue, 26 Jul 2016 17:55:46 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id f3sm526274lff.21.2016.07.26.17.55.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jul 2016 17:55:45 -0700 (PDT) Subject: Re: svn commit: r303354 - head/share/timedef To: Kevin Lo , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201607270046.u6R0kmWK045150@repo.freebsd.org> From: Andrey Chernov Message-ID: <81134a98-b8ff-fba9-1d8d-eed2cc1253db@freebsd.org> Date: Wed, 27 Jul 2016 03:55:44 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201607270046.u6R0kmWK045150@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 27 Jul 2016 00:55:55 -0000 On 27.07.2016 3:46, Kevin Lo wrote: > Author: kevlo > Date: Wed Jul 27 00:46:48 2016 > New Revision: 303354 > URL: https://svnweb.freebsd.org/changeset/base/303354 > > Log: > Add weekday to the date format. This file is generated, so this change will be lost after next generation. It will be better to fix generation script instead. > > Modified: > head/share/timedef/zh_TW.UTF-8.src > > Modified: head/share/timedef/zh_TW.UTF-8.src > ============================================================================== > --- head/share/timedef/zh_TW.UTF-8.src Wed Jul 27 00:08:01 2016 (r303353) > +++ head/share/timedef/zh_TW.UTF-8.src Wed Jul 27 00:46:48 2016 (r303354) > @@ -56,14 +56,14 @@ > %Y/%m/%d > # > # c_fmt > -%Y年%m月%e日 %p%I:%M:%S [%Z] > +%Y年%m月%e日%A %p%I:%M:%S [%Z] > # > # AM/PM > 上午 > 下午 > # > # date_fmt > -%Y年%m月%e日 %p%I:%M:%S [%Z] > +%Y年%m月%e日%A %p%I:%M:%S [%Z] > # > # Long month names (without case ending) > 1月 > From owner-svn-src-head@freebsd.org Wed Jul 27 01:26: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 B7F0CBA6195; Wed, 27 Jul 2016 01:26:58 +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 81A3E1449; Wed, 27 Jul 2016 01:26:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id C6D7AD68C9B; Wed, 27 Jul 2016 10:44:22 +1000 (AEST) Date: Wed, 27 Jul 2016 10:44:22 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Schouten cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303342 - in head: include lib/libc/stdlib In-Reply-To: <201607262011.u6QKBTDp043256@repo.freebsd.org> Message-ID: <20160727091654.P1485@besplex.bde.org> References: <201607262011.u6QKBTDp043256@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=OtmysHLt c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=7p6omsNoN1DVj17v3WwA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 27 Jul 2016 01:26:58 -0000 On Tue, 26 Jul 2016, Ed Schouten wrote: > Log: > Fix typing of srandom() and initstate(). > > POSIX requires that these functions have an unsigned int for their first > argument; not an unsigned long. > > My reasoning is that we can safely change these functions without > breaking the ABI. As far as I know, our supported architectures either > use registers for passing function arguments that are at least as big as > long (e.g., amd64), or int and long are of the same size (e.g., i386). This might work here since the type is unsigned, but it wouldn't work to change from int to long. Doing the correct extension in callers seems to be accidental on amd64, and doesn't happen for the signed case with gcc-4.2. For passing at least the first arg in the standard place (%rdi), gcc-4.2 loads both int and u_int args using movl. This always zero-extends. This is accidentally correct for u_ints, but for ints it does bad things like turning -1 into 0xFFFFFFFF. Callees don't depend on callers not passing garbage in the top bits. They generate extra instructions which waste time to do the correct extension if necessary. That is, if you don't pun the types. If you pass (int)-1 to a function expecting long, then with gcc-4.2 on amd64, -1 becomes 0xFFFFFFFF and the caller must trust this as a long value and not "fix" it to get -1 again. But clang sign-extends in callers, so this works, perhaps not accidentally. With unsigned types, zero-extension works for both compilers. Either gcc-4.2 is broken or clang is doing more than the ABI requires. I think the ABI shouldn't require much here. I expected the extra instructions to go away when sloppy unprotyped code and type pun became less common, but compilers still generate them. A stricter ABI would require callers to do more and callees would keep doing more. Bruce From owner-svn-src-head@freebsd.org Wed Jul 27 03:19: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 181DBBA6422; Wed, 27 Jul 2016 03:19:08 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x242.google.com (mail-pa0-x242.google.com [IPv6:2607:f8b0:400e:c03::242]) (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 D2834163C; Wed, 27 Jul 2016 03:19:07 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x242.google.com with SMTP id ez1so929418pab.3; Tue, 26 Jul 2016 20:19:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=5g4Nzjq5e4YHTwbA3PuGk1Mz/K8lGqEwfJGzGDVyf1M=; b=nheVEIfcwWNie6ZX42K4bFoSs9o1qCV88KYWXbX0dJNMbzz7bPasRPgb6ed6sA2TeQ V69f2HaONbcLzJLs7ZXZ3V+24KfghmDcuckBYCo9huXlOeBOMjHnBztNrJiuckCPlCfC IxQfpTPvZcgSzwDFm7wT/g014EXwgDPm7GaEkdonSbtXK8tWDihh+T55AtuKCE6ESqmk VtKJ1oSNhuMuclbeg+MaUkahQ1/SeAIYDtivd37OTyjFvZJIPjkkT09KsHzTS4Di/FW+ A8HiCHGog1U4sKLX7cUuInTLXhFjPSvxRZHFSZN6R39KlrLNTxtzkjCTeNkKekUcfUDJ Hm+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=5g4Nzjq5e4YHTwbA3PuGk1Mz/K8lGqEwfJGzGDVyf1M=; b=Khm2snF3ojxMm9qN5Gsn8Q1xXRZMRD+vXYui3F4YfAt5CFCanXLMO7S0lEh7E6cjZ1 UGlQ1MnH46lu1rXviMNKsacmg44zWebDehpXxTf650CK6YCzsp6+YhL/zSoKcBZ4uQ9e PtXySBNay+e9bT3LE8TqeNb8xS332XwYJuRyOvfTiGSDhmbZUFZjzanbPq1j+puDrSZU OP3mIrZgJk+PI/grSQ+ZB81/cXfRPv3m3PIxW1bULVdz2TfmLPTrSdbQ83A46d6ukmDQ 9GS/Xk2DzEWCTRASyDM6kj4KQ6LF1p9DHUf+8LKIeuP3xIV2hIyGSqY100Et+CT3f9KR akeA== X-Gm-Message-State: AEkoouvgUxWjYHI+CD9xFjzMnLRre3ipRmMK/KKN7+MkAWy+cb8HOOD7ekUb0Hq2s3MvEw== X-Received: by 10.66.233.38 with SMTP id tt6mr45111889pac.99.1469589546740; Tue, 26 Jul 2016 20:19:06 -0700 (PDT) Received: from [10.230.255.244] ([73.109.57.116]) by smtp.gmail.com with ESMTPSA id tm1sm4532163pac.23.2016.07.26.20.19.05 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Jul 2016 20:19:05 -0700 (PDT) Subject: Re: svn commit: r303047 - head/usr.bin/sed Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_3525F60C-E6B2-4FA0-8100-95C8B919B5F1"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201607192256.u6JMuewv007503@repo.freebsd.org> Date: Tue, 26 Jul 2016 20:19:06 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <1F81EA99-0498-4B8E-996A-D330EE6D770D@gmail.com> References: <201607192256.u6JMuewv007503@repo.freebsd.org> To: "Pedro F. Giffuni" X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 27 Jul 2016 03:19:08 -0000 --Apple-Mail=_3525F60C-E6B2-4FA0-8100-95C8B919B5F1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Jul 19, 2016, at 15:56, Pedro F. Giffuni wrote: >=20 > Author: pfg > Date: Tue Jul 19 22:56:40 2016 > New Revision: 303047 > URL: https://svnweb.freebsd.org/changeset/base/303047 >=20 > Log: > sed(1): Assorted cleanups and simplifications. >=20 > Const-ify several variables, make it build cleanly with WARNS level = 5. >=20 > Submitted by: mi > PR: 195929 > MFC after: 1 month >=20 > Modified: > head/usr.bin/sed/Makefile > head/usr.bin/sed/compile.c > head/usr.bin/sed/defs.h > head/usr.bin/sed/extern.h > head/usr.bin/sed/main.c > head/usr.bin/sed/misc.c > head/usr.bin/sed/process.c This breaks the etcupdate tests: = https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D211399 . Thanks, -Ngie --Apple-Mail=_3525F60C-E6B2-4FA0-8100-95C8B919B5F1 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----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJXmCgqAAoJEPWDqSZpMIYVCd4QAIS8A3xppHXQCryqIxWAlm6v G3DZ+yyP+u+5UOFAgGZnQXv24YHJWT6A0YD5RUjm/gsbX3WGzR3KGLLvUh5GITJn B/UbyYKUzRF7ZVFQA6HAdN7qVES38hnN3uLZpv4+nmGgEpghlAjnrmidP+Xm9W0n Ugh81eUEWBqVd4VNdxhuT8UQ+320u7mDmdJdB6jhZTpNqdPyuMZ+aT8cs/96tsQM OXq5lw+BdyMhZcbaLqLTCqEUlCwA90JcETgoyCz2ujZaE0yGx9ySjHd43jlx0h2P gERjvPULXtF5NAeb+UrAfWndc6iEb24HV99yddZJDjAxf6wh5C2gPQ8+EjBoHtuD 2nKV4mbR0+r/53JK8WaoUDQJ9ykGBluQWWI7NCLYmrdYospKvLAjUi6vsxip/pt/ Df4qVtodCh6qe3njCTkp6whgzF6X2YLM7B8USV+VMPo8uEpzBpJlltLdRruXzyN0 NFx0zWAl1sUYr3CY0b2jqnxU+HSH2V+d1LASn/isFYXjRAFYFOCaOuEvOBWL+vpE vdeRZFpvQ87sEfSe2egmFbF00qNfuEX4AJm2OAF7OOK2GOGDDz6PB/Ci/c+E/p5X V7y8es1WRfPk7iGnXKIJlx9I7xbTw3ciW2IZf9YHfRedK64A2zr4s1LEAAhUl2ri xOxkF6q+oRDHxwLGWIqR =JYYQ -----END PGP SIGNATURE----- --Apple-Mail=_3525F60C-E6B2-4FA0-8100-95C8B919B5F1-- From owner-svn-src-head@freebsd.org Wed Jul 27 03:21: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 C8F5BBA64C3; Wed, 27 Jul 2016 03:21:03 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A7521871; Wed, 27 Jul 2016 03:21:03 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6R3L2j2001225; Wed, 27 Jul 2016 03:21:02 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6R3L2AE001222; Wed, 27 Jul 2016 03:21:02 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201607270321.u6R3L2AE001222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Wed, 27 Jul 2016 03:21:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303355 - in head/sys: conf 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.22 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, 27 Jul 2016 03:21:03 -0000 Author: stevek Date: Wed Jul 27 03:21:02 2016 New Revision: 303355 URL: https://svnweb.freebsd.org/changeset/base/303355 Log: Add the NUM_CORE_FILES kernel config option which specifies the limit for the number of core files allowed by a particular process when using the %I core file name pattern. Sanity check at compile time to ensure the value is within the valid range of 0-10. Reviewed by: jtl, sjg Approved by: sjg (mentor) Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D6812 Modified: head/sys/conf/NOTES head/sys/conf/options head/sys/kern/kern_sig.c Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Wed Jul 27 00:46:48 2016 (r303354) +++ head/sys/conf/NOTES Wed Jul 27 03:21:02 2016 (r303355) @@ -578,6 +578,17 @@ options COMPILING_LINT # options STACK +# +# The NUM_CORE_FILES option specifies the limit for the number of core +# files generated by a particular process, when the core file format +# specifier includes the %I pattern. Since we only have 1 character for +# the core count in the format string, meaning the range will be 0-9, the +# maximum value allowed for this option is 10. +# This core file limit can be adjusted at runtime via the debug.ncores +# sysctl. +# +options NUM_CORE_FILES=5 + ##################################################################### # PERFORMANCE MONITORING OPTIONS Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Wed Jul 27 00:46:48 2016 (r303354) +++ head/sys/conf/options Wed Jul 27 03:21:02 2016 (r303355) @@ -65,6 +65,7 @@ SYSCTL_DEBUG opt_sysctl.h EARLY_PRINTF opt_global.h TEXTDUMP_PREFERRED opt_ddb.h TEXTDUMP_VERBOSE opt_ddb.h +NUM_CORE_FILES opt_global.h # Miscellaneous options. ADAPTIVE_LOCKMGRS Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Wed Jul 27 00:46:48 2016 (r303354) +++ head/sys/kern/kern_sig.c Wed Jul 27 03:21:02 2016 (r303355) @@ -3142,8 +3142,12 @@ childproc_exited(struct proc *p) * We only have 1 character for the core count in the format * string, so the range will be 0-9 */ -#define MAX_NUM_CORES 10 -static int num_cores = 5; +#define MAX_NUM_CORE_FILES 10 +#ifndef NUM_CORE_FILES +#define NUM_CORE_FILES 5 +#endif +CTASSERT(NUM_CORE_FILES >= 0 && NUM_CORE_FILES <= MAX_NUM_CORE_FILES); +static int num_cores = NUM_CORE_FILES; static int sysctl_debug_num_cores_check (SYSCTL_HANDLER_ARGS) @@ -3155,8 +3159,8 @@ sysctl_debug_num_cores_check (SYSCTL_HAN error = sysctl_handle_int(oidp, &new_val, 0, req); if (error != 0 || req->newptr == NULL) return (error); - if (new_val > MAX_NUM_CORES) - new_val = MAX_NUM_CORES; + if (new_val > MAX_NUM_CORE_FILES) + new_val = MAX_NUM_CORE_FILES; if (new_val < 0) new_val = 0; num_cores = new_val; From owner-svn-src-head@freebsd.org Wed Jul 27 03:49: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 B6A19BA6C17; Wed, 27 Jul 2016 03:49:01 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89BB01307; Wed, 27 Jul 2016 03:49:01 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6R3n0s8010630; Wed, 27 Jul 2016 03:49:00 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6R3n0wr010629; Wed, 27 Jul 2016 03:49:00 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201607270349.u6R3n0wr010629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Wed, 27 Jul 2016 03:49:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303356 - head/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.22 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, 27 Jul 2016 03:49:01 -0000 Author: alc Date: Wed Jul 27 03:49:00 2016 New Revision: 303356 URL: https://svnweb.freebsd.org/changeset/base/303356 Log: Update a comment to reflect r284376. MFC after: 3 days Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Wed Jul 27 03:21:02 2016 (r303355) +++ head/sys/vm/vm_pageout.c Wed Jul 27 03:49:00 2016 (r303356) @@ -1072,10 +1072,9 @@ unlock_page: /* * If the page appears to be clean at the machine-independent * layer, then remove all of its mappings from the pmap in - * anticipation of placing it onto the cache queue. If, - * however, any of the page's mappings allow write access, - * then the page may still be modified until the last of those - * mappings are removed. + * anticipation of freeing it. If, however, any of the page's + * mappings allow write access, then the page may still be + * modified until the last of those mappings are removed. */ if (object->ref_count != 0) { vm_page_test_dirty(m); From owner-svn-src-head@freebsd.org Wed Jul 27 04:33: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 34F34A7A724 for ; Wed, 27 Jul 2016 04:33:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm50-vm8.bullet.mail.bf1.yahoo.com (nm50-vm8.bullet.mail.bf1.yahoo.com [216.109.115.239]) (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 E19361CD0 for ; Wed, 27 Jul 2016 04:33:37 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1469594010; bh=oKjJuHrlL4LcNGT/YHmKWZCM4uHMBroQoLcdm8TSLns=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=LktGxMMZ+0Zm6S0bcfLiM2Z5YRFrI+9fGduT1bgvRVuhSz5wwFL9PB92iwJlLooENNBNPGq4UoaCWAytfg2fb1qr+EhHJ3osIkbJQEVQQmrEdAtpCwdHaZcYClEh9hpmzjLjDJSpLwdGRfg3LrirmqumUv6jKrnXeXB2ehavU8O4/FDOnMTKQDDzeUuErpY1O2VbvV1MOpRJEna78Z1e3rumzVxx3Lqhzuq7bo5HYcfDUWhUm2HJf6C0Vq88oxBFVxl9f0t2/N3cvY/9JseRXQeY3AKBwLI1IsDFFZSBK+JRxqt8G6A2jDktGtYPElGVVCtOXrP/VC+AN8/hGCT2yg== Received: from [66.196.81.172] by nm50.bullet.mail.bf1.yahoo.com with NNFMP; 27 Jul 2016 04:33:30 -0000 Received: from [68.142.230.78] by tm18.bullet.mail.bf1.yahoo.com with NNFMP; 27 Jul 2016 04:33:30 -0000 Received: from [127.0.0.1] by smtp235.mail.bf1.yahoo.com with NNFMP; 27 Jul 2016 04:33:30 -0000 X-Yahoo-Newman-Id: 808099.68347.bm@smtp235.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: gwik9woVM1lPUZ5RoO9P51IxmTjfQd_bqicQq.MxKDe285a 8.uI9oEXWL5L8_3SZj7nz4M_w0wB8KZi4KMAR6YLFVlH8vG99CywRUDZ92rG eNUcXQ1w_I33l9RDsJye1f0Mp57J6SOA8nVVVST3nZnsVg_o6Y94vjgPz.bb feCIZLxHVV9n6zUb412UJ0jfszdcJcn_bQk_OUw71hdCFTqC41_SIUufble8 damsplzcfXJHFqh9pYAxsvXaPzSd609RfMWbkFllPPprYd23DF4QYGHTkx.G EfIdPhF5OOmvOLNpSr6xQ7IBkjWeKrrsPC2puDKRM6BXJNwZ1kOq45el3KoB I.eACC_2eHdL.2z0RuRG5juZl8pLDXDCi4midp2TRkwiM74VnnxtrnneJ5lO 7Jnqu_P1EGw_X0fNVL0ZVv7w8cUVkSMGhVvi.4u66gUqnIGXk.wNRO7AhAL2 ZIPPEai4wIN.FouFcU0DLuKsovmGY8PrCrnJbqZyBdhlfrKymIorllqYwrlI KS8IbZFWRJUXfzI5T4Nx9_k2X74xyP2HkrqVCdxurP1LwCQ-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r303047 - head/usr.bin/sed To: "Ngie Cooper (yaneurabeya)" References: <201607192256.u6JMuewv007503@repo.freebsd.org> <1F81EA99-0498-4B8E-996A-D330EE6D770D@gmail.com> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: <8816e889-4e10-e936-2cdc-78e7243648c6@FreeBSD.org> Date: Tue, 26 Jul 2016 23:33:32 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <1F81EA99-0498-4B8E-996A-D330EE6D770D@gmail.com> 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.22 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, 27 Jul 2016 04:33:38 -0000 On 07/26/16 22:19, Ngie Cooper (yaneurabeya) wrote: > >> On Jul 19, 2016, at 15:56, Pedro F. Giffuni wrote: >> >> Author: pfg >> Date: Tue Jul 19 22:56:40 2016 >> New Revision: 303047 >> URL: https://svnweb.freebsd.org/changeset/base/303047 >> >> Log: >> sed(1): Assorted cleanups and simplifications. >> >> Const-ify several variables, make it build cleanly with WARNS level 5. >> >> Submitted by: mi >> PR: 195929 >> MFC after: 1 month >> >> Modified: >> head/usr.bin/sed/Makefile >> head/usr.bin/sed/compile.c >> head/usr.bin/sed/defs.h >> head/usr.bin/sed/extern.h >> head/usr.bin/sed/main.c >> head/usr.bin/sed/misc.c >> head/usr.bin/sed/process.c > > This breaks the etcupdate tests: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211399 . > Thanks, I am OK with reverting but I would like more details. Is there a way to get a diff between the pass vs. failing tests? Pedro. From owner-svn-src-head@freebsd.org Wed Jul 27 05:47: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 233BEBA6367; Wed, 27 Jul 2016 05:47:34 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00EFD1AE6; Wed, 27 Jul 2016 05:47:33 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6R5lXGt055237; Wed, 27 Jul 2016 05:47:33 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6R5lXNW055234; Wed, 27 Jul 2016 05:47:33 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201607270547.u6R5lXNW055234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 27 Jul 2016 05:47:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303361 - head/sys/dev/hyperv/vmbus 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.22 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, 27 Jul 2016 05:47:34 -0000 Author: sephe Date: Wed Jul 27 05:47:32 2016 New Revision: 303361 URL: https://svnweb.freebsd.org/changeset/base/303361 Log: hyperv/vmbus: Initialize RX/TX bufring mutex at channel creation time MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D7312 Modified: head/sys/dev/hyperv/vmbus/hv_ring_buffer.c head/sys/dev/hyperv/vmbus/vmbus_brvar.h head/sys/dev/hyperv/vmbus/vmbus_chan.c Modified: head/sys/dev/hyperv/vmbus/hv_ring_buffer.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Wed Jul 27 05:38:09 2016 (r303360) +++ head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Wed Jul 27 05:47:32 2016 (r303361) @@ -198,20 +198,24 @@ hv_ring_buffer_needsig_on_write(uint32_t /** * @brief Initialize the ring buffer. */ -int +void hv_vmbus_ring_buffer_init(hv_vmbus_ring_buffer_info *ring_info, void *buffer, uint32_t buffer_len) { - memset(ring_info, 0, sizeof(hv_vmbus_ring_buffer_info)); - ring_info->ring_buffer = buffer; - ring_info->ring_buffer->br_rindex = 0; - ring_info->ring_buffer->br_windex = 0; - ring_info->ring_data_size = buffer_len - sizeof(struct vmbus_bufring); - mtx_init(&ring_info->ring_lock, "vmbus ring buffer", NULL, MTX_SPIN); +} - return (0); +void +vmbus_br_init(hv_vmbus_ring_buffer_info *ring_info) +{ + mtx_init(&ring_info->ring_lock, "vmbus_br", NULL, MTX_SPIN); +} + +void +vmbus_br_deinit(hv_vmbus_ring_buffer_info *ring_info) +{ + mtx_destroy(&ring_info->ring_lock); } /** @@ -220,7 +224,7 @@ hv_vmbus_ring_buffer_init(hv_vmbus_ring_ void hv_ring_buffer_cleanup(hv_vmbus_ring_buffer_info *ring_info) { - mtx_destroy(&ring_info->ring_lock); + /* Do nothing */ } /** Modified: head/sys/dev/hyperv/vmbus/vmbus_brvar.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_brvar.h Wed Jul 27 05:38:09 2016 (r303360) +++ head/sys/dev/hyperv/vmbus/vmbus_brvar.h Wed Jul 27 05:47:32 2016 (r303361) @@ -49,11 +49,13 @@ void vmbus_br_sysctl_create(struct sysct struct sysctl_oid *br_tree, hv_vmbus_ring_buffer_info *br, const char *name); -int hv_vmbus_ring_buffer_init( +void vmbus_br_init(hv_vmbus_ring_buffer_info *ring_info); +void vmbus_br_deinit(hv_vmbus_ring_buffer_info *ring_info); + +void hv_vmbus_ring_buffer_init( hv_vmbus_ring_buffer_info *ring_info, void *buffer, uint32_t buffer_len); - void hv_ring_buffer_cleanup( hv_vmbus_ring_buffer_info *ring_info); Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_chan.c Wed Jul 27 05:38:09 2016 (r303360) +++ head/sys/dev/hyperv/vmbus/vmbus_chan.c Wed Jul 27 05:47:32 2016 (r303361) @@ -914,6 +914,8 @@ vmbus_chan_alloc(struct vmbus_softc *sc) mtx_init(&chan->ch_subchan_lock, "vmbus subchan", NULL, MTX_DEF); TAILQ_INIT(&chan->ch_subchans); TASK_INIT(&chan->ch_detach_task, 0, vmbus_chan_detach_task, chan); + vmbus_br_init(&chan->ch_rxbr); + vmbus_br_init(&chan->ch_txbr); return chan; } @@ -926,6 +928,8 @@ vmbus_chan_free(struct vmbus_channel *ch /* TODO: asset no longer on the vmbus channel list */ hyperv_dmamem_free(&chan->ch_monprm_dma, chan->ch_monprm); mtx_destroy(&chan->ch_subchan_lock); + vmbus_br_deinit(&chan->ch_rxbr); + vmbus_br_deinit(&chan->ch_txbr); free(chan, M_DEVBUF); } From owner-svn-src-head@freebsd.org Wed Jul 27 06:12:10 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 BBB79BA6831; Wed, 27 Jul 2016 06:12:10 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com [IPv6:2607:f8b0:400e:c00::243]) (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 889C81672; Wed, 27 Jul 2016 06:12:10 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x243.google.com with SMTP id h186so1222339pfg.2; Tue, 26 Jul 2016 23:12:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=QWQv/oqB9P9b9Dyvyk4WRFWEJjasJrpk5qViZa2Kehg=; b=BbC1ZwJTc7peRRkcWKOOdcA2V/etgIKUl5MiZgupRDzCksbxWy0HdPiQr1lmlLvYhW 2J+MWzeW5R+RYb4ruEio8mtk/LfRh1/U3Q9NDnm/vMXJ4vsnozBb4/eISu3YE9DJ2sp1 oL6yM4N3ikHY9uATPtc7EnIZNkFlLr92yOyFA9B8rTyzYRAlVdc9jkTUtO4yazqdhJRS vvvQmmH1aFpN4cyQt8eqGGa8v8aPknvhOip5IKoFiC3HpLw39nIBd8vKQxy6qbo+zw3S IE2ESu6dne677MjP0EP5wTIooksn9zETQEoe1SInlxiGrEUWGK83xOQZ0jv32Podb3qc kLGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=QWQv/oqB9P9b9Dyvyk4WRFWEJjasJrpk5qViZa2Kehg=; b=UVFN+aNxX88rALDtI0VxxVkZ55/54Ga1kJAqt/Bsl3qVS7Mu1+Jt8eBtAuWp+V6ham 2aFvqaYnF52DRyfxEpkZH3+gpjX//9qxLdV/Hezw2vn+RSEWLUXChhUMbKnbZFeF0FPj 88rONFPRXyq3JOt9zy4UGptqa7J24J4DRiAQrzzsR0+9JobimPCthMuYjeAnY2xRq/XM CcYC4QyV81OxFaA/LhbjJ9r7Qn26zvu9rGGVBfvgggMT5g/N4rEM12oOvpErilZXYcXQ FhSrrzALT2ArMtsZe2FcdJy29+8N/+jToXbgObMRg5TyM4h94ZCfWuWaVNfaYNzFAxmy 3dFw== X-Gm-Message-State: AEkoouv7r9GeSPi+XJTvw9K82V4Q7LqazCk4Ld92fvE1HvM+/5sgjoyhy2m1FhEN/iTMXg== X-Received: by 10.98.133.10 with SMTP id u10mr29236710pfd.134.1469599929996; Tue, 26 Jul 2016 23:12:09 -0700 (PDT) Received: from [10.236.47.233] ([73.109.56.213]) by smtp.gmail.com with ESMTPSA id ee3sm5662799pac.25.2016.07.26.23.12.08 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Jul 2016 23:12:09 -0700 (PDT) Subject: Re: svn commit: r303047 - head/usr.bin/sed Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_4D8CC49C-8E44-4867-99F2-E41CFAF2DDC0"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <8816e889-4e10-e936-2cdc-78e7243648c6@FreeBSD.org> Date: Tue, 26 Jul 2016 23:12:07 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201607192256.u6JMuewv007503@repo.freebsd.org> <1F81EA99-0498-4B8E-996A-D330EE6D770D@gmail.com> <8816e889-4e10-e936-2cdc-78e7243648c6@FreeBSD.org> To: Pedro Giffuni X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 27 Jul 2016 06:12:10 -0000 --Apple-Mail=_4D8CC49C-8E44-4867-99F2-E41CFAF2DDC0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 > On Jul 26, 2016, at 21:33, Pedro Giffuni wrote: >=20 >=20 >=20 > On 07/26/16 22:19, Ngie Cooper (yaneurabeya) wrote: >>=20 >>> On Jul 19, 2016, at 15:56, Pedro F. Giffuni wrote: >>>=20 >>> Author: pfg >>> Date: Tue Jul 19 22:56:40 2016 >>> New Revision: 303047 >>> URL: https://svnweb.freebsd.org/changeset/base/303047 >>>=20 >>> Log: >>> sed(1): Assorted cleanups and simplifications. >>>=20 >>> Const-ify several variables, make it build cleanly with WARNS level = 5. >>>=20 >>> Submitted by: mi >>> PR: 195929 >>> MFC after: 1 month >>>=20 >>> Modified: >>> head/usr.bin/sed/Makefile >>> head/usr.bin/sed/compile.c >>> head/usr.bin/sed/defs.h >>> head/usr.bin/sed/extern.h >>> head/usr.bin/sed/main.c >>> head/usr.bin/sed/misc.c >>> head/usr.bin/sed/process.c >>=20 >> This breaks the etcupdate tests: = https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D211399 . >> Thanks, >=20 > I am OK with reverting but I would like more details. Is there a way = to > get a diff between the pass vs. failing tests? I added more info to the bug. It looks like it=92s swallowing a newline = with the www group/password entry when used with /i. Thanks, -Ngie --Apple-Mail=_4D8CC49C-8E44-4867-99F2-E41CFAF2DDC0 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----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJXmFC3AAoJEPWDqSZpMIYVI/IQAM3Qyh1WZH5S+es3qUb1S5Qh cq/xaREFIB2zrs7cSsygq74Tsgeg/QTms1BnZa35mFwp8JULdSGS7XfdOi5IExvq jnnZ3xdy+uq8J269UZYNQ7NEPsBEM4KBSrzJ8go+oQ9t/ok8Xcjfr4lSyZYhbvOm elmwmCwnBIuzK2a3QS/yphFOMxoscADXQqJCiwewn7Ch38gW0m9qfG6yQtZfdItF G+6qgIvqRtUy2VwUjJrepmfF0p3/3v1Whz8hutPYcTx31GH9yzZ4j8BheWMse+1m WqL/nDTQlDx5yeWZj8UywXjF7LZdhwiC8tDM8242LcEylOXgdG6fVBG00m7gWJ3d N+f4r+30koOY5Eyifb766VZTGMTaViL0qplMpHHjk/e+DsWw7MINtiWIyJiyKm/t 1BbyCFnB0xb90/6rLgxlr8WJxpXzla54ZP0WdU7Agpg1xRgRm7c7aRoyS+uScj5D 7reOc1kKogLNTIRLb6AWG2EEptGXwpsWhciaz+45RULQ5ZTCFhOW89f2f7OvM+C4 k+HZL7ranaMO95p+CVx9v0Opl+91snxtDALeFP+iiNUNBnGLqBgFcYFJH33Eum3K HbTGwnTnNY42noWsr+DiEeRGcHii3aXN5Ko8cL39J1KustCfjDN8ig8tSCcy0zfs 7NvpY5Ez4qxbXstzFtJ/ =TTXK -----END PGP SIGNATURE----- --Apple-Mail=_4D8CC49C-8E44-4867-99F2-E41CFAF2DDC0-- From owner-svn-src-head@freebsd.org Wed Jul 27 06:17: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 975D2BA6926; Wed, 27 Jul 2016 06:17:21 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 672821989; Wed, 27 Jul 2016 06:17:21 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6R6HKg8066262; Wed, 27 Jul 2016 06:17:20 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6R6HKoT066258; Wed, 27 Jul 2016 06:17:20 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201607270617.u6R6HKoT066258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 27 Jul 2016 06:17:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303362 - head/sys/dev/hyperv/vmbus 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.22 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, 27 Jul 2016 06:17:21 -0000 Author: sephe Date: Wed Jul 27 06:17:20 2016 New Revision: 303362 URL: https://svnweb.freebsd.org/changeset/base/303362 Log: hyperv/vmbus: Use different struct for RX/TX bufring. So that they can use suitable MP synchronization mechanism. While I'm here change the bufring init/read/write function names. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7313 Modified: head/sys/dev/hyperv/vmbus/hv_ring_buffer.c head/sys/dev/hyperv/vmbus/vmbus_brvar.h head/sys/dev/hyperv/vmbus/vmbus_chan.c head/sys/dev/hyperv/vmbus/vmbus_chanvar.h Modified: head/sys/dev/hyperv/vmbus/hv_ring_buffer.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Wed Jul 27 05:47:32 2016 (r303361) +++ head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Wed Jul 27 06:17:20 2016 (r303362) @@ -34,32 +34,32 @@ #include #include -/* Amount of space to write to */ -#define HV_BYTES_AVAIL_TO_WRITE(r, w, z) \ - ((w) >= (r)) ? ((z) - ((w) - (r))) : ((r) - (w)) +/* Amount of space available for write */ +#define VMBUS_BR_WAVAIL(r, w, z) \ + (((w) >= (r)) ? ((z) - ((w) - (r))) : ((r) - (w))) -static uint32_t copy_to_ring_buffer(hv_vmbus_ring_buffer_info *ring_info, +static uint32_t copy_to_ring_buffer(const struct vmbus_txbr *tbr, uint32_t start_write_offset, const uint8_t *src, uint32_t src_len); -static uint32_t copy_from_ring_buffer(hv_vmbus_ring_buffer_info *ring_info, +static uint32_t copy_from_ring_buffer(const struct vmbus_rxbr *rbr, char *dest, uint32_t dest_len, uint32_t start_read_offset); static int vmbus_br_sysctl_state(SYSCTL_HANDLER_ARGS) { - const hv_vmbus_ring_buffer_info *br = arg1; - uint32_t rindex, windex, intr_mask, ravail, wavail; + const struct vmbus_br *br = arg1; + uint32_t rindex, windex, imask, ravail, wavail; char state[256]; - rindex = br->ring_buffer->br_rindex; - windex = br->ring_buffer->br_windex; - intr_mask = br->ring_buffer->br_imask; - wavail = HV_BYTES_AVAIL_TO_WRITE(rindex, windex, br->ring_data_size); - ravail = br->ring_data_size - wavail; + rindex = br->vbr_rindex; + windex = br->vbr_windex; + imask = br->vbr_imask; + wavail = VMBUS_BR_WAVAIL(rindex, windex, br->vbr_dsize); + ravail = br->vbr_dsize - wavail; snprintf(state, sizeof(state), - "rindex:%u windex:%u intr_mask:%u ravail:%u wavail:%u", - rindex, windex, intr_mask, ravail, wavail); + "rindex:%u windex:%u imask:%u ravail:%u wavail:%u", + rindex, windex, imask, ravail, wavail); return sysctl_handle_string(oidp, state, sizeof(state), req); } @@ -76,25 +76,25 @@ vmbus_br_sysctl_state_bin(SYSCTL_HANDLER #define BR_STATE_WSPC 4 #define BR_STATE_MAX 5 - const hv_vmbus_ring_buffer_info *br = arg1; + const struct vmbus_br *br = arg1; uint32_t rindex, windex, wavail, state[BR_STATE_MAX]; - rindex = br->ring_buffer->br_rindex; - windex = br->ring_buffer->br_windex; - wavail = HV_BYTES_AVAIL_TO_WRITE(rindex, windex, br->ring_data_size); + rindex = br->vbr_rindex; + windex = br->vbr_windex; + wavail = VMBUS_BR_WAVAIL(rindex, windex, br->vbr_dsize); state[BR_STATE_RIDX] = rindex; state[BR_STATE_WIDX] = windex; - state[BR_STATE_IMSK] = br->ring_buffer->br_imask; + state[BR_STATE_IMSK] = br->vbr_imask; state[BR_STATE_WSPC] = wavail; - state[BR_STATE_RSPC] = br->ring_data_size - wavail; + state[BR_STATE_RSPC] = br->vbr_dsize - wavail; return sysctl_handle_opaque(oidp, state, sizeof(state), req); } void vmbus_br_sysctl_create(struct sysctl_ctx_list *ctx, struct sysctl_oid *br_tree, - hv_vmbus_ring_buffer_info *br, const char *name) + struct vmbus_br *br, const char *name) { struct sysctl_oid *tree; char desc[64]; @@ -115,40 +115,30 @@ vmbus_br_sysctl_create(struct sysctl_ctx br, 0, vmbus_br_sysctl_state_bin, "IU", desc); } -/** - * @brief Get number of bytes available to read and to write to - * for the specified ring buffer - */ -static __inline void -get_ring_buffer_avail_bytes(hv_vmbus_ring_buffer_info *rbi, uint32_t *read, - uint32_t *write) +void +vmbus_rxbr_intr_mask(struct vmbus_rxbr *rbr) { - uint32_t read_loc, write_loc; - - /* - * Capture the read/write indices before they changed - */ - read_loc = rbi->ring_buffer->br_rindex; - write_loc = rbi->ring_buffer->br_windex; - - *write = HV_BYTES_AVAIL_TO_WRITE(read_loc, write_loc, - rbi->ring_data_size); - *read = rbi->ring_data_size - *write; + rbr->rxbr_imask = 1; + mb(); } -void -hv_ring_buffer_read_begin(hv_vmbus_ring_buffer_info *ring_info) +static __inline uint32_t +vmbus_rxbr_avail(const struct vmbus_rxbr *rbr) { - ring_info->ring_buffer->br_imask = 1; - mb(); + uint32_t rindex, windex; + + /* Get snapshot */ + rindex = rbr->rxbr_rindex; + windex = rbr->rxbr_windex; + + return (rbr->rxbr_dsize - + VMBUS_BR_WAVAIL(rindex, windex, rbr->rxbr_dsize)); } uint32_t -hv_ring_buffer_read_end(hv_vmbus_ring_buffer_info *ring_info) +vmbus_rxbr_intr_unmask(struct vmbus_rxbr *rbr) { - uint32_t read, write; - - ring_info->ring_buffer->br_imask = 0; + rbr->rxbr_imask = 0; mb(); /* @@ -156,8 +146,7 @@ hv_ring_buffer_read_end(hv_vmbus_ring_bu * If it is not, we raced and we need to process new * incoming messages. */ - get_ring_buffer_avail_bytes(ring_info, &read, &write); - return (read); + return vmbus_rxbr_avail(rbr); } /* @@ -177,10 +166,10 @@ hv_ring_buffer_read_end(hv_vmbus_ring_bu */ static boolean_t hv_ring_buffer_needsig_on_write(uint32_t old_write_location, - hv_vmbus_ring_buffer_info *rbi) + const struct vmbus_txbr *tbr) { mb(); - if (rbi->ring_buffer->br_imask) + if (tbr->txbr_imask) return (FALSE); /* Read memory barrier */ @@ -189,54 +178,73 @@ hv_ring_buffer_needsig_on_write(uint32_t * This is the only case we need to signal when the * ring transitions from being empty to non-empty. */ - if (old_write_location == rbi->ring_buffer->br_rindex) + if (old_write_location == tbr->txbr_rindex) return (TRUE); return (FALSE); } -/** - * @brief Initialize the ring buffer. - */ +static void +vmbus_br_setup(struct vmbus_br *br, void *buf, int blen) +{ + br->vbr = buf; + br->vbr_dsize = blen - sizeof(struct vmbus_bufring); +} + void -hv_vmbus_ring_buffer_init(hv_vmbus_ring_buffer_info *ring_info, void *buffer, - uint32_t buffer_len) +vmbus_rxbr_init(struct vmbus_rxbr *rbr) { - ring_info->ring_buffer = buffer; - ring_info->ring_data_size = buffer_len - sizeof(struct vmbus_bufring); + mtx_init(&rbr->rxbr_lock, "vmbus_rxbr", NULL, MTX_SPIN); } void -vmbus_br_init(hv_vmbus_ring_buffer_info *ring_info) +vmbus_rxbr_deinit(struct vmbus_rxbr *rbr) { - mtx_init(&ring_info->ring_lock, "vmbus_br", NULL, MTX_SPIN); + mtx_destroy(&rbr->rxbr_lock); } void -vmbus_br_deinit(hv_vmbus_ring_buffer_info *ring_info) +vmbus_rxbr_setup(struct vmbus_rxbr *rbr, void *buf, int blen) { - mtx_destroy(&ring_info->ring_lock); + vmbus_br_setup(&rbr->rxbr, buf, blen); } -/** - * @brief Cleanup the ring buffer. - */ void -hv_ring_buffer_cleanup(hv_vmbus_ring_buffer_info *ring_info) +vmbus_txbr_init(struct vmbus_txbr *tbr) { - /* Do nothing */ + mtx_init(&tbr->txbr_lock, "vmbus_txbr", NULL, MTX_SPIN); +} + +void +vmbus_txbr_deinit(struct vmbus_txbr *tbr) +{ + mtx_destroy(&tbr->txbr_lock); +} + +void +vmbus_txbr_setup(struct vmbus_txbr *tbr, void *buf, int blen) +{ + vmbus_br_setup(&tbr->txbr, buf, blen); +} + +static __inline uint32_t +vmbus_txbr_avail(const struct vmbus_txbr *tbr) +{ + uint32_t rindex, windex; + + /* Get snapshot */ + rindex = tbr->txbr_rindex; + windex = tbr->txbr_windex; + + return VMBUS_BR_WAVAIL(rindex, windex, tbr->txbr_dsize); } -/** - * @brief Write to the ring buffer. - */ int -hv_ring_buffer_write(hv_vmbus_ring_buffer_info *out_ring_info, - const struct iovec iov[], uint32_t iovlen, boolean_t *need_sig) +vmbus_txbr_write(struct vmbus_txbr *tbr, const struct iovec iov[], int iovlen, + boolean_t *need_sig) { int i = 0; uint32_t byte_avail_to_write; - uint32_t byte_avail_to_read; uint32_t old_write_location; uint32_t total_bytes_to_write = 0; volatile uint32_t next_write_location; @@ -247,10 +255,9 @@ hv_ring_buffer_write(hv_vmbus_ring_buffe total_bytes_to_write += sizeof(uint64_t); - mtx_lock_spin(&out_ring_info->ring_lock); + mtx_lock_spin(&tbr->txbr_lock); - get_ring_buffer_avail_bytes(out_ring_info, &byte_avail_to_read, - &byte_avail_to_write); + byte_avail_to_write = vmbus_txbr_avail(tbr); /* * If there is only room for the packet, assume it is full. @@ -258,28 +265,28 @@ hv_ring_buffer_write(hv_vmbus_ring_buffe * is empty since the read index == write index */ if (byte_avail_to_write <= total_bytes_to_write) { - mtx_unlock_spin(&out_ring_info->ring_lock); + mtx_unlock_spin(&tbr->txbr_lock); return (EAGAIN); } /* * Write to the ring buffer */ - next_write_location = out_ring_info->ring_buffer->br_windex; + next_write_location = tbr->txbr_windex; old_write_location = next_write_location; for (i = 0; i < iovlen; i++) { - next_write_location = copy_to_ring_buffer(out_ring_info, + next_write_location = copy_to_ring_buffer(tbr, next_write_location, iov[i].iov_base, iov[i].iov_len); } /* * Set previous packet start */ - prev_indices = ((uint64_t)out_ring_info->ring_buffer->br_windex) << 32; + prev_indices = ((uint64_t)tbr->txbr_windex) << 32; - next_write_location = copy_to_ring_buffer(out_ring_info, + next_write_location = copy_to_ring_buffer(tbr, next_write_location, (char *)&prev_indices, sizeof(uint64_t)); /* @@ -290,88 +297,73 @@ hv_ring_buffer_write(hv_vmbus_ring_buffe /* * Now, update the write location */ - out_ring_info->ring_buffer->br_windex = next_write_location; + tbr->txbr_windex = next_write_location; - mtx_unlock_spin(&out_ring_info->ring_lock); + mtx_unlock_spin(&tbr->txbr_lock); - *need_sig = hv_ring_buffer_needsig_on_write(old_write_location, - out_ring_info); + *need_sig = hv_ring_buffer_needsig_on_write(old_write_location, tbr); return (0); } -/** - * @brief Read without advancing the read index. - */ int -hv_ring_buffer_peek(hv_vmbus_ring_buffer_info *in_ring_info, void *buffer, - uint32_t buffer_len) +vmbus_rxbr_peek(struct vmbus_rxbr *rbr, void *data, int dlen) { - uint32_t bytesAvailToWrite; uint32_t bytesAvailToRead; uint32_t nextReadLocation = 0; - mtx_lock_spin(&in_ring_info->ring_lock); + mtx_lock_spin(&rbr->rxbr_lock); - get_ring_buffer_avail_bytes(in_ring_info, &bytesAvailToRead, - &bytesAvailToWrite); + bytesAvailToRead = vmbus_rxbr_avail(rbr); /* * Make sure there is something to read */ - if (bytesAvailToRead < buffer_len) { - mtx_unlock_spin(&in_ring_info->ring_lock); + if (bytesAvailToRead < dlen) { + mtx_unlock_spin(&rbr->rxbr_lock); return (EAGAIN); } /* * Convert to byte offset */ - nextReadLocation = in_ring_info->ring_buffer->br_rindex; + nextReadLocation = rbr->rxbr_rindex; - nextReadLocation = copy_from_ring_buffer(in_ring_info, - (char *)buffer, buffer_len, nextReadLocation); + nextReadLocation = copy_from_ring_buffer(rbr, data, dlen, + nextReadLocation); - mtx_unlock_spin(&in_ring_info->ring_lock); + mtx_unlock_spin(&rbr->rxbr_lock); return (0); } -/** - * @brief Read and advance the read index. - */ int -hv_ring_buffer_read(hv_vmbus_ring_buffer_info *in_ring_info, void *buffer, - uint32_t buffer_len, uint32_t offset) +vmbus_rxbr_read(struct vmbus_rxbr *rbr, void *data, int dlen, uint32_t offset) { - uint32_t bytes_avail_to_write; uint32_t bytes_avail_to_read; uint32_t next_read_location = 0; uint64_t prev_indices = 0; - if (buffer_len <= 0) - return (EINVAL); + KASSERT(dlen > 0, ("invalid dlen %d", dlen)); - mtx_lock_spin(&in_ring_info->ring_lock); + mtx_lock_spin(&rbr->rxbr_lock); - get_ring_buffer_avail_bytes(in_ring_info, &bytes_avail_to_read, - &bytes_avail_to_write); + bytes_avail_to_read = vmbus_rxbr_avail(rbr); /* * Make sure there is something to read */ - if (bytes_avail_to_read < buffer_len) { - mtx_unlock_spin(&in_ring_info->ring_lock); + if (bytes_avail_to_read < dlen) { + mtx_unlock_spin(&rbr->rxbr_lock); return (EAGAIN); } - next_read_location = (in_ring_info->ring_buffer->br_rindex + offset) % - in_ring_info->ring_data_size; + next_read_location = (rbr->rxbr_rindex + offset) % rbr->rxbr_dsize; - next_read_location = copy_from_ring_buffer(in_ring_info, (char *)buffer, - buffer_len, next_read_location); + next_read_location = copy_from_ring_buffer(rbr, data, dlen, + next_read_location); - next_read_location = copy_from_ring_buffer(in_ring_info, + next_read_location = copy_from_ring_buffer(rbr, (char *)&prev_indices, sizeof(uint64_t), next_read_location); /* @@ -384,9 +376,9 @@ hv_ring_buffer_read(hv_vmbus_ring_buffer /* * Update the read index */ - in_ring_info->ring_buffer->br_rindex = next_read_location; + rbr->rxbr_rindex = next_read_location; - mtx_unlock_spin(&in_ring_info->ring_lock); + mtx_unlock_spin(&rbr->rxbr_lock); return (0); } @@ -397,11 +389,11 @@ hv_ring_buffer_read(hv_vmbus_ring_buffer * Assume there is enough room. Handles wrap-around in dest case only! */ static uint32_t -copy_to_ring_buffer(hv_vmbus_ring_buffer_info *ring_info, +copy_to_ring_buffer(const struct vmbus_txbr *tbr, uint32_t start_write_offset, const uint8_t *src, uint32_t src_len) { - char *ring_buffer = ring_info->ring_buffer->br_data; - uint32_t ring_buffer_size = ring_info->ring_data_size; + char *ring_buffer = tbr->txbr_data; + uint32_t ring_buffer_size = tbr->txbr_dsize; uint32_t fragLen; if (src_len > ring_buffer_size - start_write_offset) { @@ -425,12 +417,12 @@ copy_to_ring_buffer(hv_vmbus_ring_buffer * Assume there is enough room. Handles wrap-around in src case only! */ static uint32_t -copy_from_ring_buffer(hv_vmbus_ring_buffer_info *ring_info, char *dest, +copy_from_ring_buffer(const struct vmbus_rxbr *rbr, char *dest, uint32_t dest_len, uint32_t start_read_offset) { uint32_t fragLen; - char *ring_buffer = ring_info->ring_buffer->br_data; - uint32_t ring_buffer_size = ring_info->ring_data_size; + char *ring_buffer = rbr->rxbr_data; + uint32_t ring_buffer_size = rbr->rxbr_dsize; if (dest_len > ring_buffer_size - start_read_offset) { /* wrap-around detected at the src */ Modified: head/sys/dev/hyperv/vmbus/vmbus_brvar.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_brvar.h Wed Jul 27 05:47:32 2016 (r303361) +++ head/sys/dev/hyperv/vmbus/vmbus_brvar.h Wed Jul 27 06:17:20 2016 (r303362) @@ -36,50 +36,58 @@ #include #include -typedef struct { - struct vmbus_bufring *ring_buffer; - struct mtx ring_lock; - uint32_t ring_data_size; /* ring_size */ -} hv_vmbus_ring_buffer_info; +struct vmbus_br { + struct vmbus_bufring *vbr; + uint32_t vbr_dsize; /* total data size */ +}; + +#define vbr_windex vbr->br_windex +#define vbr_rindex vbr->br_rindex +#define vbr_imask vbr->br_imask +#define vbr_data vbr->br_data + +struct vmbus_rxbr { + struct mtx rxbr_lock; + struct vmbus_br rxbr; +}; + +#define rxbr_windex rxbr.vbr_windex +#define rxbr_rindex rxbr.vbr_rindex +#define rxbr_imask rxbr.vbr_imask +#define rxbr_data rxbr.vbr_data +#define rxbr_dsize rxbr.vbr_dsize + +struct vmbus_txbr { + struct mtx txbr_lock; + struct vmbus_br txbr; +}; + +#define txbr_windex txbr.vbr_windex +#define txbr_rindex txbr.vbr_rindex +#define txbr_imask txbr.vbr_imask +#define txbr_data txbr.vbr_data +#define txbr_dsize txbr.vbr_dsize struct sysctl_ctx_list; struct sysctl_oid; -void vmbus_br_sysctl_create(struct sysctl_ctx_list *ctx, - struct sysctl_oid *br_tree, hv_vmbus_ring_buffer_info *br, - const char *name); - -void vmbus_br_init(hv_vmbus_ring_buffer_info *ring_info); -void vmbus_br_deinit(hv_vmbus_ring_buffer_info *ring_info); - -void hv_vmbus_ring_buffer_init( - hv_vmbus_ring_buffer_info *ring_info, - void *buffer, - uint32_t buffer_len); -void hv_ring_buffer_cleanup( - hv_vmbus_ring_buffer_info *ring_info); - -int hv_ring_buffer_write( - hv_vmbus_ring_buffer_info *ring_info, - const struct iovec iov[], - uint32_t iovlen, - boolean_t *need_sig); - -int hv_ring_buffer_peek( - hv_vmbus_ring_buffer_info *ring_info, - void *buffer, - uint32_t buffer_len); - -int hv_ring_buffer_read( - hv_vmbus_ring_buffer_info *ring_info, - void *buffer, - uint32_t buffer_len, - uint32_t offset); - -void hv_ring_buffer_read_begin( - hv_vmbus_ring_buffer_info *ring_info); - -uint32_t hv_ring_buffer_read_end( - hv_vmbus_ring_buffer_info *ring_info); +void vmbus_br_sysctl_create(struct sysctl_ctx_list *ctx, + struct sysctl_oid *br_tree, struct vmbus_br *br, + const char *name); + +void vmbus_rxbr_init(struct vmbus_rxbr *rbr); +void vmbus_rxbr_deinit(struct vmbus_rxbr *rbr); +void vmbus_rxbr_setup(struct vmbus_rxbr *rbr, void *buf, int blen); +int vmbus_rxbr_peek(struct vmbus_rxbr *rbr, void *data, int dlen); +int vmbus_rxbr_read(struct vmbus_rxbr *rbr, void *data, int dlen, + uint32_t offset); +void vmbus_rxbr_intr_mask(struct vmbus_rxbr *rbr); +uint32_t vmbus_rxbr_intr_unmask(struct vmbus_rxbr *rbr); + +void vmbus_txbr_init(struct vmbus_txbr *tbr); +void vmbus_txbr_deinit(struct vmbus_txbr *tbr); +void vmbus_txbr_setup(struct vmbus_txbr *tbr, void *buf, int blen); +int vmbus_txbr_write(struct vmbus_txbr *tbr, + const struct iovec iov[], int iovlen, boolean_t *need_sig); #endif /* _VMBUS_BRVAR_H_ */ Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_chan.c Wed Jul 27 05:47:32 2016 (r303361) +++ head/sys/dev/hyperv/vmbus/vmbus_chan.c Wed Jul 27 06:17:20 2016 (r303362) @@ -178,11 +178,11 @@ vmbus_chan_sysctl_create(struct vmbus_ch /* * Create sysctl tree for RX bufring. */ - vmbus_br_sysctl_create(ctx, br_tree, &chan->ch_rxbr, "rx"); + vmbus_br_sysctl_create(ctx, br_tree, &chan->ch_rxbr.rxbr, "rx"); /* * Create sysctl tree for TX bufring. */ - vmbus_br_sysctl_create(ctx, br_tree, &chan->ch_txbr, "tx"); + vmbus_br_sysctl_create(ctx, br_tree, &chan->ch_txbr.txbr, "tx"); } } @@ -239,9 +239,9 @@ vmbus_chan_open(struct vmbus_channel *ch chan->ch_bufring = br; /* TX bufring comes first */ - hv_vmbus_ring_buffer_init(&chan->ch_txbr, br, txbr_size); + vmbus_txbr_setup(&chan->ch_txbr, br, txbr_size); /* RX bufring immediately follows TX bufring */ - hv_vmbus_ring_buffer_init(&chan->ch_rxbr, br + txbr_size, rxbr_size); + vmbus_rxbr_setup(&chan->ch_rxbr, br + txbr_size, rxbr_size); /* Create sysctl tree for this channel */ vmbus_chan_sysctl_create(chan); @@ -549,8 +549,6 @@ vmbus_chan_close_internal(struct vmbus_c /* * Destroy the TX+RX bufrings. */ - hv_ring_buffer_cleanup(&chan->ch_txbr); - hv_ring_buffer_cleanup(&chan->ch_rxbr); if (chan->ch_bufring != NULL) { hyperv_dmamem_free(&chan->ch_bufring_dma, chan->ch_bufring); chan->ch_bufring = NULL; @@ -620,7 +618,7 @@ vmbus_chan_send(struct vmbus_channel *ch iov[2].iov_base = &pad; iov[2].iov_len = pad_pktlen - pktlen; - error = hv_ring_buffer_write(&chan->ch_txbr, iov, 3, &send_evt); + error = vmbus_txbr_write(&chan->ch_txbr, iov, 3, &send_evt); if (!error && send_evt) vmbus_chan_signal_tx(chan); return error; @@ -660,7 +658,7 @@ vmbus_chan_send_sglist(struct vmbus_chan iov[3].iov_base = &pad; iov[3].iov_len = pad_pktlen - pktlen; - error = hv_ring_buffer_write(&chan->ch_txbr, iov, 4, &send_evt); + error = vmbus_txbr_write(&chan->ch_txbr, iov, 4, &send_evt); if (!error && send_evt) vmbus_chan_signal_tx(chan); return error; @@ -702,7 +700,7 @@ vmbus_chan_send_prplist(struct vmbus_cha iov[3].iov_base = &pad; iov[3].iov_len = pad_pktlen - pktlen; - error = hv_ring_buffer_write(&chan->ch_txbr, iov, 4, &send_evt); + error = vmbus_txbr_write(&chan->ch_txbr, iov, 4, &send_evt); if (!error && send_evt) vmbus_chan_signal_tx(chan); return error; @@ -715,7 +713,7 @@ vmbus_chan_recv(struct vmbus_channel *ch struct vmbus_chanpkt_hdr pkt; int error, dlen, hlen; - error = hv_ring_buffer_peek(&chan->ch_rxbr, &pkt, sizeof(pkt)); + error = vmbus_rxbr_peek(&chan->ch_rxbr, &pkt, sizeof(pkt)); if (error) return error; @@ -732,8 +730,8 @@ vmbus_chan_recv(struct vmbus_channel *ch *dlen0 = dlen; /* Skip packet header */ - error = hv_ring_buffer_read(&chan->ch_rxbr, data, dlen, hlen); - KASSERT(!error, ("hv_ring_buffer_read failed")); + error = vmbus_rxbr_read(&chan->ch_rxbr, data, dlen, hlen); + KASSERT(!error, ("vmbus_rxbr_read failed")); return 0; } @@ -745,7 +743,7 @@ vmbus_chan_recv_pkt(struct vmbus_channel struct vmbus_chanpkt_hdr pkt; int error, pktlen; - error = hv_ring_buffer_peek(&chan->ch_rxbr, &pkt, sizeof(pkt)); + error = vmbus_rxbr_peek(&chan->ch_rxbr, &pkt, sizeof(pkt)); if (error) return error; @@ -758,8 +756,8 @@ vmbus_chan_recv_pkt(struct vmbus_channel *pktlen0 = pktlen; /* Include packet header */ - error = hv_ring_buffer_read(&chan->ch_rxbr, pkt0, pktlen, 0); - KASSERT(!error, ("hv_ring_buffer_read failed")); + error = vmbus_rxbr_read(&chan->ch_rxbr, pkt0, pktlen, 0); + KASSERT(!error, ("vmbus_rxbr_read failed")); return 0; } @@ -788,12 +786,12 @@ vmbus_chan_task(void *xchan, int pending cb(chan, cbarg); - left = hv_ring_buffer_read_end(&chan->ch_rxbr); + left = vmbus_rxbr_intr_unmask(&chan->ch_rxbr); if (left == 0) { /* No more data in RX bufring; done */ break; } - hv_ring_buffer_read_begin(&chan->ch_rxbr); + vmbus_rxbr_intr_mask(&chan->ch_rxbr); } } @@ -835,7 +833,7 @@ vmbus_event_flags_proc(struct vmbus_soft continue; if (chan->ch_flags & VMBUS_CHAN_FLAG_BATCHREAD) - hv_ring_buffer_read_begin(&chan->ch_rxbr); + vmbus_rxbr_intr_mask(&chan->ch_rxbr); taskqueue_enqueue(chan->ch_tq, &chan->ch_task); } } @@ -914,8 +912,8 @@ vmbus_chan_alloc(struct vmbus_softc *sc) mtx_init(&chan->ch_subchan_lock, "vmbus subchan", NULL, MTX_DEF); TAILQ_INIT(&chan->ch_subchans); TASK_INIT(&chan->ch_detach_task, 0, vmbus_chan_detach_task, chan); - vmbus_br_init(&chan->ch_rxbr); - vmbus_br_init(&chan->ch_txbr); + vmbus_rxbr_init(&chan->ch_rxbr); + vmbus_txbr_init(&chan->ch_txbr); return chan; } @@ -928,8 +926,8 @@ vmbus_chan_free(struct vmbus_channel *ch /* TODO: asset no longer on the vmbus channel list */ hyperv_dmamem_free(&chan->ch_monprm_dma, chan->ch_monprm); mtx_destroy(&chan->ch_subchan_lock); - vmbus_br_deinit(&chan->ch_rxbr); - vmbus_br_deinit(&chan->ch_txbr); + vmbus_rxbr_deinit(&chan->ch_rxbr); + vmbus_txbr_deinit(&chan->ch_txbr); free(chan, M_DEVBUF); } Modified: head/sys/dev/hyperv/vmbus/vmbus_chanvar.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_chanvar.h Wed Jul 27 05:47:32 2016 (r303361) +++ head/sys/dev/hyperv/vmbus/vmbus_chanvar.h Wed Jul 27 06:17:20 2016 (r303362) @@ -52,7 +52,7 @@ struct vmbus_channel { /* * RX bufring; immediately following ch_txbr. */ - hv_vmbus_ring_buffer_info ch_rxbr; + struct vmbus_rxbr ch_rxbr; struct taskqueue *ch_tq; struct task ch_task; @@ -71,7 +71,7 @@ struct vmbus_channel { * TX bufring and following MNF/evtflags do _not_ fit in * one 64B cacheline. */ - hv_vmbus_ring_buffer_info ch_txbr __aligned(CACHE_LINE_SIZE); + struct vmbus_txbr ch_txbr __aligned(CACHE_LINE_SIZE); uint32_t ch_txflags; /* VMBUS_CHAN_TXF_ */ /* From owner-svn-src-head@freebsd.org Wed Jul 27 06:36: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 312C4BA6D78; Wed, 27 Jul 2016 06:36:59 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3E3816D3; Wed, 27 Jul 2016 06:36:58 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6R6awjn073665; Wed, 27 Jul 2016 06:36:58 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6R6awvA073664; Wed, 27 Jul 2016 06:36:58 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201607270636.u6R6awvA073664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 27 Jul 2016 06:36:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303366 - head/sys/dev/hyperv/vmbus 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.22 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, 27 Jul 2016 06:36:59 -0000 Author: sephe Date: Wed Jul 27 06:36:57 2016 New Revision: 303366 URL: https://svnweb.freebsd.org/changeset/base/303366 Log: hyperv/vmbus: Update comment for bufring MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7314 Modified: head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Modified: head/sys/dev/hyperv/vmbus/hv_ring_buffer.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Wed Jul 27 06:31:40 2016 (r303365) +++ head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Wed Jul 27 06:36:57 2016 (r303366) @@ -144,25 +144,23 @@ vmbus_rxbr_intr_unmask(struct vmbus_rxbr /* * Now check to see if the ring buffer is still empty. * If it is not, we raced and we need to process new - * incoming messages. + * incoming channel packets. */ return vmbus_rxbr_avail(rbr); } /* - * When we write to the ring buffer, check if the host needs to - * be signaled. Here is the details of this protocol: + * When we write to the ring buffer, check if the host needs to be + * signaled. * - * 1. The host guarantees that while it is draining the - * ring buffer, it will set the interrupt_mask to - * indicate it does not need to be interrupted when - * new data is placed. - * - * 2. The host guarantees that it will completely drain - * the ring buffer before exiting the read loop. Further, - * once the ring buffer is empty, it will clear the - * interrupt_mask and re-check to see if new data has - * arrived. + * The contract: + * - The host guarantees that while it is draining the TX bufring, + * it will set the br_imask to indicate it does not need to be + * interrupted when new data are added. + * - The host guarantees that it will completely drain the TX bufring + * before exiting the read loop. Further, once the TX bufring is + * empty, it will clear the br_imask and re-check to see if new + * data have arrived. */ static boolean_t hv_ring_buffer_needsig_on_write(uint32_t old_write_location, @@ -172,8 +170,10 @@ hv_ring_buffer_needsig_on_write(uint32_t if (tbr->txbr_imask) return (FALSE); + /* XXX only compiler fence is needed */ /* Read memory barrier */ rmb(); + /* * This is the only case we need to signal when the * ring transitions from being empty to non-empty. @@ -252,7 +252,6 @@ vmbus_txbr_write(struct vmbus_txbr *tbr, for (i = 0; i < iovlen; i++) total_bytes_to_write += iov[i].iov_len; - total_bytes_to_write += sizeof(uint64_t); mtx_lock_spin(&tbr->txbr_lock); @@ -260,9 +259,11 @@ vmbus_txbr_write(struct vmbus_txbr *tbr, byte_avail_to_write = vmbus_txbr_avail(tbr); /* - * If there is only room for the packet, assume it is full. - * Otherwise, the next time around, we think the ring buffer - * is empty since the read index == write index + * NOTE: + * If this write is going to make br_windex same as br_rindex, + * i.e. the available space for write is same as the write size, + * we can't do it then, since br_windex == br_rindex means that + * the bufring is empty. */ if (byte_avail_to_write <= total_bytes_to_write) { mtx_unlock_spin(&tbr->txbr_lock); @@ -270,7 +271,7 @@ vmbus_txbr_write(struct vmbus_txbr *tbr, } /* - * Write to the ring buffer + * Copy the scattered channel packet to the TX bufring. */ next_write_location = tbr->txbr_windex; @@ -282,20 +283,20 @@ vmbus_txbr_write(struct vmbus_txbr *tbr, } /* - * Set previous packet start + * Set the offset of the current channel packet. */ prev_indices = ((uint64_t)tbr->txbr_windex) << 32; - next_write_location = copy_to_ring_buffer(tbr, next_write_location, (char *)&prev_indices, sizeof(uint64_t)); /* + * XXX only compiler fence is needed. * Full memory barrier before upding the write index. */ mb(); /* - * Now, update the write location + * Now, update the write index. */ tbr->txbr_windex = next_write_location; @@ -315,20 +316,12 @@ vmbus_rxbr_peek(struct vmbus_rxbr *rbr, mtx_lock_spin(&rbr->rxbr_lock); bytesAvailToRead = vmbus_rxbr_avail(rbr); - - /* - * Make sure there is something to read - */ if (bytesAvailToRead < dlen) { mtx_unlock_spin(&rbr->rxbr_lock); return (EAGAIN); } - /* - * Convert to byte offset - */ nextReadLocation = rbr->rxbr_rindex; - nextReadLocation = copy_from_ring_buffer(rbr, data, dlen, nextReadLocation); @@ -349,24 +342,27 @@ vmbus_rxbr_read(struct vmbus_rxbr *rbr, mtx_lock_spin(&rbr->rxbr_lock); bytes_avail_to_read = vmbus_rxbr_avail(rbr); - - /* - * Make sure there is something to read - */ if (bytes_avail_to_read < dlen) { mtx_unlock_spin(&rbr->rxbr_lock); return (EAGAIN); } + /* + * Copy channel packet from RX bufring. + */ next_read_location = (rbr->rxbr_rindex + offset) % rbr->rxbr_dsize; - next_read_location = copy_from_ring_buffer(rbr, data, dlen, next_read_location); + /* + * Discard this channel packet's start offset, which is useless + * for us. + */ next_read_location = copy_from_ring_buffer(rbr, (char *)&prev_indices, sizeof(uint64_t), next_read_location); /* + * XXX only compiler fence is needed. * Make sure all reads are done before we update the read index since * the writer may start writing to the read area once the read index * is updated. @@ -383,11 +379,6 @@ vmbus_rxbr_read(struct vmbus_rxbr *rbr, return (0); } -/** - * @brief Helper routine to copy from source to ring buffer. - * - * Assume there is enough room. Handles wrap-around in dest case only! - */ static uint32_t copy_to_ring_buffer(const struct vmbus_txbr *tbr, uint32_t start_write_offset, const uint8_t *src, uint32_t src_len) @@ -397,7 +388,7 @@ copy_to_ring_buffer(const struct vmbus_t uint32_t fragLen; if (src_len > ring_buffer_size - start_write_offset) { - /* wrap-around detected! */ + /* Wrap-around detected! */ fragLen = ring_buffer_size - start_write_offset; memcpy(ring_buffer + start_write_offset, src, fragLen); memcpy(ring_buffer, src + fragLen, src_len - fragLen); @@ -411,11 +402,6 @@ copy_to_ring_buffer(const struct vmbus_t return (start_write_offset); } -/** - * @brief Helper routine to copy to source from ring buffer. - * - * Assume there is enough room. Handles wrap-around in src case only! - */ static uint32_t copy_from_ring_buffer(const struct vmbus_rxbr *rbr, char *dest, uint32_t dest_len, uint32_t start_read_offset) @@ -425,7 +411,7 @@ copy_from_ring_buffer(const struct vmbus uint32_t ring_buffer_size = rbr->rxbr_dsize; if (dest_len > ring_buffer_size - start_read_offset) { - /* wrap-around detected at the src */ + /* Wrap-around detected at the src */ fragLen = ring_buffer_size - start_read_offset; memcpy(dest, ring_buffer + start_read_offset, fragLen); memcpy(dest + fragLen, ring_buffer, dest_len - fragLen); From owner-svn-src-head@freebsd.org Wed Jul 27 06:49:17 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 8F89FBA5212; Wed, 27 Jul 2016 06:49:17 +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 6069C1E52; Wed, 27 Jul 2016 06:49:17 +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 u6R6nGCq077367; Wed, 27 Jul 2016 06:49:16 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6R6nG87077366; Wed, 27 Jul 2016 06:49:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201607270649.u6R6nG87077366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 27 Jul 2016 06:49:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303367 - head/usr.bin/sed/tests 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.22 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, 27 Jul 2016 06:49:17 -0000 Author: ngie Date: Wed Jul 27 06:49:16 2016 New Revision: 303367 URL: https://svnweb.freebsd.org/changeset/base/303367 Log: Testcase 7.8 no longer needs to be marked TODO It passes out of the box today MFC after: 2 months Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/sed/tests/multi_test.sh Modified: head/usr.bin/sed/tests/multi_test.sh ============================================================================== --- head/usr.bin/sed/tests/multi_test.sh Wed Jul 27 06:36:57 2016 (r303366) +++ head/usr.bin/sed/tests/multi_test.sh Wed Jul 27 06:49:16 2016 (r303367) @@ -383,7 +383,6 @@ test_print() mark '7.8' echo line1 > lines3 echo "" >> lines3 - TODO=1 $SED -n -e '$p' lines3 /dev/null } From owner-svn-src-head@freebsd.org Wed Jul 27 06:52: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 904CBBA53EE; Wed, 27 Jul 2016 06:52:44 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51C0B1362; Wed, 27 Jul 2016 06:52:44 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6R6qhna080750; Wed, 27 Jul 2016 06:52:43 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6R6qht5080749; Wed, 27 Jul 2016 06:52:43 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201607270652.u6R6qht5080749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 27 Jul 2016 06:52:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303368 - head/sys/dev/hyperv/vmbus 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.22 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, 27 Jul 2016 06:52:44 -0000 Author: sephe Date: Wed Jul 27 06:52:43 2016 New Revision: 303368 URL: https://svnweb.freebsd.org/changeset/base/303368 Log: hyperv/vmbus: Cleanup TX bufring write process. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7315 Modified: head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Modified: head/sys/dev/hyperv/vmbus/hv_ring_buffer.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Wed Jul 27 06:49:16 2016 (r303367) +++ head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Wed Jul 27 06:52:43 2016 (r303368) @@ -38,9 +38,6 @@ #define VMBUS_BR_WAVAIL(r, w, z) \ (((w) >= (r)) ? ((z) - ((w) - (r))) : ((r) - (w))) -static uint32_t copy_to_ring_buffer(const struct vmbus_txbr *tbr, - uint32_t start_write_offset, const uint8_t *src, - uint32_t src_len); static uint32_t copy_from_ring_buffer(const struct vmbus_rxbr *rbr, char *dest, uint32_t dest_len, uint32_t start_read_offset); @@ -149,41 +146,6 @@ vmbus_rxbr_intr_unmask(struct vmbus_rxbr return vmbus_rxbr_avail(rbr); } -/* - * When we write to the ring buffer, check if the host needs to be - * signaled. - * - * The contract: - * - The host guarantees that while it is draining the TX bufring, - * it will set the br_imask to indicate it does not need to be - * interrupted when new data are added. - * - The host guarantees that it will completely drain the TX bufring - * before exiting the read loop. Further, once the TX bufring is - * empty, it will clear the br_imask and re-check to see if new - * data have arrived. - */ -static boolean_t -hv_ring_buffer_needsig_on_write(uint32_t old_write_location, - const struct vmbus_txbr *tbr) -{ - mb(); - if (tbr->txbr_imask) - return (FALSE); - - /* XXX only compiler fence is needed */ - /* Read memory barrier */ - rmb(); - - /* - * This is the only case we need to signal when the - * ring transitions from being empty to non-empty. - */ - if (old_write_location == tbr->txbr_rindex) - return (TRUE); - - return (FALSE); -} - static void vmbus_br_setup(struct vmbus_br *br, void *buf, int blen) { @@ -227,6 +189,40 @@ vmbus_txbr_setup(struct vmbus_txbr *tbr, vmbus_br_setup(&tbr->txbr, buf, blen); } +/* + * When we write to the ring buffer, check if the host needs to be + * signaled. + * + * The contract: + * - The host guarantees that while it is draining the TX bufring, + * it will set the br_imask to indicate it does not need to be + * interrupted when new data are added. + * - The host guarantees that it will completely drain the TX bufring + * before exiting the read loop. Further, once the TX bufring is + * empty, it will clear the br_imask and re-check to see if new + * data have arrived. + */ +static __inline boolean_t +vmbus_txbr_need_signal(const struct vmbus_txbr *tbr, uint32_t old_windex) +{ + mb(); + if (tbr->txbr_imask) + return (FALSE); + + /* XXX only compiler fence is needed */ + /* Read memory barrier */ + rmb(); + + /* + * This is the only case we need to signal when the + * ring transitions from being empty to non-empty. + */ + if (old_windex == tbr->txbr_rindex) + return (TRUE); + + return (FALSE); +} + static __inline uint32_t vmbus_txbr_avail(const struct vmbus_txbr *tbr) { @@ -239,25 +235,52 @@ vmbus_txbr_avail(const struct vmbus_txbr return VMBUS_BR_WAVAIL(rindex, windex, tbr->txbr_dsize); } +static __inline uint32_t +vmbus_txbr_copyto(const struct vmbus_txbr *tbr, uint32_t windex, + const void *src0, uint32_t cplen) +{ + const uint8_t *src = src0; + uint8_t *br_data = tbr->txbr_data; + uint32_t br_dsize = tbr->txbr_dsize; + + if (cplen > br_dsize - windex) { + uint32_t fraglen; + + /* Wrap-around detected! */ + fraglen = br_dsize - windex; + memcpy(br_data + windex, src, fraglen); + memcpy(br_data, src + fraglen, cplen - fraglen); + } else { + memcpy(br_data + windex, src, cplen); + } + + windex += cplen; + windex %= br_dsize; + + return windex; +} + +/* + * Write scattered channel packet to TX bufring. + * + * The offset of this channel packet is written as a 64bits value + * immediately after this channel packet. + */ int vmbus_txbr_write(struct vmbus_txbr *tbr, const struct iovec iov[], int iovlen, boolean_t *need_sig) { - int i = 0; - uint32_t byte_avail_to_write; - uint32_t old_write_location; - uint32_t total_bytes_to_write = 0; - volatile uint32_t next_write_location; - uint64_t prev_indices = 0; + uint32_t old_windex, windex, total; + uint64_t save_windex; + int i; + total = 0; for (i = 0; i < iovlen; i++) - total_bytes_to_write += iov[i].iov_len; - total_bytes_to_write += sizeof(uint64_t); + total += iov[i].iov_len; + total += sizeof(save_windex); mtx_lock_spin(&tbr->txbr_lock); - byte_avail_to_write = vmbus_txbr_avail(tbr); - /* * NOTE: * If this write is going to make br_windex same as br_rindex, @@ -265,29 +288,29 @@ vmbus_txbr_write(struct vmbus_txbr *tbr, * we can't do it then, since br_windex == br_rindex means that * the bufring is empty. */ - if (byte_avail_to_write <= total_bytes_to_write) { + if (vmbus_txbr_avail(tbr) <= total) { mtx_unlock_spin(&tbr->txbr_lock); return (EAGAIN); } + /* Save br_windex for later use */ + old_windex = tbr->txbr_windex; + /* * Copy the scattered channel packet to the TX bufring. */ - next_write_location = tbr->txbr_windex; - - old_write_location = next_write_location; - + windex = old_windex; for (i = 0; i < iovlen; i++) { - next_write_location = copy_to_ring_buffer(tbr, - next_write_location, iov[i].iov_base, iov[i].iov_len); + windex = vmbus_txbr_copyto(tbr, windex, + iov[i].iov_base, iov[i].iov_len); } /* * Set the offset of the current channel packet. */ - prev_indices = ((uint64_t)tbr->txbr_windex) << 32; - next_write_location = copy_to_ring_buffer(tbr, - next_write_location, (char *)&prev_indices, sizeof(uint64_t)); + save_windex = ((uint64_t)old_windex) << 32; + windex = vmbus_txbr_copyto(tbr, windex, &save_windex, + sizeof(save_windex)); /* * XXX only compiler fence is needed. @@ -296,13 +319,14 @@ vmbus_txbr_write(struct vmbus_txbr *tbr, mb(); /* - * Now, update the write index. + * Update the write index _after_ the channel packet + * is copied. */ - tbr->txbr_windex = next_write_location; + tbr->txbr_windex = windex; mtx_unlock_spin(&tbr->txbr_lock); - *need_sig = hv_ring_buffer_needsig_on_write(old_write_location, tbr); + *need_sig = vmbus_txbr_need_signal(tbr, old_windex); return (0); } @@ -380,29 +404,6 @@ vmbus_rxbr_read(struct vmbus_rxbr *rbr, } static uint32_t -copy_to_ring_buffer(const struct vmbus_txbr *tbr, - uint32_t start_write_offset, const uint8_t *src, uint32_t src_len) -{ - char *ring_buffer = tbr->txbr_data; - uint32_t ring_buffer_size = tbr->txbr_dsize; - uint32_t fragLen; - - if (src_len > ring_buffer_size - start_write_offset) { - /* Wrap-around detected! */ - fragLen = ring_buffer_size - start_write_offset; - memcpy(ring_buffer + start_write_offset, src, fragLen); - memcpy(ring_buffer, src + fragLen, src_len - fragLen); - } else { - memcpy(ring_buffer + start_write_offset, src, src_len); - } - - start_write_offset += src_len; - start_write_offset %= ring_buffer_size; - - return (start_write_offset); -} - -static uint32_t copy_from_ring_buffer(const struct vmbus_rxbr *rbr, char *dest, uint32_t dest_len, uint32_t start_read_offset) { From owner-svn-src-head@freebsd.org Wed Jul 27 07:19: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 A1959BA5AEB; Wed, 27 Jul 2016 07:19:07 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E5CB1EB4; Wed, 27 Jul 2016 07:19:07 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6R7J6oa088646; Wed, 27 Jul 2016 07:19:06 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6R7J6Sc088645; Wed, 27 Jul 2016 07:19:06 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201607270719.u6R7J6Sc088645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 27 Jul 2016 07:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303369 - head/sys/dev/hyperv/vmbus 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.22 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, 27 Jul 2016 07:19:07 -0000 Author: sephe Date: Wed Jul 27 07:19:06 2016 New Revision: 303369 URL: https://svnweb.freebsd.org/changeset/base/303369 Log: hyperv/vmbus: Stringent RX bufring data length checks. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7316 Modified: head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Modified: head/sys/dev/hyperv/vmbus/hv_ring_buffer.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Wed Jul 27 06:52:43 2016 (r303368) +++ head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Wed Jul 27 07:19:06 2016 (r303369) @@ -339,8 +339,12 @@ vmbus_rxbr_peek(struct vmbus_rxbr *rbr, mtx_lock_spin(&rbr->rxbr_lock); + /* + * The requested data and the 64bits channel packet + * offset should be there at least. + */ bytesAvailToRead = vmbus_rxbr_avail(rbr); - if (bytesAvailToRead < dlen) { + if (bytesAvailToRead < dlen + sizeof(uint64_t)) { mtx_unlock_spin(&rbr->rxbr_lock); return (EAGAIN); } @@ -366,7 +370,7 @@ vmbus_rxbr_read(struct vmbus_rxbr *rbr, mtx_lock_spin(&rbr->rxbr_lock); bytes_avail_to_read = vmbus_rxbr_avail(rbr); - if (bytes_avail_to_read < dlen) { + if (bytes_avail_to_read < dlen + offset + sizeof(prev_indices)) { mtx_unlock_spin(&rbr->rxbr_lock); return (EAGAIN); } From owner-svn-src-head@freebsd.org Wed Jul 27 07:36: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 808B6BA614A; Wed, 27 Jul 2016 07:36:55 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5421518C9; Wed, 27 Jul 2016 07:36:55 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6R7asJm095722; Wed, 27 Jul 2016 07:36:54 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6R7as13095720; Wed, 27 Jul 2016 07:36:54 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201607270736.u6R7as13095720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 27 Jul 2016 07:36:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303370 - head/sys/dev/hyperv/vmbus 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.22 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, 27 Jul 2016 07:36:55 -0000 Author: sephe Date: Wed Jul 27 07:36:54 2016 New Revision: 303370 URL: https://svnweb.freebsd.org/changeset/base/303370 Log: hyperv/vmbus: Cleanup RX bufring read process. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7317 Modified: head/sys/dev/hyperv/vmbus/hv_ring_buffer.c head/sys/dev/hyperv/vmbus/vmbus_brvar.h Modified: head/sys/dev/hyperv/vmbus/hv_ring_buffer.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Wed Jul 27 07:19:06 2016 (r303369) +++ head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Wed Jul 27 07:36:54 2016 (r303370) @@ -38,8 +38,8 @@ #define VMBUS_BR_WAVAIL(r, w, z) \ (((w) >= (r)) ? ((z) - ((w) - (r))) : ((r) - (w))) -static uint32_t copy_from_ring_buffer(const struct vmbus_rxbr *rbr, - char *dest, uint32_t dest_len, uint32_t start_read_offset); +/* Increase bufing index */ +#define VMBUS_BR_IDXINC(idx, inc, sz) (((idx) + (inc)) % (sz)) static int vmbus_br_sysctl_state(SYSCTL_HANDLER_ARGS) @@ -244,20 +244,15 @@ vmbus_txbr_copyto(const struct vmbus_txb uint32_t br_dsize = tbr->txbr_dsize; if (cplen > br_dsize - windex) { - uint32_t fraglen; + uint32_t fraglen = br_dsize - windex; - /* Wrap-around detected! */ - fraglen = br_dsize - windex; + /* Wrap-around detected */ memcpy(br_data + windex, src, fraglen); memcpy(br_data, src + fraglen, cplen - fraglen); } else { memcpy(br_data + windex, src, cplen); } - - windex += cplen; - windex %= br_dsize; - - return windex; + return VMBUS_BR_IDXINC(windex, cplen, br_dsize); } /* @@ -331,46 +326,60 @@ vmbus_txbr_write(struct vmbus_txbr *tbr, return (0); } +static __inline uint32_t +vmbus_rxbr_copyfrom(const struct vmbus_rxbr *rbr, uint32_t rindex, + void *dst0, int cplen) +{ + uint8_t *dst = dst0; + const uint8_t *br_data = rbr->rxbr_data; + uint32_t br_dsize = rbr->rxbr_dsize; + + if (cplen > br_dsize - rindex) { + uint32_t fraglen = br_dsize - rindex; + + /* Wrap-around detected. */ + memcpy(dst, br_data + rindex, fraglen); + memcpy(dst + fraglen, br_data, cplen - fraglen); + } else { + memcpy(dst, br_data + rindex, cplen); + } + return VMBUS_BR_IDXINC(rindex, cplen, br_dsize); +} + int vmbus_rxbr_peek(struct vmbus_rxbr *rbr, void *data, int dlen) { - uint32_t bytesAvailToRead; - uint32_t nextReadLocation = 0; - mtx_lock_spin(&rbr->rxbr_lock); /* * The requested data and the 64bits channel packet * offset should be there at least. */ - bytesAvailToRead = vmbus_rxbr_avail(rbr); - if (bytesAvailToRead < dlen + sizeof(uint64_t)) { + if (vmbus_rxbr_avail(rbr) < dlen + sizeof(uint64_t)) { mtx_unlock_spin(&rbr->rxbr_lock); return (EAGAIN); } - - nextReadLocation = rbr->rxbr_rindex; - nextReadLocation = copy_from_ring_buffer(rbr, data, dlen, - nextReadLocation); + vmbus_rxbr_copyfrom(rbr, rbr->rxbr_rindex, data, dlen); mtx_unlock_spin(&rbr->rxbr_lock); return (0); } +/* + * NOTE: + * We assume (dlen + skip) == sizeof(channel packet). + */ int -vmbus_rxbr_read(struct vmbus_rxbr *rbr, void *data, int dlen, uint32_t offset) +vmbus_rxbr_read(struct vmbus_rxbr *rbr, void *data, int dlen, uint32_t skip) { - uint32_t bytes_avail_to_read; - uint32_t next_read_location = 0; - uint64_t prev_indices = 0; + uint32_t rindex, br_dsize = rbr->rxbr_dsize; - KASSERT(dlen > 0, ("invalid dlen %d", dlen)); + KASSERT(dlen + skip > 0, ("invalid dlen %d, offset %u", dlen, skip)); mtx_lock_spin(&rbr->rxbr_lock); - bytes_avail_to_read = vmbus_rxbr_avail(rbr); - if (bytes_avail_to_read < dlen + offset + sizeof(prev_indices)) { + if (vmbus_rxbr_avail(rbr) < dlen + skip + sizeof(uint64_t)) { mtx_unlock_spin(&rbr->rxbr_lock); return (EAGAIN); } @@ -378,16 +387,13 @@ vmbus_rxbr_read(struct vmbus_rxbr *rbr, /* * Copy channel packet from RX bufring. */ - next_read_location = (rbr->rxbr_rindex + offset) % rbr->rxbr_dsize; - next_read_location = copy_from_ring_buffer(rbr, data, dlen, - next_read_location); + rindex = VMBUS_BR_IDXINC(rbr->rxbr_rindex, skip, br_dsize); + rindex = vmbus_rxbr_copyfrom(rbr, rindex, data, dlen); /* - * Discard this channel packet's start offset, which is useless - * for us. + * Discard this channel packet's 64bits offset, which is useless to us. */ - next_read_location = copy_from_ring_buffer(rbr, - (char *)&prev_indices, sizeof(uint64_t), next_read_location); + rindex = VMBUS_BR_IDXINC(rindex, sizeof(uint64_t), br_dsize); /* * XXX only compiler fence is needed. @@ -398,34 +404,11 @@ vmbus_rxbr_read(struct vmbus_rxbr *rbr, wmb(); /* - * Update the read index + * Update the read index _after_ the channel packet is fetched. */ - rbr->rxbr_rindex = next_read_location; + rbr->rxbr_rindex = rindex; mtx_unlock_spin(&rbr->rxbr_lock); return (0); } - -static uint32_t -copy_from_ring_buffer(const struct vmbus_rxbr *rbr, char *dest, - uint32_t dest_len, uint32_t start_read_offset) -{ - uint32_t fragLen; - char *ring_buffer = rbr->rxbr_data; - uint32_t ring_buffer_size = rbr->rxbr_dsize; - - if (dest_len > ring_buffer_size - start_read_offset) { - /* Wrap-around detected at the src */ - fragLen = ring_buffer_size - start_read_offset; - memcpy(dest, ring_buffer + start_read_offset, fragLen); - memcpy(dest + fragLen, ring_buffer, dest_len - fragLen); - } else { - memcpy(dest, ring_buffer + start_read_offset, dest_len); - } - - start_read_offset += dest_len; - start_read_offset %= ring_buffer_size; - - return (start_read_offset); -} Modified: head/sys/dev/hyperv/vmbus/vmbus_brvar.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_brvar.h Wed Jul 27 07:19:06 2016 (r303369) +++ head/sys/dev/hyperv/vmbus/vmbus_brvar.h Wed Jul 27 07:36:54 2016 (r303370) @@ -80,7 +80,7 @@ void vmbus_rxbr_deinit(struct vmbus_rxb void vmbus_rxbr_setup(struct vmbus_rxbr *rbr, void *buf, int blen); int vmbus_rxbr_peek(struct vmbus_rxbr *rbr, void *data, int dlen); int vmbus_rxbr_read(struct vmbus_rxbr *rbr, void *data, int dlen, - uint32_t offset); + uint32_t skip); void vmbus_rxbr_intr_mask(struct vmbus_rxbr *rbr); uint32_t vmbus_rxbr_intr_unmask(struct vmbus_rxbr *rbr); From owner-svn-src-head@freebsd.org Wed Jul 27 08:08: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 53184BA6CF3; Wed, 27 Jul 2016 08:08:47 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 231CE1B9A; Wed, 27 Jul 2016 08:08:47 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6R88k8W007357; Wed, 27 Jul 2016 08:08:46 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6R88kqm007355; Wed, 27 Jul 2016 08:08:46 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201607270808.u6R88kqm007355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Wed, 27 Jul 2016 08:08:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303372 - in head/tools/tools/locale: . tools 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.22 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, 27 Jul 2016 08:08:47 -0000 Author: kevlo Date: Wed Jul 27 08:08:46 2016 New Revision: 303372 URL: https://svnweb.freebsd.org/changeset/base/303372 Log: Fix cldr2def.pl script to add weekday to the date format of zh_TW locales. While here, mention dependency on textproc/p5-XML-Parser in README. Reviewed by: bapt Modified: head/tools/tools/locale/README head/tools/tools/locale/tools/cldr2def.pl Modified: head/tools/tools/locale/README ============================================================================== --- head/tools/tools/locale/README Wed Jul 27 07:51:58 2016 (r303371) +++ head/tools/tools/locale/README Wed Jul 27 08:08:46 2016 (r303372) @@ -2,7 +2,8 @@ To generate the locales: -Tools needed: java, perl, devel/p5-Tie-IxHash and converters/p5-Text-Iconv +Tools needed: java, perl, devel/p5-Tie-IxHash, converters/p5-Text-Iconv and +textproc/p5-XML-Parser fetch cldr data from: http://cldr.unicode.org extract in a directory ~/unicode/cldr/v27.0.1 for example Modified: head/tools/tools/locale/tools/cldr2def.pl ============================================================================== --- head/tools/tools/locale/tools/cldr2def.pl Wed Jul 27 07:51:58 2016 (r303371) +++ head/tools/tools/locale/tools/cldr2def.pl Wed Jul 27 08:08:46 2016 (r303372) @@ -240,6 +240,8 @@ sub callback_dtformat { if ($nl eq 'ja_JP') { $s =~ s/(> )(%H)/$1%A $2/; + } elsif ($nl eq 'zh_TW') { + $s =~ s/(> )(%p)/$1%A $2/; } $s =~ s/\.,/\./; $s =~ s/^"%e\./%A %e/; From owner-svn-src-head@freebsd.org Wed Jul 27 08:11: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 96BCABA6D5E; Wed, 27 Jul 2016 08:11:09 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 69A271EA9; Wed, 27 Jul 2016 08:11:09 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6R8B86P007538; Wed, 27 Jul 2016 08:11:08 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6R8B808007536; Wed, 27 Jul 2016 08:11:08 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201607270811.u6R8B808007536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Wed, 27 Jul 2016 08:11:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303373 - head/share/timedef 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.22 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, 27 Jul 2016 08:11:09 -0000 Author: kevlo Date: Wed Jul 27 08:11:08 2016 New Revision: 303373 URL: https://svnweb.freebsd.org/changeset/base/303373 Log: Regenerate timedef for zh_TW. Reviewed by: bapt Modified: head/share/timedef/zh_TW.Big5.src head/share/timedef/zh_TW.UTF-8.src Modified: head/share/timedef/zh_TW.Big5.src ============================================================================== --- head/share/timedef/zh_TW.Big5.src Wed Jul 27 08:08:46 2016 (r303372) +++ head/share/timedef/zh_TW.Big5.src Wed Jul 27 08:11:08 2016 (r303373) @@ -63,7 +63,7 @@ U # # date_fmt -%Y~%m%e %p%I:%M:%S [%Z] +%Y~%m%e %A %p%I:%M:%S [%Z] # # Long month names (without case ending) Modified: head/share/timedef/zh_TW.UTF-8.src ============================================================================== --- head/share/timedef/zh_TW.UTF-8.src Wed Jul 27 08:08:46 2016 (r303372) +++ head/share/timedef/zh_TW.UTF-8.src Wed Jul 27 08:11:08 2016 (r303373) @@ -56,14 +56,14 @@ %Y/%m/%d # # c_fmt -%Y年%m月%e日%A %p%I:%M:%S [%Z] +%Y年%m月%e日 %A %p%I:%M:%S [%Z] # # AM/PM 上午 下午 # # date_fmt -%Y年%m月%e日%A %p%I:%M:%S [%Z] +%Y年%m月%e日 %A %p%I:%M:%S [%Z] # # Long month names (without case ending) 1月 From owner-svn-src-head@freebsd.org Wed Jul 27 08:14: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 0133FBA6E86; Wed, 27 Jul 2016 08:14:39 +0000 (UTC) (envelope-from kevlo@ns.kevlo.org) Received: from ns.kevlo.org (220-135-115-6.HINET-IP.hinet.net [220.135.115.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "ns.kevlo.org", Issuer "ns.kevlo.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 591D312D0; Wed, 27 Jul 2016 08:14:39 +0000 (UTC) (envelope-from kevlo@ns.kevlo.org) Received: from ns.kevlo.org (localhost [127.0.0.1]) by ns.kevlo.org (8.15.2/8.15.2) with ESMTPS id u6R8EJbd068103 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 27 Jul 2016 16:14:19 +0800 (CST) (envelope-from kevlo@ns.kevlo.org) Received: (from kevlo@localhost) by ns.kevlo.org (8.15.2/8.15.2/Submit) id u6R8EJfv068102; Wed, 27 Jul 2016 16:14:19 +0800 (CST) (envelope-from kevlo) Date: Wed, 27 Jul 2016 16:14:18 +0800 From: Kevin Lo To: Andrey Chernov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303354 - head/share/timedef Message-ID: <20160727081418.GA68095@ns.kevlo.org> References: <201607270046.u6R0kmWK045150@repo.freebsd.org> <81134a98-b8ff-fba9-1d8d-eed2cc1253db@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <81134a98-b8ff-fba9-1d8d-eed2cc1253db@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 27 Jul 2016 08:14:40 -0000 On Wed, Jul 27, 2016 at 03:55:44AM +0300, Andrey Chernov wrote: > > On 27.07.2016 3:46, Kevin Lo wrote: > > Author: kevlo > > Date: Wed Jul 27 00:46:48 2016 > > New Revision: 303354 > > URL: https://svnweb.freebsd.org/changeset/base/303354 > > > > Log: > > Add weekday to the date format. > > This file is generated, so this change will be lost after next > generation. It will be better to fix generation script instead. Fair enough. Fixed in r303372, thanks. > > > > Modified: > > head/share/timedef/zh_TW.UTF-8.src > > > > Modified: head/share/timedef/zh_TW.UTF-8.src > > ============================================================================== > > --- head/share/timedef/zh_TW.UTF-8.src Wed Jul 27 00:08:01 2016 (r303353) > > +++ head/share/timedef/zh_TW.UTF-8.src Wed Jul 27 00:46:48 2016 (r303354) > > @@ -56,14 +56,14 @@ > > %Y/%m/%d > > # > > # c_fmt > > -%Y年%m月%e日 %p%I:%M:%S [%Z] > > +%Y年%m月%e日%A %p%I:%M:%S [%Z] > > # > > # AM/PM > > 上午 > > 下午 > > # > > # date_fmt > > -%Y年%m月%e日 %p%I:%M:%S [%Z] > > +%Y年%m月%e日%A %p%I:%M:%S [%Z] > > # > > # Long month names (without case ending) > > 1月 > > > > From owner-svn-src-head@freebsd.org Wed Jul 27 08:26: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 63578BA5489; Wed, 27 Jul 2016 08:26:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12B241AE6; Wed, 27 Jul 2016 08:26:35 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6R8QZSn014880; Wed, 27 Jul 2016 08:26:35 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6R8QZgk014879; Wed, 27 Jul 2016 08:26:35 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201607270826.u6R8QZgk014879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 27 Jul 2016 08:26:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303374 - head/sbin/route 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.22 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, 27 Jul 2016 08:26:36 -0000 Author: ae Date: Wed Jul 27 08:26:34 2016 New Revision: 303374 URL: https://svnweb.freebsd.org/changeset/base/303374 Log: Due to dropped mbuf in netisr queue route(8) can fall into infinity loop of reading the rtsock's feed. When it used by some scripts, this leads to growing number of not finished route(8) instances and thus growing number of rtsock consumers. Add SIGALRM handler to prevent this. Reviewed by: melifaro Obtained from: Yandex LLC MFC after: 2 weeks Sponsored by: Yandex LLC Modified: head/sbin/route/route.c Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Wed Jul 27 08:11:08 2016 (r303373) +++ head/sbin/route/route.c Wed Jul 27 08:26:34 2016 (r303374) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -144,6 +145,16 @@ static int fiboptlist_range(const char * static void usage(const char *) __dead2; +#define READ_TIMEOUT 10 +static volatile sig_atomic_t stop_read; + +static void +stopit(int sig __unused) +{ + + stop_read = 1; +} + static void usage(const char *cp) { @@ -776,6 +787,7 @@ set_metric(char *value, int key) static void newroute(int argc, char **argv) { + struct sigaction sa; struct hostent *hp; struct fibl *fl; char *cmd; @@ -791,6 +803,12 @@ newroute(int argc, char **argv) hp = NULL; TAILQ_INIT(&fibl_head); + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + sa.sa_handler = stopit; + if (sigaction(SIGALRM, &sa, 0) == -1) + warn("sigaction SIGALRM"); + cmd = argv[0]; if (*cmd != 'g' && *cmd != 's') shutdown(s, SHUT_RD); /* Don't want to read back our messages */ @@ -1541,9 +1559,17 @@ rtmsg(int cmd, int flags, int fib) return (-1); } if (cmd == RTM_GET) { + stop_read = 0; + alarm(READ_TIMEOUT); do { l = read(s, (char *)&m_rtmsg, sizeof(m_rtmsg)); - } while (l > 0 && (rtm.rtm_seq != rtm_seq || rtm.rtm_pid != pid)); + } while (l > 0 && stop_read == 0 && + (rtm.rtm_seq != rtm_seq || rtm.rtm_pid != pid)); + if (stop_read != 0) { + warnx("read from routing socket timed out"); + return (-1); + } else + alarm(0); if (l < 0) warn("read from routing socket"); else From owner-svn-src-head@freebsd.org Wed Jul 27 09:27: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 9D746BA6905; Wed, 27 Jul 2016 09:27:09 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C8F812A8; Wed, 27 Jul 2016 09:27:09 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6R9R8qS037040; Wed, 27 Jul 2016 09:27:08 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6R9R829037036; Wed, 27 Jul 2016 09:27:08 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201607270927.u6R9R829037036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 27 Jul 2016 09:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303379 - in head/sys: conf dev/hyperv/vmbus modules/hyperv/vmbus 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.22 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, 27 Jul 2016 09:27:09 -0000 Author: sephe Date: Wed Jul 27 09:27:08 2016 New Revision: 303379 URL: https://svnweb.freebsd.org/changeset/base/303379 Log: hyperv/vmbus: Rename cleaned up bufring code MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7318 Added: head/sys/dev/hyperv/vmbus/vmbus_br.c - copied unchanged from r303378, head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Deleted: head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/modules/hyperv/vmbus/Makefile Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Wed Jul 27 09:26:46 2016 (r303378) +++ head/sys/conf/files.amd64 Wed Jul 27 09:27:08 2016 (r303379) @@ -270,10 +270,10 @@ dev/hyperv/utilities/hv_kvp.c optiona dev/hyperv/utilities/hv_shutdown.c optional hyperv dev/hyperv/utilities/hv_timesync.c optional hyperv dev/hyperv/utilities/hv_util.c optional hyperv -dev/hyperv/vmbus/hv_ring_buffer.c optional hyperv dev/hyperv/vmbus/hyperv.c optional hyperv dev/hyperv/vmbus/hyperv_busdma.c optional hyperv dev/hyperv/vmbus/vmbus.c optional hyperv +dev/hyperv/vmbus/vmbus_br.c optional hyperv dev/hyperv/vmbus/vmbus_chan.c optional hyperv dev/hyperv/vmbus/vmbus_et.c optional hyperv dev/hyperv/vmbus/vmbus_if.m optional hyperv Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Wed Jul 27 09:26:46 2016 (r303378) +++ head/sys/conf/files.i386 Wed Jul 27 09:27:08 2016 (r303379) @@ -246,10 +246,10 @@ dev/hyperv/utilities/hv_kvp.c optiona dev/hyperv/utilities/hv_shutdown.c optional hyperv dev/hyperv/utilities/hv_timesync.c optional hyperv dev/hyperv/utilities/hv_util.c optional hyperv -dev/hyperv/vmbus/hv_ring_buffer.c optional hyperv dev/hyperv/vmbus/hyperv.c optional hyperv dev/hyperv/vmbus/hyperv_busdma.c optional hyperv dev/hyperv/vmbus/vmbus.c optional hyperv +dev/hyperv/vmbus/vmbus_br.c optional hyperv dev/hyperv/vmbus/vmbus_chan.c optional hyperv dev/hyperv/vmbus/vmbus_et.c optional hyperv dev/hyperv/vmbus/vmbus_if.m optional hyperv Copied: head/sys/dev/hyperv/vmbus/vmbus_br.c (from r303378, head/sys/dev/hyperv/vmbus/hv_ring_buffer.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/vmbus/vmbus_br.c Wed Jul 27 09:27:08 2016 (r303379, copy of r303378, head/sys/dev/hyperv/vmbus/hv_ring_buffer.c) @@ -0,0 +1,414 @@ +/*- + * Copyright (c) 2009-2012,2016 Microsoft Corp. + * Copyright (c) 2012 NetApp Inc. + * Copyright (c) 2012 Citrix 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include + +#include +#include + +/* Amount of space available for write */ +#define VMBUS_BR_WAVAIL(r, w, z) \ + (((w) >= (r)) ? ((z) - ((w) - (r))) : ((r) - (w))) + +/* Increase bufing index */ +#define VMBUS_BR_IDXINC(idx, inc, sz) (((idx) + (inc)) % (sz)) + +static int +vmbus_br_sysctl_state(SYSCTL_HANDLER_ARGS) +{ + const struct vmbus_br *br = arg1; + uint32_t rindex, windex, imask, ravail, wavail; + char state[256]; + + rindex = br->vbr_rindex; + windex = br->vbr_windex; + imask = br->vbr_imask; + wavail = VMBUS_BR_WAVAIL(rindex, windex, br->vbr_dsize); + ravail = br->vbr_dsize - wavail; + + snprintf(state, sizeof(state), + "rindex:%u windex:%u imask:%u ravail:%u wavail:%u", + rindex, windex, imask, ravail, wavail); + return sysctl_handle_string(oidp, state, sizeof(state), req); +} + +/* + * Binary bufring states. + */ +static int +vmbus_br_sysctl_state_bin(SYSCTL_HANDLER_ARGS) +{ +#define BR_STATE_RIDX 0 +#define BR_STATE_WIDX 1 +#define BR_STATE_IMSK 2 +#define BR_STATE_RSPC 3 +#define BR_STATE_WSPC 4 +#define BR_STATE_MAX 5 + + const struct vmbus_br *br = arg1; + uint32_t rindex, windex, wavail, state[BR_STATE_MAX]; + + rindex = br->vbr_rindex; + windex = br->vbr_windex; + wavail = VMBUS_BR_WAVAIL(rindex, windex, br->vbr_dsize); + + state[BR_STATE_RIDX] = rindex; + state[BR_STATE_WIDX] = windex; + state[BR_STATE_IMSK] = br->vbr_imask; + state[BR_STATE_WSPC] = wavail; + state[BR_STATE_RSPC] = br->vbr_dsize - wavail; + + return sysctl_handle_opaque(oidp, state, sizeof(state), req); +} + +void +vmbus_br_sysctl_create(struct sysctl_ctx_list *ctx, struct sysctl_oid *br_tree, + struct vmbus_br *br, const char *name) +{ + struct sysctl_oid *tree; + char desc[64]; + + tree = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(br_tree), OID_AUTO, + name, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); + if (tree == NULL) + return; + + snprintf(desc, sizeof(desc), "%s state", name); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "state", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + br, 0, vmbus_br_sysctl_state, "A", desc); + + snprintf(desc, sizeof(desc), "%s binary state", name); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "state_bin", + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, + br, 0, vmbus_br_sysctl_state_bin, "IU", desc); +} + +void +vmbus_rxbr_intr_mask(struct vmbus_rxbr *rbr) +{ + rbr->rxbr_imask = 1; + mb(); +} + +static __inline uint32_t +vmbus_rxbr_avail(const struct vmbus_rxbr *rbr) +{ + uint32_t rindex, windex; + + /* Get snapshot */ + rindex = rbr->rxbr_rindex; + windex = rbr->rxbr_windex; + + return (rbr->rxbr_dsize - + VMBUS_BR_WAVAIL(rindex, windex, rbr->rxbr_dsize)); +} + +uint32_t +vmbus_rxbr_intr_unmask(struct vmbus_rxbr *rbr) +{ + rbr->rxbr_imask = 0; + mb(); + + /* + * Now check to see if the ring buffer is still empty. + * If it is not, we raced and we need to process new + * incoming channel packets. + */ + return vmbus_rxbr_avail(rbr); +} + +static void +vmbus_br_setup(struct vmbus_br *br, void *buf, int blen) +{ + br->vbr = buf; + br->vbr_dsize = blen - sizeof(struct vmbus_bufring); +} + +void +vmbus_rxbr_init(struct vmbus_rxbr *rbr) +{ + mtx_init(&rbr->rxbr_lock, "vmbus_rxbr", NULL, MTX_SPIN); +} + +void +vmbus_rxbr_deinit(struct vmbus_rxbr *rbr) +{ + mtx_destroy(&rbr->rxbr_lock); +} + +void +vmbus_rxbr_setup(struct vmbus_rxbr *rbr, void *buf, int blen) +{ + vmbus_br_setup(&rbr->rxbr, buf, blen); +} + +void +vmbus_txbr_init(struct vmbus_txbr *tbr) +{ + mtx_init(&tbr->txbr_lock, "vmbus_txbr", NULL, MTX_SPIN); +} + +void +vmbus_txbr_deinit(struct vmbus_txbr *tbr) +{ + mtx_destroy(&tbr->txbr_lock); +} + +void +vmbus_txbr_setup(struct vmbus_txbr *tbr, void *buf, int blen) +{ + vmbus_br_setup(&tbr->txbr, buf, blen); +} + +/* + * When we write to the ring buffer, check if the host needs to be + * signaled. + * + * The contract: + * - The host guarantees that while it is draining the TX bufring, + * it will set the br_imask to indicate it does not need to be + * interrupted when new data are added. + * - The host guarantees that it will completely drain the TX bufring + * before exiting the read loop. Further, once the TX bufring is + * empty, it will clear the br_imask and re-check to see if new + * data have arrived. + */ +static __inline boolean_t +vmbus_txbr_need_signal(const struct vmbus_txbr *tbr, uint32_t old_windex) +{ + mb(); + if (tbr->txbr_imask) + return (FALSE); + + /* XXX only compiler fence is needed */ + /* Read memory barrier */ + rmb(); + + /* + * This is the only case we need to signal when the + * ring transitions from being empty to non-empty. + */ + if (old_windex == tbr->txbr_rindex) + return (TRUE); + + return (FALSE); +} + +static __inline uint32_t +vmbus_txbr_avail(const struct vmbus_txbr *tbr) +{ + uint32_t rindex, windex; + + /* Get snapshot */ + rindex = tbr->txbr_rindex; + windex = tbr->txbr_windex; + + return VMBUS_BR_WAVAIL(rindex, windex, tbr->txbr_dsize); +} + +static __inline uint32_t +vmbus_txbr_copyto(const struct vmbus_txbr *tbr, uint32_t windex, + const void *src0, uint32_t cplen) +{ + const uint8_t *src = src0; + uint8_t *br_data = tbr->txbr_data; + uint32_t br_dsize = tbr->txbr_dsize; + + if (cplen > br_dsize - windex) { + uint32_t fraglen = br_dsize - windex; + + /* Wrap-around detected */ + memcpy(br_data + windex, src, fraglen); + memcpy(br_data, src + fraglen, cplen - fraglen); + } else { + memcpy(br_data + windex, src, cplen); + } + return VMBUS_BR_IDXINC(windex, cplen, br_dsize); +} + +/* + * Write scattered channel packet to TX bufring. + * + * The offset of this channel packet is written as a 64bits value + * immediately after this channel packet. + */ +int +vmbus_txbr_write(struct vmbus_txbr *tbr, const struct iovec iov[], int iovlen, + boolean_t *need_sig) +{ + uint32_t old_windex, windex, total; + uint64_t save_windex; + int i; + + total = 0; + for (i = 0; i < iovlen; i++) + total += iov[i].iov_len; + total += sizeof(save_windex); + + mtx_lock_spin(&tbr->txbr_lock); + + /* + * NOTE: + * If this write is going to make br_windex same as br_rindex, + * i.e. the available space for write is same as the write size, + * we can't do it then, since br_windex == br_rindex means that + * the bufring is empty. + */ + if (vmbus_txbr_avail(tbr) <= total) { + mtx_unlock_spin(&tbr->txbr_lock); + return (EAGAIN); + } + + /* Save br_windex for later use */ + old_windex = tbr->txbr_windex; + + /* + * Copy the scattered channel packet to the TX bufring. + */ + windex = old_windex; + for (i = 0; i < iovlen; i++) { + windex = vmbus_txbr_copyto(tbr, windex, + iov[i].iov_base, iov[i].iov_len); + } + + /* + * Set the offset of the current channel packet. + */ + save_windex = ((uint64_t)old_windex) << 32; + windex = vmbus_txbr_copyto(tbr, windex, &save_windex, + sizeof(save_windex)); + + /* + * XXX only compiler fence is needed. + * Full memory barrier before upding the write index. + */ + mb(); + + /* + * Update the write index _after_ the channel packet + * is copied. + */ + tbr->txbr_windex = windex; + + mtx_unlock_spin(&tbr->txbr_lock); + + *need_sig = vmbus_txbr_need_signal(tbr, old_windex); + + return (0); +} + +static __inline uint32_t +vmbus_rxbr_copyfrom(const struct vmbus_rxbr *rbr, uint32_t rindex, + void *dst0, int cplen) +{ + uint8_t *dst = dst0; + const uint8_t *br_data = rbr->rxbr_data; + uint32_t br_dsize = rbr->rxbr_dsize; + + if (cplen > br_dsize - rindex) { + uint32_t fraglen = br_dsize - rindex; + + /* Wrap-around detected. */ + memcpy(dst, br_data + rindex, fraglen); + memcpy(dst + fraglen, br_data, cplen - fraglen); + } else { + memcpy(dst, br_data + rindex, cplen); + } + return VMBUS_BR_IDXINC(rindex, cplen, br_dsize); +} + +int +vmbus_rxbr_peek(struct vmbus_rxbr *rbr, void *data, int dlen) +{ + mtx_lock_spin(&rbr->rxbr_lock); + + /* + * The requested data and the 64bits channel packet + * offset should be there at least. + */ + if (vmbus_rxbr_avail(rbr) < dlen + sizeof(uint64_t)) { + mtx_unlock_spin(&rbr->rxbr_lock); + return (EAGAIN); + } + vmbus_rxbr_copyfrom(rbr, rbr->rxbr_rindex, data, dlen); + + mtx_unlock_spin(&rbr->rxbr_lock); + + return (0); +} + +/* + * NOTE: + * We assume (dlen + skip) == sizeof(channel packet). + */ +int +vmbus_rxbr_read(struct vmbus_rxbr *rbr, void *data, int dlen, uint32_t skip) +{ + uint32_t rindex, br_dsize = rbr->rxbr_dsize; + + KASSERT(dlen + skip > 0, ("invalid dlen %d, offset %u", dlen, skip)); + + mtx_lock_spin(&rbr->rxbr_lock); + + if (vmbus_rxbr_avail(rbr) < dlen + skip + sizeof(uint64_t)) { + mtx_unlock_spin(&rbr->rxbr_lock); + return (EAGAIN); + } + + /* + * Copy channel packet from RX bufring. + */ + rindex = VMBUS_BR_IDXINC(rbr->rxbr_rindex, skip, br_dsize); + rindex = vmbus_rxbr_copyfrom(rbr, rindex, data, dlen); + + /* + * Discard this channel packet's 64bits offset, which is useless to us. + */ + rindex = VMBUS_BR_IDXINC(rindex, sizeof(uint64_t), br_dsize); + + /* + * XXX only compiler fence is needed. + * Make sure all reads are done before we update the read index since + * the writer may start writing to the read area once the read index + * is updated. + */ + wmb(); + + /* + * Update the read index _after_ the channel packet is fetched. + */ + rbr->rxbr_rindex = rindex; + + mtx_unlock_spin(&rbr->rxbr_lock); + + return (0); +} Modified: head/sys/modules/hyperv/vmbus/Makefile ============================================================================== --- head/sys/modules/hyperv/vmbus/Makefile Wed Jul 27 09:26:46 2016 (r303378) +++ head/sys/modules/hyperv/vmbus/Makefile Wed Jul 27 09:27:08 2016 (r303379) @@ -4,11 +4,11 @@ ${.CURDIR}/../../../dev/hyperv/vmbus/${MACHINE_CPUARCH} KMOD= hv_vmbus -SRCS= hv_ring_buffer.c \ - hyperv.c \ +SRCS= hyperv.c \ hyperv_busdma.c \ hyperv_machdep.c \ vmbus.c \ + vmbus_br.c \ vmbus_chan.c \ vmbus_et.c SRCS+= acpi_if.h bus_if.h device_if.h opt_acpi.h vmbus_if.h From owner-svn-src-head@freebsd.org Wed Jul 27 11:09: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 F2E3EBA3E5D; Wed, 27 Jul 2016 11:09: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 BDDD11233; Wed, 27 Jul 2016 11:09: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 u6RB91uo074946; Wed, 27 Jul 2016 11:09:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RB8xQh074927; Wed, 27 Jul 2016 11:08:59 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201607271108.u6RB8xQh074927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 27 Jul 2016 11:08:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303382 - in head/sys: compat/linprocfs fs/devfs fs/fdescfs fs/nfs fs/procfs kern net net/altq netpfil/ipfw nfs rpc/rpcsec_gss 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.22 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, 27 Jul 2016 11:09:02 -0000 Author: kib Date: Wed Jul 27 11:08:59 2016 New Revision: 303382 URL: https://svnweb.freebsd.org/changeset/base/303382 Log: Hide the boottime and bootimebin globals, provide the getboottime(9) and getboottimebin(9) KPI. Change consumers of boottime to use the KPI. The variables were renamed to avoid shadowing issues with local variables of the same name. Issue is that boottime* should be adjusted from tc_windup(), which requires them to be members of the timehands structure. As a preparation, this commit only introduces the interface. Some uses of boottime were found doubtful, e.g. NLM uses boottime to identify the system boot instance. Arguably the identity should not change on the leap second adjustment, but the commit is about the timekeeping code and the consumers were kept bug-to-bug compatible. Tested by: pho (as part of the bigger patch) Reviewed by: jhb (same) Discussed with: bde Sponsored by: The FreeBSD Foundation MFC after: 1 month X-Differential revision: https://reviews.freebsd.org/D7302 Modified: head/sys/compat/linprocfs/linprocfs.c head/sys/fs/devfs/devfs_vnops.c head/sys/fs/fdescfs/fdesc_vnops.c head/sys/fs/nfs/nfsport.h head/sys/fs/procfs/procfs_status.c head/sys/kern/kern_acct.c head/sys/kern/kern_proc.c head/sys/kern/kern_tc.c head/sys/kern/sys_procdesc.c head/sys/net/altq/altq_subr.c head/sys/net/bpf.c head/sys/netpfil/ipfw/ip_fw_sockopt.c head/sys/nfs/nfs_lock.c head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c head/sys/sys/time.h Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Wed Jul 27 10:43:36 2016 (r303381) +++ head/sys/compat/linprocfs/linprocfs.c Wed Jul 27 11:08:59 2016 (r303382) @@ -447,9 +447,11 @@ linprocfs_dostat(PFS_FILL_ARGS) struct pcpu *pcpu; long cp_time[CPUSTATES]; long *cp; + struct timeval boottime; int i; read_cpu_time(cp_time); + getboottime(&boottime); sbuf_printf(sb, "cpu %ld %ld %ld %ld\n", T2J(cp_time[CP_USER]), T2J(cp_time[CP_NICE]), @@ -624,10 +626,12 @@ static int linprocfs_doprocstat(PFS_FILL_ARGS) { struct kinfo_proc kp; + struct timeval boottime; char state; static int ratelimit = 0; vm_offset_t startcode, startdata; + getboottime(&boottime); sx_slock(&proctree_lock); PROC_LOCK(p); fill_kinfo_proc(p, &kp); Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Wed Jul 27 10:43:36 2016 (r303381) +++ head/sys/fs/devfs/devfs_vnops.c Wed Jul 27 11:08:59 2016 (r303382) @@ -707,10 +707,11 @@ devfs_getattr(struct vop_getattr_args *a { struct vnode *vp = ap->a_vp; struct vattr *vap = ap->a_vap; - int error; struct devfs_dirent *de; struct devfs_mount *dmp; struct cdev *dev; + struct timeval boottime; + int error; error = devfs_populate_vp(vp); if (error != 0) @@ -740,6 +741,7 @@ devfs_getattr(struct vop_getattr_args *a vap->va_blocksize = DEV_BSIZE; vap->va_type = vp->v_type; + getboottime(&boottime); #define fix(aa) \ do { \ if ((aa).tv_sec <= 3600) { \ Modified: head/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- head/sys/fs/fdescfs/fdesc_vnops.c Wed Jul 27 10:43:36 2016 (r303381) +++ head/sys/fs/fdescfs/fdesc_vnops.c Wed Jul 27 11:08:59 2016 (r303382) @@ -394,7 +394,9 @@ fdesc_getattr(struct vop_getattr_args *a { struct vnode *vp = ap->a_vp; struct vattr *vap = ap->a_vap; + struct timeval boottime; + getboottime(&boottime); vap->va_mode = S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH; vap->va_fileid = VTOFDESC(vp)->fd_ix; vap->va_uid = 0; Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Wed Jul 27 10:43:36 2016 (r303381) +++ head/sys/fs/nfs/nfsport.h Wed Jul 27 11:08:59 2016 (r303382) @@ -872,7 +872,7 @@ int newnfs_realign(struct mbuf **, int); /* * Set boottime. */ -#define NFSSETBOOTTIME(b) ((b) = boottime) +#define NFSSETBOOTTIME(b) (getboottime(&b)) /* * The size of directory blocks in the buffer cache. Modified: head/sys/fs/procfs/procfs_status.c ============================================================================== --- head/sys/fs/procfs/procfs_status.c Wed Jul 27 10:43:36 2016 (r303381) +++ head/sys/fs/procfs/procfs_status.c Wed Jul 27 11:08:59 2016 (r303382) @@ -70,6 +70,7 @@ procfs_doprocstatus(PFS_FILL_ARGS) const char *wmesg; char *pc; char *sep; + struct timeval boottime; int pid, ppid, pgid, sid; int i; @@ -129,6 +130,7 @@ procfs_doprocstatus(PFS_FILL_ARGS) calcru(p, &ut, &st); PROC_STATUNLOCK(p); start = p->p_stats->p_start; + getboottime(&boottime); timevaladd(&start, &boottime); sbuf_printf(sb, " %jd,%ld %jd,%ld %jd,%ld", (intmax_t)start.tv_sec, start.tv_usec, Modified: head/sys/kern/kern_acct.c ============================================================================== --- head/sys/kern/kern_acct.c Wed Jul 27 10:43:36 2016 (r303381) +++ head/sys/kern/kern_acct.c Wed Jul 27 11:08:59 2016 (r303382) @@ -389,7 +389,7 @@ acct_process(struct thread *td) acct.ac_stime = encode_timeval(st); /* (4) The elapsed time the command ran (and its starting time) */ - tmp = boottime; + getboottime(&tmp); timevaladd(&tmp, &p->p_stats->p_start); acct.ac_btime = tmp.tv_sec; microuptime(&tmp); Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Wed Jul 27 10:43:36 2016 (r303381) +++ head/sys/kern/kern_proc.c Wed Jul 27 11:08:59 2016 (r303382) @@ -872,6 +872,7 @@ fill_kinfo_proc_only(struct proc *p, str struct session *sp; struct ucred *cred; struct sigacts *ps; + struct timeval boottime; /* For proc_realparent. */ sx_assert(&proctree_lock, SX_LOCKED); @@ -953,6 +954,7 @@ fill_kinfo_proc_only(struct proc *p, str kp->ki_nice = p->p_nice; kp->ki_fibnum = p->p_fibnum; kp->ki_start = p->p_stats->p_start; + getboottime(&boottime); timevaladd(&kp->ki_start, &boottime); PROC_STATLOCK(p); rufetch(p, &kp->ki_rusage); Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Wed Jul 27 10:43:36 2016 (r303381) +++ head/sys/kern/kern_tc.c Wed Jul 27 11:08:59 2016 (r303382) @@ -106,8 +106,8 @@ int tc_min_ticktock_freq = 1; volatile time_t time_second = 1; volatile time_t time_uptime = 1; -struct bintime boottimebin; -struct timeval boottime; +static struct bintime boottimebin_x; +static struct timeval boottime_x; static int sysctl_kern_boottime(SYSCTL_HANDLER_ARGS); SYSCTL_PROC(_kern, KERN_BOOTTIME, boottime, CTLTYPE_STRUCT|CTLFLAG_RD, NULL, 0, sysctl_kern_boottime, "S,timeval", "System boottime"); @@ -143,6 +143,10 @@ void dtrace_getnanotime(struct timespec static int sysctl_kern_boottime(SYSCTL_HANDLER_ARGS) { + struct timeval boottime; + + getboottime(&boottime); + #ifndef __mips__ #ifdef SCTL_MASK32 int tv[2]; @@ -150,11 +154,11 @@ sysctl_kern_boottime(SYSCTL_HANDLER_ARGS if (req->flags & SCTL_MASK32) { tv[0] = boottime.tv_sec; tv[1] = boottime.tv_usec; - return SYSCTL_OUT(req, tv, sizeof(tv)); - } else + return (SYSCTL_OUT(req, tv, sizeof(tv))); + } #endif #endif - return SYSCTL_OUT(req, &boottime, sizeof(boottime)); + return (SYSCTL_OUT(req, &boottime, sizeof(boottime))); } static int @@ -236,7 +240,7 @@ fbclock_bintime(struct bintime *bt) { fbclock_binuptime(bt); - bintime_add(bt, &boottimebin); + bintime_add(bt, &boottimebin_x); } void @@ -311,7 +315,7 @@ fbclock_getbintime(struct bintime *bt) *bt = th->th_offset; atomic_thread_fence_acq(); } while (gen == 0 || gen != th->th_generation); - bintime_add(bt, &boottimebin); + bintime_add(bt, &boottimebin_x); } void @@ -380,7 +384,7 @@ bintime(struct bintime *bt) { binuptime(bt); - bintime_add(bt, &boottimebin); + bintime_add(bt, &boottimebin_x); } void @@ -455,7 +459,7 @@ getbintime(struct bintime *bt) *bt = th->th_offset; atomic_thread_fence_acq(); } while (gen == 0 || gen != th->th_generation); - bintime_add(bt, &boottimebin); + bintime_add(bt, &boottimebin_x); } void @@ -487,6 +491,20 @@ getmicrotime(struct timeval *tvp) } #endif /* FFCLOCK */ +void +getboottime(struct timeval *boottime) +{ + + *boottime = boottime_x; +} + +void +getboottimebin(struct bintime *boottimebin) +{ + + *boottimebin = boottimebin_x; +} + #ifdef FFCLOCK /* * Support for feed-forward synchronization algorithms. This is heavily inspired @@ -1103,6 +1121,7 @@ int sysclock_snap2bintime(struct sysclock_snap *cs, struct bintime *bt, int whichclock, uint32_t flags) { + struct bintime boottimebin; #ifdef FFCLOCK struct bintime bt2; uint64_t period; @@ -1116,8 +1135,10 @@ sysclock_snap2bintime(struct sysclock_sn if (cs->delta > 0) bintime_addx(bt, cs->fb_info.th_scale * cs->delta); - if ((flags & FBCLOCK_UPTIME) == 0) + if ((flags & FBCLOCK_UPTIME) == 0) { + getboottimebin(&boottimebin); bintime_add(bt, &boottimebin); + } break; #ifdef FFCLOCK case SYSCLOCK_FFWD: @@ -1242,9 +1263,9 @@ tc_setclock(struct timespec *ts) timespec2bintime(ts, &bt); binuptime(&bt2); bintime_sub(&bt, &bt2); - bintime_add(&bt2, &boottimebin); - boottimebin = bt; - bintime2timeval(&bt, &boottime); + bintime_add(&bt2, &boottimebin_x); + boottimebin_x = bt; + bintime2timeval(&bt, &boottime_x); /* XXX fiddle all the little crinkly bits around the fiords... */ tc_windup(); @@ -1338,7 +1359,7 @@ tc_windup(void) * case we missed a leap second. */ bt = th->th_offset; - bintime_add(&bt, &boottimebin); + bintime_add(&bt, &boottimebin_x); i = bt.sec - tho->th_microtime.tv_sec; if (i > LARGE_STEP) i = 2; @@ -1346,7 +1367,7 @@ tc_windup(void) t = bt.sec; ntp_update_second(&th->th_adjustment, &bt.sec); if (bt.sec != t) - boottimebin.sec += bt.sec - t; + boottimebin_x.sec += bt.sec - t; } /* Update the UTC timestamps used by the get*() functions. */ /* XXX shouldn't do this here. Should force non-`get' versions. */ @@ -1769,7 +1790,7 @@ pps_event(struct pps_state *pps, int eve tcount &= pps->capth->th_counter->tc_counter_mask; bt = pps->capth->th_offset; bintime_addx(&bt, pps->capth->th_scale * tcount); - bintime_add(&bt, &boottimebin); + bintime_add(&bt, &boottimebin_x); bintime2timespec(&bt, &ts); /* If the timecounter was wound up underneath us, bail out. */ @@ -2095,7 +2116,7 @@ tc_fill_vdso_timehands(struct vdso_timeh vdso_th->th_offset_count = th->th_offset_count; vdso_th->th_counter_mask = th->th_counter->tc_counter_mask; vdso_th->th_offset = th->th_offset; - vdso_th->th_boottime = boottimebin; + vdso_th->th_boottime = boottimebin_x; enabled = cpu_fill_vdso_timehands(vdso_th, th->th_counter); if (!vdso_th_enable) enabled = 0; @@ -2116,8 +2137,8 @@ tc_fill_vdso_timehands32(struct vdso_tim vdso_th32->th_counter_mask = th->th_counter->tc_counter_mask; vdso_th32->th_offset.sec = th->th_offset.sec; *(uint64_t *)&vdso_th32->th_offset.frac[0] = th->th_offset.frac; - vdso_th32->th_boottime.sec = boottimebin.sec; - *(uint64_t *)&vdso_th32->th_boottime.frac[0] = boottimebin.frac; + vdso_th32->th_boottime.sec = boottimebin_x.sec; + *(uint64_t *)&vdso_th32->th_boottime.frac[0] = boottimebin_x.frac; enabled = cpu_fill_vdso_timehands32(vdso_th32, th->th_counter); if (!vdso_th_enable) enabled = 0; Modified: head/sys/kern/sys_procdesc.c ============================================================================== --- head/sys/kern/sys_procdesc.c Wed Jul 27 10:43:36 2016 (r303381) +++ head/sys/kern/sys_procdesc.c Wed Jul 27 11:08:59 2016 (r303382) @@ -523,7 +523,7 @@ procdesc_stat(struct file *fp, struct st struct thread *td) { struct procdesc *pd; - struct timeval pstart; + struct timeval pstart, boottime; /* * XXXRW: Perhaps we should cache some more information from the @@ -539,6 +539,7 @@ procdesc_stat(struct file *fp, struct st /* Set birth and [acm] times to process start time. */ pstart = pd->pd_proc->p_stats->p_start; + getboottime(&boottime); timevaladd(&pstart, &boottime); TIMEVAL_TO_TIMESPEC(&pstart, &sb->st_birthtim); sb->st_atim = sb->st_birthtim; Modified: head/sys/net/altq/altq_subr.c ============================================================================== --- head/sys/net/altq/altq_subr.c Wed Jul 27 10:43:36 2016 (r303381) +++ head/sys/net/altq/altq_subr.c Wed Jul 27 11:08:59 2016 (r303382) @@ -1027,9 +1027,10 @@ read_machclk(void) panic("read_machclk"); #endif } else { - struct timeval tv; + struct timeval tv, boottime; microtime(&tv); + getboottime(&boottime); val = (((u_int64_t)(tv.tv_sec - boottime.tv_sec) * 1000000 + tv.tv_usec) << MACHCLK_SHIFT); } Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Wed Jul 27 10:43:36 2016 (r303381) +++ head/sys/net/bpf.c Wed Jul 27 11:08:59 2016 (r303382) @@ -2328,12 +2328,13 @@ bpf_hdrlen(struct bpf_d *d) static void bpf_bintime2ts(struct bintime *bt, struct bpf_ts *ts, int tstype) { - struct bintime bt2; + struct bintime bt2, boottimebin; struct timeval tsm; struct timespec tsn; if ((tstype & BPF_T_MONOTONIC) == 0) { bt2 = *bt; + getboottimebin(&boottimebin); bintime_add(&bt2, &boottimebin); bt = &bt2; } Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_sockopt.c Wed Jul 27 10:43:36 2016 (r303381) +++ head/sys/netpfil/ipfw/ip_fw_sockopt.c Wed Jul 27 11:08:59 2016 (r303382) @@ -395,6 +395,7 @@ swap_map(struct ip_fw_chain *chain, stru static void export_cntr1_base(struct ip_fw *krule, struct ip_fw_bcounter *cntr) { + struct timeval boottime; cntr->size = sizeof(*cntr); @@ -403,21 +404,26 @@ export_cntr1_base(struct ip_fw *krule, s cntr->bcnt = counter_u64_fetch(krule->cntr + 1); cntr->timestamp = krule->timestamp; } - if (cntr->timestamp > 0) + if (cntr->timestamp > 0) { + getboottime(&boottime); cntr->timestamp += boottime.tv_sec; + } } static void export_cntr0_base(struct ip_fw *krule, struct ip_fw_bcounter0 *cntr) { + struct timeval boottime; if (krule->cntr != NULL) { cntr->pcnt = counter_u64_fetch(krule->cntr); cntr->bcnt = counter_u64_fetch(krule->cntr + 1); cntr->timestamp = krule->timestamp; } - if (cntr->timestamp > 0) + if (cntr->timestamp > 0) { + getboottime(&boottime); cntr->timestamp += boottime.tv_sec; + } } /* @@ -2055,11 +2061,13 @@ ipfw_getrules(struct ip_fw_chain *chain, char *ep = bp + space; struct ip_fw *rule; struct ip_fw_rule0 *dst; + struct timeval boottime; int error, i, l, warnflag; time_t boot_seconds; warnflag = 0; + getboottime(&boottime); boot_seconds = boottime.tv_sec; for (i = 0; i < chain->n_rules; i++) { rule = chain->map[i]; Modified: head/sys/nfs/nfs_lock.c ============================================================================== --- head/sys/nfs/nfs_lock.c Wed Jul 27 10:43:36 2016 (r303381) +++ head/sys/nfs/nfs_lock.c Wed Jul 27 11:08:59 2016 (r303382) @@ -241,6 +241,7 @@ nfs_dolock(struct vop_advlock_args *ap) struct flock *fl; struct proc *p; struct nfsmount *nmp; + struct timeval boottime; td = curthread; p = td->td_proc; @@ -284,6 +285,7 @@ nfs_dolock(struct vop_advlock_args *ap) p->p_nlminfo = malloc(sizeof(struct nlminfo), M_NLMINFO, M_WAITOK | M_ZERO); p->p_nlminfo->pid_start = p->p_stats->p_start; + getboottime(&boottime); timevaladd(&p->p_nlminfo->pid_start, &boottime); } msg.lm_msg_ident.pid_start = p->p_nlminfo->pid_start; Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c ============================================================================== --- head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Wed Jul 27 10:43:36 2016 (r303381) +++ head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Wed Jul 27 11:08:59 2016 (r303382) @@ -504,11 +504,13 @@ svc_rpc_gss_find_client(struct svc_rpc_g { struct svc_rpc_gss_client *client; struct svc_rpc_gss_client_list *list; + struct timeval boottime; unsigned long hostid; rpc_gss_log_debug("in svc_rpc_gss_find_client(%d)", id->ci_id); getcredhostid(curthread->td_ucred, &hostid); + getboottime(&boottime); if (id->ci_hostid != hostid || id->ci_boottime != boottime.tv_sec) return (NULL); @@ -537,6 +539,7 @@ svc_rpc_gss_create_client(void) { struct svc_rpc_gss_client *client; struct svc_rpc_gss_client_list *list; + struct timeval boottime; unsigned long hostid; rpc_gss_log_debug("in svc_rpc_gss_create_client()"); @@ -547,6 +550,7 @@ svc_rpc_gss_create_client(void) sx_init(&client->cl_lock, "GSS-client"); getcredhostid(curthread->td_ucred, &hostid); client->cl_id.ci_hostid = hostid; + getboottime(&boottime); client->cl_id.ci_boottime = boottime.tv_sec; client->cl_id.ci_id = svc_rpc_gss_next_clientid++; list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % CLIENT_HASH_SIZE]; Modified: head/sys/sys/time.h ============================================================================== --- head/sys/sys/time.h Wed Jul 27 10:43:36 2016 (r303381) +++ head/sys/sys/time.h Wed Jul 27 11:08:59 2016 (r303382) @@ -372,8 +372,6 @@ void resettodr(void); extern volatile time_t time_second; extern volatile time_t time_uptime; -extern struct bintime boottimebin; -extern struct timeval boottime; extern struct bintime tc_tick_bt; extern sbintime_t tc_tick_sbt; extern struct bintime tick_bt; @@ -440,6 +438,9 @@ void getbintime(struct bintime *bt); void getnanotime(struct timespec *tsp); void getmicrotime(struct timeval *tvp); +void getboottime(struct timeval *boottime); +void getboottimebin(struct bintime *boottimebin); + /* Other functions */ int itimerdecr(struct itimerval *itp, int usec); int itimerfix(struct timeval *tv); From owner-svn-src-head@freebsd.org Wed Jul 27 11:27: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 8F387BA4365; Wed, 27 Jul 2016 11:27:53 +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 473A51AFB; Wed, 27 Jul 2016 11:27:53 +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 u6RBRqrU082117; Wed, 27 Jul 2016 11:27:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RBRqEM082116; Wed, 27 Jul 2016 11:27:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201607271127.u6RBRqEM082116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 27 Jul 2016 11:27:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303383 - 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.22 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, 27 Jul 2016 11:27:53 -0000 Author: kib Date: Wed Jul 27 11:27:52 2016 New Revision: 303383 URL: https://svnweb.freebsd.org/changeset/base/303383 Log: Reduce number of timehands to just two. This is useful because consumers can now be only one tc_windup() call late. Use C99 initialization. Tested by: pho (as part of the whole patch) Reviewed by: jhb (same) Discussed with: bde Sponsored by: The FreeBSD Foundation MFC after: 1 month X-Differential revision: https://reviews.freebsd.org/D7302 Modified: head/sys/kern/kern_tc.c Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Wed Jul 27 11:08:59 2016 (r303382) +++ head/sys/kern/kern_tc.c Wed Jul 27 11:27:52 2016 (r303383) @@ -76,25 +76,15 @@ struct timehands { }; static struct timehands th0; -static struct timehands th9 = { NULL, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0, &th0}; -static struct timehands th8 = { NULL, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0, &th9}; -static struct timehands th7 = { NULL, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0, &th8}; -static struct timehands th6 = { NULL, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0, &th7}; -static struct timehands th5 = { NULL, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0, &th6}; -static struct timehands th4 = { NULL, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0, &th5}; -static struct timehands th3 = { NULL, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0, &th4}; -static struct timehands th2 = { NULL, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0, &th3}; -static struct timehands th1 = { NULL, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0, &th2}; +static struct timehands th1 = { + .th_next = &th0 +}; static struct timehands th0 = { - &dummy_timecounter, - 0, - (uint64_t)-1 / 1000000, - 0, - {1, 0}, - {0, 0}, - {0, 0}, - 1, - &th1 + .th_counter = &dummy_timecounter, + .th_scale = (uint64_t)-1 / 1000000, + .th_offset = { .sec = 1 }, + .th_generation = 1, + .th_next = &th1 }; static struct timehands *volatile timehands = &th0; From owner-svn-src-head@freebsd.org Wed Jul 27 11:33: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 819AEBA44EF; Wed, 27 Jul 2016 11:33:34 +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 47B691EFF; Wed, 27 Jul 2016 11:33:34 +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 u6RBXX2v085646; Wed, 27 Jul 2016 11:33:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RBXX19085645; Wed, 27 Jul 2016 11:33:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201607271133.u6RBXX19085645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 27 Jul 2016 11:33:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303384 - 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.22 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, 27 Jul 2016 11:33:34 -0000 Author: kib Date: Wed Jul 27 11:33:33 2016 New Revision: 303384 URL: https://svnweb.freebsd.org/changeset/base/303384 Log: Style. Sponsored by: The FreeBSD Foundation MFC after: 1 month X-Differential revision: https://reviews.freebsd.org/D7302 Modified: head/sys/kern/kern_tc.c Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Wed Jul 27 11:27:52 2016 (r303383) +++ head/sys/kern/kern_tc.c Wed Jul 27 11:33:33 2016 (r303384) @@ -158,7 +158,7 @@ sysctl_kern_timecounter_get(SYSCTL_HANDL struct timecounter *tc = arg1; ncount = tc->tc_get_timecount(tc); - return sysctl_handle_int(oidp, &ncount, 0, req); + return (sysctl_handle_int(oidp, &ncount, 0, req)); } static int @@ -168,7 +168,7 @@ sysctl_kern_timecounter_freq(SYSCTL_HAND struct timecounter *tc = arg1; freq = tc->tc_frequency; - return sysctl_handle_64(oidp, &freq, 0, req); + return (sysctl_handle_64(oidp, &freq, 0, req)); } /* From owner-svn-src-head@freebsd.org Wed Jul 27 11:34: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 D4989BA459B; Wed, 27 Jul 2016 11:34:26 +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 A17E412C6; Wed, 27 Jul 2016 11:34:26 +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 u6RBYPLp085717; Wed, 27 Jul 2016 11:34:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RBYPPO085716; Wed, 27 Jul 2016 11:34:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201607271134.u6RBYPPO085716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 27 Jul 2016 11:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303385 - 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.22 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, 27 Jul 2016 11:34:26 -0000 Author: kib Date: Wed Jul 27 11:34:25 2016 New Revision: 303385 URL: https://svnweb.freebsd.org/changeset/base/303385 Log: Reduce the resettodr_lock scope to only CLOCK_SETTIME() call. Tested by: pho (as part of the whole patch) Reviewed by: jhb (same) Discussed with: bde Sponsored by: The FreeBSD Foundation MFC after: 1 month X-Differential revision: https://reviews.freebsd.org/D7302 Modified: head/sys/kern/subr_rtc.c Modified: head/sys/kern/subr_rtc.c ============================================================================== --- head/sys/kern/subr_rtc.c Wed Jul 27 11:33:33 2016 (r303384) +++ head/sys/kern/subr_rtc.c Wed Jul 27 11:34:25 2016 (r303385) @@ -172,11 +172,11 @@ resettodr(void) if (disable_rtc_set || clock_dev == NULL) return; - mtx_lock(&resettodr_lock); getnanotime(&ts); timespecadd(&ts, &clock_adj); ts.tv_sec -= utc_offset(); /* XXX: We should really set all registered RTCs */ + mtx_lock(&resettodr_lock); error = CLOCK_SETTIME(clock_dev, &ts); mtx_unlock(&resettodr_lock); if (error != 0) From owner-svn-src-head@freebsd.org Wed Jul 27 11:40: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 CCABCBA4715; Wed, 27 Jul 2016 11:40:07 +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 A7F161634; Wed, 27 Jul 2016 11:40:07 +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 u6RBe6BA085964; Wed, 27 Jul 2016 11:40:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RBe6oE085963; Wed, 27 Jul 2016 11:40:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201607271140.u6RBe6oE085963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 27 Jul 2016 11:40:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303386 - 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.22 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, 27 Jul 2016 11:40:07 -0000 Author: kib Date: Wed Jul 27 11:40:06 2016 New Revision: 303386 URL: https://svnweb.freebsd.org/changeset/base/303386 Log: Fix a bug in r302252. Change ntpadj_lock to spinlock always, and rename stuff removing ADJ/adj from the names. ntp_update_second() requires ntp_lock and is called from the tc_windup(), so ntp_lock must be a spinlock. Add missed lock to ntp_update_second(). Tested by: pho (as part of the whole patch) Reviewed by: jhb (same) Noted by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 month X-Differential revision: https://reviews.freebsd.org/D7302 Modified: head/sys/kern/kern_ntptime.c Modified: head/sys/kern/kern_ntptime.c ============================================================================== --- head/sys/kern/kern_ntptime.c Wed Jul 27 11:34:25 2016 (r303385) +++ head/sys/kern/kern_ntptime.c Wed Jul 27 11:40:06 2016 (r303386) @@ -162,29 +162,12 @@ static l_fp time_adj; /* tick adjust ( static int64_t time_adjtime; /* correction from adjtime(2) (usec) */ -static struct mtx ntpadj_lock; -MTX_SYSINIT(ntpadj, &ntpadj_lock, "ntpadj", -#ifdef PPS_SYNC - MTX_SPIN -#else - MTX_DEF -#endif -); +static struct mtx ntp_lock; +MTX_SYSINIT(ntp, &ntp_lock, "ntp", MTX_SPIN); -/* - * When PPS_SYNC is defined, hardpps() function is provided which can - * be legitimately called from interrupt filters. Due to this, use - * spinlock for ntptime state protection, otherwise sleepable mutex is - * adequate. - */ -#ifdef PPS_SYNC -#define NTPADJ_LOCK() mtx_lock_spin(&ntpadj_lock) -#define NTPADJ_UNLOCK() mtx_unlock_spin(&ntpadj_lock) -#else -#define NTPADJ_LOCK() mtx_lock(&ntpadj_lock) -#define NTPADJ_UNLOCK() mtx_unlock(&ntpadj_lock) -#endif -#define NTPADJ_ASSERT_LOCKED() mtx_assert(&ntpadj_lock, MA_OWNED) +#define NTP_LOCK() mtx_lock_spin(&ntp_lock) +#define NTP_UNLOCK() mtx_unlock_spin(&ntp_lock) +#define NTP_ASSERT_LOCKED() mtx_assert(&ntp_lock, MA_OWNED) #ifdef PPS_SYNC /* @@ -271,7 +254,7 @@ ntp_gettime1(struct ntptimeval *ntvp) { struct timespec atv; /* nanosecond time */ - NTPADJ_ASSERT_LOCKED(); + NTP_ASSERT_LOCKED(); nanotime(&atv); ntvp->time.tv_sec = atv.tv_sec; @@ -302,9 +285,9 @@ sys_ntp_gettime(struct thread *td, struc { struct ntptimeval ntv; - NTPADJ_LOCK(); + NTP_LOCK(); ntp_gettime1(&ntv); - NTPADJ_UNLOCK(); + NTP_UNLOCK(); td->td_retval[0] = ntv.time_state; return (copyout(&ntv, uap->ntvp, sizeof(ntv))); @@ -315,9 +298,9 @@ ntp_sysctl(SYSCTL_HANDLER_ARGS) { struct ntptimeval ntv; /* temporary structure */ - NTPADJ_LOCK(); + NTP_LOCK(); ntp_gettime1(&ntv); - NTPADJ_UNLOCK(); + NTP_UNLOCK(); return (sysctl_handle_opaque(oidp, &ntv, sizeof(ntv), req)); } @@ -382,7 +365,7 @@ sys_ntp_adjtime(struct thread *td, struc error = priv_check(td, PRIV_NTP_ADJTIME); if (error != 0) return (error); - NTPADJ_LOCK(); + NTP_LOCK(); if (modes & MOD_MAXERROR) time_maxerror = ntv.maxerror; if (modes & MOD_ESTERROR) @@ -484,7 +467,7 @@ sys_ntp_adjtime(struct thread *td, struc ntv.stbcnt = pps_stbcnt; #endif /* PPS_SYNC */ retval = ntp_is_time_error(time_status) ? TIME_ERROR : time_state; - NTPADJ_UNLOCK(); + NTP_UNLOCK(); error = copyout((caddr_t)&ntv, (caddr_t)uap->tp, sizeof(ntv)); if (error == 0) @@ -506,6 +489,8 @@ ntp_update_second(int64_t *adjustment, t int tickrate; l_fp ftemp; /* 32/64-bit temporary */ + NTP_LOCK(); + /* * On rollover of the second both the nanosecond and microsecond * clocks are updated and the state machine cranked as @@ -627,6 +612,8 @@ ntp_update_second(int64_t *adjustment, t else time_status &= ~STA_PPSSIGNAL; #endif /* PPS_SYNC */ + + NTP_UNLOCK(); } /* @@ -690,7 +677,7 @@ hardupdate(offset) long mtemp; l_fp ftemp; - NTPADJ_ASSERT_LOCKED(); + NTP_ASSERT_LOCKED(); /* * Select how the phase is to be controlled and from which @@ -772,7 +759,7 @@ hardpps(tsp, nsec) long u_sec, u_nsec, v_nsec; /* temps */ l_fp ftemp; - NTPADJ_LOCK(); + NTP_LOCK(); /* * The signal is first processed by a range gate and frequency @@ -956,7 +943,7 @@ hardpps(tsp, nsec) time_freq = pps_freq; out: - NTPADJ_UNLOCK(); + NTP_UNLOCK(); } #endif /* PPS_SYNC */ @@ -999,11 +986,11 @@ kern_adjtime(struct thread *td, struct t return (error); ltw = (int64_t)delta->tv_sec * 1000000 + delta->tv_usec; } - NTPADJ_LOCK(); + NTP_LOCK(); ltr = time_adjtime; if (delta != NULL) time_adjtime = ltw; - NTPADJ_UNLOCK(); + NTP_UNLOCK(); if (olddelta != NULL) { atv.tv_sec = ltr / 1000000; atv.tv_usec = ltr % 1000000; From owner-svn-src-head@freebsd.org Wed Jul 27 11:49: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 45144BA49B2; Wed, 27 Jul 2016 11:49:43 +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 071731B02; Wed, 27 Jul 2016 11:49:42 +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 u6RBng49089542; Wed, 27 Jul 2016 11:49:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RBngu3089540; Wed, 27 Jul 2016 11:49:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201607271149.u6RBngu3089540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 27 Jul 2016 11:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303387 - 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.22 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, 27 Jul 2016 11:49:43 -0000 Author: kib Date: Wed Jul 27 11:49:41 2016 New Revision: 303387 URL: https://svnweb.freebsd.org/changeset/base/303387 Log: Prevent parallel tc_windup() calls, both parallel top-level calls from setclock() and from simultaneous top-level and interrupt. For this, tc_windup() is protected with a tc_setclock_mtx spinlock, in the try mode when called from hardclock interrupt. If spinlock cannot be obtained without spinning from the interrupt context, this means that top-level executes tc_windup() on other core and our try may be avoided. The boottimebin and boottime variables should be adjusted from tc_windup(). To be correct, they must be part of the timehands and read using lockless protocol. Remove the globals and reimplement the getboottime(9)/getboottimebin(9) KPI using the timehands read protocol. Tested by: pho (as part of the whole patch) Reviewed by: jhb (same) Discussed wit: bde Sponsored by: The FreeBSD Foundation MFC after: 1 month X-Differential revision: https://reviews.freebsd.org/D7302 Modified: head/sys/kern/kern_clock.c head/sys/kern/kern_tc.c Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Wed Jul 27 11:40:06 2016 (r303386) +++ head/sys/kern/kern_clock.c Wed Jul 27 11:49:41 2016 (r303387) @@ -381,7 +381,9 @@ volatile int ticks; int psratio; static DPCPU_DEFINE(int, pcputicks); /* Per-CPU version of ticks. */ -static int global_hardclock_run = 0; +#ifdef DEVICE_POLLING +static int devpoll_run = 0; +#endif /* * Initialize clock frequencies and start both clocks running. @@ -584,15 +586,15 @@ hardclock_cnt(int cnt, int usermode) #endif /* We are in charge to handle this tick duty. */ if (newticks > 0) { - /* Dangerous and no need to call these things concurrently. */ - if (atomic_cmpset_acq_int(&global_hardclock_run, 0, 1)) { - tc_ticktock(newticks); + tc_ticktock(newticks); #ifdef DEVICE_POLLING + /* Dangerous and no need to call these things concurrently. */ + if (atomic_cmpset_acq_int(&devpoll_run, 0, 1)) { /* This is very short and quick. */ hardclock_device_poll(); -#endif /* DEVICE_POLLING */ - atomic_store_rel_int(&global_hardclock_run, 0); + atomic_store_rel_int(&devpoll_run, 0); } +#endif /* DEVICE_POLLING */ #ifdef SW_WATCHDOG if (watchdog_enabled > 0) { i = atomic_fetchadd_int(&watchdog_ticks, -newticks); Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Wed Jul 27 11:40:06 2016 (r303386) +++ head/sys/kern/kern_tc.c Wed Jul 27 11:49:41 2016 (r303387) @@ -70,6 +70,7 @@ struct timehands { struct bintime th_offset; struct timeval th_microtime; struct timespec th_nanotime; + struct bintime th_boottime; /* Fields not to be copied in tc_windup start with th_generation. */ u_int th_generation; struct timehands *th_next; @@ -96,8 +97,6 @@ int tc_min_ticktock_freq = 1; volatile time_t time_second = 1; volatile time_t time_uptime = 1; -static struct bintime boottimebin_x; -static struct timeval boottime_x; static int sysctl_kern_boottime(SYSCTL_HANDLER_ARGS); SYSCTL_PROC(_kern, KERN_BOOTTIME, boottime, CTLTYPE_STRUCT|CTLFLAG_RD, NULL, 0, sysctl_kern_boottime, "S,timeval", "System boottime"); @@ -125,7 +124,7 @@ SYSCTL_PROC(_kern_timecounter, OID_AUTO, static int tc_chosen; /* Non-zero if a specific tc was chosen via sysctl. */ -static void tc_windup(void); +static void tc_windup(struct bintime *new_boottimebin); static void cpu_tick_calibrate(int); void dtrace_getnanotime(struct timespec *tsp); @@ -228,9 +227,17 @@ fbclock_microuptime(struct timeval *tvp) void fbclock_bintime(struct bintime *bt) { + struct timehands *th; + unsigned int gen; - fbclock_binuptime(bt); - bintime_add(bt, &boottimebin_x); + do { + th = timehands; + gen = atomic_load_acq_int(&th->th_generation); + *bt = th->th_offset; + bintime_addx(bt, th->th_scale * tc_delta(th)); + bintime_add(bt, &th->th_boottime); + atomic_thread_fence_acq(); + } while (gen == 0 || gen != th->th_generation); } void @@ -303,9 +310,9 @@ fbclock_getbintime(struct bintime *bt) th = timehands; gen = atomic_load_acq_int(&th->th_generation); *bt = th->th_offset; + bintime_add(bt, &th->th_boottime); atomic_thread_fence_acq(); } while (gen == 0 || gen != th->th_generation); - bintime_add(bt, &boottimebin_x); } void @@ -372,9 +379,17 @@ microuptime(struct timeval *tvp) void bintime(struct bintime *bt) { + struct timehands *th; + u_int gen; - binuptime(bt); - bintime_add(bt, &boottimebin_x); + do { + th = timehands; + gen = atomic_load_acq_int(&th->th_generation); + *bt = th->th_offset; + bintime_addx(bt, th->th_scale * tc_delta(th)); + bintime_add(bt, &th->th_boottime); + atomic_thread_fence_acq(); + } while (gen == 0 || gen != th->th_generation); } void @@ -447,9 +462,9 @@ getbintime(struct bintime *bt) th = timehands; gen = atomic_load_acq_int(&th->th_generation); *bt = th->th_offset; + bintime_add(bt, &th->th_boottime); atomic_thread_fence_acq(); } while (gen == 0 || gen != th->th_generation); - bintime_add(bt, &boottimebin_x); } void @@ -484,15 +499,24 @@ getmicrotime(struct timeval *tvp) void getboottime(struct timeval *boottime) { + struct bintime boottimebin; - *boottime = boottime_x; + getboottimebin(&boottimebin); + bintime2timeval(&boottimebin, boottime); } void getboottimebin(struct bintime *boottimebin) { + struct timehands *th; + u_int gen; - *boottimebin = boottimebin_x; + do { + th = timehands; + gen = atomic_load_acq_int(&th->th_generation); + *boottimebin = th->th_boottime; + atomic_thread_fence_acq(); + } while (gen == 0 || gen != th->th_generation); } #ifdef FFCLOCK @@ -1237,10 +1261,12 @@ tc_getfrequency(void) return (timehands->th_counter->tc_frequency); } +static struct mtx tc_setclock_mtx; +MTX_SYSINIT(tc_setclock_init, &tc_setclock_mtx, "tcsetc", MTX_SPIN); + /* * Step our concept of UTC. This is done by modifying our estimate of * when we booted. - * XXX: not locked. */ void tc_setclock(struct timespec *ts) @@ -1248,26 +1274,24 @@ tc_setclock(struct timespec *ts) struct timespec tbef, taft; struct bintime bt, bt2; - cpu_tick_calibrate(1); - nanotime(&tbef); timespec2bintime(ts, &bt); + nanotime(&tbef); + mtx_lock_spin(&tc_setclock_mtx); + cpu_tick_calibrate(1); binuptime(&bt2); bintime_sub(&bt, &bt2); - bintime_add(&bt2, &boottimebin_x); - boottimebin_x = bt; - bintime2timeval(&bt, &boottime_x); /* XXX fiddle all the little crinkly bits around the fiords... */ - tc_windup(); - nanotime(&taft); + tc_windup(&bt); + mtx_unlock_spin(&tc_setclock_mtx); if (timestepwarnings) { + nanotime(&taft); log(LOG_INFO, "Time stepped from %jd.%09ld to %jd.%09ld (%jd.%09ld)\n", (intmax_t)tbef.tv_sec, tbef.tv_nsec, (intmax_t)taft.tv_sec, taft.tv_nsec, (intmax_t)ts->tv_sec, ts->tv_nsec); } - cpu_tick_calibrate(1); } /* @@ -1276,7 +1300,7 @@ tc_setclock(struct timespec *ts) * timecounter and/or do seconds processing in NTP. Slightly magic. */ static void -tc_windup(void) +tc_windup(struct bintime *new_boottimebin) { struct bintime bt; struct timehands *th, *tho; @@ -1300,6 +1324,8 @@ tc_windup(void) th->th_generation = 0; atomic_thread_fence_rel(); bcopy(tho, th, offsetof(struct timehands, th_generation)); + if (new_boottimebin != NULL) + th->th_boottime = *new_boottimebin; /* * Capture a timecounter delta on the current timecounter and if @@ -1349,7 +1375,7 @@ tc_windup(void) * case we missed a leap second. */ bt = th->th_offset; - bintime_add(&bt, &boottimebin_x); + bintime_add(&bt, &th->th_boottime); i = bt.sec - tho->th_microtime.tv_sec; if (i > LARGE_STEP) i = 2; @@ -1357,7 +1383,7 @@ tc_windup(void) t = bt.sec; ntp_update_second(&th->th_adjustment, &bt.sec); if (bt.sec != t) - boottimebin_x.sec += bt.sec - t; + th->th_boottime.sec += bt.sec - t; } /* Update the UTC timestamps used by the get*() functions. */ /* XXX shouldn't do this here. Should force non-`get' versions. */ @@ -1780,7 +1806,7 @@ pps_event(struct pps_state *pps, int eve tcount &= pps->capth->th_counter->tc_counter_mask; bt = pps->capth->th_offset; bintime_addx(&bt, pps->capth->th_scale * tcount); - bintime_add(&bt, &boottimebin_x); + bintime_add(&bt, &pps->capth->th_boottime); bintime2timespec(&bt, &ts); /* If the timecounter was wound up underneath us, bail out. */ @@ -1853,11 +1879,14 @@ tc_ticktock(int cnt) { static int count; - count += cnt; - if (count < tc_tick) - return; - count = 0; - tc_windup(); + if (mtx_trylock_spin(&tc_setclock_mtx)) { + count += cnt; + if (count >= tc_tick) { + count = 0; + tc_windup(NULL); + } + mtx_unlock_spin(&tc_setclock_mtx); + } } static void __inline @@ -1932,7 +1961,9 @@ inittimecounter(void *dummy) /* warm up new timecounter (again) and get rolling. */ (void)timecounter->tc_get_timecount(timecounter); (void)timecounter->tc_get_timecount(timecounter); - tc_windup(); + mtx_lock_spin(&tc_setclock_mtx); + tc_windup(NULL); + mtx_unlock_spin(&tc_setclock_mtx); } SYSINIT(timecounter, SI_SUB_CLOCKS, SI_ORDER_SECOND, inittimecounter, NULL); @@ -2106,7 +2137,7 @@ tc_fill_vdso_timehands(struct vdso_timeh vdso_th->th_offset_count = th->th_offset_count; vdso_th->th_counter_mask = th->th_counter->tc_counter_mask; vdso_th->th_offset = th->th_offset; - vdso_th->th_boottime = boottimebin_x; + vdso_th->th_boottime = th->th_boottime; enabled = cpu_fill_vdso_timehands(vdso_th, th->th_counter); if (!vdso_th_enable) enabled = 0; @@ -2127,8 +2158,8 @@ tc_fill_vdso_timehands32(struct vdso_tim vdso_th32->th_counter_mask = th->th_counter->tc_counter_mask; vdso_th32->th_offset.sec = th->th_offset.sec; *(uint64_t *)&vdso_th32->th_offset.frac[0] = th->th_offset.frac; - vdso_th32->th_boottime.sec = boottimebin_x.sec; - *(uint64_t *)&vdso_th32->th_boottime.frac[0] = boottimebin_x.frac; + vdso_th32->th_boottime.sec = th->th_boottime.sec; + *(uint64_t *)&vdso_th32->th_boottime.frac[0] = th->th_boottime.frac; enabled = cpu_fill_vdso_timehands32(vdso_th32, th->th_counter); if (!vdso_th_enable) enabled = 0; From owner-svn-src-head@freebsd.org Wed Jul 27 11:54: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 A43B1BA4CA5; Wed, 27 Jul 2016 11:54: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 6CFBA107A; Wed, 27 Jul 2016 11:54: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 u6RBsOnQ092959; Wed, 27 Jul 2016 11:54:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RBsOqA092958; Wed, 27 Jul 2016 11:54:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201607271154.u6RBsOqA092958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 27 Jul 2016 11:54:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303388 - 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.22 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, 27 Jul 2016 11:54:25 -0000 Author: kib Date: Wed Jul 27 11:54:24 2016 New Revision: 303388 URL: https://svnweb.freebsd.org/changeset/base/303388 Log: Remove Giant from settime(), tc_setclock_mtx guards tc_windup() calls, and there is no other issues with parallel settime(). Remove spl() vestiges there as well. Tested by: pho (as part of the whole patch) Reviewed by: jhb (same) Discussed wit: bde Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential revision: https://reviews.freebsd.org/D7302 Modified: head/sys/kern/kern_time.c Modified: head/sys/kern/kern_time.c ============================================================================== --- head/sys/kern/kern_time.c Wed Jul 27 11:49:41 2016 (r303387) +++ head/sys/kern/kern_time.c Wed Jul 27 11:54:24 2016 (r303388) @@ -120,9 +120,7 @@ settime(struct thread *td, struct timeva struct timeval delta, tv1, tv2; static struct timeval maxtime, laststep; struct timespec ts; - int s; - s = splclock(); microtime(&tv1); delta = *tv; timevalsub(&delta, &tv1); @@ -152,10 +150,8 @@ settime(struct thread *td, struct timeva printf("Time adjustment clamped to -1 second\n"); } } else { - if (tv1.tv_sec == laststep.tv_sec) { - splx(s); + if (tv1.tv_sec == laststep.tv_sec) return (EPERM); - } if (delta.tv_sec > 1) { tv->tv_sec = tv1.tv_sec + 1; printf("Time adjustment clamped to +1 second\n"); @@ -166,10 +162,8 @@ settime(struct thread *td, struct timeva ts.tv_sec = tv->tv_sec; ts.tv_nsec = tv->tv_usec * 1000; - mtx_lock(&Giant); tc_setclock(&ts); resettodr(); - mtx_unlock(&Giant); return (0); } From owner-svn-src-head@freebsd.org Wed Jul 27 14:12: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 4C176BA65EC; Wed, 27 Jul 2016 14:12:06 +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 18C831E7F; Wed, 27 Jul 2016 14:12:06 +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 u6REC5qC042022; Wed, 27 Jul 2016 14:12:05 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6REC5Jh042020; Wed, 27 Jul 2016 14:12:05 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201607271412.u6REC5Jh042020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 27 Jul 2016 14:12:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303390 - 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.22 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, 27 Jul 2016 14:12:06 -0000 Author: emaste Date: Wed Jul 27 14:12:04 2016 New Revision: 303390 URL: https://svnweb.freebsd.org/changeset/base/303390 Log: syscons,vt: improve phrasing in kern.vty man page description Submitted by: wblock Modified: head/share/man/man4/syscons.4 head/share/man/man4/vt.4 Modified: head/share/man/man4/syscons.4 ============================================================================== --- head/share/man/man4/syscons.4 Wed Jul 27 13:53:15 2016 (r303389) +++ head/share/man/man4/syscons.4 Wed Jul 27 14:12:04 2016 (r303390) @@ -468,10 +468,11 @@ be selected by setting this variable to .Ql sc or .Ql vt . -If not set, the default console in the +The .Pa GENERIC -kernel is -.Xr vt 4 . +kernel uses +.Xr vt 4 +when this value is not set. .El .Sh FILES .Bl -tag -width /usr/share/syscons/xxxxyyyyzzz -compact Modified: head/share/man/man4/vt.4 ============================================================================== --- head/share/man/man4/vt.4 Wed Jul 27 13:53:15 2016 (r303389) +++ head/share/man/man4/vt.4 Wed Jul 27 14:12:04 2016 (r303390) @@ -201,10 +201,11 @@ Set this value to or .Ql sc to choose a specific system console, overriding the default. -If not set, the default in the +The .Pa GENERIC -kernel is -.Nm . +kernel uses +.Nm +when this value is not set. .It Va kern.vt.fb.default_mode Set this value to a graphic mode to override the default mode picked by the .Nm From owner-svn-src-head@freebsd.org Wed Jul 27 14:27: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 A63DABA6874; Wed, 27 Jul 2016 14:27:09 +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 5EF8F1784; Wed, 27 Jul 2016 14:27:09 +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 u6RER8VY048538; Wed, 27 Jul 2016 14:27:08 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RER8C0048537; Wed, 27 Jul 2016 14:27:08 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201607271427.u6RER8C0048537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 27 Jul 2016 14:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303391 - 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.22 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, 27 Jul 2016 14:27:09 -0000 Author: emaste Date: Wed Jul 27 14:27:08 2016 New Revision: 303391 URL: https://svnweb.freebsd.org/changeset/base/303391 Log: ANSIfy kern_proc.c and delete register keyword Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6478 Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Wed Jul 27 14:12:04 2016 (r303390) +++ head/sys/kern/kern_proc.c Wed Jul 27 14:27:08 2016 (r303391) @@ -354,10 +354,9 @@ found: * The caller must hold proctree_lock. */ struct pgrp * -pgfind(pgid) - register pid_t pgid; +pgfind(pid_t pgid) { - register struct pgrp *pgrp; + struct pgrp *pgrp; sx_assert(&proctree_lock, SX_LOCKED); @@ -435,11 +434,7 @@ errout: * Begin a new session if required. */ int -enterpgrp(p, pgid, pgrp, sess) - register struct proc *p; - pid_t pgid; - struct pgrp *pgrp; - struct session *sess; +enterpgrp(struct proc *p, pid_t pgid, struct pgrp *pgrp, struct session *sess) { sx_assert(&proctree_lock, SX_XLOCKED); @@ -500,9 +495,7 @@ enterpgrp(p, pgid, pgrp, sess) * Move p to an existing process group */ int -enterthispgrp(p, pgrp) - register struct proc *p; - struct pgrp *pgrp; +enterthispgrp(struct proc *p, struct pgrp *pgrp) { sx_assert(&proctree_lock, SX_XLOCKED); @@ -527,9 +520,7 @@ enterthispgrp(p, pgrp) * Move p to a process group */ static void -doenterpgrp(p, pgrp) - struct proc *p; - struct pgrp *pgrp; +doenterpgrp(struct proc *p, struct pgrp *pgrp) { struct pgrp *savepgrp; @@ -566,8 +557,7 @@ doenterpgrp(p, pgrp) * remove process from process group */ int -leavepgrp(p) - register struct proc *p; +leavepgrp(struct proc *p) { struct pgrp *savepgrp; @@ -588,8 +578,7 @@ leavepgrp(p) * delete a process group */ static void -pgdelete(pgrp) - register struct pgrp *pgrp; +pgdelete(struct pgrp *pgrp) { struct session *savesess; struct tty *tp; @@ -622,9 +611,7 @@ pgdelete(pgrp) } static void -pgadjustjobc(pgrp, entering) - struct pgrp *pgrp; - int entering; +pgadjustjobc(struct pgrp *pgrp, int entering) { PGRP_LOCK(pgrp); @@ -764,10 +751,9 @@ killjobc(void) * hang-up all process in that group. */ static void -orphanpg(pg) - struct pgrp *pg; +orphanpg(struct pgrp *pg) { - register struct proc *p; + struct proc *p; PGRP_LOCK_ASSERT(pg, MA_OWNED); @@ -812,9 +798,9 @@ sess_release(struct session *s) DB_SHOW_COMMAND(pgrpdump, pgrpdump) { - register struct pgrp *pgrp; - register struct proc *p; - register int i; + struct pgrp *pgrp; + struct proc *p; + int i; for (i = 0; i <= pgrphash; i++) { if (!LIST_EMPTY(&pgrphashtbl[i])) { From owner-svn-src-head@freebsd.org Wed Jul 27 14:58: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 C6B8FBA6EE3; Wed, 27 Jul 2016 14:58:16 +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 7C8D91741; Wed, 27 Jul 2016 14:58:16 +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 u6REwFaL059659; Wed, 27 Jul 2016 14:58:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6REwF1r059656; Wed, 27 Jul 2016 14:58:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201607271458.u6REwF1r059656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 27 Jul 2016 14:58:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303392 - in head: . 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.22 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, 27 Jul 2016 14:58:16 -0000 Author: emaste Date: Wed Jul 27 14:58:15 2016 New Revision: 303392 URL: https://svnweb.freebsd.org/changeset/base/303392 Log: Remove ${OBJDUMP} as it is not used by the base system It was added to sys.mk relatively recently (r274503) for EFI builds but is no longer used by the base system. The in-tree binutils are outdated, will not be updated, and will be removed in the future. Remove it from the toolchain build now to slightly simplify the build and make sure we don't grow an accidental dependency. Note that this affects only the toolchain build, and does not affect /usr/bin/objdump in the built world. Reviewed by: bdrewery Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6460 Modified: head/Makefile.inc1 head/share/mk/local.meta.sys.mk head/share/mk/sys.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Jul 27 14:27:08 2016 (r303391) +++ head/Makefile.inc1 Wed Jul 27 14:58:15 2016 (r303392) @@ -178,7 +178,7 @@ CROSS_BINUTILS_PREFIX=/usr/local/${TARGE .endif .endif .endif -XBINUTILS= AS AR LD NM OBJCOPY OBJDUMP RANLIB SIZE STRINGS +XBINUTILS= AS AR LD NM OBJCOPY RANLIB SIZE STRINGS .for BINUTIL in ${XBINUTILS} .if defined(CROSS_BINUTILS_PREFIX) && \ exists(${CROSS_BINUTILS_PREFIX}${${BINUTIL}}) @@ -539,7 +539,7 @@ HMAKE+= PATH=${TMPPATH} METALOG=${METAL CROSSENV+= CC="${XCC} ${XCFLAGS}" CXX="${XCXX} ${XCXXFLAGS} ${XCFLAGS}" \ CPP="${XCPP} ${XCFLAGS}" \ AS="${XAS}" AR="${XAR}" LD="${XLD}" NM=${XNM} \ - OBJDUMP=${XOBJDUMP} OBJCOPY="${XOBJCOPY}" \ + OBJCOPY="${XOBJCOPY}" \ RANLIB=${XRANLIB} STRINGS=${XSTRINGS} \ SIZE="${XSIZE}" Modified: head/share/mk/local.meta.sys.mk ============================================================================== --- head/share/mk/local.meta.sys.mk Wed Jul 27 14:27:08 2016 (r303391) +++ head/share/mk/local.meta.sys.mk Wed Jul 27 14:58:15 2016 (r303392) @@ -222,7 +222,7 @@ WITH_META_STATS= t .if ${MACHINE} == "host" MK_SHARED_TOOLCHAIN= no .endif -TOOLCHAIN_VARS= AS AR CC CLANG_TBLGEN CXX CPP LD NM OBJDUMP OBJCOPY RANLIB \ +TOOLCHAIN_VARS= AS AR CC CLANG_TBLGEN CXX CPP LD NM OBJCOPY RANLIB \ STRINGS SIZE LLVM_TBLGEN _toolchain_bin_CLANG_TBLGEN= /usr/bin/clang-tblgen _toolchain_bin_LLVM_TBLGEN= /usr/bin/llvm-tblgen Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Wed Jul 27 14:27:08 2016 (r303391) +++ head/share/mk/sys.mk Wed Jul 27 14:58:15 2016 (r303392) @@ -237,8 +237,6 @@ OBJCFLAGS ?= ${OBJCINCLUDES} ${CFLAGS} - OBJCOPY ?= objcopy -OBJDUMP ?= objdump - PC ?= pc PFLAGS ?= From owner-svn-src-head@freebsd.org Wed Jul 27 15:14: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 E2A81BA24AF; Wed, 27 Jul 2016 15:14:12 +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 958DA15D9; Wed, 27 Jul 2016 15:14:12 +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 u6RFEBlS068948; Wed, 27 Jul 2016 15:14:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RFEBGP068945; Wed, 27 Jul 2016 15:14:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201607271514.u6RFEBGP068945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 27 Jul 2016 15:14:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303393 - head/lib/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.22 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, 27 Jul 2016 15:14:13 -0000 Author: kib Date: Wed Jul 27 15:14:11 2016 New Revision: 303393 URL: https://svnweb.freebsd.org/changeset/base/303393 Log: Remove empty initializer for the once facility. It was not needed since r179417. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libthr/thread/thr_init.c head/lib/libthr/thread/thr_once.c head/lib/libthr/thread/thr_private.h Modified: head/lib/libthr/thread/thr_init.c ============================================================================== --- head/lib/libthr/thread/thr_init.c Wed Jul 27 14:58:15 2016 (r303392) +++ head/lib/libthr/thread/thr_init.c Wed Jul 27 15:14:11 2016 (r303393) @@ -447,7 +447,6 @@ init_private(void) _thr_urwlock_init(&_thr_atfork_lock); _thr_umutex_init(&_thr_event_lock); _thr_umutex_init(&_suspend_all_lock); - _thr_once_init(); _thr_spinlock_init(); _thr_list_init(); _thr_wake_addr_init(); Modified: head/lib/libthr/thread/thr_once.c ============================================================================== --- head/lib/libthr/thread/thr_once.c Wed Jul 27 14:58:15 2016 (r303392) +++ head/lib/libthr/thread/thr_once.c Wed Jul 27 15:14:11 2016 (r303393) @@ -101,8 +101,3 @@ _pthread_once(pthread_once_t *once_contr _thr_umtx_wake(&once_control->state, INT_MAX, 0); return (0); } - -void -_thr_once_init(void) -{ -} Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Wed Jul 27 14:58:15 2016 (r303392) +++ head/lib/libthr/thread/thr_private.h Wed Jul 27 15:14:11 2016 (r303393) @@ -811,7 +811,6 @@ void _thr_link(struct pthread *, struct void _thr_unlink(struct pthread *, struct pthread *) __hidden; void _thr_assert_lock_level(void) __hidden __dead2; void _thr_ast(struct pthread *) __hidden; -void _thr_once_init(void) __hidden; void _thr_report_creation(struct pthread *curthread, struct pthread *newthread) __hidden; void _thr_report_death(struct pthread *curthread) __hidden; From owner-svn-src-head@freebsd.org Wed Jul 27 15:31: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 99B31BA2C3E; Wed, 27 Jul 2016 15:31:27 +0000 (UTC) (envelope-from pluknet@gmail.com) 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 31A051F51; Wed, 27 Jul 2016 15:31:27 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: by mail-wm0-x22e.google.com with SMTP id q128so217481527wma.1; Wed, 27 Jul 2016 08:31:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=zdbMMXD+1agVTop68qjIz0tnG+h05pv8nyJgz+UILjc=; b=SANeeVfmNIegeL1ksus1eVAf7WqGMVEavWmmPJgE0dHUqbYgBjFZVlh7a/gr5rbC6D xV/ICoYEtw4iNYU6Xh4UIQCoCNvgSQItLgs1htt2IcfUvFFyXRYblkR7BihOEEjve6bT p49MuYZ8BOJ16vrRxkiqHeVW/ThtdGJe62wd8jhm+4wVpGEgIQlFkZzJzzfyv1YFkLp8 ENsDbbobwegkGn/3Qcc9L/45nZ9U+czDnsaR9ycgeevbmN4bB/ghoUpTtu53hpiL/r4H 8kjYYETI/8NrryqazmbsVqUnnp7VKNwZwKDjPQElD2T02AjCCGDrf9bxVPqdUO6HNlr+ B/NQ== 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:from:date :message-id:subject:to:cc; bh=zdbMMXD+1agVTop68qjIz0tnG+h05pv8nyJgz+UILjc=; b=XLKMBxBf/aobvikDQExK8mjEEzOZqDKmub3EItLo1s/BY3Vp+pYDj9UFqCd388qRRN ZAWfExoNWmU1vShYu/JHEhsy4APosiLCjqd7vkHeOPJZekz4VnPSMFhQgmd9uR/Zr8ZJ uoXbXwp0iwYCCZQsLeor55UNuApTJBz8wd7tJj8Hu7OHDUwPhqvRHHOMx8+5BV7TKFCK vbjXJT7YVBtu4/C+94mCc++UEDKCuOPmY7F50wVdw/9l/hBOoccUjewVTYea4nKvMNV3 wHv801J5TQvhW8QquqWsgovlCNcthRrCDglvmhDLfZmtrZzO5dKMIlApbnk+J4jVmj4n s+rw== X-Gm-Message-State: AEkooutn9jFybmrcZ0aQzOaEQus2/kpltY7sJJ3ejG/GQ9zG8cw2/45WbsK74q0ofNx8lqH3zr4vhsoa07nRlQ== X-Received: by 10.28.4.77 with SMTP id 74mr34135633wme.84.1469633484709; Wed, 27 Jul 2016 08:31:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.105.104 with HTTP; Wed, 27 Jul 2016 08:31:24 -0700 (PDT) In-Reply-To: <201511181752.tAIHqcdF006755@repo.freebsd.org> References: <201511181752.tAIHqcdF006755@repo.freebsd.org> From: Sergey Kandaurov Date: Wed, 27 Jul 2016 18:31:24 +0300 Message-ID: Subject: Re: svn commit: r291021 - in head: sbin usr.sbin To: Bryan Drewery 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.22 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, 27 Jul 2016 15:31:27 -0000 On 18 November 2015 at 20:52, Bryan Drewery wrote: > Author: bdrewery > Date: Wed Nov 18 17:52:38 2015 > New Revision: 291021 > URL: https://svnweb.freebsd.org/changeset/base/291021 > > Log: > Convert to SUBDIR.yes format. > > Reviewed by: imp > Sponsored by: EMC / Isilon Storage Division > Differential Revision: https://reviews.freebsd.org/D4182 > Looks like this change lost pmcstudy by an accident. > - > -# XXX MK_TOOLCHAIN? > -.if ${MK_PMC} != "no" > -SUBDIR+= pmcannotate > -SUBDIR+= pmccontrol > -SUBDIR+= pmcstat > -SUBDIR+= pmcstudy > -.endif > - [...] > +SUBDIR.${MK_PMC}+= pmcannotate > +SUBDIR.${MK_PMC}+= pmccontrol > +SUBDIR.${MK_PMC}+= pmcstat -- wbr, pluknet From owner-svn-src-head@freebsd.org Wed Jul 27 15:58: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 213D8BA6620; Wed, 27 Jul 2016 15:58:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id ED9EC12B3; Wed, 27 Jul 2016 15:58:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id E427E1BFD; Wed, 27 Jul 2016 15:58:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 803422358D; Wed, 27 Jul 2016 15:58:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id ti-82R_6Dj_M; Wed, 27 Jul 2016 15:58:12 +0000 (UTC) Subject: Re: svn commit: r291021 - in head: sbin usr.sbin DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 63B8023587 To: Sergey Kandaurov References: <201511181752.tAIHqcdF006755@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <10fff636-d896-d0b4-3cb5-4bf3d0159706@FreeBSD.org> Date: Wed, 27 Jul 2016 08:58:12 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LniQoJ8l2RdFvdNFeerbp2acrxV8hPnfE" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 27 Jul 2016 15:58:20 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --LniQoJ8l2RdFvdNFeerbp2acrxV8hPnfE Content-Type: multipart/mixed; boundary="IeQPVxGk5pQLk9k7rBLKjIf8ixSLImLcA" From: Bryan Drewery To: Sergey Kandaurov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <10fff636-d896-d0b4-3cb5-4bf3d0159706@FreeBSD.org> Subject: Re: svn commit: r291021 - in head: sbin usr.sbin References: <201511181752.tAIHqcdF006755@repo.freebsd.org> In-Reply-To: --IeQPVxGk5pQLk9k7rBLKjIf8ixSLImLcA Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 7/27/2016 8:31 AM, Sergey Kandaurov wrote: > On 18 November 2015 at 20:52, Bryan Drewery wrot= e: >> Author: bdrewery >> Date: Wed Nov 18 17:52:38 2015 >> New Revision: 291021 >> URL: https://svnweb.freebsd.org/changeset/base/291021 >> >> Log: >> Convert to SUBDIR.yes format. >> >> Reviewed by: imp >> Sponsored by: EMC / Isilon Storage Division >> Differential Revision: https://reviews.freebsd.org/D4182 >> >=20 > Looks like this change lost pmcstudy by an accident. >=20 >> - >> -# XXX MK_TOOLCHAIN? >> -.if ${MK_PMC} !=3D "no" >> -SUBDIR+=3D pmcannotate >> -SUBDIR+=3D pmccontrol >> -SUBDIR+=3D pmcstat >> -SUBDIR+=3D pmcstudy >> -.endif >> - > [...] >> +SUBDIR.${MK_PMC}+=3D pmcannotate >> +SUBDIR.${MK_PMC}+=3D pmccontrol >> +SUBDIR.${MK_PMC}+=3D pmcstat >=20 >=20 >=20 Nice catch. I'm doing a build test now and will get it in soon. --=20 Regards, Bryan Drewery --IeQPVxGk5pQLk9k7rBLKjIf8ixSLImLcA-- --LniQoJ8l2RdFvdNFeerbp2acrxV8hPnfE 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 iQEcBAEBAgAGBQJXmNoUAAoJEDXXcbtuRpfPadEH/RQdFk2+DKMW51qhrIvl/Un6 un2O497cS5XYbVPlSNR5eGClHVWwNL09YiZf7G641QYalTIcOMklTp/PX8h3dTMw nw/d/2t4Vk0CJVE4p9V59hwmkr8laIC9xWB9AMh6/qlBDGb5f13iIYg3yzSpMGFt DQ/B2+imLzO/BIoUlsuLjqd/wcgboAkeAZDgwZIUAuExUY3hbJ+0uZ44aSyptPBp priBrRtwJGqnUhh7BgacF5FaQikwJKIm2T5hnn1e4TqOWapWMn8ML/4qiHLKe56W HYl8SQhjyZlv8vUCM0Zo8QH1NYlPxmRtRUbfrfi4neq/hDCrLLNrRCi4kViEVfs= =FvY6 -----END PGP SIGNATURE----- --LniQoJ8l2RdFvdNFeerbp2acrxV8hPnfE-- From owner-svn-src-head@freebsd.org Wed Jul 27 16:01: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 48F3BBA6785; Wed, 27 Jul 2016 16:01:45 +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 1BD321656; Wed, 27 Jul 2016 16:01:45 +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 u6RG1iUC087333; Wed, 27 Jul 2016 16:01:44 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RG1iks087332; Wed, 27 Jul 2016 16:01:44 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201607271601.u6RG1iks087332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 27 Jul 2016 16:01:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303394 - head/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.22 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, 27 Jul 2016 16:01:45 -0000 Author: emaste Date: Wed Jul 27 16:01:44 2016 New Revision: 303394 URL: https://svnweb.freebsd.org/changeset/base/303394 Log: Enable LLVM libunwind by default on amd64 and i386 It is a maintained and updated runtime exception stack unwinder that should be a drop-in replacement. It can be disabled by setting WITHOUT_LLVM_LIBUNWIND in src.conf. PR: 206039 [exp-run] Sponsored by: The FreeBSD Foundation Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Wed Jul 27 15:14:11 2016 (r303393) +++ head/share/mk/src.opts.mk Wed Jul 27 16:01:44 2016 (r303394) @@ -235,15 +235,18 @@ __DEFAULT_NO_OPTIONS+=CLANG CLANG_BOOTST # In-tree binutils/gcc are older versions without modern architecture support. .if ${__T} == "aarch64" || ${__T} == "riscv64" BROKEN_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP GCC GCC_BOOTSTRAP GDB -__DEFAULT_YES_OPTIONS+=LLVM_LIBUNWIND -.else -__DEFAULT_NO_OPTIONS+=LLVM_LIBUNWIND .endif .if ${__T} == "riscv64" BROKEN_OPTIONS+=PROFILE # "sorry, unimplemented: profiler support for RISC-V" BROKEN_OPTIONS+=TESTS # "undefined reference to `_Unwind_Resume'" BROKEN_OPTIONS+=CXX # "libcxxrt.so: undefined reference to `_Unwind_Resume_or_Rethrow'" .endif +.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \ + ${__T} == "riscv64" +__DEFAULT_YES_OPTIONS+=LLVM_LIBUNWIND +.else +__DEFAULT_NO_OPTIONS+=LLVM_LIBUNWIND +.endif .if ${__T} == "aarch64" || ${__T} == "amd64" __DEFAULT_YES_OPTIONS+=LLDB .else From owner-svn-src-head@freebsd.org Wed Jul 27 16:34: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 15A27BA6166; Wed, 27 Jul 2016 16:34:21 +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 CB4AC1D3C; Wed, 27 Jul 2016 16:34:20 +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 u6RGYKPF099789; Wed, 27 Jul 2016 16:34:20 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RGYJHx099787; Wed, 27 Jul 2016 16:34:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201607271634.u6RGYJHx099787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 27 Jul 2016 16:34:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303396 - in head: contrib/gcc/config/arm gnu/lib/libgcc 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.22 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, 27 Jul 2016 16:34:21 -0000 Author: emaste Date: Wed Jul 27 16:34:19 2016 New Revision: 303396 URL: https://svnweb.freebsd.org/changeset/base/303396 Log: rename ARM's libunwind.S to to avoid conflict with llvm libunwind llvm libunwind includes a libunwind.cpp, but on ARM libunwind.S is found first in .PATH. Rename the latter one, since it is not going to be updated again. Reviewed by: andrew MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7162 Added: head/contrib/gcc/config/arm/libunwind-arm.S - copied unchanged from r303395, head/contrib/gcc/config/arm/libunwind.S Deleted: head/contrib/gcc/config/arm/libunwind.S Modified: head/gnu/lib/libgcc/Makefile Copied: head/contrib/gcc/config/arm/libunwind-arm.S (from r303395, head/contrib/gcc/config/arm/libunwind.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/gcc/config/arm/libunwind-arm.S Wed Jul 27 16:34:19 2016 (r303396, copy of r303395, head/contrib/gcc/config/arm/libunwind.S) @@ -0,0 +1,136 @@ +/* Support functions for the unwinder. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + Contributed by Paul Brook + + This file is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + In addition to the permissions in the GNU General Public License, the + Free Software Foundation gives you unlimited permission to link the + compiled version of this file into combinations with other programs, + and to distribute those combinations without any restriction coming + from the use of this file. (The General Public License restrictions + do apply in other respects; for example, they cover modification of + the file, and distribution when not linked into a combine + executable.) + + This file is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +#include + +/* Allow the use of VFP instructions */ +#if __ARM_ARCH >= 7 +.fpu vfp +#endif + +#ifndef __symbian__ + +#include "lib1funcs.asm" + +.macro UNPREFIX name + .global SYM (\name) + EQUIV SYM (\name), SYM (__\name) +.endm + +/* r0 points to a 16-word block. Upload these values to the actual core + state. */ +ARM_FUNC_START restore_core_regs + /* We must use sp as the base register when restoring sp. Push the + last 3 registers onto the top of the current stack to achieve + this. */ + add r1, r0, #52 + ldmia r1, {r3, r4, r5} /* {sp, lr, pc}. */ +#ifdef __INTERWORKING__ + /* Restore pc into ip. */ + mov r2, r5 + stmfd sp!, {r2, r3, r4} +#else + stmfd sp!, {r3, r4, r5} +#endif + /* Don't bother restoring ip. */ + ldmia r0, {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, fp} + /* Pop the three registers we pushed earlier. */ +#ifdef __INTERWORKING__ + ldmfd sp, {ip, sp, lr} + bx ip +#else + ldmfd sp, {sp, lr, pc} +#endif + FUNC_END restore_core_regs + UNPREFIX restore_core_regs + +/* Load VFP registers d0-d15 from the address in r0. */ +ARM_FUNC_START gnu_Unwind_Restore_VFP + /* Use the generic coprocessor form so that gas doesn't complain + on soft-float targets. */ +#if __ARM_ARCH >= 7 + fldmiax r0, {d0-d15} +#else + ldc p11,cr0,[r0],{0x21} /* fldmiax r0, {d0-d15} */ +#endif + RET + +/* Store VFR regsters d0-d15 to the address in r0. */ +ARM_FUNC_START gnu_Unwind_Save_VFP + /* Use the generic coprocessor form so that gas doesn't complain + on soft-float targets. */ +#if __ARM_ARCH >= 7 + fstmiax r0, {d0-d15} +#else + stc p11,cr0,[r0],{0x21} /* fstmiax r0, {d0-d15} */ +#endif + RET + +/* Wrappers to save core registers, then call the real routine. */ + +.macro UNWIND_WRAPPER name nargs + ARM_FUNC_START \name + /* Create a phase2_vrs structure. */ + /* Split reg push in two to ensure the correct value for sp. */ + stmfd sp!, {sp, lr, pc} + stmfd sp!, {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, fp, ip} + + /* Demand-save flags, plus an extra word for alignment. */ + mov r3, #0 + stmfd sp!, {r2, r3} + + /* Point r1 at the block. Pass r[0..nargs) unchanged. */ + add r\nargs, sp, #4 +#if defined(__thumb__) + /* Switch back to thumb mode to avoid interworking hassle. */ + adr ip, .L1_\name + orr ip, ip, #1 + bx ip + .thumb +.L1_\name: + bl SYM (__gnu\name) __PLT__ + ldr r3, [sp, #64] + add sp, #72 + bx r3 +#else + bl SYM (__gnu\name) __PLT__ + ldr lr, [sp, #64] + add sp, sp, #72 + RET +#endif + FUNC_END \name + UNPREFIX \name +.endm + +UNWIND_WRAPPER _Unwind_RaiseException 1 +UNWIND_WRAPPER _Unwind_Resume 1 +UNWIND_WRAPPER _Unwind_Resume_or_Rethrow 1 +UNWIND_WRAPPER _Unwind_ForcedUnwind 3 +UNWIND_WRAPPER _Unwind_Backtrace 2 + +#endif /* ndef __symbian__ */ Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Wed Jul 27 16:27:41 2016 (r303395) +++ head/gnu/lib/libgcc/Makefile Wed Jul 27 16:34:19 2016 (r303396) @@ -99,7 +99,7 @@ STATIC_CXXFLAGS+= -fvisibility=hidden -f .else # MK_LLVM_LIBUNWIND .if ${TARGET_CPUARCH} == "arm" -LIB2ADDEH = unwind-arm.c libunwind.S pr-support.c unwind-c.c +LIB2ADDEH = unwind-arm.c libunwind-arm.S pr-support.c unwind-c.c .else LIB2ADDEH = unwind-dw2.c unwind-dw2-fde-glibc.c unwind-sjlj.c gthr-gnat.c \ unwind-c.c From owner-svn-src-head@freebsd.org Wed Jul 27 17:11: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 7FD66BA6BE8; Wed, 27 Jul 2016 17:11:04 +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 357A51845; Wed, 27 Jul 2016 17:11:04 +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 u6RHB3tF012535; Wed, 27 Jul 2016 17:11:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RHB3uB012534; Wed, 27 Jul 2016 17:11:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201607271711.u6RHB3uB012534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 27 Jul 2016 17:11:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303399 - head/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.22 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, 27 Jul 2016 17:11:04 -0000 Author: markj Date: Wed Jul 27 17:11:03 2016 New Revision: 303399 URL: https://svnweb.freebsd.org/changeset/base/303399 Log: De-pluralize "queues" where appropriate in the pagedaemon code. MFC after: 1 week Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Wed Jul 27 17:10:09 2016 (r303398) +++ head/sys/vm/vm_pageout.c Wed Jul 27 17:11:03 2016 (r303399) @@ -885,7 +885,7 @@ vm_pageout_scan(struct vm_domain *vmd, i int act_delta, addl_page_shortage, deficit, error, maxlaunder, maxscan; int page_shortage, scan_tick, scanned, starting_page_shortage; int vnodes_skipped; - boolean_t pageout_ok, queues_locked; + boolean_t pageout_ok, queue_locked; /* * If we need to reclaim memory ask kernel caches to return @@ -952,12 +952,12 @@ vm_pageout_scan(struct vm_domain *vmd, i pq = &vmd->vmd_pagequeues[PQ_INACTIVE]; maxscan = pq->pq_cnt; vm_pagequeue_lock(pq); - queues_locked = TRUE; + queue_locked = TRUE; for (m = TAILQ_FIRST(&pq->pq_pl); m != NULL && maxscan-- > 0 && page_shortage > 0; m = next) { vm_pagequeue_assert_locked(pq); - KASSERT(queues_locked, ("unlocked queues")); + KASSERT(queue_locked, ("unlocked inactive queue")); KASSERT(m->queue == PQ_INACTIVE, ("Inactive queue %p", m)); PCPU_INC(cnt.v_pdpages); @@ -1027,7 +1027,7 @@ unlock_page: */ TAILQ_INSERT_AFTER(&pq->pq_pl, m, &vmd->vmd_marker, plinks.q); vm_pagequeue_unlock(pq); - queues_locked = FALSE; + queue_locked = FALSE; /* * Invalid pages can be easily freed. They cannot be @@ -1115,7 +1115,7 @@ free_page: m->flags |= PG_WINATCFLS; requeue_page: vm_pagequeue_lock(pq); - queues_locked = TRUE; + queue_locked = TRUE; vm_page_requeue_locked(m); } else if (maxlaunder > 0) { /* @@ -1153,15 +1153,15 @@ requeue_page: addl_page_shortage++; } vm_page_lock_assert(m, MA_NOTOWNED); - goto relock_queues; + goto relock_queue; } drop_page: vm_page_unlock(m); VM_OBJECT_WUNLOCK(object); -relock_queues: - if (!queues_locked) { +relock_queue: + if (!queue_locked) { vm_pagequeue_lock(pq); - queues_locked = TRUE; + queue_locked = TRUE; } next = TAILQ_NEXT(&vmd->vmd_marker, plinks.q); TAILQ_REMOVE(&pq->pq_pl, &vmd->vmd_marker, plinks.q); From owner-svn-src-head@freebsd.org Wed Jul 27 17:18: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 9502BBA6D79; Wed, 27 Jul 2016 17:18:09 +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 678561CCD; Wed, 27 Jul 2016 17:18:09 +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 u6RHI8jV015581; Wed, 27 Jul 2016 17:18:08 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RHI8Xg015580; Wed, 27 Jul 2016 17:18:08 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201607271718.u6RHI8Xg015580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 27 Jul 2016 17:18:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303400 - head/contrib/libcxxrt 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.22 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, 27 Jul 2016 17:18:09 -0000 Author: emaste Date: Wed Jul 27 17:18:08 2016 New Revision: 303400 URL: https://svnweb.freebsd.org/changeset/base/303400 Log: libcxxrt: fix demangling of wchar_t 'wchar_t' is 7 characters long, not 6. r303297 fixed this in libelftc, but not the second copy of this file that we have in libcxxrt. PR: 208661 Submitted by: Daniel McRobb Obtained from: ELF Tool Chain r3480 MFC after: 3 days Modified: head/contrib/libcxxrt/libelftc_dem_gnu3.c Modified: head/contrib/libcxxrt/libelftc_dem_gnu3.c ============================================================================== --- head/contrib/libcxxrt/libelftc_dem_gnu3.c Wed Jul 27 17:11:03 2016 (r303399) +++ head/contrib/libcxxrt/libelftc_dem_gnu3.c Wed Jul 27 17:18:08 2016 (r303400) @@ -2842,7 +2842,7 @@ again: case 'w': /* wchar_t */ - if (!cpp_demangle_push_str(ddata, "wchar_t", 6)) + if (!cpp_demangle_push_str(ddata, "wchar_t", 7)) goto clean; ++ddata->cur; goto rtn; From owner-svn-src-head@freebsd.org Wed Jul 27 18:12: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 85894BA6E60; Wed, 27 Jul 2016 18:12:37 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E89E1283; Wed, 27 Jul 2016 18:12:37 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6RICac0037687; Wed, 27 Jul 2016 18:12:36 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RICa1V037684; Wed, 27 Jul 2016 18:12:36 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201607271812.u6RICa1V037684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 27 Jul 2016 18:12:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303404 - in head: share/timedef tools/tools/locale/tools 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.22 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, 27 Jul 2016 18:12:37 -0000 Author: jkim Date: Wed Jul 27 18:12:36 2016 New Revision: 303404 URL: https://svnweb.freebsd.org/changeset/base/303404 Log: Add a hack to add weekday to date format for ko_KR locale. Modified: head/share/timedef/ko_KR.UTF-8.src head/share/timedef/ko_KR.eucKR.src head/tools/tools/locale/tools/cldr2def.pl Modified: head/share/timedef/ko_KR.UTF-8.src ============================================================================== --- head/share/timedef/ko_KR.UTF-8.src Wed Jul 27 17:55:40 2016 (r303403) +++ head/share/timedef/ko_KR.UTF-8.src Wed Jul 27 18:12:36 2016 (r303404) @@ -56,14 +56,14 @@ %y. %m. %e. # # c_fmt -%Y년 %m월 %e일 %p %I시 %M분 %S초 +%Y년 %m월 %e일 %A %p %I시 %M분 %S초 # # AM/PM 오전 오후 # # date_fmt -%Y년 %m월 %e일 %p %I시 %M분 %S초 %Z +%Y년 %m월 %e일 %A %p %I시 %M분 %S초 %Z # # Long month names (without case ending) 1월 Modified: head/share/timedef/ko_KR.eucKR.src ============================================================================== --- head/share/timedef/ko_KR.eucKR.src Wed Jul 27 17:55:40 2016 (r303403) +++ head/share/timedef/ko_KR.eucKR.src Wed Jul 27 18:12:36 2016 (r303404) @@ -56,14 +56,14 @@ %y. %m. %e. # # c_fmt -%Y %m %e %p %I %M %S +%Y %m %e %A %p %I %M %S # # AM/PM # # date_fmt -%Y %m %e %p %I %M %S %Z +%Y %m %e %A %p %I %M %S %Z # # Long month names (without case ending) 1 Modified: head/tools/tools/locale/tools/cldr2def.pl ============================================================================== --- head/tools/tools/locale/tools/cldr2def.pl Wed Jul 27 17:55:40 2016 (r303403) +++ head/tools/tools/locale/tools/cldr2def.pl Wed Jul 27 18:12:36 2016 (r303404) @@ -217,6 +217,9 @@ sub callback_cformat { my $s = shift; my $nl = $callback{data}{l} . "_" . $callback{data}{c}; + if ($nl eq 'ko_KR') { + $s =~ s/(> )(%p)/$1%A $2/; + } $s =~ s/\.,/\./; $s =~ s/ %Z//; $s =~ s/ %z//; @@ -240,7 +243,7 @@ sub callback_dtformat { if ($nl eq 'ja_JP') { $s =~ s/(> )(%H)/$1%A $2/; - } elsif ($nl eq 'zh_TW') { + } elsif ($nl eq 'ko_KR' || $nl eq 'zh_TW') { $s =~ s/(> )(%p)/$1%A $2/; } $s =~ s/\.,/\./; From owner-svn-src-head@freebsd.org Wed Jul 27 18:29: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 B0A35BA5328; Wed, 27 Jul 2016 18:29:36 +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 7CC391ABD; Wed, 27 Jul 2016 18:29:36 +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 u6RITZSL041715; Wed, 27 Jul 2016 18:29:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RITZlx041710; Wed, 27 Jul 2016 18:29:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201607271829.u6RITZlx041710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 27 Jul 2016 18:29:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303405 - in head/sys/dev/cxgbe: . tom 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.22 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, 27 Jul 2016 18:29:36 -0000 Author: jhb Date: Wed Jul 27 18:29:35 2016 New Revision: 303405 URL: https://svnweb.freebsd.org/changeset/base/303405 Log: Add support for zero-copy aio_write() on TOE sockets. AIO write requests for a TOE socket on a Chelsio T4+ adapter can now DMA directly from the user-supplied buffer. This is implemented by wiring the pages backing the user-supplied buffer and queueing special mbufs backed by raw VM pages to the socket buffer. The TOE code recognizes these special mbufs and builds a sglist from the VM page array associated with the mbuf when queueing a work request to the TOE. Because these mbufs do not have an associated virtual address, m_data is not valid. Thus, the AIO handler does not invoke sosend() directly for these mbufs but instead inlines portions of sosend_generic() and tcp_usr_send(). An aiotx_buffer structure is used to describe the user buffer (e.g. it holds the array of VM pages and a reference to the AIO job). The special mbufs reference this structure via m_ext. Note that a single job might be split across multiple mbufs (e.g. if it is larger than the socket buffer size). The 'ext_arg2' member of each mbuf gives an offset relative to the backing aiotx_buffer. The AIO job associated with an aiotx_buffer structure is completed when the last reference to the structure is released. Zero-copy aio_write()'s for connections associated with a given adapter can be enabled/disabled at runtime via the 'dev.t[45]nex.N.toe.tx_zcopy' sysctl. MFC after: 1 month Relnotes: yes Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/offload.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_tom.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/offload.h ============================================================================== --- head/sys/dev/cxgbe/offload.h Wed Jul 27 18:12:36 2016 (r303404) +++ head/sys/dev/cxgbe/offload.h Wed Jul 27 18:29:35 2016 (r303405) @@ -147,6 +147,7 @@ struct tom_tunables { int ddp; int rx_coalesce; int tx_align; + int tx_zcopy; }; #ifdef TCP_OFFLOAD Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Wed Jul 27 18:12:36 2016 (r303404) +++ head/sys/dev/cxgbe/t4_main.c Wed Jul 27 18:29:35 2016 (r303405) @@ -4864,6 +4864,11 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tx_align", CTLFLAG_RW, &sc->tt.tx_align, 0, "chop and align payload"); + sc->tt.tx_zcopy = 0; + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tx_zcopy", + CTLFLAG_RW, &sc->tt.tx_zcopy, 0, + "Enable zero-copy aio_write(2)"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "timer_tick", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_tp_tick, "A", "TP timer tick (us)"); Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Jul 27 18:12:36 2016 (r303404) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Jul 27 18:29:35 2016 (r303405) @@ -32,15 +32,18 @@ __FBSDID("$FreeBSD$"); #ifdef TCP_OFFLOAD #include -#include +#include +#include #include #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -51,6 +54,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include + +#include +#include +#include +#include +#include + #include "common/common.h" #include "common/t4_msg.h" #include "common/t4_regs.h" @@ -71,6 +82,34 @@ VNET_DECLARE(int, tcp_autorcvbuf_inc); VNET_DECLARE(int, tcp_autorcvbuf_max); #define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) +#define IS_AIOTX_MBUF(m) \ + ((m)->m_flags & M_EXT && (m)->m_ext.ext_flags & EXT_FLAG_AIOTX) + +static void t4_aiotx_cancel(struct kaiocb *job); +static void t4_aiotx_queue_toep(struct toepcb *toep); + +static size_t +aiotx_mbuf_pgoff(struct mbuf *m) +{ + struct aiotx_buffer *ab; + + MPASS(IS_AIOTX_MBUF(m)); + ab = m->m_ext.ext_arg1; + return ((ab->ps.offset + (uintptr_t)m->m_ext.ext_arg2) % PAGE_SIZE); +} + +static vm_page_t * +aiotx_mbuf_pages(struct mbuf *m) +{ + struct aiotx_buffer *ab; + int npages; + + MPASS(IS_AIOTX_MBUF(m)); + ab = m->m_ext.ext_arg1; + npages = (ab->ps.offset + (uintptr_t)m->m_ext.ext_arg2) / PAGE_SIZE; + return (ab->ps.pages + npages); +} + void send_flowc_wr(struct toepcb *toep, struct flowc_tx_params *ftxp) { @@ -519,7 +558,11 @@ write_tx_sgl(void *dst, struct mbuf *sta i = -1; for (m = start; m != stop; m = m->m_next) { - rc = sglist_append(&sg, mtod(m, void *), m->m_len); + if (IS_AIOTX_MBUF(m)) + rc = sglist_append_vmpages(&sg, aiotx_mbuf_pages(m), + aiotx_mbuf_pgoff(m), m->m_len); + else + rc = sglist_append(&sg, mtod(m, void *), m->m_len); if (__predict_false(rc != 0)) panic("%s: sglist_append %d", __func__, rc); @@ -579,6 +622,7 @@ t4_push_frames(struct adapter *sc, struc struct sockbuf *sb = &so->so_snd; int tx_credits, shove, compl, sowwakeup; struct ofld_tx_sdesc *txsd = &toep->txsd[toep->txsd_pidx]; + bool aiotx_mbuf_seen; INP_WLOCK_ASSERT(inp); KASSERT(toep->flags & TPF_FLOWC_WR_SENT, @@ -589,6 +633,10 @@ t4_push_frames(struct adapter *sc, struc toep->ulp_mode == ULP_MODE_RDMA, ("%s: ulp_mode %u for toep %p", __func__, toep->ulp_mode, toep)); +#ifdef VERBOSE_TRACES + CTR4(KTR_CXGBE, "%s: tid %d toep flags %#x tp flags %#x drop %d", + __func__, toep->tid, toep->flags, tp->t_flags); +#endif if (__predict_false(toep->flags & TPF_ABORT_SHUTDOWN)) return; @@ -618,8 +666,15 @@ t4_push_frames(struct adapter *sc, struc plen = 0; nsegs = 0; max_nsegs_1mbuf = 0; /* max # of SGL segments in any one mbuf */ + aiotx_mbuf_seen = false; for (m = sndptr; m != NULL; m = m->m_next) { - int n = sglist_count(mtod(m, void *), m->m_len); + int n; + + if (IS_AIOTX_MBUF(m)) + n = sglist_count_vmpages(aiotx_mbuf_pages(m), + aiotx_mbuf_pgoff(m), m->m_len); + else + n = sglist_count(mtod(m, void *), m->m_len); nsegs += n; plen += m->m_len; @@ -631,9 +686,13 @@ t4_push_frames(struct adapter *sc, struc if (plen == 0) { /* Too few credits */ toep->flags |= TPF_TX_SUSPENDED; - if (sowwakeup) + if (sowwakeup) { + if (!TAILQ_EMPTY( + &toep->aiotx_jobq)) + t4_aiotx_queue_toep( + toep); sowwakeup_locked(so); - else + } else SOCKBUF_UNLOCK(sb); SOCKBUF_UNLOCK_ASSERT(sb); return; @@ -641,6 +700,8 @@ t4_push_frames(struct adapter *sc, struc break; } + if (IS_AIOTX_MBUF(m)) + aiotx_mbuf_seen = true; if (max_nsegs_1mbuf < n) max_nsegs_1mbuf = n; sb_sndptr = m; /* new sb->sb_sndptr if all goes well */ @@ -670,9 +731,11 @@ t4_push_frames(struct adapter *sc, struc else sowwakeup = 1; /* room available */ } - if (sowwakeup) + if (sowwakeup) { + if (!TAILQ_EMPTY(&toep->aiotx_jobq)) + t4_aiotx_queue_toep(toep); sowwakeup_locked(so); - else + } else SOCKBUF_UNLOCK(sb); SOCKBUF_UNLOCK_ASSERT(sb); @@ -687,7 +750,7 @@ t4_push_frames(struct adapter *sc, struc panic("%s: excess tx.", __func__); shove = m == NULL && !(tp->t_flags & TF_MORETOCOME); - if (plen <= max_imm) { + if (plen <= max_imm && !aiotx_mbuf_seen) { /* Immediate data tx */ @@ -1616,6 +1679,9 @@ do_fw4_ack(struct sge_iq *iq, const stru } } +#ifdef VERBOSE_TRACES + CTR3(KTR_CXGBE, "%s: tid %d credits %u", __func__, tid, credits); +#endif so = inp->inp_socket; txsd = &toep->txsd[toep->txsd_cidx]; plen = 0; @@ -1642,6 +1708,10 @@ do_fw4_ack(struct sge_iq *iq, const stru if (toep->flags & TPF_TX_SUSPENDED && toep->tx_credits >= toep->tx_total / 4) { +#ifdef VERBOSE_TRACES + CTR2(KTR_CXGBE, "%s: tid %d calling t4_push_frames", __func__, + tid); +#endif toep->flags &= ~TPF_TX_SUSPENDED; if (toep->ulp_mode == ULP_MODE_ISCSI) t4_push_pdus(sc, toep, plen); @@ -1668,7 +1738,13 @@ do_fw4_ack(struct sge_iq *iq, const stru sowwakeup_locked(so); /* unlocks so_snd */ rqdrop_locked(&toep->ulp_pdu_reclaimq, plen); } else { +#ifdef VERBOSE_TRACES + CTR3(KTR_CXGBE, "%s: tid %d dropped %d bytes", __func__, + tid, plen); +#endif sbdrop_locked(sb, plen); + if (!TAILQ_EMPTY(&toep->aiotx_jobq)) + t4_aiotx_queue_toep(toep); sowwakeup_locked(so); /* unlocks so_snd */ } SOCKBUF_UNLOCK_ASSERT(sb); @@ -1768,4 +1844,397 @@ t4_uninit_cpl_io_handlers(void) t4_register_cpl_handler(CPL_RX_DATA, do_rx_data); t4_register_cpl_handler(CPL_FW4_ACK, do_fw4_ack); } + +/* + * Use the 'backend3' field in AIO jobs to store the amount of data + * sent by the AIO job so far and the 'backend4' field to hold an + * error that should be reported when the job is completed. + */ +#define aio_sent backend3 +#define aio_error backend4 + +#define jobtotid(job) \ + (((struct toepcb *)(so_sototcpcb((job)->fd_file->f_data)->t_toe))->tid) + +static void +free_aiotx_buffer(struct aiotx_buffer *ab) +{ + struct kaiocb *job; + long status; + int error; + + if (refcount_release(&ab->refcount) == 0) + return; + + job = ab->job; + error = job->aio_error; + status = job->aio_sent; + vm_page_unhold_pages(ab->ps.pages, ab->ps.npages); + free(ab, M_CXGBE); +#ifdef VERBOSE_TRACES + CTR5(KTR_CXGBE, "%s: tid %d completed %p len %ld, error %d", __func__, + jobtotid(job), job, status, error); +#endif + if (error == ECANCELED && status != 0) + error = 0; + if (error == ECANCELED) + aio_cancel(job); + else if (error) + aio_complete(job, -1, error); + else + aio_complete(job, status, 0); +} + +static void +t4_aiotx_mbuf_free(struct mbuf *m, void *buffer, void *arg) +{ + struct aiotx_buffer *ab = buffer; + +#ifdef VERBOSE_TRACES + CTR3(KTR_CXGBE, "%s: completed %d bytes for tid %d", __func__, + m->m_len, jobtotid(ab->job)); +#endif + free_aiotx_buffer(ab); +} + +/* + * Hold the buffer backing an AIO request and return an AIO transmit + * buffer. + */ +static int +hold_aio(struct kaiocb *job) +{ + struct aiotx_buffer *ab; + struct vmspace *vm; + vm_map_t map; + vm_offset_t start, end, pgoff; + int n; + + MPASS(job->backend1 == NULL); + + /* + * The AIO subsystem will cancel and drain all requests before + * permitting a process to exit or exec, so p_vmspace should + * be stable here. + */ + vm = job->userproc->p_vmspace; + map = &vm->vm_map; + start = (uintptr_t)job->uaiocb.aio_buf; + pgoff = start & PAGE_MASK; + end = round_page(start + job->uaiocb.aio_nbytes); + start = trunc_page(start); + n = atop(end - start); + + ab = malloc(sizeof(*ab) + n * sizeof(vm_page_t), M_CXGBE, M_WAITOK | + M_ZERO); + refcount_init(&ab->refcount, 1); + ab->ps.pages = (vm_page_t *)(ab + 1); + ab->ps.npages = vm_fault_quick_hold_pages(map, start, end - start, + VM_PROT_WRITE, ab->ps.pages, n); + if (ab->ps.npages < 0) { + free(ab, M_CXGBE); + return (EFAULT); + } + + KASSERT(ab->ps.npages == n, + ("hold_aio: page count mismatch: %d vs %d", ab->ps.npages, n)); + + ab->ps.offset = pgoff; + ab->ps.len = job->uaiocb.aio_nbytes; + ab->job = job; + job->backend1 = ab; +#ifdef VERBOSE_TRACES + CTR5(KTR_CXGBE, "%s: tid %d, new pageset %p for job %p, npages %d", + __func__, jobtotid(job), &ab->ps, job, ab->ps.npages); +#endif + return (0); +} + +static void +t4_aiotx_process_job(struct toepcb *toep, struct socket *so, struct kaiocb *job) +{ + struct adapter *sc; + struct sockbuf *sb; + struct file *fp; + struct aiotx_buffer *ab; + struct inpcb *inp; + struct tcpcb *tp; + struct mbuf *m; + int error; + bool moretocome, sendmore; + + sc = td_adapter(toep->td); + sb = &so->so_snd; + SOCKBUF_UNLOCK(sb); + fp = job->fd_file; + ab = job->backend1; + m = NULL; + +#ifdef MAC + error = mac_socket_check_send(fp->f_cred, so); + if (error != 0) + goto out; +#endif + + if (ab == NULL) { + error = hold_aio(job); + if (error != 0) + goto out; + ab = job->backend1; + } + + /* Inline sosend_generic(). */ + + job->msgsnd = 1; + + error = sblock(sb, SBL_WAIT); + MPASS(error == 0); + +sendanother: + m = m_get(M_WAITOK, MT_DATA); + + SOCKBUF_LOCK(sb); + if (so->so_snd.sb_state & SBS_CANTSENDMORE) { + SOCKBUF_UNLOCK(sb); + sbunlock(sb); + if ((so->so_options & SO_NOSIGPIPE) == 0) { + PROC_LOCK(job->userproc); + kern_psignal(job->userproc, SIGPIPE); + PROC_UNLOCK(job->userproc); + } + error = EPIPE; + goto out; + } + if (so->so_error) { + error = so->so_error; + so->so_error = 0; + SOCKBUF_UNLOCK(sb); + sbunlock(sb); + goto out; + } + if ((so->so_state & SS_ISCONNECTED) == 0) { + SOCKBUF_UNLOCK(sb); + sbunlock(sb); + error = ENOTCONN; + goto out; + } + if (sbspace(sb) < sb->sb_lowat) { + MPASS(job->aio_sent == 0 || !(so->so_state & SS_NBIO)); + + /* + * Don't block if there is too little room in the socket + * buffer. Instead, requeue the request. + */ + if (!aio_set_cancel_function(job, t4_aiotx_cancel)) { + SOCKBUF_UNLOCK(sb); + sbunlock(sb); + error = ECANCELED; + goto out; + } + TAILQ_INSERT_HEAD(&toep->aiotx_jobq, job, list); + SOCKBUF_UNLOCK(sb); + sbunlock(sb); + goto out; + } + + /* + * Write as much data as the socket permits, but no more than a + * a single sndbuf at a time. + */ + m->m_len = sbspace(sb); + if (m->m_len > ab->ps.len - job->aio_sent) { + m->m_len = ab->ps.len - job->aio_sent; + moretocome = false; + } else + moretocome = true; + if (m->m_len > sc->tt.sndbuf) { + m->m_len = sc->tt.sndbuf; + sendmore = true; + } else + sendmore = false; + + if (!TAILQ_EMPTY(&toep->aiotx_jobq)) + moretocome = true; + SOCKBUF_UNLOCK(sb); + MPASS(m->m_len != 0); + + /* Inlined tcp_usr_send(). */ + + inp = toep->inp; + INP_WLOCK(inp); + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { + INP_WUNLOCK(inp); + sbunlock(sb); + error = ECONNRESET; + goto out; + } + + refcount_acquire(&ab->refcount); + m_extadd(m, NULL, ab->ps.len, t4_aiotx_mbuf_free, ab, + (void *)(uintptr_t)job->aio_sent, 0, EXT_NET_DRV); + m->m_ext.ext_flags |= EXT_FLAG_AIOTX; + job->aio_sent += m->m_len; + + sbappendstream(sb, m, 0); + m = NULL; + + if (!(inp->inp_flags & INP_DROPPED)) { + tp = intotcpcb(inp); + if (moretocome) + tp->t_flags |= TF_MORETOCOME; + error = tp->t_fb->tfb_tcp_output(tp); + if (moretocome) + tp->t_flags &= ~TF_MORETOCOME; + } + + INP_WUNLOCK(inp); + if (sendmore) + goto sendanother; + sbunlock(sb); + + if (error) + goto out; + + /* + * If this is a non-blocking socket and the request has not + * been fully completed, requeue it until the socket is ready + * again. + */ + if (job->aio_sent < job->uaiocb.aio_nbytes && + !(so->so_state & SS_NBIO)) { + SOCKBUF_LOCK(sb); + if (!aio_set_cancel_function(job, t4_aiotx_cancel)) { + SOCKBUF_UNLOCK(sb); + error = ECANCELED; + goto out; + } + TAILQ_INSERT_HEAD(&toep->aiotx_jobq, job, list); + return; + } + + /* + * If the request will not be requeued, drop a reference on + * the the aiotx buffer. Any mbufs in flight should still + * contain a reference, but this drops the reference that the + * job owns while it is waiting to queue mbufs to the socket. + */ + free_aiotx_buffer(ab); + +out: + if (error) { + if (ab != NULL) { + job->aio_error = error; + free_aiotx_buffer(ab); + } else { + MPASS(job->aio_sent == 0); + aio_complete(job, -1, error); + } + } + if (m != NULL) + m_free(m); + SOCKBUF_LOCK(sb); +} + +static void +t4_aiotx_task(void *context, int pending) +{ + struct toepcb *toep = context; + struct inpcb *inp = toep->inp; + struct socket *so = inp->inp_socket; + struct kaiocb *job; + + CURVNET_SET(so->so_vnet); + SOCKBUF_LOCK(&so->so_snd); + while (!TAILQ_EMPTY(&toep->aiotx_jobq) && sowriteable(so)) { + job = TAILQ_FIRST(&toep->aiotx_jobq); + TAILQ_REMOVE(&toep->aiotx_jobq, job, list); + if (!aio_clear_cancel_function(job)) + continue; + + t4_aiotx_process_job(toep, so, job); + } + toep->aiotx_task_active = false; + SOCKBUF_UNLOCK(&so->so_snd); + CURVNET_RESTORE(); + + free_toepcb(toep); +} + +static void +t4_aiotx_queue_toep(struct toepcb *toep) +{ + + SOCKBUF_LOCK_ASSERT(&toep->inp->inp_socket->so_snd); +#ifdef VERBOSE_TRACES + CTR3(KTR_CXGBE, "%s: queueing aiotx task for tid %d, active = %s", + __func__, toep->tid, toep->aiotx_task_active ? "true" : "false"); +#endif + if (toep->aiotx_task_active) + return; + toep->aiotx_task_active = true; + hold_toepcb(toep); + soaio_enqueue(&toep->aiotx_task); +} + +static void +t4_aiotx_cancel(struct kaiocb *job) +{ + struct aiotx_buffer *ab; + struct socket *so; + struct sockbuf *sb; + struct tcpcb *tp; + struct toepcb *toep; + + so = job->fd_file->f_data; + tp = so_sototcpcb(so); + toep = tp->t_toe; + MPASS(job->uaiocb.aio_lio_opcode == LIO_WRITE); + sb = &so->so_snd; + + SOCKBUF_LOCK(sb); + if (!aio_cancel_cleared(job)) + TAILQ_REMOVE(&toep->aiotx_jobq, job, list); + SOCKBUF_UNLOCK(sb); + + ab = job->backend1; + if (ab != NULL) + free_aiotx_buffer(ab); + else + aio_cancel(job); +} + +int +t4_aio_queue_aiotx(struct socket *so, struct kaiocb *job) +{ + struct tcpcb *tp = so_sototcpcb(so); + struct toepcb *toep = tp->t_toe; + struct adapter *sc = td_adapter(toep->td); + + /* This only handles writes. */ + if (job->uaiocb.aio_lio_opcode != LIO_WRITE) + return (EOPNOTSUPP); + + if (!sc->tt.tx_zcopy) + return (EOPNOTSUPP); + + SOCKBUF_LOCK(&so->so_snd); +#ifdef VERBOSE_TRACES + CTR2(KTR_CXGBE, "%s: queueing %p", __func__, job); +#endif + if (!aio_set_cancel_function(job, t4_aiotx_cancel)) + panic("new job was cancelled"); + TAILQ_INSERT_TAIL(&toep->aiotx_jobq, job, list); + if (sowriteable(so)) + t4_aiotx_queue_toep(toep); + SOCKBUF_UNLOCK(&so->so_snd); + return (0); +} + +void +aiotx_init_toep(struct toepcb *toep) +{ + + TAILQ_INIT(&toep->aiotx_jobq); + TASK_INIT(&toep->aiotx_task, 0, t4_aiotx_task, toep); +} #endif Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Wed Jul 27 18:12:36 2016 (r303404) +++ head/sys/dev/cxgbe/tom/t4_tom.c Wed Jul 27 18:29:35 2016 (r303405) @@ -68,11 +68,11 @@ __FBSDID("$FreeBSD$"); #include "tom/t4_tom_l2t.h" #include "tom/t4_tom.h" -static struct protosw ddp_protosw; -static struct pr_usrreqs ddp_usrreqs; +static struct protosw toe_protosw; +static struct pr_usrreqs toe_usrreqs; -static struct protosw ddp6_protosw; -static struct pr_usrreqs ddp6_usrreqs; +static struct protosw toe6_protosw; +static struct pr_usrreqs toe6_usrreqs; /* Module ops */ static int t4_tom_mod_load(void); @@ -167,6 +167,7 @@ alloc_toepcb(struct vi_info *vi, int txq toep->txsd_avail = txsd_total; toep->txsd_pidx = 0; toep->txsd_cidx = 0; + aiotx_init_toep(toep); ddp_init_toep(toep); return (toep); @@ -217,12 +218,10 @@ offload_socket(struct socket *so, struct sb = &so->so_rcv; SOCKBUF_LOCK(sb); sb->sb_flags |= SB_NOCOALESCE; - if (toep->ulp_mode == ULP_MODE_TCPDDP) { - if (inp->inp_vflag & INP_IPV6) - so->so_proto = &ddp6_protosw; - else - so->so_proto = &ddp_protosw; - } + if (inp->inp_vflag & INP_IPV6) + so->so_proto = &toe6_protosw; + else + so->so_proto = &toe_protosw; SOCKBUF_UNLOCK(sb); /* Update TCP PCB */ @@ -1120,6 +1119,22 @@ t4_tom_ifaddr_event(void *arg __unused, } static int +t4_aio_queue_tom(struct socket *so, struct kaiocb *job) +{ + struct tcpcb *tp = so_sototcpcb(so); + struct toepcb *toep = tp->t_toe; + int error; + + if (toep->ulp_mode == ULP_MODE_TCPDDP) { + error = t4_aio_queue_ddp(so, job); + if (error != EOPNOTSUPP) + return (error); + } + + return (t4_aio_queue_aiotx(so, job)); +} + +static int t4_tom_mod_load(void) { int rc; @@ -1137,18 +1152,18 @@ t4_tom_mod_load(void) tcp_protosw = pffindproto(PF_INET, IPPROTO_TCP, SOCK_STREAM); if (tcp_protosw == NULL) return (ENOPROTOOPT); - bcopy(tcp_protosw, &ddp_protosw, sizeof(ddp_protosw)); - bcopy(tcp_protosw->pr_usrreqs, &ddp_usrreqs, sizeof(ddp_usrreqs)); - ddp_usrreqs.pru_aio_queue = t4_aio_queue_ddp; - ddp_protosw.pr_usrreqs = &ddp_usrreqs; + bcopy(tcp_protosw, &toe_protosw, sizeof(toe_protosw)); + bcopy(tcp_protosw->pr_usrreqs, &toe_usrreqs, sizeof(toe_usrreqs)); + toe_usrreqs.pru_aio_queue = t4_aio_queue_tom; + toe_protosw.pr_usrreqs = &toe_usrreqs; tcp6_protosw = pffindproto(PF_INET6, IPPROTO_TCP, SOCK_STREAM); if (tcp6_protosw == NULL) return (ENOPROTOOPT); - bcopy(tcp6_protosw, &ddp6_protosw, sizeof(ddp6_protosw)); - bcopy(tcp6_protosw->pr_usrreqs, &ddp6_usrreqs, sizeof(ddp6_usrreqs)); - ddp6_usrreqs.pru_aio_queue = t4_aio_queue_ddp; - ddp6_protosw.pr_usrreqs = &ddp6_usrreqs; + bcopy(tcp6_protosw, &toe6_protosw, sizeof(toe6_protosw)); + bcopy(tcp6_protosw->pr_usrreqs, &toe6_usrreqs, sizeof(toe6_usrreqs)); + toe6_usrreqs.pru_aio_queue = t4_aio_queue_tom; + toe6_protosw.pr_usrreqs = &toe6_usrreqs; TIMEOUT_TASK_INIT(taskqueue_thread, &clip_task, 0, t4_clip_task, NULL); ifaddr_evhandler = EVENTHANDLER_REGISTER(ifaddr_event, Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Wed Jul 27 18:12:36 2016 (r303404) +++ head/sys/dev/cxgbe/tom/t4_tom.h Wed Jul 27 18:29:35 2016 (r303405) @@ -102,6 +102,8 @@ TAILQ_HEAD(pagesetq, pageset); #define PS_WIRED 0x0001 /* Pages wired rather than held. */ #define PS_PPODS_WRITTEN 0x0002 /* Page pods written to the card. */ +#define EXT_FLAG_AIOTX EXT_FLAG_VENDOR1 + struct ddp_buffer { struct pageset *ps; @@ -109,6 +111,12 @@ struct ddp_buffer { int cancel_pending; }; +struct aiotx_buffer { + struct pageset ps; + struct kaiocb *job; + int refcount; +}; + struct toepcb { TAILQ_ENTRY(toepcb) link; /* toep_list */ u_int flags; /* miscellaneous flags */ @@ -151,6 +159,10 @@ struct toepcb { struct kaiocb *ddp_queueing; struct mtx ddp_lock; + TAILQ_HEAD(, kaiocb) aiotx_jobq; + struct task aiotx_task; + bool aiotx_task_active; + /* Tx software descriptor */ uint8_t txsd_total; uint8_t txsd_pidx; @@ -313,6 +325,8 @@ int do_abort_rpl_synqe(struct sge_iq *, void t4_offload_socket(struct toedev *, void *, struct socket *); /* t4_cpl_io.c */ +void aiotx_init_toep(struct toepcb *); +int t4_aio_queue_aiotx(struct socket *, struct kaiocb *); void t4_init_cpl_io_handlers(void); void t4_uninit_cpl_io_handlers(void); void send_abort_rpl(struct adapter *, struct sge_wrq *, int , int); From owner-svn-src-head@freebsd.org Wed Jul 27 19:22: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 01B49BA5EC7; Wed, 27 Jul 2016 19:22:14 +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 D19E612FF; Wed, 27 Jul 2016 19:22:13 +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 E56A1B999; Wed, 27 Jul 2016 15:22:12 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303405 - in head/sys/dev/cxgbe: . tom Date: Wed, 27 Jul 2016 12:11:06 -0700 Message-ID: <3422795.rot3cCl2OH@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201607271829.u6RITZlx041710@repo.freebsd.org> References: <201607271829.u6RITZlx041710@repo.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); Wed, 27 Jul 2016 15:22:13 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 27 Jul 2016 19:22:14 -0000 On Wednesday, July 27, 2016 06:29:35 PM John Baldwin wrote: > Author: jhb > Date: Wed Jul 27 18:29:35 2016 > New Revision: 303405 > URL: https://svnweb.freebsd.org/changeset/base/303405 > > Log: > Add support for zero-copy aio_write() on TOE sockets. > > AIO write requests for a TOE socket on a Chelsio T4+ adapter can now > DMA directly from the user-supplied buffer. This is implemented by > wiring the pages backing the user-supplied buffer and queueing special > mbufs backed by raw VM pages to the socket buffer. The TOE code > recognizes these special mbufs and builds a sglist from the VM page > array associated with the mbuf when queueing a work request to the TOE. > > Because these mbufs do not have an associated virtual address, m_data > is not valid. Thus, the AIO handler does not invoke sosend() directly > for these mbufs but instead inlines portions of sosend_generic() and > tcp_usr_send(). > > An aiotx_buffer structure is used to describe the user buffer (e.g. > it holds the array of VM pages and a reference to the AIO job). The > special mbufs reference this structure via m_ext. Note that a single > job might be split across multiple mbufs (e.g. if it is larger than > the socket buffer size). The 'ext_arg2' member of each mbuf gives an > offset relative to the backing aiotx_buffer. The AIO job associated > with an aiotx_buffer structure is completed when the last reference to > the structure is released. > > Zero-copy aio_write()'s for connections associated with a given > adapter can be enabled/disabled at runtime via the > 'dev.t[45]nex.N.toe.tx_zcopy' sysctl. In theory if our stack was able to safely cope with unmapped buffers, this could be used for aio_write() on sockets in general rather than only with TOE engines (in particular it is probably safe on adapters with checksum offload enabled assuming you aren't using some sort of packet filter that wants to inspect packet payloads rather than just headers). Compared to the changes for zerocopy receive with TOE, these are simpler and also less dramatic in terms of performance. For benchmarking I used netperf's TCP_STREAM (write(2) and aio_write(2)) and TCP_SENDFILE (sendfile(2)) tests comparing CPU usage and throughput. Without TOE, write(2) uses 138-158% of a single CPU, sendfile(2) uses 117-145%, and aio_write(2) uses 139-202% to send a single 40G stream. At the default write size (32k) for netperf, aio_write() and write() have the largest divergence, but for other write sizes I tested (256k, 512k, 1m) they were within a few percentage points of each other. Enabling TOE reduced CPU usage for all three (in this case zero-copy aio_write() is not enabled): write(2) - 81-87%, sendfile(2) - 58-69%, aio_write(2) - 83-142%. Again, aio_write() was comparable for larger write sizes, but diverged from write(2) for 32k writes. One other thing to note however, is that the sendfile(2) test did not achieve full 40G with 32k and 256k write sizes. The larger tests sizes that did achieve 40G with sendfile(2) used 66-69% CPU. The zero-copy aio_write(2) with TOE used 23-54% of a single core. As with sendfile(2), the 32k write size did not achieve 40G. The remaining test sizes that did used 23-24%. There are still some wrinkles I need to iron out with the zero-copy case. In certain edge cases I can force it to transmit a dismally low 1G or so instead of 40G, but only if socket buffer autosizing is enabled. The reason smaller write sizes don't get to line rate with sendfile/aio_write (I think) is that non-zero copy writes can accumulate data from multiple calls into the socket buffer allowing the socket buffer autosizing code to notice and kick in sooner / faster. One could ameliorate this by queueing more writes, though queueing larger writes has the same effect and probably less overhead. -- John Baldwin From owner-svn-src-head@freebsd.org Wed Jul 27 19:31: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 B1735BA618A; Wed, 27 Jul 2016 19:31:26 +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 830301959; Wed, 27 Jul 2016 19:31:26 +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 u6RJVPUL064152; Wed, 27 Jul 2016 19:31:25 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RJVPUf064151; Wed, 27 Jul 2016 19:31:25 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201607271931.u6RJVPUf064151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 27 Jul 2016 19:31:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303406 - 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.22 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, 27 Jul 2016 19:31:26 -0000 Author: jhb Date: Wed Jul 27 19:31:25 2016 New Revision: 303406 URL: https://svnweb.freebsd.org/changeset/base/303406 Log: Adjust tests in fsync job scheduling loop to reduce indentation. Modified: head/sys/kern/vfs_aio.c Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Wed Jul 27 18:29:35 2016 (r303405) +++ head/sys/kern/vfs_aio.c Wed Jul 27 19:31:25 2016 (r303406) @@ -913,18 +913,16 @@ notification_done: if (job->jobflags & KAIOCB_CHECKSYNC) { schedule_fsync = false; TAILQ_FOREACH_SAFE(sjob, &ki->kaio_syncqueue, list, sjobn) { - if (job->fd_file == sjob->fd_file && - job->seqno < sjob->seqno) { - if (--sjob->pending == 0) { - TAILQ_REMOVE(&ki->kaio_syncqueue, sjob, - list); - if (!aio_clear_cancel_function(sjob)) - continue; - TAILQ_INSERT_TAIL(&ki->kaio_syncready, - sjob, list); - schedule_fsync = true; - } - } + if (job->fd_file != sjob->fd_file || + job->seqno >= sjob->seqno) + continue; + if (--sjob->pending > 0) + continue; + TAILQ_REMOVE(&ki->kaio_syncqueue, sjob, list); + if (!aio_clear_cancel_function(sjob)) + continue; + TAILQ_INSERT_TAIL(&ki->kaio_syncready, sjob, list); + schedule_fsync = true; } if (schedule_fsync) taskqueue_enqueue(taskqueue_aiod_kick, From owner-svn-src-head@freebsd.org Wed Jul 27 19:44: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 1B643BA6833; Wed, 27 Jul 2016 19:44:53 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::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 D9C3A183B; Wed, 27 Jul 2016 19:44:52 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x233.google.com with SMTP id b62so79980036iod.3; Wed, 27 Jul 2016 12:44:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=H9rhgFC2elknqbUzHBLOGCGBtdJRXdxey2lDayd0Hpc=; b=i66JB/DUsc1AS1RwUzr4HF1WLK5tr/LnrnBlbjdKX4hW9yLREyKhGvIcElHWVk1J7b G6xymaOjy703xgAlToDiUY73zkGUW6HIpT2x4VZyDgciWyOclWXdHPS3Ldv4WCl7aiFK Nh4dCyAscgv4Ty1dIHQxZKGE9G1bzVFAetWxtaLnWUD2P1GMZPDe/LRlJHawek7IDxww znqpJUZu4IgwBSJ+AvBwPbvW8jE3+oimhNY57ioewN9J0rk/Q43P1pOMkqI8qONckej1 X5BWdx7PJdfnSGd02XrRwnQVww51Gaw8CwHayodfd6bik5B4BFswrRx3g/LpAVBpDNc5 M3og== 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:from:date :message-id:subject:to:cc; bh=H9rhgFC2elknqbUzHBLOGCGBtdJRXdxey2lDayd0Hpc=; b=XLJ9IfJ1FtaSrzxgb9R0RN2BY/HvNxzcChsmUj/Ly8RViCteVHNEDDPeiadk8CUUy0 dIB3VAJomxZgUL7q3cD+iKoC5Kj+ceu/2ntlXCVWNdywb3m0EC+++QtS0n37k17hDki0 jKLzr/arrES/hrXVhZpgeSlLM2KXsTJsU57jGaHaUcnU/3NelrJ679i3XekV5AcVQ0k4 iiES1K5HOriFAAQVasI6vnriorCTV3dluOt4YG+fVzq3v10fKjzcBzrjoy/2BVdyjRg+ amGSWvzrv/VbMpwBJZNBQT3IbZ7hIo5DcZRIpa25vdVN2BtyukO1ftvVYjRo9UbzUHc2 RJnQ== X-Gm-Message-State: AEkoout24VdiGUuUZidIa8xHg+qfjjP1KreWLk4sTctRv9X1Bet2Xq9qoRflkJ9h4nB/HBvTep1PEYN9sOjE8w== X-Received: by 10.107.15.157 with SMTP id 29mr33161186iop.123.1469648692155; Wed, 27 Jul 2016 12:44:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.141.129 with HTTP; Wed, 27 Jul 2016 12:44:51 -0700 (PDT) In-Reply-To: <3422795.rot3cCl2OH@ralph.baldwin.cx> References: <201607271829.u6RITZlx041710@repo.freebsd.org> <3422795.rot3cCl2OH@ralph.baldwin.cx> From: Adrian Chadd Date: Wed, 27 Jul 2016 12:44:51 -0700 Message-ID: Subject: Re: svn commit: r303405 - in head/sys/dev/cxgbe: . tom To: John Baldwin 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.22 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, 27 Jul 2016 19:44:53 -0000 [snip] When we had my kqueue sendfile stuff in tree to handle notifications, I was getting 40g across what, 64k sockets on 8 cores using SHM sendfile + kqueue sendfile completion. it worked pretty well. One core could get 40g if I pre-seeded enough data into it (ie, multiple sendfile transactions on a socket) so I kept the socket buffer full. Otherwise there'd be dead time where the socket buffer was empty. It was very sensitive to the TCP segment size - ie, if for some reason the TCP TX path passed up less than 32k chunks, it would end up chewing way too much CPU in tcp_output(). That was very sensitive to the TX write() size and latency to the receiver. It wasn't running out of data either; it was just some side effect of how big the writes were and how quickly the TX socket buffer was being topped off. I .. well, never got to finish instrumenting the full relationship going on there (between TSO and buffer sizes/latency) to see if that could be better engineered so we always kept the TSO full if we could. -adrian From owner-svn-src-head@freebsd.org Wed Jul 27 20:28: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 C37D1BA6F29; Wed, 27 Jul 2016 20:28:29 +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 9637C1CC8; Wed, 27 Jul 2016 20:28:29 +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 u6RKSSrF086226; Wed, 27 Jul 2016 20:28:28 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RKSSkC086225; Wed, 27 Jul 2016 20:28:28 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201607272028.u6RKSSkC086225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 27 Jul 2016 20:28:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303410 - head/usr.sbin 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.22 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, 27 Jul 2016 20:28:29 -0000 Author: bdrewery Date: Wed Jul 27 20:28:28 2016 New Revision: 303410 URL: https://svnweb.freebsd.org/changeset/base/303410 Log: Reconnect pmcstudy, lost in r291021 Reported by: pluknet MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Wed Jul 27 19:41:07 2016 (r303409) +++ head/usr.sbin/Makefile Wed Jul 27 20:28:28 2016 (r303410) @@ -181,6 +181,7 @@ SUBDIR.${MK_PKGBOOTSTRAP}+= pkg SUBDIR.${MK_PMC}+= pmcannotate SUBDIR.${MK_PMC}+= pmccontrol SUBDIR.${MK_PMC}+= pmcstat +SUBDIR.${MK_PMC}+= pmcstudy SUBDIR.${MK_PORTSNAP}+= portsnap SUBDIR.${MK_PPP}+= ppp SUBDIR.${MK_QUOTAS}+= edquota From owner-svn-src-head@freebsd.org Wed Jul 27 20:34: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 68A74BA63AA; Wed, 27 Jul 2016 20:34:11 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 256391305; Wed, 27 Jul 2016 20:34:11 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6RKYAN3089716; Wed, 27 Jul 2016 20:34:10 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RKY9nd089710; Wed, 27 Jul 2016 20:34:09 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201607272034.u6RKY9nd089710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Wed, 27 Jul 2016 20:34:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303411 - in head/sys: conf kern netinet netinet6 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.22 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, 27 Jul 2016 20:34:11 -0000 Author: stevek Date: Wed Jul 27 20:34:09 2016 New Revision: 303411 URL: https://svnweb.freebsd.org/changeset/base/303411 Log: Prepare for network stack as a module - Move cr_canseeinpcb to sys/netinet/in_prot.c in order to separate the INET and INET6-specific code from the rest of the prot code (It is only used by the network stack, so it makes sense for it to live with the other network stack code.) - Move cr_canseeinpcb prototype from sys/systm.h to netinet/in_systm.h - Rename cr_seeotheruids to cr_canseeotheruids and cr_seeothergids to cr_canseeothergids, make them non-static, and add prototypes (so they can be seen/called by in_prot.c functions.) - Remove sw_csum variable from ip6_forward in ip6_forward.c, as it is an unused variable. Reviewed by: gnn, jtl Approved by: sjg (mentor) Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D2901 Added: head/sys/netinet/in_prot.c (contents, props changed) Modified: head/sys/conf/files head/sys/kern/kern_prot.c head/sys/netinet/in_systm.h head/sys/netinet6/ip6_forward.c head/sys/sys/systm.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Jul 27 20:28:28 2016 (r303410) +++ head/sys/conf/files Wed Jul 27 20:34:09 2016 (r303411) @@ -3750,6 +3750,7 @@ netinet/ip_id.c optional inet netinet/in_mcast.c optional inet netinet/in_pcb.c optional inet | inet6 netinet/in_pcbgroup.c optional inet pcbgroup | inet6 pcbgroup +netinet/in_prot.c optional inet | inet6 netinet/in_proto.c optional inet | inet6 netinet/in_rmx.c optional inet netinet/in_rss.c optional inet rss Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Wed Jul 27 20:28:28 2016 (r303410) +++ head/sys/kern/kern_prot.c Wed Jul 27 20:34:09 2016 (r303411) @@ -76,11 +76,6 @@ FEATURE(regression, "Kernel support for interfaces necessary for regression testing (SECURITY RISK!)"); #endif -#if defined(INET) || defined(INET6) -#include -#include -#endif - #include #include @@ -1342,8 +1337,8 @@ SYSCTL_INT(_security_bsd, OID_AUTO, see_ * References: *u1 and *u2 must not change during the call * u1 may equal u2, in which case only one reference is required */ -static int -cr_seeotheruids(struct ucred *u1, struct ucred *u2) +int +cr_canseeotheruids(struct ucred *u1, struct ucred *u2) { if (!see_other_uids && u1->cr_ruid != u2->cr_ruid) { @@ -1372,8 +1367,8 @@ SYSCTL_INT(_security_bsd, OID_AUTO, see_ * References: *u1 and *u2 must not change during the call * u1 may equal u2, in which case only one reference is required */ -static int -cr_seeothergids(struct ucred *u1, struct ucred *u2) +int +cr_canseeothergids(struct ucred *u1, struct ucred *u2) { int i, match; @@ -1411,9 +1406,9 @@ cr_cansee(struct ucred *u1, struct ucred if ((error = mac_cred_check_visible(u1, u2))) return (error); #endif - if ((error = cr_seeotheruids(u1, u2))) + if ((error = cr_canseeotheruids(u1, u2))) return (error); - if ((error = cr_seeothergids(u1, u2))) + if ((error = cr_canseeothergids(u1, u2))) return (error); return (0); } @@ -1472,9 +1467,9 @@ cr_cansignal(struct ucred *cred, struct if ((error = mac_proc_check_signal(cred, proc, signum))) return (error); #endif - if ((error = cr_seeotheruids(cred, proc->p_ucred))) + if ((error = cr_canseeotheruids(cred, proc->p_ucred))) return (error); - if ((error = cr_seeothergids(cred, proc->p_ucred))) + if ((error = cr_canseeothergids(cred, proc->p_ucred))) return (error); /* @@ -1589,9 +1584,9 @@ p_cansched(struct thread *td, struct pro if ((error = mac_proc_check_sched(td->td_ucred, p))) return (error); #endif - if ((error = cr_seeotheruids(td->td_ucred, p->p_ucred))) + if ((error = cr_canseeotheruids(td->td_ucred, p->p_ucred))) return (error); - if ((error = cr_seeothergids(td->td_ucred, p->p_ucred))) + if ((error = cr_canseeothergids(td->td_ucred, p->p_ucred))) return (error); if (td->td_ucred->cr_ruid != p->p_ucred->cr_ruid && td->td_ucred->cr_uid != p->p_ucred->cr_ruid) { @@ -1646,9 +1641,9 @@ p_candebug(struct thread *td, struct pro if ((error = mac_proc_check_debug(td->td_ucred, p))) return (error); #endif - if ((error = cr_seeotheruids(td->td_ucred, p->p_ucred))) + if ((error = cr_canseeotheruids(td->td_ucred, p->p_ucred))) return (error); - if ((error = cr_seeothergids(td->td_ucred, p->p_ucred))) + if ((error = cr_canseeothergids(td->td_ucred, p->p_ucred))) return (error); /* @@ -1740,42 +1735,14 @@ cr_canseesocket(struct ucred *cred, stru if (error) return (error); #endif - if (cr_seeotheruids(cred, so->so_cred)) + if (cr_canseeotheruids(cred, so->so_cred)) return (ENOENT); - if (cr_seeothergids(cred, so->so_cred)) + if (cr_canseeothergids(cred, so->so_cred)) return (ENOENT); return (0); } -#if defined(INET) || defined(INET6) -/*- - * Determine whether the subject represented by cred can "see" a socket. - * Returns: 0 for permitted, ENOENT otherwise. - */ -int -cr_canseeinpcb(struct ucred *cred, struct inpcb *inp) -{ - int error; - - error = prison_check(cred, inp->inp_cred); - if (error) - return (ENOENT); -#ifdef MAC - INP_LOCK_ASSERT(inp); - error = mac_inpcb_check_visible(cred, inp); - if (error) - return (error); -#endif - if (cr_seeotheruids(cred, inp->inp_cred)) - return (ENOENT); - if (cr_seeothergids(cred, inp->inp_cred)) - return (ENOENT); - - return (0); -} -#endif - /*- * Determine whether td can wait for the exit of p. * Returns: 0 for permitted, an errno value otherwise @@ -1800,7 +1767,7 @@ p_canwait(struct thread *td, struct proc #endif #if 0 /* XXXMAC: This could have odd effects on some shells. */ - if ((error = cr_seeotheruids(td->td_ucred, p->p_ucred))) + if ((error = cr_canseeotheruids(td->td_ucred, p->p_ucred))) return (error); #endif Added: head/sys/netinet/in_prot.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/in_prot.c Wed Jul 27 20:34:09 2016 (r303411) @@ -0,0 +1,91 @@ +/*- + * Copyright (c) 1982, 1986, 1989, 1990, 1991, 1993 + * The Regents of the University of California. + * (c) UNIX System Laboratories, Inc. + * Copyright (c) 2000-2001 Robert N. M. Watson. + * All rights reserved. + * + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * 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. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. + * + * @(#)kern_prot.c 8.6 (Berkeley) 1/21/94 + */ + +/* + * System calls related to processes and protection + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_compat.h" +#include "opt_inet.h" +#include "opt_inet6.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +/*- + * Determine whether the subject represented by cred can "see" a socket. + * Returns: 0 for permitted, ENOENT otherwise. + */ +int +cr_canseeinpcb(struct ucred *cred, struct inpcb *inp) +{ + int error; + + error = prison_check(cred, inp->inp_cred); + if (error) + return (ENOENT); +#ifdef MAC + INP_LOCK_ASSERT(inp); + error = mac_inpcb_check_visible(cred, inp); + if (error) + return (error); +#endif + if (cr_canseeotheruids(cred, inp->inp_cred)) + return (ENOENT); + if (cr_canseeothergids(cred, inp->inp_cred)) + return (ENOENT); + + return (0); +} Modified: head/sys/netinet/in_systm.h ============================================================================== --- head/sys/netinet/in_systm.h Wed Jul 27 20:28:28 2016 (r303410) +++ head/sys/netinet/in_systm.h Wed Jul 27 20:34:09 2016 (r303411) @@ -55,6 +55,11 @@ typedef u_int32_t n_long; /* long as re typedef u_int32_t n_time; /* ms since 00:00 UTC, byte rev */ #ifdef _KERNEL +struct inpcb; +struct ucred; + +int cr_canseeinpcb(struct ucred *cred, struct inpcb *inp); + uint32_t iptime(void); #endif Modified: head/sys/netinet6/ip6_forward.c ============================================================================== --- head/sys/netinet6/ip6_forward.c Wed Jul 27 20:28:28 2016 (r303410) +++ head/sys/netinet6/ip6_forward.c Wed Jul 27 20:34:09 2016 (r303411) @@ -103,9 +103,6 @@ ip6_forward(struct mbuf *m, int srcrt) #ifdef IPSEC struct secpolicy *sp = NULL; #endif -#ifdef SCTP - int sw_csum; -#endif struct m_tag *fwd_tag; char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Wed Jul 27 20:28:28 2016 (r303410) +++ head/sys/sys/systm.h Wed Jul 27 20:34:09 2016 (r303411) @@ -315,7 +315,8 @@ extern int cpu_disable_c3_sleep; int cr_cansee(struct ucred *u1, struct ucred *u2); int cr_canseesocket(struct ucred *cred, struct socket *so); -int cr_canseeinpcb(struct ucred *cred, struct inpcb *inp); +int cr_canseeothergids(struct ucred *u1, struct ucred *u2); +int cr_canseeotheruids(struct ucred *u1, struct ucred *u2); char *kern_getenv(const char *name); void freeenv(char *env); From owner-svn-src-head@freebsd.org Wed Jul 27 20:37: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 BE909BA646C; Wed, 27 Jul 2016 20:37:33 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FE9415A4; Wed, 27 Jul 2016 20:37:33 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6RKbWH8089889; Wed, 27 Jul 2016 20:37:32 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RKbWdx089888; Wed, 27 Jul 2016 20:37:32 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201607272037.u6RKbWdx089888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Wed, 27 Jul 2016 20:37:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303412 - 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.22 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, 27 Jul 2016 20:37:33 -0000 Author: rrs Date: Wed Jul 27 20:37:32 2016 New Revision: 303412 URL: https://svnweb.freebsd.org/changeset/base/303412 Log: Remove myself from kern_timeout.c yeah! Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Wed Jul 27 20:34:09 2016 (r303411) +++ head/MAINTAINERS Wed Jul 27 20:37:32 2016 (r303412) @@ -37,7 +37,6 @@ subsystem login notes ----------------------------- atf freebsd-testing,jmmv,ngie Pre-commit review requested. ath(4) adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org -callout_*(9) rrs Pre-commit review requested -- becareful its tricksy code :o. contrib/compiler-rt dim Pre-commit review preferred. contrib/libc++ dim Pre-commit review preferred. contrib/libcxxrt dim Pre-commit review preferred. From owner-svn-src-head@freebsd.org Wed Jul 27 20: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 434E9BA666B; Wed, 27 Jul 2016 20:43:09 +0000 (UTC) (envelope-from ivadasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15E1E1AE8; Wed, 27 Jul 2016 20:43:09 +0000 (UTC) (envelope-from ivadasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6RKh8N4093442; Wed, 27 Jul 2016 20:43:08 GMT (envelope-from ivadasz@FreeBSD.org) Received: (from ivadasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RKh8P5093441; Wed, 27 Jul 2016 20:43:08 GMT (envelope-from ivadasz@FreeBSD.org) Message-Id: <201607272043.u6RKh8P5093441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ivadasz set sender to ivadasz@FreeBSD.org using -f From: =?UTF-8?Q?Imre_Vad=c3=a1sz?= Date: Wed, 27 Jul 2016 20:43:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303413 - head/sys/dev/iwm 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.22 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, 27 Jul 2016 20:43:09 -0000 Author: ivadasz Date: Wed Jul 27 20:43:08 2016 New Revision: 303413 URL: https://svnweb.freebsd.org/changeset/base/303413 Log: [iwm] Fix inverted logic in iwm_tx(). The PROT_REQUIRE flag in should be set for data frames above a certain length, but we were setting it for !data frames above a certain length, which makes no sense at all. Taken-From: OpenBSD, Linux iwlwifi Approved by: adrian (mentor) Obtained from: DragonFlyBSD git 8cc03924a36c572c2908e659e624f44636dc2b33 Differential Revision: https://reviews.freebsd.org/D7323 Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Wed Jul 27 20:37:32 2016 (r303412) +++ head/sys/dev/iwm/if_iwm.c Wed Jul 27 20:43:08 2016 (r303413) @@ -3344,7 +3344,7 @@ iwm_tx(struct iwm_softc *sc, struct mbuf flags |= IWM_TX_CMD_FLG_ACK; } - if (type != IEEE80211_FC0_TYPE_DATA + if (type == IEEE80211_FC0_TYPE_DATA && (totlen + IEEE80211_CRC_LEN > vap->iv_rtsthreshold) && !IEEE80211_IS_MULTICAST(wh->i_addr1)) { flags |= IWM_TX_CMD_FLG_PROT_REQUIRE; From owner-svn-src-head@freebsd.org Wed Jul 27 20:44: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 63916BA66D4; Wed, 27 Jul 2016 20:44:54 +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 364F81CA3; Wed, 27 Jul 2016 20:44:54 +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 u6RKirIs093559; Wed, 27 Jul 2016 20:44:53 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RKirg8093558; Wed, 27 Jul 2016 20:44:53 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201607272044.u6RKirg8093558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 27 Jul 2016 20:44:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303414 - head/sys/modules/mlx5 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.22 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, 27 Jul 2016 20:44:54 -0000 Author: bdrewery Date: Wed Jul 27 20:44:53 2016 New Revision: 303414 URL: https://svnweb.freebsd.org/changeset/base/303414 Log: opt_random.h was removed in r287558 for opt_global.h MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/sys/modules/mlx5/Makefile Modified: head/sys/modules/mlx5/Makefile ============================================================================== --- head/sys/modules/mlx5/Makefile Wed Jul 27 20:43:08 2016 (r303413) +++ head/sys/modules/mlx5/Makefile Wed Jul 27 20:44:53 2016 (r303414) @@ -25,7 +25,7 @@ mlx5_uar.c \ mlx5_vport.c \ mlx5_wq.c \ device_if.h bus_if.h vnode_if.h pci_if.h \ - opt_inet.h opt_inet6.h opt_random.h opt_rss.h + opt_inet.h opt_inet6.h opt_rss.h CFLAGS+= -I${.CURDIR}/../../ofed/include CFLAGS+= -I${.CURDIR}/../../compat/linuxkpi/common/include From owner-svn-src-head@freebsd.org Wed Jul 27 20:45: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 B1257BA670B; Wed, 27 Jul 2016 20:45:01 +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 82B711DF2; Wed, 27 Jul 2016 20:45:01 +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 u6RKj04j093618; Wed, 27 Jul 2016 20:45:00 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RKj0Fc093616; Wed, 27 Jul 2016 20:45:00 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201607272045.u6RKj0Fc093616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 27 Jul 2016 20:45:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303415 - in head/sys/modules: hyperv/vmbus linux64 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.22 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, 27 Jul 2016 20:45:01 -0000 Author: bdrewery Date: Wed Jul 27 20:45:00 2016 New Revision: 303415 URL: https://svnweb.freebsd.org/changeset/base/303415 Log: opt_apic.h is only used on i386. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/sys/modules/hyperv/vmbus/Makefile head/sys/modules/linux64/Makefile Modified: head/sys/modules/hyperv/vmbus/Makefile ============================================================================== --- head/sys/modules/hyperv/vmbus/Makefile Wed Jul 27 20:44:53 2016 (r303414) +++ head/sys/modules/hyperv/vmbus/Makefile Wed Jul 27 20:45:00 2016 (r303415) @@ -14,7 +14,10 @@ SRCS= hyperv.c \ SRCS+= acpi_if.h bus_if.h device_if.h opt_acpi.h vmbus_if.h # XXX: for assym.s -SRCS+= opt_kstack_pages.h opt_nfs.h opt_apic.h opt_hwpmc_hooks.h opt_compat.h +SRCS+= opt_kstack_pages.h opt_nfs.h opt_hwpmc_hooks.h opt_compat.h +.if ${MACHINE_CPUARCH} == "i386" +SRCS+= opt_apic.h +.endif SRCS+= assym.s \ vmbus_vector.S Modified: head/sys/modules/linux64/Makefile ============================================================================== --- head/sys/modules/linux64/Makefile Wed Jul 27 20:44:53 2016 (r303414) +++ head/sys/modules/linux64/Makefile Wed Jul 27 20:45:00 2016 (r303415) @@ -16,7 +16,10 @@ SRCS= linux_fork.c linux_dummy.c linux_f DPSRCS= linux_genassym.c # XXX: for assym.s -SRCS+= opt_kstack_pages.h opt_nfs.h opt_apic.h opt_hwpmc_hooks.h +SRCS+= opt_kstack_pages.h opt_nfs.h opt_hwpmc_hooks.h +.if ${MACHINE_CPUARCH} == "i386" +SRCS+= opt_apic.h +.endif CLEANFILES= linux_assym.h linux_genassym.o linux_locore.o From owner-svn-src-head@freebsd.org Wed Jul 27 20:46: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 3C812BA6835; Wed, 27 Jul 2016 20:46:53 +0000 (UTC) (envelope-from ivadasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E95581293; Wed, 27 Jul 2016 20:46:52 +0000 (UTC) (envelope-from ivadasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6RKkqSw093828; Wed, 27 Jul 2016 20:46:52 GMT (envelope-from ivadasz@FreeBSD.org) Received: (from ivadasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RKkqPJ093825; Wed, 27 Jul 2016 20:46:52 GMT (envelope-from ivadasz@FreeBSD.org) Message-Id: <201607272046.u6RKkqPJ093825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ivadasz set sender to ivadasz@FreeBSD.org using -f From: =?UTF-8?Q?Imre_Vad=c3=a1sz?= Date: Wed, 27 Jul 2016 20:46:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303416 - head/sys/dev/iwm 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.22 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, 27 Jul 2016 20:46:53 -0000 Author: ivadasz Date: Wed Jul 27 20:46:51 2016 New Revision: 303416 URL: https://svnweb.freebsd.org/changeset/base/303416 Log: [iwm] Set different pm_timeout for action frames. When building a Tx Command for management frames, we are lacking a check for action frames, for which we should set a different pm_timeout. This cause the fw to stay awake for 100TU after each such frame is transmitted, resulting an excessive power consumption. Taken-From: Linux iwlwifi (git b084a35663c3f1f7) Approved by: adrian (mentor) Obtained from: Linux git b084a35663c3f1f7de1c45c4ae3006864c940fe7 Obtained from: DragonFlyBSD git ba00f0e3ae873d6f0d5743e22c3ebc49c44dfdac Differential Revision: https://reviews.freebsd.org/D7324 Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwmreg.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Wed Jul 27 20:45:00 2016 (r303415) +++ head/sys/dev/iwm/if_iwm.c Wed Jul 27 20:46:51 2016 (r303416) @@ -3360,12 +3360,15 @@ iwm_tx(struct iwm_softc *sc, struct mbuf uint8_t subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; if (subtype == IEEE80211_FC0_SUBTYPE_ASSOC_REQ || - subtype == IEEE80211_FC0_SUBTYPE_REASSOC_REQ) - tx->pm_frame_timeout = htole16(3); - else - tx->pm_frame_timeout = htole16(2); + subtype == IEEE80211_FC0_SUBTYPE_REASSOC_REQ) { + tx->pm_frame_timeout = htole16(IWM_PM_FRAME_ASSOC); + } else if (subtype == IEEE80211_FC0_SUBTYPE_ACTION) { + tx->pm_frame_timeout = htole16(IWM_PM_FRAME_NONE); + } else { + tx->pm_frame_timeout = htole16(IWM_PM_FRAME_MGMT); + } } else { - tx->pm_frame_timeout = htole16(0); + tx->pm_frame_timeout = htole16(IWM_PM_FRAME_NONE); } if (hdrlen & 3) { Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Wed Jul 27 20:45:00 2016 (r303415) +++ head/sys/dev/iwm/if_iwmreg.h Wed Jul 27 20:46:51 2016 (r303416) @@ -4244,6 +4244,18 @@ enum iwm_tx_flags { IWM_TX_CMD_FLG_HCCA_CHUNK = (1 << 31) }; /* IWM_TX_FLAGS_BITS_API_S_VER_1 */ +/** + * enum iwm_tx_pm_timeouts - pm timeout values in TX command + * @IWM_PM_FRAME_NONE: no need to suspend sleep mode + * @IWM_PM_FRAME_MGMT: fw suspend sleep mode for 100TU + * @IWM_PM_FRAME_ASSOC: fw suspend sleep mode for 10sec + */ +enum iwm_tx_pm_timeouts { + IWM_PM_FRAME_NONE = 0, + IWM_PM_FRAME_MGMT = 2, + IWM_PM_FRAME_ASSOC = 3, +}; + /* * TX command security control */ From owner-svn-src-head@freebsd.org Wed Jul 27 20: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 66270BA68BD; Wed, 27 Jul 2016 20:48:16 +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 3233A144F; Wed, 27 Jul 2016 20:48:16 +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 u6RKmFAl093916; Wed, 27 Jul 2016 20:48:15 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RKmFJR093914; Wed, 27 Jul 2016 20:48:15 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201607272048.u6RKmFJR093914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 27 Jul 2016 20:48:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303417 - in head/sys/modules: ixl ixlv 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.22 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, 27 Jul 2016 20:48:16 -0000 Author: bdrewery Date: Wed Jul 27 20:48:15 2016 New Revision: 303417 URL: https://svnweb.freebsd.org/changeset/base/303417 Log: opt_bdg.h was removed in r150636. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/sys/modules/ixl/Makefile head/sys/modules/ixlv/Makefile Modified: head/sys/modules/ixl/Makefile ============================================================================== --- head/sys/modules/ixl/Makefile Wed Jul 27 20:46:51 2016 (r303416) +++ head/sys/modules/ixl/Makefile Wed Jul 27 20:48:15 2016 (r303417) @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../dev/ixl KMOD = if_ixl -SRCS = device_if.h bus_if.h pci_if.h pci_iov_if.h opt_bdg.h +SRCS = device_if.h bus_if.h pci_if.h pci_iov_if.h SRCS += opt_inet.h opt_inet6.h opt_rss.h SRCS += if_ixl.c ixl_txrx.c i40e_osdep.c Modified: head/sys/modules/ixlv/Makefile ============================================================================== --- head/sys/modules/ixlv/Makefile Wed Jul 27 20:46:51 2016 (r303416) +++ head/sys/modules/ixlv/Makefile Wed Jul 27 20:48:15 2016 (r303417) @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../dev/ixl KMOD = if_ixlv -SRCS = device_if.h bus_if.h pci_if.h pci_iov_if.h opt_bdg.h +SRCS = device_if.h bus_if.h pci_if.h pci_iov_if.h SRCS += opt_inet.h opt_inet6.h opt_rss.h SRCS += if_ixlv.c ixlvc.c ixl_txrx.c i40e_osdep.c From owner-svn-src-head@freebsd.org Wed Jul 27 20:51: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 BEAEABA6A81; Wed, 27 Jul 2016 20:51:32 +0000 (UTC) (envelope-from ivadasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77770183A; Wed, 27 Jul 2016 20:51:32 +0000 (UTC) (envelope-from ivadasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6RKpVjJ094695; Wed, 27 Jul 2016 20:51:31 GMT (envelope-from ivadasz@FreeBSD.org) Received: (from ivadasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RKpVPE094694; Wed, 27 Jul 2016 20:51:31 GMT (envelope-from ivadasz@FreeBSD.org) Message-Id: <201607272051.u6RKpVPE094694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ivadasz set sender to ivadasz@FreeBSD.org using -f From: =?UTF-8?Q?Imre_Vad=c3=a1sz?= Date: Wed, 27 Jul 2016 20:51:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303418 - head/sys/dev/iwm 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.22 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, 27 Jul 2016 20:51:32 -0000 Author: ivadasz Date: Wed Jul 27 20:51:31 2016 New Revision: 303418 URL: https://svnweb.freebsd.org/changeset/base/303418 Log: [iwm] When stopping TX DMA, wait for all channels at once. * Makes the TX DMA stopping more similar to Linux code, and potentially a bit faster. Also, output an error message when TX DMA idling fails. Taken-From: Linux iwlwifi Tested: * AC3165, STA mode Approved by: adrian (mentor) Obtained from: DragonFlyBSD git 2ee486ddff973ac552ff787c17e8d83e8ae0f24c Differential Revision: https://reviews.freebsd.org/D7325 Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Wed Jul 27 20:48:15 2016 (r303417) +++ head/sys/dev/iwm/if_iwm.c Wed Jul 27 20:51:31 2016 (r303418) @@ -911,12 +911,9 @@ iwm_free_fwmem(struct iwm_softc *sc) static int iwm_alloc_sched(struct iwm_softc *sc) { - int rv; - /* TX scheduler rings must be aligned on a 1KB boundary. */ - rv = iwm_dma_contig_alloc(sc->sc_dmat, &sc->sched_dma, + return iwm_dma_contig_alloc(sc->sc_dmat, &sc->sched_dma, nitems(sc->txq) * sizeof(struct iwm_agn_scd_bc_tbl), 1024); - return rv; } static void @@ -1281,8 +1278,8 @@ iwm_stop_device(struct iwm_softc *sc) { struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); - int chnl, ntries; - int qid; + int chnl, qid; + uint32_t mask = 0; /* tell the device to stop sending interrupts */ iwm_disable_interrupts(sc); @@ -1304,20 +1301,20 @@ iwm_stop_device(struct iwm_softc *sc) iwm_write_prph(sc, IWM_SCD_TXFACT, 0); - /* Stop all DMA channels. */ if (iwm_nic_lock(sc)) { + /* Stop each Tx DMA channel */ for (chnl = 0; chnl < IWM_FH_TCSR_CHNL_NUM; chnl++) { IWM_WRITE(sc, IWM_FH_TCSR_CHNL_TX_CONFIG_REG(chnl), 0); - for (ntries = 0; ntries < 200; ntries++) { - uint32_t r; + mask |= IWM_FH_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE(chnl); + } - r = IWM_READ(sc, IWM_FH_TSSR_TX_STATUS_REG); - if (r & IWM_FH_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE( - chnl)) - break; - DELAY(20); - } + /* Wait for DMA channels to be idle */ + if (iwm_poll_bit(sc, IWM_FH_TSSR_TX_STATUS_REG, mask, mask, + 5000) < 0) { + device_printf(sc->sc_dev, + "Failing on timeout while stopping DMA channel: [0x%08x]\n", + IWM_READ(sc, IWM_FH_TSSR_TX_STATUS_REG)); } iwm_nic_unlock(sc); } From owner-svn-src-head@freebsd.org Wed Jul 27 21:45: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 CE8F4BA6798; Wed, 27 Jul 2016 21:45:12 +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 A04C313DC; Wed, 27 Jul 2016 21:45:12 +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 u6RLjBd4016328; Wed, 27 Jul 2016 21:45:11 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RLjBZO016327; Wed, 27 Jul 2016 21:45:11 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201607272145.u6RLjBZO016327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 27 Jul 2016 21:45:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303419 - head/usr.sbin/pmcstudy 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.22 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, 27 Jul 2016 21:45:12 -0000 Author: bdrewery Date: Wed Jul 27 21:45:11 2016 New Revision: 303419 URL: https://svnweb.freebsd.org/changeset/base/303419 Log: Fix non-amd64 build from r292043 after reconnecting in r303410. MFC after: 3 days X-MFC-With: r303410 Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/pmcstudy/pmcstudy.c Modified: head/usr.sbin/pmcstudy/pmcstudy.c ============================================================================== --- head/usr.sbin/pmcstudy/pmcstudy.c Wed Jul 27 20:51:31 2016 (r303418) +++ head/usr.sbin/pmcstudy/pmcstudy.c Wed Jul 27 21:45:11 2016 (r303419) @@ -2322,11 +2322,7 @@ do_cpuid(u_int ax, u_int cx, u_int *p) #else #define cpuid(in, a, b, c, d) -static __inline void -do_cpuid(u_int ax, u_int cx, u_int *p) -{ -} - +#define do_cpuid(ax, cx, p) #endif static void From owner-svn-src-head@freebsd.org Thu Jul 28 03:21: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 195B6BA6FA2; Thu, 28 Jul 2016 03:21:24 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id F399D1329; Thu, 28 Jul 2016 03:21:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id EB0551866; Thu, 28 Jul 2016 03:21:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 8DBBA24250; Thu, 28 Jul 2016 03:21:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id IW-f6Aowma81; Thu, 28 Jul 2016 03:21:21 +0000 (UTC) Subject: Re: svn commit: r303382 - in head/sys: compat/linprocfs fs/devfs fs/fdescfs fs/nfs fs/procfs kern net net/altq netpfil/ipfw nfs rpc/rpcsec_gss sys DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com CC7C02424B To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201607271108.u6RB8xQh074927@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <408dac83-72d2-65f2-880b-bb887069acf9@FreeBSD.org> Date: Wed, 27 Jul 2016 20:21:21 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201607271108.u6RB8xQh074927@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4tR4GdtrRfljohgWcQCB1IIoFibuTnd3S" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 28 Jul 2016 03:21:24 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --4tR4GdtrRfljohgWcQCB1IIoFibuTnd3S Content-Type: multipart/mixed; boundary="j0f9ojFxVk8gEUwwpgRqah4uwRsoPJSdN" From: Bryan Drewery To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <408dac83-72d2-65f2-880b-bb887069acf9@FreeBSD.org> Subject: Re: svn commit: r303382 - in head/sys: compat/linprocfs fs/devfs fs/fdescfs fs/nfs fs/procfs kern net net/altq netpfil/ipfw nfs rpc/rpcsec_gss sys References: <201607271108.u6RB8xQh074927@repo.freebsd.org> In-Reply-To: <201607271108.u6RB8xQh074927@repo.freebsd.org> --j0f9ojFxVk8gEUwwpgRqah4uwRsoPJSdN Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 7/27/2016 4:08 AM, Konstantin Belousov wrote: > +void > +getboottime(struct timeval *boottime) > +{ > + > + *boottime =3D boottime_x; > +} > + > +void > +getboottimebin(struct bintime *boottimebin) > +{ > + > + *boottimebin =3D boottimebin_x; > +} Is there benefit to moving these to a header and making them explicitly inline? --=20 Regards, Bryan Drewery --j0f9ojFxVk8gEUwwpgRqah4uwRsoPJSdN-- --4tR4GdtrRfljohgWcQCB1IIoFibuTnd3S 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 iQEcBAEBAgAGBQJXmXoxAAoJEDXXcbtuRpfP0bkIAJy0fk1GTl4IUuwcvCGducR1 bGAdjYTphLlqB/JW02LaTUffPexDXUEwlCumEcP7N71q1b/QN2cqJItZBs20LiN1 UrLEEZWwtn7oggwODdPkeHAZ85ozXnKR7r8QU+8tu8p92scyIwob7887iWjR5I1a bO1YqAtZk0qC4qAR9liWQ2hRLzJrh2eILUpiFQ37YThc080o4KULdqoID5Csbx9y cTJyy/IK4WnxME6hkosukihu3OI5rOREXRAfokJ8qIkKTBphl0A/XdywWT0Dmq1q sKQFno7Hplejm+Tlitihuxfja+ZZUOS9er7M5F3z6McNb6N38ZBzAh7e9MiuOmU= =D2K2 -----END PGP SIGNATURE----- --4tR4GdtrRfljohgWcQCB1IIoFibuTnd3S-- From owner-svn-src-head@freebsd.org Thu Jul 28 05:59: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 7D283BA6ECD; Thu, 28 Jul 2016 05:59:58 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23A4A1B3A; Thu, 28 Jul 2016 05:59:58 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6S5xvgx096718; Thu, 28 Jul 2016 05:59:57 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6S5xvdp096715; Thu, 28 Jul 2016 05:59:57 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201607280559.u6S5xvdp096715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Thu, 28 Jul 2016 05:59:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303420 - in head/sys: arm/altera/socfpga arm/ti 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.22 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, 28 Jul 2016 05:59:58 -0000 Author: loos Date: Thu Jul 28 05:59:56 2016 New Revision: 303420 URL: https://svnweb.freebsd.org/changeset/base/303420 Log: Enable the build of micphy as part of generic miibus build, but only for FDT enabled systems. Sponsored by: Rubicon Communications (Netgate) Modified: head/sys/arm/altera/socfpga/files.socfpga head/sys/arm/ti/files.ti head/sys/conf/files Modified: head/sys/arm/altera/socfpga/files.socfpga ============================================================================== --- head/sys/arm/altera/socfpga/files.socfpga Wed Jul 27 21:45:11 2016 (r303419) +++ head/sys/arm/altera/socfpga/files.socfpga Thu Jul 28 05:59:56 2016 (r303420) @@ -9,7 +9,6 @@ arm/altera/socfpga/socfpga_rstmgr.c sta arm/altera/socfpga/socfpga_mp.c optional smp arm/altera/socfpga/socfpga_gpio.c optional gpio -dev/mii/micphy.c optional micphy dev/mmc/host/dwmmc.c optional dwmmc # BERI specific Modified: head/sys/arm/ti/files.ti ============================================================================== --- head/sys/arm/ti/files.ti Wed Jul 27 21:45:11 2016 (r303419) +++ head/sys/arm/ti/files.ti Thu Jul 28 05:59:56 2016 (r303420) @@ -20,7 +20,6 @@ arm/ti/ti_i2c.c optional ti_i2c arm/ti/ti_sdhci.c optional sdhci arm/ti/ti_spi.c optional ti_spi -dev/mii/micphy.c optional micphy dev/uart/uart_dev_ti8250.c optional uart dev/uart/uart_dev_ns8250.c optional uart Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Jul 27 21:45:11 2016 (r303419) +++ head/sys/conf/files Thu Jul 28 05:59:56 2016 (r303420) @@ -2045,6 +2045,7 @@ dev/mii/icsphy.c optional miibus | icsp dev/mii/ip1000phy.c optional miibus | ip1000phy dev/mii/jmphy.c optional miibus | jmphy dev/mii/lxtphy.c optional miibus | lxtphy +dev/mii/micphy.c optional miibus fdt | micphy fdt dev/mii/mii.c optional miibus | mii dev/mii/mii_bitbang.c optional miibus | mii_bitbang dev/mii/mii_physubr.c optional miibus | mii From owner-svn-src-head@freebsd.org Thu Jul 28 06:30: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 546C8BA65AD; Thu, 28 Jul 2016 06:30:30 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A1D21786; Thu, 28 Jul 2016 06:30:30 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6S6UTZs008006; Thu, 28 Jul 2016 06:30:29 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6S6UTnR008005; Thu, 28 Jul 2016 06:30:29 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201607280630.u6S6UTnR008005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 28 Jul 2016 06:30:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303421 - head/sys/dev/hyperv/vmbus 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.22 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, 28 Jul 2016 06:30:30 -0000 Author: sephe Date: Thu Jul 28 06:30:29 2016 New Revision: 303421 URL: https://svnweb.freebsd.org/changeset/base/303421 Log: hyperv/vmbus: Avoid unnecessary mb() MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7333 Modified: head/sys/dev/hyperv/vmbus/vmbus_br.c Modified: head/sys/dev/hyperv/vmbus/vmbus_br.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_br.c Thu Jul 28 05:59:56 2016 (r303420) +++ head/sys/dev/hyperv/vmbus/vmbus_br.c Thu Jul 28 06:30:29 2016 (r303421) @@ -209,9 +209,7 @@ vmbus_txbr_need_signal(const struct vmbu if (tbr->txbr_imask) return (FALSE); - /* XXX only compiler fence is needed */ - /* Read memory barrier */ - rmb(); + __compiler_membar(); /* * This is the only case we need to signal when the @@ -308,15 +306,10 @@ vmbus_txbr_write(struct vmbus_txbr *tbr, sizeof(save_windex)); /* - * XXX only compiler fence is needed. - * Full memory barrier before upding the write index. - */ - mb(); - - /* * Update the write index _after_ the channel packet * is copied. */ + __compiler_membar(); tbr->txbr_windex = windex; mtx_unlock_spin(&tbr->txbr_lock); @@ -396,16 +389,9 @@ vmbus_rxbr_read(struct vmbus_rxbr *rbr, rindex = VMBUS_BR_IDXINC(rindex, sizeof(uint64_t), br_dsize); /* - * XXX only compiler fence is needed. - * Make sure all reads are done before we update the read index since - * the writer may start writing to the read area once the read index - * is updated. - */ - wmb(); - - /* * Update the read index _after_ the channel packet is fetched. */ + __compiler_membar(); rbr->rxbr_rindex = rindex; mtx_unlock_spin(&rbr->rxbr_lock); From owner-svn-src-head@freebsd.org Thu Jul 28 06:46: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 157ACBA6938; Thu, 28 Jul 2016 06:46:13 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E21041F90; Thu, 28 Jul 2016 06:46:12 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6S6kCMi015649; Thu, 28 Jul 2016 06:46:12 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6S6kAvQ015635; Thu, 28 Jul 2016 06:46:10 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201607280646.u6S6kAvQ015635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 28 Jul 2016 06:46:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303422 - in head/sys/dev/hyperv: include netvsc storvsc utilities vmbus 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.22 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, 28 Jul 2016 06:46:13 -0000 Author: sephe Date: Thu Jul 28 06:46:10 2016 New Revision: 303422 URL: https://svnweb.freebsd.org/changeset/base/303422 Log: hyperv/vmbus: Inclusion cleanup MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7334 Modified: head/sys/dev/hyperv/include/hyperv.h head/sys/dev/hyperv/include/vmbus.h head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c head/sys/dev/hyperv/utilities/hv_heartbeat.c head/sys/dev/hyperv/utilities/hv_shutdown.c head/sys/dev/hyperv/utilities/hv_timesync.c head/sys/dev/hyperv/vmbus/hyperv.c head/sys/dev/hyperv/vmbus/vmbus.c head/sys/dev/hyperv/vmbus/vmbus_chan.c head/sys/dev/hyperv/vmbus/vmbus_et.c head/sys/dev/hyperv/vmbus/vmbus_var.h Modified: head/sys/dev/hyperv/include/hyperv.h ============================================================================== --- head/sys/dev/hyperv/include/hyperv.h Thu Jul 28 06:30:29 2016 (r303421) +++ head/sys/dev/hyperv/include/hyperv.h Thu Jul 28 06:46:10 2016 (r303422) @@ -28,36 +28,14 @@ * $FreeBSD$ */ -/** - * HyperV definitions for messages that are sent between instances of the - * Channel Management Library in separate partitions, or in some cases, - * back to itself. - */ - -#ifndef __HYPERV_H__ -#define __HYPERV_H__ +#ifndef _HYPERV_H_ +#define _HYPERV_H_ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + #include -#include #include -#include -#include -#include - struct hyperv_guid { uint8_t hv_guid[16]; } __packed; @@ -77,4 +55,4 @@ hv_get_phys_addr(void *virt) return (ret); } -#endif /* __HYPERV_H__ */ +#endif /* _HYPERV_H_ */ Modified: head/sys/dev/hyperv/include/vmbus.h ============================================================================== --- head/sys/dev/hyperv/include/vmbus.h Thu Jul 28 06:30:29 2016 (r303421) +++ head/sys/dev/hyperv/include/vmbus.h Thu Jul 28 06:46:10 2016 (r303422) @@ -30,6 +30,7 @@ #define _VMBUS_H_ #include +#include /* * VMBUS version is 32 bit, upper 16 bit for major_number and lower Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Jul 28 06:30:29 2016 (r303421) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Jul 28 06:46:10 2016 (r303422) @@ -44,6 +44,7 @@ #include #include #include +#include #include #include Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Jul 28 06:30:29 2016 (r303421) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Jul 28 06:46:10 2016 (r303422) @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Thu Jul 28 06:30:29 2016 (r303421) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Thu Jul 28 06:46:10 2016 (r303422) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_heartbeat.c Thu Jul 28 06:30:29 2016 (r303421) +++ head/sys/dev/hyperv/utilities/hv_heartbeat.c Thu Jul 28 06:46:10 2016 (r303422) @@ -33,6 +33,7 @@ #include #include #include +#include #include #include Modified: head/sys/dev/hyperv/utilities/hv_shutdown.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_shutdown.c Thu Jul 28 06:30:29 2016 (r303421) +++ head/sys/dev/hyperv/utilities/hv_shutdown.c Thu Jul 28 06:46:10 2016 (r303422) @@ -38,6 +38,7 @@ #include #include #include +#include #include #include Modified: head/sys/dev/hyperv/utilities/hv_timesync.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_timesync.c Thu Jul 28 06:30:29 2016 (r303421) +++ head/sys/dev/hyperv/utilities/hv_timesync.c Thu Jul 28 06:46:10 2016 (r303422) @@ -38,6 +38,8 @@ #include #include #include +#include +#include #include #include Modified: head/sys/dev/hyperv/vmbus/hyperv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hyperv.c Thu Jul 28 06:30:29 2016 (r303421) +++ head/sys/dev/hyperv/vmbus/hyperv.c Thu Jul 28 06:46:10 2016 (r303422) @@ -34,23 +34,14 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include #include -#include -#include -#include -#include -#include #include #include #include #include #include -#if 0 -#include -#endif #define HYPERV_FREEBSD_BUILD 0ULL #define HYPERV_FREEBSD_VERSION ((uint64_t)__FreeBSD_version) Modified: head/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus.c Thu Jul 28 06:30:29 2016 (r303421) +++ head/sys/dev/hyperv/vmbus/vmbus.c Thu Jul 28 06:46:10 2016 (r303422) @@ -38,26 +38,16 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include +#include #include -#include #include -#include -#include -#include #include -#include -#include -#include -#include - -#include #include -#include -#include -#include -#include +#include + +#include #include #include @@ -66,7 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include "acpi_if.h" #include "vmbus_if.h" Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_chan.c Thu Jul 28 06:30:29 2016 (r303421) +++ head/sys/dev/hyperv/vmbus/vmbus_chan.c Thu Jul 28 06:46:10 2016 (r303422) @@ -31,19 +31,14 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include #include +#include #include +#include #include +#include #include -#include - -#include -#include -#include #include #include Modified: head/sys/dev/hyperv/vmbus/vmbus_et.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_et.c Thu Jul 28 06:30:29 2016 (r303421) +++ head/sys/dev/hyperv/vmbus/vmbus_et.c Thu Jul 28 06:46:10 2016 (r303422) @@ -32,9 +32,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include +#include #include #include Modified: head/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_var.h Thu Jul 28 06:30:29 2016 (r303421) +++ head/sys/dev/hyperv/vmbus/vmbus_var.h Thu Jul 28 06:46:10 2016 (r303422) @@ -30,7 +30,6 @@ #define _VMBUS_VAR_H_ #include -#include #include #include From owner-svn-src-head@freebsd.org Thu Jul 28 08:20: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 276B5BA5DC4; Thu, 28 Jul 2016 08:20: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 B4B2B16CE; Thu, 28 Jul 2016 08:20:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u6S8KYTr063577 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 28 Jul 2016 11:20:34 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u6S8KYTr063577 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u6S8KYJT063572; Thu, 28 Jul 2016 11:20:34 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 28 Jul 2016 11:20:34 +0300 From: Konstantin Belousov To: Bryan Drewery Cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303382 - in head/sys: compat/linprocfs fs/devfs fs/fdescfs fs/nfs fs/procfs kern net net/altq netpfil/ipfw nfs rpc/rpcsec_gss sys Message-ID: <20160728082034.GQ38613@kib.kiev.ua> References: <201607271108.u6RB8xQh074927@repo.freebsd.org> <408dac83-72d2-65f2-880b-bb887069acf9@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <408dac83-72d2-65f2-880b-bb887069acf9@FreeBSD.org> User-Agent: Mutt/1.6.1 (2016-04-27) 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.22 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, 28 Jul 2016 08:20:44 -0000 On Wed, Jul 27, 2016 at 08:21:21PM -0700, Bryan Drewery wrote: > On 7/27/2016 4:08 AM, Konstantin Belousov wrote: > > +void > > +getboottime(struct timeval *boottime) > > +{ > > + > > + *boottime = boottime_x; > > +} > > + > > +void > > +getboottimebin(struct bintime *boottimebin) > > +{ > > + > > + *boottimebin = boottimebin_x; > > +} > > Is there benefit to moving these to a header and making them explicitly > inline? > No. See r303387. From owner-svn-src-head@freebsd.org Thu Jul 28 08:30: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 5B817BA60F9; Thu, 28 Jul 2016 08:30: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 C8B381D08; Thu, 28 Jul 2016 08:30:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u6S8UgXS066088 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 28 Jul 2016 11:30:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u6S8UgXS066088 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u6S8UgRP066087; Thu, 28 Jul 2016 11:30:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 28 Jul 2016 11:30:42 +0300 From: Konstantin Belousov To: Bryan Drewery Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303419 - head/usr.sbin/pmcstudy Message-ID: <20160728083042.GR38613@kib.kiev.ua> References: <201607272145.u6RLjBZO016327@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201607272145.u6RLjBZO016327@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) 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.22 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, 28 Jul 2016 08:30:48 -0000 On Wed, Jul 27, 2016 at 09:45:11PM +0000, Bryan Drewery wrote: > Author: bdrewery > Date: Wed Jul 27 21:45:11 2016 > New Revision: 303419 > URL: https://svnweb.freebsd.org/changeset/base/303419 > > Log: > Fix non-amd64 build from r292043 after reconnecting in r303410. > > MFC after: 3 days > X-MFC-With: r303410 > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/usr.sbin/pmcstudy/pmcstudy.c > > Modified: head/usr.sbin/pmcstudy/pmcstudy.c > ============================================================================== > --- head/usr.sbin/pmcstudy/pmcstudy.c Wed Jul 27 20:51:31 2016 (r303418) > +++ head/usr.sbin/pmcstudy/pmcstudy.c Wed Jul 27 21:45:11 2016 (r303419) > @@ -2322,11 +2322,7 @@ do_cpuid(u_int ax, u_int cx, u_int *p) > > #else > #define cpuid(in, a, b, c, d) > -static __inline void > -do_cpuid(u_int ax, u_int cx, u_int *p) > -{ > -} > - > +#define do_cpuid(ax, cx, p) > #endif > > static void Should the same code be enabled for i386 as well ? From owner-svn-src-head@freebsd.org Thu Jul 28 08:41: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 34DF4BA6382; Thu, 28 Jul 2016 08:41: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 E75CA13A8; Thu, 28 Jul 2016 08:41:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6S8fEA6057882; Thu, 28 Jul 2016 08:41:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6S8fDj1057663; Thu, 28 Jul 2016 08:41:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201607280841.u6S8fDj1057663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 28 Jul 2016 08:41:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303423 - in head: bin/ps sys/kern 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.22 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, 28 Jul 2016 08:41:15 -0000 Author: kib Date: Thu Jul 28 08:41:13 2016 New Revision: 303423 URL: https://svnweb.freebsd.org/changeset/base/303423 Log: When a debugger attaches to the process, SIGSTOP is sent to the target. Due to a way issignal() selects the next signal to deliver and report, if the simultaneous or already pending another signal exists, that signal might be reported by the next waitpid(2) call. This causes minor annoyance for debuggers, which must be prepared to take any signal as the first event, then filter SIGSTOP later. More importantly, for tools like gcore(1), which attach and then detach without processing events, SIGSTOP might leak to be delivered after PT_DETACH. This results in the process being unintentionally stopped after detach, which is fatal for automatic tools. The solution is to force SIGSTOP to be the first signal reported after the attach. Attach code is modified to set P2_PTRACE_FSTP to indicate that the attaching ritual was not yet finished, and issignal() prefers SIGSTOP in that condition. Also, the thread which handles P2_PTRACE_FSTP is made to guarantee to own p_xthread during the first waitpid(2). All that ensures that SIGSTOP is consumed first. Additionally, if P2_PTRACE_FSTP is still set on detach, which means that waitpid(2) was not called at all, SIGSTOP is removed from the queue, ensuring that the process is resumed on detach. In issignal(), when acting on STOPing signals, remove the signal from queue before suspending. Otherwise parallel attach could result in ptracestop() acting on that STOP as if it was the STOP signal from the attach. Then SIGSTOP from attach leaks again. As a minor refactoring, some bits of the common attach code is moved to new helper proc_set_traced(). Reported by: markj Reviewed by: jhb, markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D7256 Modified: head/bin/ps/ps.1 head/sys/kern/kern_exit.c head/sys/kern/kern_fork.c head/sys/kern/kern_sig.c head/sys/kern/sys_process.c head/sys/sys/proc.h Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Thu Jul 28 06:46:10 2016 (r303422) +++ head/bin/ps/ps.1 Thu Jul 28 08:41:13 2016 (r303423) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd December 1, 2015 +.Dd July 28, 2016 .Dt PS 1 .Os .Sh NAME @@ -360,6 +360,7 @@ the include file .It Dv "P2_NOTRACE" Ta No "0x00000002" Ta "No ptrace(2) attach or coredumps" .It Dv "P2_NOTRACE_EXEC" Ta No "0x00000004" Ta "Keep P2_NOPTRACE on exec(2)" .It Dv "P2_AST_SU" Ta No "0x00000008" Ta "Handles SU ast for kthreads" +.It Dv "P2_PTRACE_FSTP" Ta No "0x00000010" Ta "SIGSTOP from PT_ATTACH not yet handled" .El .It Cm label The MAC label of the process. Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Thu Jul 28 06:46:10 2016 (r303422) +++ head/sys/kern/kern_exit.c Thu Jul 28 08:41:13 2016 (r303423) @@ -476,9 +476,12 @@ exit1(struct thread *td, int rval, int s */ clear_orphan(q); q->p_flag &= ~(P_TRACED | P_STOPPED_TRACE); + q->p_flag2 &= ~P2_PTRACE_FSTP; q->p_ptevents = 0; - FOREACH_THREAD_IN_PROC(q, tdt) - tdt->td_dbgflags &= ~TDB_SUSPEND; + FOREACH_THREAD_IN_PROC(q, tdt) { + tdt->td_dbgflags &= ~(TDB_SUSPEND | TDB_XSIG | + TDB_FSTP); + } kern_psignal(q, SIGKILL); } PROC_UNLOCK(q); Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Thu Jul 28 06:46:10 2016 (r303422) +++ head/sys/kern/kern_fork.c Thu Jul 28 08:41:13 2016 (r303423) @@ -1074,15 +1074,13 @@ fork_return(struct thread *td, struct tr * parent's children, do it now. */ dbg = p->p_pptr->p_pptr; - p->p_flag |= P_TRACED; - p->p_ptevents = PTRACE_DEFAULT; - p->p_oppid = p->p_pptr->p_pid; + proc_set_traced(p); CTR2(KTR_PTRACE, "fork_return: attaching to new child pid %d: oppid %d", p->p_pid, p->p_oppid); proc_reparent(p, dbg); sx_xunlock(&proctree_lock); - td->td_dbgflags |= TDB_CHILD | TDB_SCX; + td->td_dbgflags |= TDB_CHILD | TDB_SCX | TDB_FSTP; ptracestop(td, SIGSTOP); td->td_dbgflags &= ~(TDB_CHILD | TDB_SCX); } else { Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Thu Jul 28 06:46:10 2016 (r303422) +++ head/sys/kern/kern_sig.c Thu Jul 28 08:41:13 2016 (r303423) @@ -2526,14 +2526,26 @@ ptracestop(struct thread *td, int sig) PROC_SUNLOCK(p); return (sig); } + /* - * Just make wait() to work, the last stopped thread - * will win. + * Make wait(2) work. Ensure that right after the + * attach, the thread which was decided to become the + * leader of attach gets reported to the waiter. + * Otherwise, just avoid overwriting another thread's + * assignment to p_xthread. If another thread has + * already set p_xthread, the current thread will get + * a chance to report itself upon the next iteration. */ - p->p_xsig = sig; - p->p_xthread = td; - p->p_flag |= (P_STOPPED_SIG|P_STOPPED_TRACE); - sig_suspend_threads(td, p, 0); + if ((td->td_dbgflags & TDB_FSTP) != 0 || + ((p->p_flag & P2_PTRACE_FSTP) == 0 && + p->p_xthread == NULL)) { + p->p_xsig = sig; + p->p_xthread = td; + td->td_dbgflags &= ~TDB_FSTP; + p->p_flag2 &= ~P2_PTRACE_FSTP; + p->p_flag |= P_STOPPED_SIG | P_STOPPED_TRACE; + sig_suspend_threads(td, p, 0); + } if ((td->td_dbgflags & TDB_STOPATFORK) != 0) { td->td_dbgflags &= ~TDB_STOPATFORK; cv_broadcast(&p->p_dbgwait); @@ -2726,7 +2738,20 @@ issignal(struct thread *td) SIG_STOPSIGMASK(sigpending); if (SIGISEMPTY(sigpending)) /* no signal to send */ return (0); - sig = sig_ffs(&sigpending); + if ((p->p_flag & (P_TRACED | P_PPTRACE)) == P_TRACED && + (p->p_flag2 & P2_PTRACE_FSTP) != 0 && + SIGISMEMBER(sigpending, SIGSTOP)) { + /* + * If debugger just attached, always consume + * SIGSTOP from ptrace(PT_ATTACH) first, to + * execute the debugger attach ritual in + * order. + */ + sig = SIGSTOP; + td->td_dbgflags |= TDB_FSTP; + } else { + sig = sig_ffs(&sigpending); + } if (p->p_stops & S_SIG) { mtx_unlock(&ps->ps_mtx); @@ -2743,7 +2768,7 @@ issignal(struct thread *td) sigqueue_delete(&p->p_sigqueue, sig); continue; } - if (p->p_flag & P_TRACED && (p->p_flag & P_PPTRACE) == 0) { + if ((p->p_flag & (P_TRACED | P_PPTRACE)) == P_TRACED) { /* * If traced, always stop. * Remove old signal from queue before the stop. @@ -2846,6 +2871,8 @@ issignal(struct thread *td) mtx_unlock(&ps->ps_mtx); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, &p->p_mtx.lock_object, "Catching SIGSTOP"); + sigqueue_delete(&td->td_sigqueue, sig); + sigqueue_delete(&p->p_sigqueue, sig); p->p_flag |= P_STOPPED_SIG; p->p_xsig = sig; PROC_SLOCK(p); @@ -2853,7 +2880,7 @@ issignal(struct thread *td) thread_suspend_switch(td, p); PROC_SUNLOCK(p); mtx_lock(&ps->ps_mtx); - break; + goto next; } else if (prop & SA_IGNORE) { /* * Except for SIGCONT, shouldn't get here. @@ -2884,6 +2911,7 @@ issignal(struct thread *td) } sigqueue_delete(&td->td_sigqueue, sig); /* take the signal! */ sigqueue_delete(&p->p_sigqueue, sig); +next:; } /* NOTREACHED */ } Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Thu Jul 28 06:46:10 2016 (r303422) +++ head/sys/kern/sys_process.c Thu Jul 28 08:41:13 2016 (r303423) @@ -692,6 +692,17 @@ sys_ptrace(struct thread *td, struct ptr #define PROC_WRITE(w, t, a) proc_write_ ## w (t, a) #endif +void +proc_set_traced(struct proc *p) +{ + + PROC_LOCK_ASSERT(p, MA_OWNED); + p->p_flag |= P_TRACED; + p->p_flag2 |= P2_PTRACE_FSTP; + p->p_ptevents = PTRACE_DEFAULT; + p->p_oppid = p->p_pptr->p_pid; +} + int kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) { @@ -899,11 +910,9 @@ kern_ptrace(struct thread *td, int req, switch (req) { case PT_TRACE_ME: /* set my trace flag and "owner" so it can read/write me */ - p->p_flag |= P_TRACED; - p->p_ptevents = PTRACE_DEFAULT; + proc_set_traced(p); if (p->p_flag & P_PPWAIT) p->p_flag |= P_PPTRACE; - p->p_oppid = p->p_pptr->p_pid; CTR1(KTR_PTRACE, "PT_TRACE_ME: pid %d", p->p_pid); break; @@ -918,9 +927,7 @@ kern_ptrace(struct thread *td, int req, * The old parent is remembered so we can put things back * on a "detach". */ - p->p_flag |= P_TRACED; - p->p_ptevents = PTRACE_DEFAULT; - p->p_oppid = p->p_pptr->p_pid; + proc_set_traced(p); if (p->p_pptr != td->td_proc) { proc_reparent(p, td->td_proc); } @@ -1088,6 +1095,17 @@ kern_ptrace(struct thread *td, int req, p->p_pid, data); p->p_oppid = 0; p->p_ptevents = 0; + FOREACH_THREAD_IN_PROC(p, td3) { + if ((td3->td_dbgflags & TDB_FSTP) != 0) { + sigqueue_delete(&td3->td_sigqueue, + SIGSTOP); + } + td3->td_dbgflags &= ~(TDB_XSIG | TDB_FSTP); + } + if ((p->p_flag2 & P2_PTRACE_FSTP) != 0) { + sigqueue_delete(&p->p_sigqueue, SIGSTOP); + p->p_flag2 &= ~P2_PTRACE_FSTP; + } /* should we send SIGCHLD? */ /* childproc_continued(p); */ @@ -1108,7 +1126,7 @@ kern_ptrace(struct thread *td, int req, if (req == PT_DETACH) { FOREACH_THREAD_IN_PROC(p, td3) - td3->td_dbgflags &= ~TDB_SUSPEND; + td3->td_dbgflags &= ~TDB_SUSPEND; } /* * unsuspend all threads, to not let a thread run, Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Thu Jul 28 06:46:10 2016 (r303422) +++ head/sys/sys/proc.h Thu Jul 28 08:41:13 2016 (r303423) @@ -423,6 +423,7 @@ do { \ #define TDB_BORN 0x00000200 /* New LWP indicator for ptrace() */ #define TDB_EXIT 0x00000400 /* Exiting LWP indicator for ptrace() */ #define TDB_VFORK 0x00000800 /* vfork indicator for ptrace() */ +#define TDB_FSTP 0x00001000 /* The thread is PT_ATTACH leader */ /* * "Private" flags kept in td_pflags: @@ -713,6 +714,7 @@ struct proc { #define P2_NOTRACE 0x00000002 /* No ptrace(2) attach or coredumps. */ #define P2_NOTRACE_EXEC 0x00000004 /* Keep P2_NOPTRACE on exec(2). */ #define P2_AST_SU 0x00000008 /* Handles SU ast for kthreads. */ +#define P2_PTRACE_FSTP 0x00000010 /* SIGSTOP from PT_ATTACH not yet handled. */ /* Flags protected by proctree_lock, kept in p_treeflags. */ #define P_TREE_ORPHANED 0x00000001 /* Reparented, on orphan list */ @@ -1003,6 +1005,7 @@ void proc_linkup(struct proc *p, struct struct proc *proc_realparent(struct proc *child); void proc_reap(struct thread *td, struct proc *p, int *status, int options); void proc_reparent(struct proc *child, struct proc *newparent); +void proc_set_traced(struct proc *p); struct pstats *pstats_alloc(void); void pstats_fork(struct pstats *src, struct pstats *dst); void pstats_free(struct pstats *ps); From owner-svn-src-head@freebsd.org Thu Jul 28 08:53: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 59AD7BA669A; Thu, 28 Jul 2016 08:53: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 1F0EA1AAF; Thu, 28 Jul 2016 08:53:39 +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 u6S8rcSB062547; Thu, 28 Jul 2016 08:53:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6S8rc9n062546; Thu, 28 Jul 2016 08:53:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201607280853.u6S8rc9n062546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 28 Jul 2016 08:53:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303424 - 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.22 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, 28 Jul 2016 08:53:39 -0000 Author: kib Date: Thu Jul 28 08:53:38 2016 New Revision: 303424 URL: https://svnweb.freebsd.org/changeset/base/303424 Log: Fix typo in comment. MFC after: 3 days Modified: head/sys/sys/proc.h Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Thu Jul 28 08:41:13 2016 (r303423) +++ head/sys/sys/proc.h Thu Jul 28 08:53:38 2016 (r303424) @@ -742,7 +742,7 @@ struct proc { #define SW_TYPE_MASK 0xff /* First 8 bits are switch type */ #define SWT_NONE 0 /* Unspecified switch. */ #define SWT_PREEMPT 1 /* Switching due to preemption. */ -#define SWT_OWEPREEMPT 2 /* Switching due to opepreempt. */ +#define SWT_OWEPREEMPT 2 /* Switching due to owepreempt. */ #define SWT_TURNSTILE 3 /* Turnstile contention. */ #define SWT_SLEEPQ 4 /* Sleepq wait. */ #define SWT_SLEEPQTIMO 5 /* Sleepq timeout wait. */ From owner-svn-src-head@freebsd.org Thu Jul 28 08:57: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 0250FBA670E; Thu, 28 Jul 2016 08:57:02 +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 AD8F91C55; Thu, 28 Jul 2016 08:57:02 +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 u6S8v1uW062726; Thu, 28 Jul 2016 08:57:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6S8v1w3062722; Thu, 28 Jul 2016 08:57:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201607280857.u6S8v1w3062722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 28 Jul 2016 08:57:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303425 - in head: share/man/man9 sys/kern 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.22 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, 28 Jul 2016 08:57:03 -0000 Author: kib Date: Thu Jul 28 08:57:01 2016 New Revision: 303425 URL: https://svnweb.freebsd.org/changeset/base/303425 Log: Extract the calculation of the callout fire time into the new function callout_when(9). See the man page update for the description of the intended use. Tested by: pho Reviewed by: jhb, bjk (man page updates) Sponsored by: The FreeBSD Foundation MFC after: 1 month X-Differential revision: https://reviews.freebsd.org/D7137 Modified: head/share/man/man9/Makefile head/share/man/man9/timeout.9 head/sys/kern/kern_timeout.c head/sys/sys/callout.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Thu Jul 28 08:53:38 2016 (r303424) +++ head/share/man/man9/Makefile Thu Jul 28 08:57:01 2016 (r303425) @@ -1766,6 +1766,7 @@ MLINKS+=timeout.9 callout.9 \ timeout.9 callout_schedule_sbt_curcpu.9 \ timeout.9 callout_schedule_sbt_on.9 \ timeout.9 callout_stop.9 \ + timeout.9 callout_when.9 \ timeout.9 untimeout.9 MLINKS+=ucred.9 cred_update_thread.9 \ ucred.9 crcopy.9 \ Modified: head/share/man/man9/timeout.9 ============================================================================== --- head/share/man/man9/timeout.9 Thu Jul 28 08:53:38 2016 (r303424) +++ head/share/man/man9/timeout.9 Thu Jul 28 08:57:01 2016 (r303425) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 4, 2016 +.Dd July 27, 2016 .Dt TIMEOUT 9 .Os .Sh NAME @@ -56,6 +56,7 @@ .Nm callout_schedule_sbt_curcpu , .Nm callout_schedule_sbt_on , .Nm callout_stop , +.Nm callout_when , .Nm timeout , .Nm untimeout .Nd execute a function after a specified length of time @@ -91,20 +92,48 @@ struct callout_handle handle = CALLOUT_H .Ft int .Fn callout_reset "struct callout *c" "int ticks" "timeout_t *func" "void *arg" .Ft int -.Fn callout_reset_curcpu "struct callout *c" "int ticks" "timeout_t *func" \ -"void *arg" -.Ft int -.Fn callout_reset_on "struct callout *c" "int ticks" "timeout_t *func" \ -"void *arg" "int cpu" -.Ft int -.Fn callout_reset_sbt "struct callout *c" "sbintime_t sbt" \ -"sbintime_t pr" "timeout_t *func" "void *arg" "int flags" -.Ft int -.Fn callout_reset_sbt_curcpu "struct callout *c" "sbintime_t sbt" \ -"sbintime_t pr" "timeout_t *func" "void *arg" "int flags" -.Ft int -.Fn callout_reset_sbt_on "struct callout *c" "sbintime_t sbt" \ -"sbintime_t pr" "timeout_t *func" "void *arg" "int cpu" "int flags" +.Fo callout_reset_curcpu +.Fa "struct callout *c" +.Fa "int ticks" +.Fa "timeout_t *func" +.Fa "void *arg" +.Fc +.Ft int +.Fo callout_reset_on +.Fa "struct callout *c" +.Fa "int ticks" +.Fa "timeout_t *func" +.Fa "void *arg" +.Fa "int cpu" +.Fc +.Ft int +.Fo callout_reset_sbt +.Fa "struct callout *c" +.Fa "sbintime_t sbt" +.Fa "sbintime_t pr" +.Fa "timeout_t *func" +.Fa "void *arg" +.Fa "int flags" +.Fc +.Ft int +.Fo callout_reset_sbt_curcpu +.Fa "struct callout *c" +.Fa "sbintime_t sbt" +.Fa "sbintime_t pr" +.Fa "timeout_t *func" +.Fa "void *arg" +.Fa "int flags" +.Fc +.Ft int +.Fo callout_reset_sbt_on +.Fa "struct callout *c" +.Fa "sbintime_t sbt" +.Fa "sbintime_t pr" +.Fa "timeout_t *func" +.Fa "void *arg" +.Fa "int cpu" +.Fa "int flags" +.Fc .Ft int .Fn callout_schedule "struct callout *c" "int ticks" .Ft int @@ -112,16 +141,37 @@ struct callout_handle handle = CALLOUT_H .Ft int .Fn callout_schedule_on "struct callout *c" "int ticks" "int cpu" .Ft int -.Fn callout_schedule_sbt "struct callout *c" "sbintime_t sbt" \ -"sbintime_t pr" "int flags" -.Ft int -.Fn callout_schedule_sbt_curcpu "struct callout *c" "sbintime_t sbt" \ -"sbintime_t pr" "int flags" -.Ft int -.Fn callout_schedule_sbt_on "struct callout *c" "sbintime_t sbt" \ -"sbintime_t pr" "int cpu" "int flags" +.Fo callout_schedule_sbt +.Fa "struct callout *c" +.Fa "sbintime_t sbt" +.Fa "sbintime_t pr" +.Fa "int flags" +.Fc +.Ft int +.Fo callout_schedule_sbt_curcpu +.Fa "struct callout *c" +.Fa "sbintime_t sbt" +.Fa "sbintime_t pr" +.Fa "int flags" +.Fc +.Ft int +.Fo callout_schedule_sbt_on +.Fa "struct callout *c" +.Fa "sbintime_t sbt" +.Fa "sbintime_t pr" +.Fa "int cpu" +.Fa "int flags" +.Fc .Ft int .Fn callout_stop "struct callout *c" +.Ft sbintime_t +.Fo callout_when +.Fa "sbintime_t sbt" +.Fa "sbintime_t precision" +.Fa "int flags" +.Fa "sbintime_t *sbt_res" +.Fa "sbintime_t *precision_res" +.Fc .Ft struct callout_handle .Fn timeout "timeout_t *func" "void *arg" "int ticks" .Ft void @@ -387,6 +437,26 @@ or this value is used as the length of t Smaller values .Pq which result in larger time intervals allow the callout subsystem to aggregate more events in one timer interrupt. +.It Dv C_PRECALC +The +.Fa sbt +argument specifies the absolute time at which the callout should be run, +and the +.Fa pr +argument specifies the requested precision, which will not be +adjusted during the scheduling process. +The +.Fa sbt +and +.Fa pr +values should be calculated by an earlier call to +.Fn callout_when +which uses the user-supplied +.Fa sbt , +.Fa pr , +and +.Fa flags +values. .It Dv C_HARDCLOCK Align the timeouts to .Fn hardclock @@ -503,6 +573,39 @@ but it .Em does not clear it when a callout expires normally via the execution of the callout function. +.Pp +The +.Fn callout_when +function may be used to pre-calculate the absolute time at which the +timeout should be run and the precision of the scheduled run time +according to the required time +.Fa sbt , +precision +.Fa precision , +and additional adjustments requested by the +.Fa flags +argument. +Flags accepted by the +.Fn callout_when +function are the same as flags for the +.Fn callout_reset +function. +The resulting time is assigned to the variable pointed to by the +.Fa sbt_res +argument, and the resulting precision is assigned to +.Fa *precision_res . +When passing the results to +.Fa callout_reset , +add the +.Va C_PRECALC +flag to +.Fa flags , +to avoid incorrect re-adjustment. +The function is intended for situations where precise time of the callout +run should be known in advance, since +trying to read this time from the callout structure itself after a +.Fn callout_reset +call is racy. .Ss "Avoiding Race Conditions" The callout subsystem invokes callout functions from its own thread context. Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Thu Jul 28 08:53:38 2016 (r303424) +++ head/sys/kern/kern_timeout.c Thu Jul 28 08:57:01 2016 (r303425) @@ -945,6 +945,56 @@ callout_handle_init(struct callout_handl handle->callout = NULL; } +void +callout_when(sbintime_t sbt, sbintime_t precision, int flags, + sbintime_t *res, sbintime_t *prec_res) +{ + sbintime_t to_sbt, to_pr; + + if ((flags & (C_ABSOLUTE | C_PRECALC)) != 0) { + *res = sbt; + *prec_res = precision; + return; + } + if ((flags & C_HARDCLOCK) != 0 && sbt < tick_sbt) + sbt = tick_sbt; + if ((flags & C_HARDCLOCK) != 0 || +#ifdef NO_EVENTTIMERS + sbt >= sbt_timethreshold) { + to_sbt = getsbinuptime(); + + /* Add safety belt for the case of hz > 1000. */ + to_sbt += tc_tick_sbt - tick_sbt; +#else + sbt >= sbt_tickthreshold) { + /* + * Obtain the time of the last hardclock() call on + * this CPU directly from the kern_clocksource.c. + * This value is per-CPU, but it is equal for all + * active ones. + */ +#ifdef __LP64__ + to_sbt = DPCPU_GET(hardclocktime); +#else + spinlock_enter(); + to_sbt = DPCPU_GET(hardclocktime); + spinlock_exit(); +#endif +#endif + if ((flags & C_HARDCLOCK) == 0) + to_sbt += tick_sbt; + } else + to_sbt = sbinuptime(); + if (SBT_MAX - to_sbt < sbt) + to_sbt = SBT_MAX; + else + to_sbt += sbt; + *res = to_sbt; + to_pr = ((C_PRELGET(flags) < 0) ? sbt >> tc_precexp : + sbt >> C_PRELGET(flags)); + *prec_res = to_pr > precision ? to_pr : precision; +} + /* * New interface; clients allocate their own callout structures. * @@ -962,10 +1012,10 @@ callout_handle_init(struct callout_handl * callout_deactivate() - marks the callout as having been serviced */ int -callout_reset_sbt_on(struct callout *c, sbintime_t sbt, sbintime_t precision, +callout_reset_sbt_on(struct callout *c, sbintime_t sbt, sbintime_t prec, void (*ftn)(void *), void *arg, int cpu, int flags) { - sbintime_t to_sbt, pr; + sbintime_t to_sbt, precision; struct callout_cpu *cc; int cancelled, direct; int ignore_cpu=0; @@ -978,47 +1028,8 @@ callout_reset_sbt_on(struct callout *c, /* Invalid CPU spec */ panic("Invalid CPU in callout %d", cpu); } - if (flags & C_ABSOLUTE) { - to_sbt = sbt; - } else { - if ((flags & C_HARDCLOCK) && (sbt < tick_sbt)) - sbt = tick_sbt; - if ((flags & C_HARDCLOCK) || -#ifdef NO_EVENTTIMERS - sbt >= sbt_timethreshold) { - to_sbt = getsbinuptime(); + callout_when(sbt, prec, flags, &to_sbt, &precision); - /* Add safety belt for the case of hz > 1000. */ - to_sbt += tc_tick_sbt - tick_sbt; -#else - sbt >= sbt_tickthreshold) { - /* - * Obtain the time of the last hardclock() call on - * this CPU directly from the kern_clocksource.c. - * This value is per-CPU, but it is equal for all - * active ones. - */ -#ifdef __LP64__ - to_sbt = DPCPU_GET(hardclocktime); -#else - spinlock_enter(); - to_sbt = DPCPU_GET(hardclocktime); - spinlock_exit(); -#endif -#endif - if ((flags & C_HARDCLOCK) == 0) - to_sbt += tick_sbt; - } else - to_sbt = sbinuptime(); - if (SBT_MAX - to_sbt < sbt) - to_sbt = SBT_MAX; - else - to_sbt += sbt; - pr = ((C_PRELGET(flags) < 0) ? sbt >> tc_precexp : - sbt >> C_PRELGET(flags)); - if (pr > precision) - precision = pr; - } /* * This flag used to be added by callout_cc_add, but the * first time you call this we could end up with the Modified: head/sys/sys/callout.h ============================================================================== --- head/sys/sys/callout.h Thu Jul 28 08:53:38 2016 (r303424) +++ head/sys/sys/callout.h Thu Jul 28 08:57:01 2016 (r303425) @@ -57,6 +57,7 @@ #define C_PRELGET(x) (int)((((x) >> 1) & C_PRELRANGE) - 1) #define C_HARDCLOCK 0x0100 /* align to hardclock() calls */ #define C_ABSOLUTE 0x0200 /* event time is absolute. */ +#define C_PRECALC 0x0400 /* event time is pre-calculated. */ struct callout_handle { struct callout *callout; @@ -129,6 +130,8 @@ int _callout_stop_safe(struct callout *, void callout_process(sbintime_t now); #define callout_async_drain(c, d) \ _callout_stop_safe(c, 0, d) +void callout_when(sbintime_t sbt, sbintime_t precision, int flags, + sbintime_t *sbt_res, sbintime_t *prec_res); #endif #endif /* _SYS_CALLOUT_H_ */ From owner-svn-src-head@freebsd.org Thu Jul 28 09:09: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 C57D5BA6C22; Thu, 28 Jul 2016 09:09: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 965171310; Thu, 28 Jul 2016 09:09: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 u6S99t71066659; Thu, 28 Jul 2016 09:09:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6S99t01066655; Thu, 28 Jul 2016 09:09:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201607280909.u6S99t01066655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 28 Jul 2016 09:09:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303426 - in head/sys: ddb 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.22 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, 28 Jul 2016 09:09:56 -0000 Author: kib Date: Thu Jul 28 09:09:55 2016 New Revision: 303426 URL: https://svnweb.freebsd.org/changeset/base/303426 Log: Rewrite subr_sleepqueue.c use of callouts to not depend on the specifics of callout KPI. Esp., do not depend on the exact interface of callout_stop(9) return values. The main change is that instead of requiring precise callouts, code maintains absolute time to wake up. Callouts now should ensure that a wake occurs at the requested moment, but we can tolerate both run-away callout, and callout_stop(9) lying about running callout either way. As consequence, it removes the constant source of the bugs where sleepq_check_timeout() causes uninterruptible thread state where the thread is detached from CPU, see e.g. r234952 and r296320. Patch also removes dual meaning of the TDF_TIMEOUT flag, making code (IMO much) simpler to reason about. Tested by: pho Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential revision: https://reviews.freebsd.org/D7137 Modified: head/sys/ddb/db_ps.c head/sys/kern/kern_thread.c head/sys/kern/subr_sleepqueue.c head/sys/sys/proc.h Modified: head/sys/ddb/db_ps.c ============================================================================== --- head/sys/ddb/db_ps.c Thu Jul 28 08:57:01 2016 (r303425) +++ head/sys/ddb/db_ps.c Thu Jul 28 09:09:55 2016 (r303426) @@ -375,8 +375,13 @@ DB_SHOW_COMMAND(thread, db_show_thread) db_printf(" lock: %s turnstile: %p\n", td->td_lockname, td->td_blocked); if (TD_ON_SLEEPQ(td)) - db_printf(" wmesg: %s wchan: %p\n", td->td_wmesg, - td->td_wchan); + db_printf( + " wmesg: %s wchan: %p sleeptimo %lx. %jx (curr %lx. %jx)\n", + td->td_wmesg, td->td_wchan, + (long)sbttobt(td->td_sleeptimo).sec, + (uintmax_t)sbttobt(td->td_sleeptimo).frac, + (long)sbttobt(sbinuptime()).sec, + (uintmax_t)sbttobt(sbinuptime()).frac); db_printf(" priority: %d\n", td->td_priority); db_printf(" container lock: %s (%p)\n", lock->lo_name, lock); if (td->td_swvoltick != 0) { Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Thu Jul 28 08:57:01 2016 (r303425) +++ head/sys/kern/kern_thread.c Thu Jul 28 09:09:55 2016 (r303426) @@ -318,7 +318,7 @@ thread_reap(void) /* * Don't even bother to lock if none at this instant, - * we really don't care about the next instant.. + * we really don't care about the next instant. */ if (!TAILQ_EMPTY(&zombie_threads)) { mtx_lock_spin(&zombie_lock); @@ -383,6 +383,7 @@ thread_free(struct thread *td) if (td->td_kstack != 0) vm_thread_dispose(td); vm_domain_policy_cleanup(&td->td_vm_dom_policy); + callout_drain(&td->td_slpcallout); uma_zfree(thread_zone, td); } @@ -580,6 +581,7 @@ thread_wait(struct proc *p) td->td_cpuset = NULL; cpu_thread_clean(td); thread_cow_free(td); + callout_drain(&td->td_slpcallout); thread_reap(); /* check for zombie threads etc. */ } Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Thu Jul 28 08:57:01 2016 (r303425) +++ head/sys/kern/subr_sleepqueue.c Thu Jul 28 09:09:55 2016 (r303426) @@ -378,6 +378,7 @@ sleepq_set_timeout_sbt(void *wchan, sbin { struct sleepqueue_chain *sc; struct thread *td; + sbintime_t pr1; td = curthread; sc = SC_LOOKUP(wchan); @@ -387,8 +388,14 @@ sleepq_set_timeout_sbt(void *wchan, sbin MPASS(wchan != NULL); if (cold) panic("timed sleep before timers are working"); - callout_reset_sbt_on(&td->td_slpcallout, sbt, pr, - sleepq_timeout, td, PCPU_GET(cpuid), flags | C_DIRECT_EXEC); + KASSERT(td->td_sleeptimo == 0, ("td %d %p td_sleeptimo %jx", + td->td_tid, td, (uintmax_t)td->td_sleeptimo)); + thread_lock(td); + callout_when(sbt, pr, flags, &td->td_sleeptimo, &pr1); + thread_unlock(td); + callout_reset_sbt_on(&td->td_slpcallout, td->td_sleeptimo, pr1, + sleepq_timeout, td, PCPU_GET(cpuid), flags | C_PRECALC | + C_DIRECT_EXEC); } /* @@ -576,37 +583,36 @@ static int sleepq_check_timeout(void) { struct thread *td; + int res; td = curthread; THREAD_LOCK_ASSERT(td, MA_OWNED); /* - * If TDF_TIMEOUT is set, we timed out. + * If TDF_TIMEOUT is set, we timed out. But recheck + * td_sleeptimo anyway. */ - if (td->td_flags & TDF_TIMEOUT) { - td->td_flags &= ~TDF_TIMEOUT; - return (EWOULDBLOCK); + res = 0; + if (td->td_sleeptimo != 0) { + if (td->td_sleeptimo <= sbinuptime()) + res = EWOULDBLOCK; + td->td_sleeptimo = 0; } - - /* - * If TDF_TIMOFAIL is set, the timeout ran after we had - * already been woken up. - */ - if (td->td_flags & TDF_TIMOFAIL) - td->td_flags &= ~TDF_TIMOFAIL; - - /* - * If callout_stop() fails, then the timeout is running on - * another CPU, so synchronize with it to avoid having it - * accidentally wake up a subsequent sleep. - */ - else if (_callout_stop_safe(&td->td_slpcallout, CS_EXECUTING, NULL) - == 0) { - td->td_flags |= TDF_TIMEOUT; - TD_SET_SLEEPING(td); - mi_switch(SW_INVOL | SWT_SLEEPQTIMO, NULL); - } - return (0); + if (td->td_flags & TDF_TIMEOUT) + td->td_flags &= ~TDF_TIMEOUT; + else + /* + * We ignore the situation where timeout subsystem was + * unable to stop our callout. The struct thread is + * type-stable, the callout will use the correct + * memory when running. The checks of the + * td_sleeptimo value in this function and in + * sleepq_timeout() ensure that the thread does not + * get spurious wakeups, even if the callout was reset + * or thread reused. + */ + callout_stop(&td->td_slpcallout); + return (res); } /* @@ -914,12 +920,17 @@ sleepq_timeout(void *arg) CTR3(KTR_PROC, "sleepq_timeout: thread %p (pid %ld, %s)", (void *)td, (long)td->td_proc->p_pid, (void *)td->td_name); - /* - * First, see if the thread is asleep and get the wait channel if - * it is. - */ thread_lock(td); - if (TD_IS_SLEEPING(td) && TD_ON_SLEEPQ(td)) { + + if (td->td_sleeptimo > sbinuptime() || td->td_sleeptimo == 0) { + /* + * The thread does not want a timeout (yet). + */ + } else if (TD_IS_SLEEPING(td) && TD_ON_SLEEPQ(td)) { + /* + * See if the thread is asleep and get the wait + * channel if it is. + */ wchan = td->td_wchan; sc = SC_LOOKUP(wchan); THREAD_LOCKPTR_ASSERT(td, &sc->sc_lock); @@ -927,40 +938,16 @@ sleepq_timeout(void *arg) MPASS(sq != NULL); td->td_flags |= TDF_TIMEOUT; wakeup_swapper = sleepq_resume_thread(sq, td, 0); - thread_unlock(td); - if (wakeup_swapper) - kick_proc0(); - return; - } - - /* - * If the thread is on the SLEEPQ but isn't sleeping yet, it - * can either be on another CPU in between sleepq_add() and - * one of the sleepq_*wait*() routines or it can be in - * sleepq_catch_signals(). - */ - if (TD_ON_SLEEPQ(td)) { + } else if (TD_ON_SLEEPQ(td)) { + /* + * If the thread is on the SLEEPQ but isn't sleeping + * yet, it can either be on another CPU in between + * sleepq_add() and one of the sleepq_*wait*() + * routines or it can be in sleepq_catch_signals(). + */ td->td_flags |= TDF_TIMEOUT; - thread_unlock(td); - return; } - /* - * Now check for the edge cases. First, if TDF_TIMEOUT is set, - * then the other thread has already yielded to us, so clear - * the flag and resume it. If TDF_TIMEOUT is not set, then the - * we know that the other thread is not on a sleep queue, but it - * hasn't resumed execution yet. In that case, set TDF_TIMOFAIL - * to let it know that the timeout has already run and doesn't - * need to be canceled. - */ - if (td->td_flags & TDF_TIMEOUT) { - MPASS(TD_IS_SLEEPING(td)); - td->td_flags &= ~TDF_TIMEOUT; - TD_CLR_SLEEPING(td); - wakeup_swapper = setrunnable(td); - } else - td->td_flags |= TDF_TIMOFAIL; thread_unlock(td); if (wakeup_swapper) kick_proc0(); Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Thu Jul 28 08:57:01 2016 (r303425) +++ head/sys/sys/proc.h Thu Jul 28 09:09:55 2016 (r303426) @@ -282,6 +282,7 @@ struct thread { int td_no_sleeping; /* (k) Sleeping disabled count. */ int td_dom_rr_idx; /* (k) RR Numa domain selection. */ void *td_su; /* (k) FFS SU private */ + sbintime_t td_sleeptimo; /* (t) Sleep timeout. */ #define td_endzero td_sigmask /* Copied during fork1() or create_thread(). */ @@ -388,7 +389,7 @@ do { \ #define TDF_ALLPROCSUSP 0x00000200 /* suspended by SINGLE_ALLPROC */ #define TDF_BOUNDARY 0x00000400 /* Thread suspended at user boundary */ #define TDF_ASTPENDING 0x00000800 /* Thread has some asynchronous events. */ -#define TDF_TIMOFAIL 0x00001000 /* Timeout from sleep after we were awake. */ +#define TDF_UNUSED12 0x00001000 /* --available-- */ #define TDF_SBDRY 0x00002000 /* Stop only on usermode boundary. */ #define TDF_UPIBLOCKED 0x00004000 /* Thread blocked on user PI mutex. */ #define TDF_NEEDSUSPCHK 0x00008000 /* Thread may need to suspend. */ From owner-svn-src-head@freebsd.org Thu Jul 28 09:50: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 AECB8BA7731; Thu, 28 Jul 2016 09:50:20 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BC19189E; Thu, 28 Jul 2016 09:50:20 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6S9oJYF081488; Thu, 28 Jul 2016 09:50:19 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6S9oJ2E081486; Thu, 28 Jul 2016 09:50:19 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201607280950.u6S9oJ2E081486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 28 Jul 2016 09:50:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303427 - in head/include: . xlocale 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.22 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, 28 Jul 2016 09:50:20 -0000 Author: ed Date: Thu Jul 28 09:50:19 2016 New Revision: 303427 URL: https://svnweb.freebsd.org/changeset/base/303427 Log: Change type of MB_CUR_MAX and MB_CUR_MAX_L() to size_t. POSIX requires that MB_CUR_MAX expands to an expression of type size_t. It currently expands to an int. As these are already macros, don't change the underlying type of these functions. There is no ned to touch those. Differential Revision: https://reviews.freebsd.org/D6645 Modified: head/include/stdlib.h head/include/xlocale/_stdlib.h Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Thu Jul 28 09:09:55 2016 (r303426) +++ head/include/stdlib.h Thu Jul 28 09:50:19 2016 (r303427) @@ -77,7 +77,7 @@ __BEGIN_DECLS #endif extern int __mb_cur_max; extern int ___mb_cur_max(void); -#define MB_CUR_MAX (___mb_cur_max()) +#define MB_CUR_MAX ((size_t)___mb_cur_max()) _Noreturn void abort(void); int abs(int) __pure2; Modified: head/include/xlocale/_stdlib.h ============================================================================== --- head/include/xlocale/_stdlib.h Thu Jul 28 09:09:55 2016 (r303426) +++ head/include/xlocale/_stdlib.h Thu Jul 28 09:50:19 2016 (r303427) @@ -55,5 +55,5 @@ size_t wcstombs_l(char * __restrict, int wctomb_l(char *, wchar_t, locale_t); int ___mb_cur_max_l(locale_t); -#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x)) +#define MB_CUR_MAX_L(x) ((size_t)___mb_cur_max_l(x)) From owner-svn-src-head@freebsd.org Thu Jul 28 10:05: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 BBDBBBA7E61; Thu, 28 Jul 2016 10:05:42 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7157215E7; Thu, 28 Jul 2016 10:05:42 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6SA5fA9088614; Thu, 28 Jul 2016 10:05:41 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SA5frW088611; Thu, 28 Jul 2016 10:05:41 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201607281005.u6SA5frW088611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 28 Jul 2016 10:05:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303428 - in head: include lib/libc/net 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.22 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, 28 Jul 2016 10:05:42 -0000 Author: ed Date: Thu Jul 28 10:05:41 2016 New Revision: 303428 URL: https://svnweb.freebsd.org/changeset/base/303428 Log: Add NI_NUMERICSCOPE. POSIX also declares NI_NUMERICSCOPE, which makes getnameinfo() return a numerical scope identifier. The interesting thing is that support for this is already present in code, but #ifdef disabled. Expose this functionality by placing a definition for it in . While there, remove references to NI_WITHSCOPEID, as that got removed 11 years ago. Modified: head/include/netdb.h head/lib/libc/net/getnameinfo.3 head/lib/libc/net/getnameinfo.c Modified: head/include/netdb.h ============================================================================== --- head/include/netdb.h Thu Jul 28 09:50:19 2016 (r303427) +++ head/include/netdb.h Thu Jul 28 10:05:41 2016 (r303428) @@ -214,9 +214,7 @@ struct addrinfo { #define NI_NAMEREQD 0x00000004 #define NI_NUMERICSERV 0x00000008 #define NI_DGRAM 0x00000010 -#if 0 /* obsolete */ -#define NI_WITHSCOPEID 0x00000020 -#endif +#define NI_NUMERICSCOPE 0x00000020 /* * Scope delimit character Modified: head/lib/libc/net/getnameinfo.3 ============================================================================== --- head/lib/libc/net/getnameinfo.3 Thu Jul 28 09:50:19 2016 (r303427) +++ head/lib/libc/net/getnameinfo.3 Thu Jul 28 10:05:41 2016 (r303428) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 20, 2015 +.Dd July 28, 2016 .Dt GETNAMEINFO 3 .Os .Sh NAME @@ -111,7 +111,7 @@ The argument is formed by .Tn OR Ns 'ing the following values: -.Bl -tag -width "NI_NUMERICHOSTXX" +.Bl -tag -width "NI_NUMERICSCOPEXX" .It Dv NI_NOFQDN A fully qualified domain name is not required for local hosts. The local part of the fully qualified domain name is returned instead. @@ -127,6 +127,8 @@ If the host name is not found and the fl address is returned in numeric form. .It NI_NUMERICSERV The service name is returned as a digit string representing the port number. +.It NI_NUMERICSCOPE +The scope identifier is returned as a digit string. .It NI_DGRAM Specifies that the service being looked up is a datagram service, and causes Modified: head/lib/libc/net/getnameinfo.c ============================================================================== --- head/lib/libc/net/getnameinfo.c Thu Jul 28 09:50:19 2016 (r303427) +++ head/lib/libc/net/getnameinfo.c Thu Jul 28 10:05:41 2016 (r303428) @@ -378,7 +378,6 @@ ip6_sa2str(const struct sockaddr_in6 *sa ifindex = (unsigned int)sa6->sin6_scope_id; a6 = &sa6->sin6_addr; -#ifdef NI_NUMERICSCOPE if ((flags & NI_NUMERICSCOPE) != 0) { n = snprintf(buf, bufsiz, "%u", sa6->sin6_scope_id); if (n < 0 || n >= bufsiz) @@ -386,7 +385,6 @@ ip6_sa2str(const struct sockaddr_in6 *sa else return n; } -#endif /* if_indextoname() does not take buffer size. not a good api... */ if ((IN6_IS_ADDR_LINKLOCAL(a6) || IN6_IS_ADDR_MC_LINKLOCAL(a6) || From owner-svn-src-head@freebsd.org Thu Jul 28 10:48: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 D7F4DBA7ABC; Thu, 28 Jul 2016 10:48:21 +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 7289A13DE; Thu, 28 Jul 2016 10:48:21 +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 u6SAmKYF004067; Thu, 28 Jul 2016 10:48:20 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SAmK3l004061; Thu, 28 Jul 2016 10:48:20 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201607281048.u6SAmK3l004061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 28 Jul 2016 10:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303429 - in head: share/man/man4 sys/dev/ntb 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.22 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, 28 Jul 2016 10:48:22 -0000 Author: mav Date: Thu Jul 28 10:48:20 2016 New Revision: 303429 URL: https://svnweb.freebsd.org/changeset/base/303429 Log: Once more refactor KPI between NTB hardware and consumers. New design allows hardware resources to be split between several consumers. For example, one BAR can be dedicated for remote memory access, while other resources can be used for packet transport for virtual Ethernet interface. And even without resource split, this code allows to specify which consumer driver should attach the hardware. From some points this makes the code even closer to Linux one, even though Linux does not provide the described flexibility. Modified: head/share/man/man4/ntb_hw.4 head/sys/dev/ntb/ntb.c head/sys/dev/ntb/ntb.h head/sys/dev/ntb/ntb_hw/ntb_hw.c head/sys/dev/ntb/ntb_if.m head/sys/dev/ntb/ntb_transport.c Modified: head/share/man/man4/ntb_hw.4 ============================================================================== --- head/share/man/man4/ntb_hw.4 Thu Jul 28 10:05:41 2016 (r303428) +++ head/share/man/man4/ntb_hw.4 Thu Jul 28 10:48:20 2016 (r303429) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 10, 2016 +.Dd July 28, 2016 .Dt NTB_HW 4 .Os .Sh NAME @@ -51,6 +51,20 @@ The following tunables are settable from .It Va hw.ntb.debug_level Driver debug level. The default value is 0, higher means more verbose. +.It Va hint.ntb_hw. Ns Ar X Ns Va .config +Configures NTB resources split between several consumer devices. +Configuration of multiple consumer devices separated by commas. +Each device can be configured as: "[:[:[:]]]", where: +.Va name +is a name of the driver which should attach the device (empty means any), +.Va mw +is a number of memory windows to allocate (empty means all available), +.Va spad +is a number of scratchpad registers to allocate (empty means all available), +.Va db +is a number of doorbells to allocate (empty means all available). +The default configuration is empty string, which means single device +with all available resources allowing any driver attachment. .El .Sh DESCRIPTION The NTB allows you to connect two computer systems using a PCIe link if they @@ -69,7 +83,7 @@ The hardware provides 2-3 memory windows On Xeon processors one of memory windows is typically consumed by the driver to workaround multiple hardware erratas. .Sh CONFIGURATION -Tne NTB configuration should be set by BIOS. +The NTB configuration should be set by BIOS. It includes enabling NTB, choosing between NTB-to-NTB or NTB-to-Root Port mode, enabling split BAR mode (one of two 64-bit BARs can be split into two 32-bit ones) and configuring BAR sizes in bits (from 12 to 29/39) for both NTB sides. Modified: head/sys/dev/ntb/ntb.c ============================================================================== --- head/sys/dev/ntb/ntb.c Thu Jul 28 10:05:41 2016 (r303428) +++ head/sys/dev/ntb/ntb.c Thu Jul 28 10:48:20 2016 (r303429) @@ -31,6 +31,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -39,4 +41,422 @@ __FBSDID("$FreeBSD$"); devclass_t ntb_hw_devclass; SYSCTL_NODE(_hw, OID_AUTO, ntb, CTLFLAG_RW, 0, "NTB sysctls"); +struct ntb_child { + device_t dev; + int enabled; + int mwoff; + int mwcnt; + int spadoff; + int spadcnt; + int dboff; + int dbmask; + void *ctx; + const struct ntb_ctx_ops *ctx_ops; + struct rmlock ctx_lock; + struct ntb_child *next; +}; + +int +ntb_register_device(device_t dev) +{ + struct ntb_child **cpp = device_get_softc(dev); + struct ntb_child *nc; + int i, mw, mwu, mwt, spad, spadu, spadt, db, dbu, dbt; + char cfg[128] = ""; + char buf[32]; + char *n, *np, *c, *p, *name; + + mwu = 0; + mwt = NTB_MW_COUNT(dev); + spadu = 0; + spadt = NTB_SPAD_COUNT(dev); + dbu = 0; + dbt = flsll(NTB_DB_VALID_MASK(dev)); + + device_printf(dev, "%d memory windows, %d scratchpads, " + "%d doorbells\n", mwt, spadt, dbt); + + snprintf(buf, sizeof(buf), "hint.%s.%d.config", device_get_name(dev), + device_get_unit(dev)); + TUNABLE_STR_FETCH(buf, cfg, sizeof(cfg)); + n = cfg; + i = 0; + while ((c = strsep(&n, ",")) != NULL) { + np = c; + name = strsep(&np, ":"); + if (name != NULL && name[0] == 0) + name = NULL; + p = strsep(&np, ":"); + mw = (p && p[0] != 0) ? strtol(p, NULL, 10) : mwt - mwu; + p = strsep(&np, ":"); + spad = (p && p[0] != 0) ? strtol(p, NULL, 10) : spadt - spadu; + db = (np && np[0] != 0) ? strtol(np, NULL, 10) : dbt - dbu; + + if (mw > mwt - mwu || spad > spadt - spadu || db > dbt - dbu) { + device_printf(dev, "Not enough resources for config\n"); + break; + } + + nc = malloc(sizeof(*nc), M_DEVBUF, M_WAITOK | M_ZERO); + nc->mwoff = mwu; + nc->mwcnt = mw; + nc->spadoff = spadu; + nc->spadcnt = spad; + nc->dboff = dbu; + nc->dbmask = (db == 0) ? 0 : (0xffffffffffffffff >> (64 - db)); + rm_init(&nc->ctx_lock, "ntb ctx"); + nc->dev = device_add_child(dev, name, -1); + if (nc->dev == NULL) { + ntb_unregister_device(dev); + return (ENOMEM); + } + device_set_ivars(nc->dev, nc); + *cpp = nc; + cpp = &nc->next; + + if (bootverbose) { + device_printf(dev, "%d \"%s\":", i, name); + if (mw > 0) { + printf(" memory windows %d", mwu); + if (mw > 1) + printf("-%d", mwu + mw - 1); + } + if (spad > 0) { + printf(" scratchpads %d", spadu); + if (spad > 1) + printf("-%d", spadu + spad - 1); + } + if (db > 0) { + printf(" doorbells %d", dbu); + if (db > 1) + printf("-%d", dbu + db - 1); + } + printf("\n"); + } + + mwu += mw; + spadu += spad; + dbu += db; + i++; + } + + bus_generic_attach(dev); + return (0); +} + +int +ntb_unregister_device(device_t dev) +{ + struct ntb_child **cpp = device_get_softc(dev); + struct ntb_child *nc; + int error = 0; + + while ((nc = *cpp) != NULL) { + *cpp = (*cpp)->next; + error = device_delete_child(dev, nc->dev); + if (error) + break; + rm_destroy(&nc->ctx_lock); + free(nc, M_DEVBUF); + } + return (error); +} + +void +ntb_link_event(device_t dev) +{ + struct ntb_child **cpp = device_get_softc(dev); + struct ntb_child *nc; + struct rm_priotracker ctx_tracker; + + for (nc = *cpp; nc != NULL; nc = nc->next) { + rm_rlock(&nc->ctx_lock, &ctx_tracker); + if (nc->ctx_ops != NULL && nc->ctx_ops->link_event != NULL) + nc->ctx_ops->link_event(nc->ctx); + rm_runlock(&nc->ctx_lock, &ctx_tracker); + } +} + +void +ntb_db_event(device_t dev, uint32_t vec) +{ + struct ntb_child **cpp = device_get_softc(dev); + struct ntb_child *nc; + struct rm_priotracker ctx_tracker; + + for (nc = *cpp; nc != NULL; nc = nc->next) { + rm_rlock(&nc->ctx_lock, &ctx_tracker); + if (nc->ctx_ops != NULL && nc->ctx_ops->db_event != NULL) + nc->ctx_ops->db_event(nc->ctx, vec); + rm_runlock(&nc->ctx_lock, &ctx_tracker); + } +} + +bool +ntb_link_is_up(device_t ntb, enum ntb_speed *speed, enum ntb_width *width) +{ + + return (NTB_LINK_IS_UP(device_get_parent(ntb), speed, width)); +} + +int +ntb_link_enable(device_t ntb, enum ntb_speed speed, enum ntb_width width) +{ + struct ntb_child *nc = device_get_ivars(ntb); + struct ntb_child **cpp = device_get_softc(device_get_parent(nc->dev)); + struct ntb_child *nc1; + + for (nc1 = *cpp; nc1 != NULL; nc1 = nc->next) { + if (nc1->enabled) { + nc->enabled = 1; + return (0); + } + } + nc->enabled = 1; + return (NTB_LINK_ENABLE(device_get_parent(ntb), speed, width)); +} + +int +ntb_link_disable(device_t ntb) +{ + struct ntb_child *nc = device_get_ivars(ntb); + struct ntb_child **cpp = device_get_softc(device_get_parent(nc->dev)); + struct ntb_child *nc1; + + if (!nc->enabled) + return (0); + nc->enabled = 0; + for (nc1 = *cpp; nc1 != NULL; nc1 = nc->next) { + if (nc1->enabled) + return (0); + } + return (NTB_LINK_DISABLE(device_get_parent(ntb))); +} + +bool +ntb_link_enabled(device_t ntb) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (nc->enabled && NTB_LINK_ENABLED(device_get_parent(ntb))); +} + +int +ntb_set_ctx(device_t ntb, void *ctx, const struct ntb_ctx_ops *ctx_ops) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + if (ctx == NULL || ctx_ops == NULL) + return (EINVAL); + + rm_wlock(&nc->ctx_lock); + if (nc->ctx_ops != NULL) { + rm_wunlock(&nc->ctx_lock); + return (EINVAL); + } + nc->ctx = ctx; + nc->ctx_ops = ctx_ops; + rm_wunlock(&nc->ctx_lock); + + return (0); +} + +void * +ntb_get_ctx(device_t ntb, const struct ntb_ctx_ops **ctx_ops) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + KASSERT(nc->ntb_ctx != NULL && nc->ctx_ops != NULL, ("bogus")); + if (ctx_ops != NULL) + *ctx_ops = nc->ctx_ops; + return (nc->ctx); +} + +void +ntb_clear_ctx(device_t ntb) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + rm_wlock(&nc->ctx_lock); + nc->ctx = NULL; + nc->ctx_ops = NULL; + rm_wunlock(&nc->ctx_lock); +} + +uint8_t +ntb_mw_count(device_t ntb) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (nc->mwcnt); +} + +int +ntb_mw_get_range(device_t ntb, unsigned mw_idx, vm_paddr_t *base, + caddr_t *vbase, size_t *size, size_t *align, size_t *align_size, + bus_addr_t *plimit) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_MW_GET_RANGE(device_get_parent(ntb), mw_idx + nc->mwoff, + base, vbase, size, align, align_size, plimit)); +} + +int +ntb_mw_set_trans(device_t ntb, unsigned mw_idx, bus_addr_t addr, size_t size) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_MW_SET_TRANS(device_get_parent(ntb), mw_idx + nc->mwoff, + addr, size)); +} + +int +ntb_mw_clear_trans(device_t ntb, unsigned mw_idx) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_MW_CLEAR_TRANS(device_get_parent(ntb), mw_idx + nc->mwoff)); +} + +int +ntb_mw_get_wc(device_t ntb, unsigned mw_idx, vm_memattr_t *mode) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_MW_GET_WC(device_get_parent(ntb), mw_idx + nc->mwoff, mode)); +} + +int +ntb_mw_set_wc(device_t ntb, unsigned mw_idx, vm_memattr_t mode) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_MW_SET_WC(device_get_parent(ntb), mw_idx + nc->mwoff, mode)); +} + +uint8_t +ntb_spad_count(device_t ntb) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (nc->spadcnt); +} + +void +ntb_spad_clear(device_t ntb) +{ + struct ntb_child *nc = device_get_ivars(ntb); + unsigned i; + + for (i = 0; i < nc->spadcnt; i++) + NTB_SPAD_WRITE(device_get_parent(ntb), i + nc->spadoff, 0); +} + +int +ntb_spad_write(device_t ntb, unsigned int idx, uint32_t val) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_SPAD_WRITE(device_get_parent(ntb), idx + nc->spadoff, val)); +} + +int +ntb_spad_read(device_t ntb, unsigned int idx, uint32_t *val) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_SPAD_READ(device_get_parent(ntb), idx + nc->spadoff, val)); +} + +int +ntb_peer_spad_write(device_t ntb, unsigned int idx, uint32_t val) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_PEER_SPAD_WRITE(device_get_parent(ntb), idx + nc->spadoff, + val)); +} + +int +ntb_peer_spad_read(device_t ntb, unsigned int idx, uint32_t *val) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_PEER_SPAD_READ(device_get_parent(ntb), idx + nc->spadoff, + val)); +} + +uint64_t +ntb_db_valid_mask(device_t ntb) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (nc->dbmask); +} + +int +ntb_db_vector_count(device_t ntb) +{ + + return (NTB_DB_VECTOR_COUNT(device_get_parent(ntb))); +} + +uint64_t +ntb_db_vector_mask(device_t ntb, uint32_t vector) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return ((NTB_DB_VECTOR_MASK(device_get_parent(ntb), vector) + >> nc->dboff) & nc->dbmask); +} + +int +ntb_peer_db_addr(device_t ntb, bus_addr_t *db_addr, vm_size_t *db_size) +{ + + return (NTB_PEER_DB_ADDR(device_get_parent(ntb), db_addr, db_size)); +} + +void +ntb_db_clear(device_t ntb, uint64_t bits) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_DB_CLEAR(device_get_parent(ntb), bits << nc->dboff)); +} + +void +ntb_db_clear_mask(device_t ntb, uint64_t bits) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_DB_CLEAR_MASK(device_get_parent(ntb), bits << nc->dboff)); +} + +uint64_t +ntb_db_read(device_t ntb) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return ((NTB_DB_READ(device_get_parent(ntb)) >> nc->dboff) + & nc->dbmask); +} + +void +ntb_db_set_mask(device_t ntb, uint64_t bits) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_DB_SET_MASK(device_get_parent(ntb), bits << nc->dboff)); +} + +void +ntb_peer_db_set(device_t ntb, uint64_t bits) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_PEER_DB_SET(device_get_parent(ntb), bits << nc->dboff)); +} + MODULE_VERSION(ntb, 1); Modified: head/sys/dev/ntb/ntb.h ============================================================================== --- head/sys/dev/ntb/ntb.h Thu Jul 28 10:05:41 2016 (r303428) +++ head/sys/dev/ntb/ntb.h Thu Jul 28 10:48:20 2016 (r303429) @@ -34,4 +34,376 @@ extern devclass_t ntb_hw_devclass; SYSCTL_DECL(_hw_ntb); +int ntb_register_device(device_t ntb); +int ntb_unregister_device(device_t ntb); + +/* + * ntb_link_event() - notify driver context of a change in link status + * @ntb: NTB device context + * + * Notify the driver context that the link status may have changed. The driver + * should call intb_link_is_up() to get the current status. + */ +void ntb_link_event(device_t ntb); + +/* + * ntb_db_event() - notify driver context of a doorbell event + * @ntb: NTB device context + * @vector: Interrupt vector number + * + * Notify the driver context of a doorbell event. If hardware supports + * multiple interrupt vectors for doorbells, the vector number indicates which + * vector received the interrupt. The vector number is relative to the first + * vector used for doorbells, starting at zero, and must be less than + * ntb_db_vector_count(). The driver may call ntb_db_read() to check which + * doorbell bits need service, and ntb_db_vector_mask() to determine which of + * those bits are associated with the vector number. + */ +void ntb_db_event(device_t ntb, uint32_t vec); + +/* + * ntb_link_is_up() - get the current ntb link state + * @ntb: NTB device context + * @speed: OUT - The link speed expressed as PCIe generation number + * @width: OUT - The link width expressed as the number of PCIe lanes + * + * RETURNS: true or false based on the hardware link state + */ +bool ntb_link_is_up(device_t ntb, enum ntb_speed *speed, enum ntb_width *width); + +/* + * ntb_link_enable() - enable the link on the secondary side of the ntb + * @ntb: NTB device context + * @max_speed: The maximum link speed expressed as PCIe generation number[0] + * @max_width: The maximum link width expressed as the number of PCIe lanes[0] + * + * Enable the link on the secondary side of the ntb. This can only be done + * from the primary side of the ntb in primary or b2b topology. The ntb device + * should train the link to its maximum speed and width, or the requested speed + * and width, whichever is smaller, if supported. + * + * Return: Zero on success, otherwise an error number. + * + * [0]: Only NTB_SPEED_AUTO and NTB_WIDTH_AUTO are valid inputs; other speed + * and width input will be ignored. + */ +int ntb_link_enable(device_t ntb, enum ntb_speed speed, enum ntb_width width); + +/* + * ntb_link_disable() - disable the link on the secondary side of the ntb + * @ntb: NTB device context + * + * Disable the link on the secondary side of the ntb. This can only be done + * from the primary side of the ntb in primary or b2b topology. The ntb device + * should disable the link. Returning from this call must indicate that a + * barrier has passed, though with no more writes may pass in either direction + * across the link, except if this call returns an error number. + * + * Return: Zero on success, otherwise an error number. + */ +int ntb_link_disable(device_t ntb); + +/* + * get enable status of the link on the secondary side of the ntb + */ +bool ntb_link_enabled(device_t ntb); + +/* + * ntb_set_ctx() - associate a driver context with an ntb device + * @ntb: NTB device context + * @ctx: Driver context + * @ctx_ops: Driver context operations + * + * Associate a driver context and operations with a ntb device. The context is + * provided by the client driver, and the driver may associate a different + * context with each ntb device. + * + * Return: Zero if the context is associated, otherwise an error number. + */ +int ntb_set_ctx(device_t ntb, void *ctx, const struct ntb_ctx_ops *ctx_ops); + +/* + * ntb_set_ctx() - get a driver context associated with an ntb device + * @ntb: NTB device context + * @ctx_ops: Driver context operations + * + * Get a driver context and operations associated with a ntb device. + */ +void * ntb_get_ctx(device_t ntb, const struct ntb_ctx_ops **ctx_ops); + +/* + * ntb_clear_ctx() - disassociate any driver context from an ntb device + * @ntb: NTB device context + * + * Clear any association that may exist between a driver context and the ntb + * device. + */ +void ntb_clear_ctx(device_t ntb); + +/* + * ntb_mw_count() - Get the number of memory windows available for KPI + * consumers. + * + * (Excludes any MW wholly reserved for register access.) + */ +uint8_t ntb_mw_count(device_t ntb); + +/* + * ntb_mw_get_range() - get the range of a memory window + * @ntb: NTB device context + * @idx: Memory window number + * @base: OUT - the base address for mapping the memory window + * @size: OUT - the size for mapping the memory window + * @align: OUT - the base alignment for translating the memory window + * @align_size: OUT - the size alignment for translating the memory window + * + * Get the range of a memory window. NULL may be given for any output + * parameter if the value is not needed. The base and size may be used for + * mapping the memory window, to access the peer memory. The alignment and + * size may be used for translating the memory window, for the peer to access + * memory on the local system. + * + * Return: Zero on success, otherwise an error number. + */ +int ntb_mw_get_range(device_t ntb, unsigned mw_idx, vm_paddr_t *base, + caddr_t *vbase, size_t *size, size_t *align, size_t *align_size, + bus_addr_t *plimit); + +/* + * ntb_mw_set_trans() - set the translation of a memory window + * @ntb: NTB device context + * @idx: Memory window number + * @addr: The dma address local memory to expose to the peer + * @size: The size of the local memory to expose to the peer + * + * Set the translation of a memory window. The peer may access local memory + * through the window starting at the address, up to the size. The address + * must be aligned to the alignment specified by ntb_mw_get_range(). The size + * must be aligned to the size alignment specified by ntb_mw_get_range(). The + * address must be below the plimit specified by ntb_mw_get_range() (i.e. for + * 32-bit BARs). + * + * Return: Zero on success, otherwise an error number. + */ +int ntb_mw_set_trans(device_t ntb, unsigned mw_idx, bus_addr_t addr, + size_t size); + +/* + * ntb_mw_clear_trans() - clear the translation of a memory window + * @ntb: NTB device context + * @idx: Memory window number + * + * Clear the translation of a memory window. The peer may no longer access + * local memory through the window. + * + * Return: Zero on success, otherwise an error number. + */ +int ntb_mw_clear_trans(device_t ntb, unsigned mw_idx); + +/* + * ntb_mw_get_wc - Get the write-combine status of a memory window + * + * Returns: Zero on success, setting *wc; otherwise an error number (e.g. if + * idx is an invalid memory window). + * + * Mode is a VM_MEMATTR_* type. + */ +int ntb_mw_get_wc(device_t ntb, unsigned mw_idx, vm_memattr_t *mode); + +/* + * ntb_mw_set_wc - Set the write-combine status of a memory window + * + * If 'mode' matches the current status, this does nothing and succeeds. Mode + * is a VM_MEMATTR_* type. + * + * Returns: Zero on success, setting the caching attribute on the virtual + * mapping of the BAR; otherwise an error number (e.g. if idx is an invalid + * memory window, or if changing the caching attribute fails). + */ +int ntb_mw_set_wc(device_t ntb, unsigned mw_idx, vm_memattr_t mode); + +/* + * ntb_spad_count() - get the total scratch regs usable + * @ntb: pointer to ntb_softc instance + * + * This function returns the max 32bit scratchpad registers usable by the + * upper layer. + * + * RETURNS: total number of scratch pad registers available + */ +uint8_t ntb_spad_count(device_t ntb); + +/* + * ntb_get_max_spads() - zero local scratch registers + * @ntb: pointer to ntb_softc instance + * + * This functions overwrites all local scratchpad registers with zeroes. + */ +void ntb_spad_clear(device_t ntb); + +/* + * ntb_spad_write() - write to the secondary scratchpad register + * @ntb: pointer to ntb_softc instance + * @idx: index to the scratchpad register, 0 based + * @val: the data value to put into the register + * + * This function allows writing of a 32bit value to the indexed scratchpad + * register. The register resides on the secondary (external) side. + * + * RETURNS: An appropriate ERRNO error value on error, or zero for success. + */ +int ntb_spad_write(device_t ntb, unsigned int idx, uint32_t val); + +/* + * ntb_spad_read() - read from the primary scratchpad register + * @ntb: pointer to ntb_softc instance + * @idx: index to scratchpad register, 0 based + * @val: pointer to 32bit integer for storing the register value + * + * This function allows reading of the 32bit scratchpad register on + * the primary (internal) side. + * + * RETURNS: An appropriate ERRNO error value on error, or zero for success. + */ +int ntb_spad_read(device_t ntb, unsigned int idx, uint32_t *val); + +/* + * ntb_peer_spad_write() - write to the secondary scratchpad register + * @ntb: pointer to ntb_softc instance + * @idx: index to the scratchpad register, 0 based + * @val: the data value to put into the register + * + * This function allows writing of a 32bit value to the indexed scratchpad + * register. The register resides on the secondary (external) side. + * + * RETURNS: An appropriate ERRNO error value on error, or zero for success. + */ +int ntb_peer_spad_write(device_t ntb, unsigned int idx, uint32_t val); + +/* + * ntb_peer_spad_read() - read from the primary scratchpad register + * @ntb: pointer to ntb_softc instance + * @idx: index to scratchpad register, 0 based + * @val: pointer to 32bit integer for storing the register value + * + * This function allows reading of the 32bit scratchpad register on + * the primary (internal) side. + * + * RETURNS: An appropriate ERRNO error value on error, or zero for success. + */ +int ntb_peer_spad_read(device_t ntb, unsigned int idx, uint32_t *val); + +/* + * ntb_db_valid_mask() - get a mask of doorbell bits supported by the ntb + * @ntb: NTB device context + * + * Hardware may support different number or arrangement of doorbell bits. + * + * Return: A mask of doorbell bits supported by the ntb. + */ +uint64_t ntb_db_valid_mask(device_t ntb); + +/* + * ntb_db_vector_count() - get the number of doorbell interrupt vectors + * @ntb: NTB device context. + * + * Hardware may support different number of interrupt vectors. + * + * Return: The number of doorbell interrupt vectors. + */ +int ntb_db_vector_count(device_t ntb); + +/* + * ntb_db_vector_mask() - get a mask of doorbell bits serviced by a vector + * @ntb: NTB device context + * @vector: Doorbell vector number + * + * Each interrupt vector may have a different number or arrangement of bits. + * + * Return: A mask of doorbell bits serviced by a vector. + */ +uint64_t ntb_db_vector_mask(device_t ntb, uint32_t vector); + +/* + * ntb_peer_db_addr() - address and size of the peer doorbell register + * @ntb: NTB device context. + * @db_addr: OUT - The address of the peer doorbell register. + * @db_size: OUT - The number of bytes to write the peer doorbell register. + * + * Return the address of the peer doorbell register. This may be used, for + * example, by drivers that offload memory copy operations to a dma engine. + * The drivers may wish to ring the peer doorbell at the completion of memory + * copy operations. For efficiency, and to simplify ordering of operations + * between the dma memory copies and the ringing doorbell, the driver may + * append one additional dma memory copy with the doorbell register as the + * destination, after the memory copy operations. + * + * Return: Zero on success, otherwise an error number. + * + * Note that writing the peer doorbell via a memory window will *not* generate + * an interrupt on the remote host; that must be done separately. + */ +int ntb_peer_db_addr(device_t ntb, bus_addr_t *db_addr, vm_size_t *db_size); + +/* + * ntb_db_clear() - clear bits in the local doorbell register + * @ntb: NTB device context. + * @db_bits: Doorbell bits to clear. + * + * Clear bits in the local doorbell register, arming the bits for the next + * doorbell. + * + * Return: Zero on success, otherwise an error number. + */ +void ntb_db_clear(device_t ntb, uint64_t bits); + +/* + * ntb_db_clear_mask() - clear bits in the local doorbell mask + * @ntb: NTB device context. + * @db_bits: Doorbell bits to clear. + * + * Clear bits in the local doorbell mask register, allowing doorbell interrupts + * from being generated for those doorbell bits. If a doorbell bit is already + * set at the time the mask is cleared, and the corresponding mask bit is + * changed from set to clear, then the ntb driver must ensure that + * ntb_db_event() is called. If the hardware does not generate the interrupt + * on clearing the mask bit, then the driver must call ntb_db_event() anyway. + * + * Return: Zero on success, otherwise an error number. + */ +void ntb_db_clear_mask(device_t ntb, uint64_t bits); + +/* + * ntb_db_read() - read the local doorbell register + * @ntb: NTB device context. + * + * Read the local doorbell register, and return the bits that are set. + * + * Return: The bits currently set in the local doorbell register. + */ +uint64_t ntb_db_read(device_t ntb); + +/* + * ntb_db_set_mask() - set bits in the local doorbell mask + * @ntb: NTB device context. + * @db_bits: Doorbell mask bits to set. + * + * Set bits in the local doorbell mask register, preventing doorbell interrupts + * from being generated for those doorbell bits. Bits that were already set + * must remain set. + * + * Return: Zero on success, otherwise an error number. + */ +void ntb_db_set_mask(device_t ntb, uint64_t bits); + +/* + * ntb_peer_db_set() - Set the doorbell on the secondary/external side + * @ntb: pointer to ntb_softc instance + * @bit: doorbell bits to ring + * + * This function allows triggering of a doorbell on the secondary/external + * side that will initiate an interrupt on the remote host + */ +void ntb_peer_db_set(device_t ntb, uint64_t bits); + #endif /* _NTB_H_ */ Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Jul 28 10:05:41 2016 (r303428) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Jul 28 10:48:20 2016 (r303429) @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -201,6 +200,9 @@ struct ntb_msix_data { }; struct ntb_softc { + /* ntb.c context. Do not move! Must go first! */ + void *ntb_store; + device_t device; enum ntb_device_type type; uint32_t features; @@ -219,10 +221,7 @@ struct ntb_softc { struct callout heartbeat_timer; struct callout lr_timer; - void *ntb_ctx; - const struct ntb_ctx_ops *ctx_ops; struct ntb_vec *msix_vec; - struct rmlock ctx_lock; uint32_t ppd; enum ntb_conn_type conn_type; @@ -284,72 +283,74 @@ bus_space_write_8(bus_space_tag_t tag, b } #endif -#define ntb_bar_read(SIZE, bar, offset) \ +#define intel_ntb_bar_read(SIZE, bar, offset) \ bus_space_read_ ## SIZE (ntb->bar_info[(bar)].pci_bus_tag, \ ntb->bar_info[(bar)].pci_bus_handle, (offset)) -#define ntb_bar_write(SIZE, bar, offset, val) \ +#define intel_ntb_bar_write(SIZE, bar, offset, val) \ bus_space_write_ ## SIZE (ntb->bar_info[(bar)].pci_bus_tag, \ ntb->bar_info[(bar)].pci_bus_handle, (offset), (val)) -#define ntb_reg_read(SIZE, offset) ntb_bar_read(SIZE, NTB_CONFIG_BAR, offset) -#define ntb_reg_write(SIZE, offset, val) \ - ntb_bar_write(SIZE, NTB_CONFIG_BAR, offset, val) -#define ntb_mw_read(SIZE, offset) \ - ntb_bar_read(SIZE, ntb_mw_to_bar(ntb, ntb->b2b_mw_idx), offset) -#define ntb_mw_write(SIZE, offset, val) \ - ntb_bar_write(SIZE, ntb_mw_to_bar(ntb, ntb->b2b_mw_idx), \ +#define intel_ntb_reg_read(SIZE, offset) \ + intel_ntb_bar_read(SIZE, NTB_CONFIG_BAR, offset) +#define intel_ntb_reg_write(SIZE, offset, val) \ + intel_ntb_bar_write(SIZE, NTB_CONFIG_BAR, offset, val) +#define intel_ntb_mw_read(SIZE, offset) \ + intel_ntb_bar_read(SIZE, intel_ntb_mw_to_bar(ntb, ntb->b2b_mw_idx), \ + offset) +#define intel_ntb_mw_write(SIZE, offset, val) \ + intel_ntb_bar_write(SIZE, intel_ntb_mw_to_bar(ntb, ntb->b2b_mw_idx), \ offset, val) -static int ntb_probe(device_t device); -static int ntb_attach(device_t device); -static int ntb_detach(device_t device); -static uint64_t ntb_db_valid_mask(device_t dev); -static void ntb_spad_clear(device_t dev); -static uint64_t ntb_db_vector_mask(device_t dev, uint32_t vector); -static bool ntb_link_is_up(device_t dev, enum ntb_speed *speed, +static int intel_ntb_probe(device_t device); +static int intel_ntb_attach(device_t device); +static int intel_ntb_detach(device_t device); +static uint64_t intel_ntb_db_valid_mask(device_t dev); +static void intel_ntb_spad_clear(device_t dev); +static uint64_t intel_ntb_db_vector_mask(device_t dev, uint32_t vector); +static bool intel_ntb_link_is_up(device_t dev, enum ntb_speed *speed, enum ntb_width *width); -static int ntb_link_enable(device_t dev, enum ntb_speed speed, +static int intel_ntb_link_enable(device_t dev, enum ntb_speed speed, enum ntb_width width); -static int ntb_link_disable(device_t dev); -static int ntb_spad_read(device_t dev, unsigned int idx, uint32_t *val); -static int ntb_peer_spad_write(device_t dev, unsigned int idx, uint32_t val); +static int intel_ntb_link_disable(device_t dev); +static int intel_ntb_spad_read(device_t dev, unsigned int idx, uint32_t *val); +static int intel_ntb_peer_spad_write(device_t dev, unsigned int idx, uint32_t val); -static unsigned ntb_user_mw_to_idx(struct ntb_softc *, unsigned uidx); -static inline enum ntb_bar ntb_mw_to_bar(struct ntb_softc *, unsigned mw); +static unsigned intel_ntb_user_mw_to_idx(struct ntb_softc *, unsigned uidx); +static inline enum ntb_bar intel_ntb_mw_to_bar(struct ntb_softc *, unsigned mw); static inline bool bar_is_64bit(struct ntb_softc *, enum ntb_bar); static inline void bar_get_xlat_params(struct ntb_softc *, enum ntb_bar, uint32_t *base, uint32_t *xlat, uint32_t *lmt); -static int ntb_map_pci_bars(struct ntb_softc *ntb); -static int ntb_mw_set_wc_internal(struct ntb_softc *, unsigned idx, +static int intel_ntb_map_pci_bars(struct ntb_softc *ntb); +static int intel_ntb_mw_set_wc_internal(struct ntb_softc *, unsigned idx, vm_memattr_t); static void print_map_success(struct ntb_softc *, struct ntb_pci_bar_info *, const char *); static int map_mmr_bar(struct ntb_softc *ntb, struct ntb_pci_bar_info *bar); static int map_memory_window_bar(struct ntb_softc *ntb, struct ntb_pci_bar_info *bar); -static void ntb_unmap_pci_bar(struct ntb_softc *ntb); -static int ntb_remap_msix(device_t, uint32_t desired, uint32_t avail); -static int ntb_init_isr(struct ntb_softc *ntb); -static int ntb_setup_legacy_interrupt(struct ntb_softc *ntb); -static int ntb_setup_msix(struct ntb_softc *ntb, uint32_t num_vectors); -static void ntb_teardown_interrupts(struct ntb_softc *ntb); -static inline uint64_t ntb_vec_mask(struct ntb_softc *, uint64_t db_vector); -static void ntb_interrupt(struct ntb_softc *, uint32_t vec); +static void intel_ntb_unmap_pci_bar(struct ntb_softc *ntb); +static int intel_ntb_remap_msix(device_t, uint32_t desired, uint32_t avail); +static int intel_ntb_init_isr(struct ntb_softc *ntb); +static int intel_ntb_setup_legacy_interrupt(struct ntb_softc *ntb); +static int intel_ntb_setup_msix(struct ntb_softc *ntb, uint32_t num_vectors); +static void intel_ntb_teardown_interrupts(struct ntb_softc *ntb); +static inline uint64_t intel_ntb_vec_mask(struct ntb_softc *, uint64_t db_vector); +static void intel_ntb_interrupt(struct ntb_softc *, uint32_t vec); static void ndev_vec_isr(void *arg); static void ndev_irq_isr(void *arg); static inline uint64_t db_ioread(struct ntb_softc *, uint64_t regoff); static inline void db_iowrite(struct ntb_softc *, uint64_t regoff, uint64_t); static inline void db_iowrite_raw(struct ntb_softc *, uint64_t regoff, uint64_t); -static int ntb_create_msix_vec(struct ntb_softc *ntb, uint32_t num_vectors); -static void ntb_free_msix_vec(struct ntb_softc *ntb); -static void ntb_get_msix_info(struct ntb_softc *ntb); -static void ntb_exchange_msix(void *); -static struct ntb_hw_info *ntb_get_device_info(uint32_t device_id); -static void ntb_detect_max_mw(struct ntb_softc *ntb); -static int ntb_detect_xeon(struct ntb_softc *ntb); -static int ntb_detect_atom(struct ntb_softc *ntb); -static int ntb_xeon_init_dev(struct ntb_softc *ntb); -static int ntb_atom_init_dev(struct ntb_softc *ntb); -static void ntb_teardown_xeon(struct ntb_softc *ntb); +static int intel_ntb_create_msix_vec(struct ntb_softc *ntb, uint32_t num_vectors); +static void intel_ntb_free_msix_vec(struct ntb_softc *ntb); +static void intel_ntb_get_msix_info(struct ntb_softc *ntb); +static void intel_ntb_exchange_msix(void *); +static struct ntb_hw_info *intel_ntb_get_device_info(uint32_t device_id); +static void intel_ntb_detect_max_mw(struct ntb_softc *ntb); +static int intel_ntb_detect_xeon(struct ntb_softc *ntb); +static int intel_ntb_detect_atom(struct ntb_softc *ntb); +static int intel_ntb_xeon_init_dev(struct ntb_softc *ntb); +static int intel_ntb_atom_init_dev(struct ntb_softc *ntb); +static void intel_ntb_teardown_xeon(struct ntb_softc *ntb); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Jul 28 11:27: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 6F390BA58F0; Thu, 28 Jul 2016 11:27:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 53BB41C89; Thu, 28 Jul 2016 11:27:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 4C27716E4; Thu, 28 Jul 2016 11:27:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id C136524640; Thu, 28 Jul 2016 11:27:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id DqoiUGoxz0PY; Thu, 28 Jul 2016 11:27:34 +0000 (UTC) Subject: Re: svn commit: r303419 - head/usr.sbin/pmcstudy DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 62BF12463B To: Konstantin Belousov References: <201607272145.u6RLjBZO016327@repo.freebsd.org> <20160728083042.GR38613@kib.kiev.ua> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <5f26182c-c69b-af45-db8d-88de6c8e0ff0@FreeBSD.org> Date: Thu, 28 Jul 2016 04:27:35 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160728083042.GR38613@kib.kiev.ua> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="RGOE6cSWlF13FRXV4rpV9oHpm92WQnvMH" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 28 Jul 2016 11:27:42 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --RGOE6cSWlF13FRXV4rpV9oHpm92WQnvMH Content-Type: multipart/mixed; boundary="J4TVRX84w6V7GRIWPpjEvE1gnlenwx8vQ" From: Bryan Drewery To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <5f26182c-c69b-af45-db8d-88de6c8e0ff0@FreeBSD.org> Subject: Re: svn commit: r303419 - head/usr.sbin/pmcstudy References: <201607272145.u6RLjBZO016327@repo.freebsd.org> <20160728083042.GR38613@kib.kiev.ua> In-Reply-To: <20160728083042.GR38613@kib.kiev.ua> --J4TVRX84w6V7GRIWPpjEvE1gnlenwx8vQ Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 7/28/2016 1:30 AM, Konstantin Belousov wrote: > On Wed, Jul 27, 2016 at 09:45:11PM +0000, Bryan Drewery wrote: >> Author: bdrewery >> Date: Wed Jul 27 21:45:11 2016 >> New Revision: 303419 >> URL: https://svnweb.freebsd.org/changeset/base/303419 >> >> Log: >> Fix non-amd64 build from r292043 after reconnecting in r303410. >> =20 >> MFC after: 3 days >> X-MFC-With: r303410 >> Sponsored by: EMC / Isilon Storage Division >> >> Modified: >> head/usr.sbin/pmcstudy/pmcstudy.c >> >> Modified: head/usr.sbin/pmcstudy/pmcstudy.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/usr.sbin/pmcstudy/pmcstudy.c Wed Jul 27 20:51:31 2016 (r30341= 8) >> +++ head/usr.sbin/pmcstudy/pmcstudy.c Wed Jul 27 21:45:11 2016 (r30341= 9) >> @@ -2322,11 +2322,7 @@ do_cpuid(u_int ax, u_int cx, u_int *p) >> =20 >> #else >> #define cpuid(in, a, b, c, d)=20 >> -static __inline void >> -do_cpuid(u_int ax, u_int cx, u_int *p) >> -{ >> -} >> - >> +#define do_cpuid(ax, cx, p) >> #endif >> =20 >> static void > Should the same code be enabled for i386 as well ? >=20 I don't know. I just know I accidentally disconnected it and when reconnecting it revealed a bug introduced while disconnected. --=20 Regards, Bryan Drewery --J4TVRX84w6V7GRIWPpjEvE1gnlenwx8vQ-- --RGOE6cSWlF13FRXV4rpV9oHpm92WQnvMH 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 iQEcBAEBAgAGBQJXmewnAAoJEDXXcbtuRpfPFOgH/2U/wKceSMEjL/nXOVyGpEB1 Nga3GfXEIqewwnEIifddoZYIv/dwJOjFiocLlkzTsZGIwYB9R5GeNLdM886D2/vI jEuJpFFmp6javpi8VpC2yJpR6M9SfOJLSMDinAFEJcAldNh57rMqxjCRurtCefdn CL9TGLwqJ6OXZp48Sl3a0BzhaaoawsVO1oOe/VkJK27MnOjo/m8EBweLxgob1fMc XJJKcJlOGXult8etYz1mO1mhSK7hQYPydD6zoVGG8EZnT3fe3dg5INY09Y9RNhEU C04/ohzoGMwDnMgHdNPxSoYAEK8ftjLxWXDFwpO9GVM5qbu2D1LqrEmeO/c8esQ= =ADZC -----END PGP SIGNATURE----- --RGOE6cSWlF13FRXV4rpV9oHpm92WQnvMH-- From owner-svn-src-head@freebsd.org Thu Jul 28 12:22: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 E0137BA518A; Thu, 28 Jul 2016 12:22:02 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9268B14A1; Thu, 28 Jul 2016 12:22:02 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6SCM1h2040988; Thu, 28 Jul 2016 12:22:01 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SCM1lI040985; Thu, 28 Jul 2016 12:22:01 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201607281222.u6SCM1lI040985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 28 Jul 2016 12:22:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303435 - in head: lib/libc/sys sys/kern 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.22 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, 28 Jul 2016 12:22:03 -0000 Author: ed Date: Thu Jul 28 12:22:01 2016 New Revision: 303435 URL: https://svnweb.freebsd.org/changeset/base/303435 Log: Change the return type of msgrcv() to ssize_t as required by POSIX. It looks like the msgrcv() system call is already written in such a way that the size is internally computed as a size_t and written into all of td_retval[0]. This means that it is effectively already returning ssize_t. It's just that the userspace prototype doesn't match up. Modified: head/lib/libc/sys/msgrcv.2 head/sys/kern/syscalls.master head/sys/sys/msg.h Modified: head/lib/libc/sys/msgrcv.2 ============================================================================== --- head/lib/libc/sys/msgrcv.2 Thu Jul 28 12:06:40 2016 (r303434) +++ head/lib/libc/sys/msgrcv.2 Thu Jul 28 12:22:01 2016 (r303435) @@ -31,7 +31,7 @@ .\" $FreeBSD$ .\" .\"/ -.Dd July 9, 2009 +.Dd July 28, 2016 .Dt MSGRCV 2 .Os .Sh NAME @@ -43,7 +43,7 @@ .In sys/types.h .In sys/ipc.h .In sys/msg.h -.Ft int +.Ft ssize_t .Fn msgrcv "int msqid" "void *msgp" "size_t msgsz" "long msgtyp" "int msgflg" .Sh DESCRIPTION The Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Thu Jul 28 12:06:40 2016 (r303434) +++ head/sys/kern/syscalls.master Thu Jul 28 12:22:01 2016 (r303435) @@ -428,7 +428,7 @@ 225 AUE_MSGGET NOSTD { int msgget(key_t key, int msgflg); } 226 AUE_MSGSND NOSTD { int msgsnd(int msqid, const void *msgp, \ size_t msgsz, int msgflg); } -227 AUE_MSGRCV NOSTD { int msgrcv(int msqid, void *msgp, \ +227 AUE_MSGRCV NOSTD { ssize_t msgrcv(int msqid, void *msgp, \ size_t msgsz, long msgtyp, int msgflg); } 228 AUE_SHMAT NOSTD { int shmat(int shmid, const void *shmaddr, \ int shmflg); } Modified: head/sys/sys/msg.h ============================================================================== --- head/sys/sys/msg.h Thu Jul 28 12:06:40 2016 (r303434) +++ head/sys/sys/msg.h Thu Jul 28 12:22:01 2016 (r303435) @@ -169,8 +169,7 @@ struct msqid_kernel { __BEGIN_DECLS int msgctl(int, int, struct msqid_ds *); int msgget(key_t, int); -/* XXX return value should be ssize_t. */ -int msgrcv(int, void *, size_t, long, int); +ssize_t msgrcv(int, void *, size_t, long, int); int msgsnd(int, const void *, size_t, int); #if __BSD_VISIBLE int msgsys(int, ...); From owner-svn-src-head@freebsd.org Thu Jul 28 12:22: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 60D4ABA5208; Thu, 28 Jul 2016 12:22:36 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C6A81693; Thu, 28 Jul 2016 12:22:36 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6SCMZDU041627; Thu, 28 Jul 2016 12:22:35 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SCMYtF041621; Thu, 28 Jul 2016 12:22:34 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201607281222.u6SCMYtF041621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 28 Jul 2016 12:22:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303436 - 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.22 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, 28 Jul 2016 12:22:36 -0000 Author: ed Date: Thu Jul 28 12:22:34 2016 New Revision: 303436 URL: https://svnweb.freebsd.org/changeset/base/303436 Log: Regenerate system call table for r303435. Modified: head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Thu Jul 28 12:22:01 2016 (r303435) +++ head/sys/kern/init_sysent.c Thu Jul 28 12:22:34 2016 (r303436) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 302094 2016-06-22 21:15:59Z brooks + * created from FreeBSD: head/sys/kern/syscalls.master 303435 2016-07-28 12:22:01Z ed */ #include "opt_compat.h" Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Thu Jul 28 12:22:01 2016 (r303435) +++ head/sys/kern/syscalls.c Thu Jul 28 12:22:34 2016 (r303436) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 302094 2016-06-22 21:15:59Z brooks + * created from FreeBSD: head/sys/kern/syscalls.master 303435 2016-07-28 12:22:01Z ed */ const char *syscallnames[] = { Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Thu Jul 28 12:22:01 2016 (r303435) +++ head/sys/kern/systrace_args.c Thu Jul 28 12:22:34 2016 (r303436) @@ -9534,7 +9534,7 @@ systrace_return_setargdesc(int sysnum, i /* msgrcv */ case 227: if (ndx == 0 || ndx == 1) - p = "int"; + p = "ssize_t"; break; /* shmat */ case 228: Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Thu Jul 28 12:22:01 2016 (r303435) +++ head/sys/sys/syscall.h Thu Jul 28 12:22:34 2016 (r303436) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 302094 2016-06-22 21:15:59Z brooks + * created from FreeBSD: head/sys/kern/syscalls.master 303435 2016-07-28 12:22:01Z ed */ #define SYS_syscall 0 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Thu Jul 28 12:22:01 2016 (r303435) +++ head/sys/sys/syscall.mk Thu Jul 28 12:22:34 2016 (r303436) @@ -1,7 +1,7 @@ # FreeBSD system call object files. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: head/sys/kern/syscalls.master 302094 2016-06-22 21:15:59Z brooks +# created from FreeBSD: head/sys/kern/syscalls.master 303435 2016-07-28 12:22:01Z ed MIASM = \ syscall.o \ exit.o \ Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Thu Jul 28 12:22:01 2016 (r303435) +++ head/sys/sys/sysproto.h Thu Jul 28 12:22:34 2016 (r303436) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 302094 2016-06-22 21:15:59Z brooks + * created from FreeBSD: head/sys/kern/syscalls.master 303435 2016-07-28 12:22:01Z ed */ #ifndef _SYS_SYSPROTO_H_ From owner-svn-src-head@freebsd.org Thu Jul 28 12:25: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 85E5DBA5355; Thu, 28 Jul 2016 12:25:59 +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 58E5F18E0; Thu, 28 Jul 2016 12:25:59 +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 u6SCPwfn041780; Thu, 28 Jul 2016 12:25:58 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SCPwMb041779; Thu, 28 Jul 2016 12:25:58 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201607281225.u6SCPwMb041779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 28 Jul 2016 12:25:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303437 - head/sys/dev/ntb 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.22 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, 28 Jul 2016 12:25:59 -0000 Author: mav Date: Thu Jul 28 12:25:58 2016 New Revision: 303437 URL: https://svnweb.freebsd.org/changeset/base/303437 Log: Fix r303429 build with invariants. Modified: head/sys/dev/ntb/ntb.c Modified: head/sys/dev/ntb/ntb.c ============================================================================== --- head/sys/dev/ntb/ntb.c Thu Jul 28 12:22:34 2016 (r303436) +++ head/sys/dev/ntb/ntb.c Thu Jul 28 12:25:58 2016 (r303437) @@ -266,7 +266,7 @@ ntb_get_ctx(device_t ntb, const struct n { struct ntb_child *nc = device_get_ivars(ntb); - KASSERT(nc->ntb_ctx != NULL && nc->ctx_ops != NULL, ("bogus")); + KASSERT(nc->ctx != NULL && nc->ctx_ops != NULL, ("bogus")); if (ctx_ops != NULL) *ctx_ops = nc->ctx_ops; return (nc->ctx); From owner-svn-src-head@freebsd.org Thu Jul 28 13:02: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 5B8F1BA5DBB for ; Thu, 28 Jul 2016 13:02:58 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x22c.google.com (mail-yw0-x22c.google.com [IPv6:2607:f8b0:4002:c05::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 1D301128E for ; Thu, 28 Jul 2016 13:02:57 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x22c.google.com with SMTP id j12so85128686ywb.2 for ; Thu, 28 Jul 2016 06:02:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=DucLEfkw/d2TNgZMEZsK38h0bH6dQ4zgnD2YfItKC5c=; b=cUr3JtP92FIgz4d/oOki1oBi+vz8gf3NG+h/HZsDDwhQi8lKpqWjdtInWBFzA7e5kL OqvHuGr6b189r9huthti/ZOSHWqB5atoO56RxXmFLMwr33ww7IqbBrAFI1OyWZTyngTH QGfLxYgo+e3Pohxdzyt/50KTZbcIPm9cgZ6+6acHDKbfZsvsApqyB2Y9vwPUY5niD/fm hBSa5uqQS3vXKxDj2i2C+U9FxbtWJ1ZtsIbr6wxIp8SNZVe3MQZrIEQR7NqsOnzHNMs7 jCs9R3hdOY7Wovb0ZPXsgj2UNK6THn1YwLGDy9xSwruoLpsKK2T11r7dNIxBwc8xobl3 kPyA== 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:from:date :message-id:subject:to:cc; bh=DucLEfkw/d2TNgZMEZsK38h0bH6dQ4zgnD2YfItKC5c=; b=hYX0xZkHxeTVYdidHlcC9sIlGqYFNvQX6UCQUEqq3+FOdZu8EQuVJsw+HDKzBBQ+nn QGvX6HzOwWDbtld1vTczkE2ygjD+8VeeshMrGenFm1J2Ok59r8ydNzF8+st5VU8O9UMe i2I9P7YFvmuAMD9Gdd4s5823ZzFPlShkIYZ/KDEQjbuowr1n9QXyVO2MDkfKCpspwAnq D3wQLjOOekt8GxlOpSchjLXwVjIJPdCPy8XNLbOvz1j0y/Ezh/cTwoIGCpkn8Fl7iWcT r9p5oHoovX6hflHvusr0YJanR9Ztg7LjhPEmRj0Kb4wLEj7nZIL3DEOoAcUG8pZHmpwZ pUnQ== X-Gm-Message-State: AEkoouuzV3dJHLId7RkPeGzpBHXzYCfAMSQ+uqI396Xk9vChIP68NEcD8DEM6hsYS24E8r5rcw0xRdd96RGD7g== X-Received: by 10.13.253.134 with SMTP id n128mr28278352ywf.20.1469710977114; Thu, 28 Jul 2016 06:02:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.201.71 with HTTP; Thu, 28 Jul 2016 06:02:56 -0700 (PDT) In-Reply-To: <20160727091654.P1485@besplex.bde.org> References: <201607262011.u6QKBTDp043256@repo.freebsd.org> <20160727091654.P1485@besplex.bde.org> From: Ed Schouten Date: Thu, 28 Jul 2016 15:02:56 +0200 Message-ID: Subject: Re: svn commit: r303342 - in head: include lib/libc/stdlib To: Bruce Evans Cc: Ed Schouten , src-committers , 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.22 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, 28 Jul 2016 13:02:58 -0000 Hi Bruce, 2016-07-27 2:44 GMT+02:00 Bruce Evans : > This might work here since the type is unsigned, but it wouldn't work to > change from int to long. Yes. That's a pretty good remark. What makes this pretty safe in this case is that srandom() discard the top bits anyway. The first thing it does is cast the argument to an uint32_t, so even if we didn't properly zero/size extend this, it wouldn't end up being used. Best regards, -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Thu Jul 28 13:15: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 D24D0BA63E3; Thu, 28 Jul 2016 13:15:24 +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 A2BF51AB2; Thu, 28 Jul 2016 13:15:24 +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 u6SDFN7m060627; Thu, 28 Jul 2016 13:15:23 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SDFNih060626; Thu, 28 Jul 2016 13:15:23 GMT (envelope-from br@FreeBSD.org) Message-Id: <201607281315.u6SDFNih060626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 28 Jul 2016 13:15:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303438 - 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.22 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, 28 Jul 2016 13:15:24 -0000 Author: br Date: Thu Jul 28 13:15:23 2016 New Revision: 303438 URL: https://svnweb.freebsd.org/changeset/base/303438 Log: o Add warn flags required to build modules with GCC 6.1; o Sort GCC 4.8 warn flags. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/sys/conf/kern.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Thu Jul 28 12:25:58 2016 (r303437) +++ head/sys/conf/kern.mk Thu Jul 28 13:15:23 2016 (r303438) @@ -45,13 +45,23 @@ CLANG_NO_IAS34= -no-integrated-as .if ${COMPILER_VERSION} >= 40800 # Catch-all for all the things that are in our tree, but for which we're # not yet ready for this compiler. -CWARNEXTRA?= -Wno-error=inline -Wno-error=enum-compare -Wno-error=unused-but-set-variable \ - -Wno-error=aggressive-loop-optimizations -Wno-error=maybe-uninitialized \ - -Wno-error=array-bounds -Wno-error=address \ - -Wno-error=cast-qual -Wno-error=sequence-point -Wno-error=attributes \ - -Wno-error=strict-overflow -Wno-error=overflow +CWARNEXTRA?= -Wno-error=address \ + -Wno-error=aggressive-loop-optimizations \ + -Wno-error=array-bounds \ + -Wno-error=attributes \ + -Wno-error=cast-qual \ + -Wno-error=enum-compare \ + -Wno-error=inline \ + -Wno-error=maybe-uninitialized \ + -Wno-error=overflow \ + -Wno-error=sequence-point \ + -Wno-error=strict-overflow \ + -Wno-error=unused-but-set-variable .if ${COMPILER_VERSION} >= 60100 -CWARNEXTRA+= -Wno-error=nonnull-compare -Wno-error=shift-overflow +CWARNEXTRA+= -Wno-error=misleading-indentation \ + -Wno-error=nonnull-compare \ + -Wno-error=shift-overflow \ + -Wno-error=tautological-compare .endif .else # For gcc 4.2, eliminate the too-often-wrong warnings about uninitialized vars. From owner-svn-src-head@freebsd.org Thu Jul 28 13: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 49649BA649E; Thu, 28 Jul 2016 13:18:11 +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 19EE81C8B; Thu, 28 Jul 2016 13:18:11 +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 u6SDIA2d060759; Thu, 28 Jul 2016 13:18:10 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SDIA8J060758; Thu, 28 Jul 2016 13:18:10 GMT (envelope-from br@FreeBSD.org) Message-Id: <201607281318.u6SDIA8J060758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 28 Jul 2016 13:18:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303439 - head/sys/modules/dtrace/dtrace 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.22 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, 28 Jul 2016 13:18:11 -0000 Author: br Date: Thu Jul 28 13:18:10 2016 New Revision: 303439 URL: https://svnweb.freebsd.org/changeset/base/303439 Log: Build DTrace assym.o with -msoft-float flag for RISC-V so we have correct flag in ELF file. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/sys/modules/dtrace/dtrace/Makefile Modified: head/sys/modules/dtrace/dtrace/Makefile ============================================================================== --- head/sys/modules/dtrace/dtrace/Makefile Thu Jul 28 13:15:23 2016 (r303438) +++ head/sys/modules/dtrace/dtrace/Makefile Thu Jul 28 13:18:10 2016 (r303439) @@ -58,6 +58,11 @@ assym.o: assym.s ${AS} -meabi=5 -o assym.o assym.s .endif +.if ${MACHINE_CPUARCH} == "riscv" +assym.o: assym.s + ${AS} -msoft-float -o assym.o assym.s +.endif + .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h From owner-svn-src-head@freebsd.org Thu Jul 28 13: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 0247ABA657B; Thu, 28 Jul 2016 13: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 C98A81F83; Thu, 28 Jul 2016 13: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 u6SDLk5u063565; Thu, 28 Jul 2016 13:21:46 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SDLjan063563; Thu, 28 Jul 2016 13:21:45 GMT (envelope-from br@FreeBSD.org) Message-Id: <201607281321.u6SDLjan063563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 28 Jul 2016 13:21:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303440 - in head/sys/modules: i2c/iicbb 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.22 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, 28 Jul 2016 13:21:47 -0000 Author: br Date: Thu Jul 28 13:21:45 2016 New Revision: 303440 URL: https://svnweb.freebsd.org/changeset/base/303440 Log: Build ofw_bus_if.h for modules for RISC-V. Modified: head/sys/modules/i2c/iicbb/Makefile head/sys/modules/uart/Makefile Modified: head/sys/modules/i2c/iicbb/Makefile ============================================================================== --- head/sys/modules/i2c/iicbb/Makefile Thu Jul 28 13:18:10 2016 (r303439) +++ head/sys/modules/i2c/iicbb/Makefile Thu Jul 28 13:21:45 2016 (r303440) @@ -2,7 +2,8 @@ .PATH: ${.CURDIR}/../../../dev/iicbus .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \ - ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "powerpc" + ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "powerpc" || \ + ${MACHINE_CPUARCH} == "riscv" ofw_bus_if= ofw_bus_if.h .endif KMOD = iicbb Modified: head/sys/modules/uart/Makefile ============================================================================== --- head/sys/modules/uart/Makefile Thu Jul 28 13:18:10 2016 (r303439) +++ head/sys/modules/uart/Makefile Thu Jul 28 13:21:45 2016 (r303440) @@ -11,7 +11,8 @@ uart_dev_lpc= uart_dev_lpc.c .endif .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \ - ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "powerpc" + ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "riscv" || \ + ${MACHINE_CPUARCH} == "sparc64" ofw_bus_if= ofw_bus_if.h .endif From owner-svn-src-head@freebsd.org Thu Jul 28 13:35: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 36FB1BA6A76; Thu, 28 Jul 2016 13:35:47 +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 F05541991; Thu, 28 Jul 2016 13:35:46 +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 u6SDZk0w068273; Thu, 28 Jul 2016 13:35:46 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SDZk2Q068272; Thu, 28 Jul 2016 13:35:46 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201607281335.u6SDZk2Q068272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 28 Jul 2016 13:35:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303441 - 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.22 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, 28 Jul 2016 13:35:47 -0000 Author: emaste Date: Thu Jul 28 13:35:46 2016 New Revision: 303441 URL: https://svnweb.freebsd.org/changeset/base/303441 Log: Regenerate src.conf.5 after r303394 Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Thu Jul 28 13:21:45 2016 (r303440) +++ head/share/man/man5/src.conf.5 Thu Jul 28 13:35:46 2016 (r303441) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 292283 2015-12-15 18:42:30Z bdrewery .\" $FreeBSD$ -.Dd June 28, 2016 +.Dd July 28, 2016 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1002,13 +1002,13 @@ amd64/amd64 and arm64/aarch64. Set to use GCC's stack unwinder (instead of LLVM's libunwind). .Pp It is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +arm/arm, arm/armeb, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. .It Va WITH_LLVM_LIBUNWIND .\" from FreeBSD: head/tools/build/options/WITH_LLVM_LIBUNWIND 293450 2016-01-09 00:42:07Z emaste Set to use LLVM's libunwind stack unwinder (instead of GCC's unwinder). .Pp It is a default setting on -arm64/aarch64. +amd64/amd64, arm64/aarch64, i386/i386 and pc98/i386. .It Va WITHOUT_LOCALES .\" from FreeBSD: head/tools/build/options/WITHOUT_LOCALES 156932 2006-03-21 07:50:50Z ru Set to not build localization files; see From owner-svn-src-head@freebsd.org Thu Jul 28 13:54: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 817A9BA6E90; Thu, 28 Jul 2016 13:54:48 +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 5CB671369; Thu, 28 Jul 2016 13:54:48 +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 u6SDslxW075433; Thu, 28 Jul 2016 13:54:47 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SDskEb075421; Thu, 28 Jul 2016 13:54:46 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201607281354.u6SDskEb075421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 28 Jul 2016 13:54:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303442 - 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.22 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, 28 Jul 2016 13:54:48 -0000 Author: emaste Date: Thu Jul 28 13:54:46 2016 New Revision: 303442 URL: https://svnweb.freebsd.org/changeset/base/303442 Log: remove CONSTRUCTORS from kernel linker scripts The linker script CONSTRUCTORS keyword is only meaningful "when linking object file formats which do not support arbitrary sections, such as ECOFF and XCOFF"[1] and is ignored for other object file formats. LLVM's lld does not yet accept (and ignore) CONSTRUCTORS, so just remove CONSTRUCTORS from the linker scripts as it has no effect. [1] https://sourceware.org/binutils/docs/ld/Output-Section-Keywords.html Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7343 Modified: head/sys/conf/ldscript.amd64 head/sys/conf/ldscript.arm head/sys/conf/ldscript.arm64 head/sys/conf/ldscript.i386 head/sys/conf/ldscript.mips head/sys/conf/ldscript.mips.cfe head/sys/conf/ldscript.mips.mips64 head/sys/conf/ldscript.mips.octeon1 head/sys/conf/ldscript.powerpc head/sys/conf/ldscript.powerpc64 head/sys/conf/ldscript.riscv head/sys/conf/ldscript.sparc64 Modified: head/sys/conf/ldscript.amd64 ============================================================================== --- head/sys/conf/ldscript.amd64 Thu Jul 28 13:35:46 2016 (r303441) +++ head/sys/conf/ldscript.amd64 Thu Jul 28 13:54:46 2016 (r303442) @@ -149,7 +149,6 @@ SECTIONS { *(.data .data.* .gnu.linkonce.d.*) KEEP (*(.gnu.linkonce.d.*personality*)) - SORT(CONSTRUCTORS) } .data1 : { *(.data1) } _edata = .; PROVIDE (edata = .); Modified: head/sys/conf/ldscript.arm ============================================================================== --- head/sys/conf/ldscript.arm Thu Jul 28 13:35:46 2016 (r303441) +++ head/sys/conf/ldscript.arm Thu Jul 28 13:54:46 2016 (r303442) @@ -76,7 +76,6 @@ SECTIONS { *(.data) *(.gnu.linkonce.d*) - CONSTRUCTORS } .data1 : { *(.data1) } . = ALIGN(32 / 8); Modified: head/sys/conf/ldscript.arm64 ============================================================================== --- head/sys/conf/ldscript.arm64 Thu Jul 28 13:35:46 2016 (r303441) +++ head/sys/conf/ldscript.arm64 Thu Jul 28 13:54:46 2016 (r303442) @@ -76,7 +76,6 @@ SECTIONS { *(.data) *(.gnu.linkonce.d*) - CONSTRUCTORS } .data1 : { *(.data1) } . = ALIGN(32 / 8); Modified: head/sys/conf/ldscript.i386 ============================================================================== --- head/sys/conf/ldscript.i386 Thu Jul 28 13:35:46 2016 (r303441) +++ head/sys/conf/ldscript.i386 Thu Jul 28 13:54:46 2016 (r303442) @@ -137,7 +137,6 @@ SECTIONS { *(.data .data.* .gnu.linkonce.d.*) KEEP (*(.gnu.linkonce.d.*personality*)) - SORT(CONSTRUCTORS) } .data1 : { *(.data1) } _edata = .; PROVIDE (edata = .); Modified: head/sys/conf/ldscript.mips ============================================================================== --- head/sys/conf/ldscript.mips Thu Jul 28 13:35:46 2016 (r303441) +++ head/sys/conf/ldscript.mips Thu Jul 28 13:54:46 2016 (r303442) @@ -184,7 +184,6 @@ SECTIONS *(.data) *(.data.*) *(.gnu.linkonce.d.*) - SORT(CONSTRUCTORS) } .data1 : { *(.data1) } .eh_frame : { KEEP (*(.eh_frame)) } Modified: head/sys/conf/ldscript.mips.cfe ============================================================================== --- head/sys/conf/ldscript.mips.cfe Thu Jul 28 13:35:46 2016 (r303441) +++ head/sys/conf/ldscript.mips.cfe Thu Jul 28 13:54:46 2016 (r303442) @@ -201,7 +201,6 @@ SECTIONS *(.data) *(.data.*) *(.gnu.linkonce.d.*) - SORT(CONSTRUCTORS) } :data .data1 : { *(.data1) } .eh_frame : { KEEP (*(.eh_frame)) } Modified: head/sys/conf/ldscript.mips.mips64 ============================================================================== --- head/sys/conf/ldscript.mips.mips64 Thu Jul 28 13:35:46 2016 (r303441) +++ head/sys/conf/ldscript.mips.mips64 Thu Jul 28 13:54:46 2016 (r303442) @@ -185,7 +185,6 @@ SECTIONS *(.data) *(.data.*) *(.gnu.linkonce.d.*) - SORT(CONSTRUCTORS) } .data1 : { *(.data1) } .eh_frame : { KEEP (*(.eh_frame)) } Modified: head/sys/conf/ldscript.mips.octeon1 ============================================================================== --- head/sys/conf/ldscript.mips.octeon1 Thu Jul 28 13:35:46 2016 (r303441) +++ head/sys/conf/ldscript.mips.octeon1 Thu Jul 28 13:54:46 2016 (r303442) @@ -28,7 +28,6 @@ SECTIONS { _rwdata = .; *(.data) . = ALIGN(32); - CONSTRUCTORS; } _gp = (. + 0x8000); Modified: head/sys/conf/ldscript.powerpc ============================================================================== --- head/sys/conf/ldscript.powerpc Thu Jul 28 13:35:46 2016 (r303441) +++ head/sys/conf/ldscript.powerpc Thu Jul 28 13:54:46 2016 (r303442) @@ -63,7 +63,6 @@ SECTIONS { *(.data) *(.gnu.linkonce.d*) - CONSTRUCTORS } .data1 : { *(.data1) } .got1 : { *(.got1) } Modified: head/sys/conf/ldscript.powerpc64 ============================================================================== --- head/sys/conf/ldscript.powerpc64 Thu Jul 28 13:35:46 2016 (r303441) +++ head/sys/conf/ldscript.powerpc64 Thu Jul 28 13:54:46 2016 (r303442) @@ -63,7 +63,6 @@ SECTIONS { *(.data) *(.gnu.linkonce.d*) - CONSTRUCTORS } .data1 : { *(.data1) } .toc1 : ALIGN(8) { *(.toc1) } Modified: head/sys/conf/ldscript.riscv ============================================================================== --- head/sys/conf/ldscript.riscv Thu Jul 28 13:35:46 2016 (r303441) +++ head/sys/conf/ldscript.riscv Thu Jul 28 13:54:46 2016 (r303442) @@ -63,7 +63,6 @@ SECTIONS { *(.data) *(.gnu.linkonce.d*) - CONSTRUCTORS } .data1 : { *(.data1) } . = ALIGN(32 / 8); Modified: head/sys/conf/ldscript.sparc64 ============================================================================== --- head/sys/conf/ldscript.sparc64 Thu Jul 28 13:35:46 2016 (r303441) +++ head/sys/conf/ldscript.sparc64 Thu Jul 28 13:54:46 2016 (r303442) @@ -154,7 +154,6 @@ SECTIONS *(.data) *(.data.*) *(.gnu.linkonce.d.*) - SORT(CONSTRUCTORS) } .data1 : { *(.data1) } .eh_frame : { KEEP (*(.eh_frame)) } From owner-svn-src-head@freebsd.org Thu Jul 28 15:17: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 7E83DBA6197; Thu, 28 Jul 2016 15:17:13 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E9821EC2; Thu, 28 Jul 2016 15:17:13 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6SFHCne005617; Thu, 28 Jul 2016 15:17:12 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SFHC6S005616; Thu, 28 Jul 2016 15:17:12 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201607281517.u6SFHC6S005616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 28 Jul 2016 15:17:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303443 - head/usr.bin/sed 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.22 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, 28 Jul 2016 15:17:13 -0000 Author: ed Date: Thu Jul 28 15:17:12 2016 New Revision: 303443 URL: https://svnweb.freebsd.org/changeset/base/303443 Log: Don't call basename() and dirname() in an unportable way. POSIX allows these functions to modify their input buffer, so that they have storage for the return value. Pull copies of the filename before calling these utility functions. Modified: head/usr.bin/sed/main.c Modified: head/usr.bin/sed/main.c ============================================================================== --- head/usr.bin/sed/main.c Thu Jul 28 13:54:46 2016 (r303442) +++ head/usr.bin/sed/main.c Thu Jul 28 15:17:12 2016 (r303443) @@ -301,6 +301,7 @@ mf_fgets(SPACE *sp, enum e_spflag spflag { struct stat sb; ssize_t len; + char *dirbuf, *basebuf; static char *p = NULL; static size_t plen = 0; int c; @@ -389,9 +390,14 @@ mf_fgets(SPACE *sp, enum e_spflag spflag if ((size_t)len > sizeof(oldfname)) errx(1, "%s: name too long", fname); } + if ((dirbuf = strdup(fname)) == NULL || + (basebuf = strdup(fname)) == NULL) + err(1, "strdup"); len = snprintf(tmpfname, sizeof(tmpfname), - "%s/.!%ld!%s", dirname(fname), (long)getpid(), - basename(fname)); + "%s/.!%ld!%s", dirname(dirbuf), (long)getpid(), + basename(basebuf)); + free(dirbuf); + free(basebuf); if ((size_t)len >= sizeof(tmpfname)) errx(1, "%s: name too long", fname); unlink(tmpfname); From owner-svn-src-head@freebsd.org Thu Jul 28 15:19: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 26839BA6245; Thu, 28 Jul 2016 15:19:49 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7BD3121F; Thu, 28 Jul 2016 15:19:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6SFJmk5005732; Thu, 28 Jul 2016 15:19:48 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SFJmij005731; Thu, 28 Jul 2016 15:19:48 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201607281519.u6SFJmij005731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 28 Jul 2016 15:19:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303444 - head/usr.bin/grep 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.22 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, 28 Jul 2016 15:19:49 -0000 Author: ed Date: Thu Jul 28 15:19:47 2016 New Revision: 303444 URL: https://svnweb.freebsd.org/changeset/base/303444 Log: Call basename() in a portable way. Pull a copy of the filename string before calling basename(). Change the loop to not return on its own, so we can put a free() statement at the bottom. Modified: head/usr.bin/grep/util.c Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Thu Jul 28 15:17:12 2016 (r303443) +++ head/usr.bin/grep/util.c Thu Jul 28 15:19:47 2016 (r303444) @@ -58,21 +58,26 @@ static int procline(struct str *l, int) bool file_matching(const char *fname) { - char *fname_base; + char *fname_base, *fname_buf; bool ret; ret = finclude ? false : true; - fname_base = basename(fname); + fname_buf = strdup(fname); + if (fname_buf == NULL) + err(2, "strdup"); + fname_base = basename(fname_buf); for (unsigned int i = 0; i < fpatterns; ++i) { if (fnmatch(fpattern[i].pat, fname, 0) == 0 || fnmatch(fpattern[i].pat, fname_base, 0) == 0) { - if (fpattern[i].mode == EXCL_PAT) - return (false); - else + if (fpattern[i].mode == EXCL_PAT) { + ret = false; + break; + } else ret = true; } } + free(fname_buf); return (ret); } From owner-svn-src-head@freebsd.org Thu Jul 28 15:23: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 83A63BA63E3 for ; Thu, 28 Jul 2016 15:23:05 +0000 (UTC) (envelope-from ircta@beroj.rahnemoon.com) Received: from beroj.rahnemoon.com (beroj.rahnemoon.com [67.205.123.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5CC52166F for ; Thu, 28 Jul 2016 15:23:05 +0000 (UTC) (envelope-from ircta@beroj.rahnemoon.com) Received: from ircta by beroj.rahnemoon.com with local (Exim 4.87) (envelope-from ) id 1bSmrh-000tz5-Cu for svn-src-head@freebsd.org; Thu, 28 Jul 2016 19:34:49 +0430 To: svn-src-head@freebsd.org Subject: Problem with parcel shipping, ID:00000397377 Date: Thu, 28 Jul 2016 15:04:49 +0000 From: "FedEx International Economy" Reply-To: "FedEx International Economy" Message-ID: <3d798954c631784789f56f63351f3e0f@iranattraction.com> X-Priority: 3 MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - beroj.rahnemoon.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [598 597] / [47 12] X-AntiAbuse: Sender Address Domain - beroj.rahnemoon.com X-Get-Message-Sender-Via: beroj.rahnemoon.com: authenticated_id: ircta/from_h X-Authenticated-Sender: beroj.rahnemoon.com: jay.christensen@iranattraction.com Content-Type: text/plain; charset=us-ascii X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 28 Jul 2016 15:23:05 -0000 Dear Customer, This is to confirm that one or more of your parcels has been shipped. Please, open email attachment to print shipment label. Kind regards, Jay Christensen, Sr. Support Agent. From owner-svn-src-head@freebsd.org Thu Jul 28 15:33: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 E2E69BA6712; Thu, 28 Jul 2016 15:33:20 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B37CA1A87; Thu, 28 Jul 2016 15:33:20 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6SFXJhb012673; Thu, 28 Jul 2016 15:33:19 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SFXJLU012672; Thu, 28 Jul 2016 15:33:19 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201607281533.u6SFXJLU012672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 28 Jul 2016 15:33:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303445 - head/usr.sbin/uathload 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.22 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, 28 Jul 2016 15:33:21 -0000 Author: ed Date: Thu Jul 28 15:33:19 2016 New Revision: 303445 URL: https://svnweb.freebsd.org/changeset/base/303445 Log: Call basename() and dirname() in the POSIXly correct way. Pull copies of the input string, as these functions are allowed to modify them. Free the copies after creating the new pathname string. Modified: head/usr.sbin/uathload/uathload.c Modified: head/usr.sbin/uathload/uathload.c ============================================================================== --- head/usr.sbin/uathload/uathload.c Thu Jul 28 15:19:47 2016 (r303444) +++ head/usr.sbin/uathload/uathload.c Thu Jul 28 15:33:19 2016 (r303445) @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -84,19 +85,30 @@ extern uint8_t _binary_ar5523_bin_end; static int getdevname(const char *devname, char *msgdev, char *datadev) { - char *bn, *dn; + char *bn, *bnbuf, *dn, *dnbuf; - dn = dirname(devname); - if (dn == NULL) + dnbuf = strdup(devname); + if (dnbuf == NULL) return (-1); - bn = basename(devname); - if (bn == NULL || strncmp(bn, "ugen", 4)) + dn = dirname(dnbuf); + bnbuf = strdup(devname); + if (bnbuf == NULL) { + free(dnbuf); return (-1); + } + bn = basename(bnbuf); + if (strncmp(bn, "ugen", 4) != 0) { + free(dnbuf); + free(bnbuf); + return (-1); + } bn += 4; /* NB: pipes are hardcoded */ snprintf(msgdev, 256, "%s/usb/%s.1", dn, bn); snprintf(datadev, 256, "%s/usb/%s.2", dn, bn); + free(dnbuf); + free(bnbuf); return (0); } From owner-svn-src-head@freebsd.org Thu Jul 28 15:49: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 0E0E5BA7310; Thu, 28 Jul 2016 15:49:53 +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 D53911612; Thu, 28 Jul 2016 15:49:52 +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 u6SFnqdo016698; Thu, 28 Jul 2016 15:49:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SFnqQK016697; Thu, 28 Jul 2016 15:49:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201607281549.u6SFnqQK016697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 28 Jul 2016 15:49:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303446 - head/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.22 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, 28 Jul 2016 15:49:53 -0000 Author: kib Date: Thu Jul 28 15:49:51 2016 New Revision: 303446 URL: https://svnweb.freebsd.org/changeset/base/303446 Log: Fix style and typo. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Thu Jul 28 15:33:19 2016 (r303445) +++ head/sys/vm/swap_pager.c Thu Jul 28 15:49:51 2016 (r303446) @@ -390,8 +390,8 @@ static int dmmax; static int nswap_lowat = 128; /* in pages, swap_pager_almost_full warn */ static int nswap_hiwat = 512; /* in pages, swap_pager_almost_full warn */ -SYSCTL_INT(_vm, OID_AUTO, dmmax, - CTLFLAG_RD, &dmmax, 0, "Maximum size of a swap block"); +SYSCTL_INT(_vm, OID_AUTO, dmmax, CTLFLAG_RD, &dmmax, 0, + "Maximum size of a swap block"); static void swp_sizecheck(void); static void swp_pager_async_iodone(struct buf *bp); @@ -2432,7 +2432,7 @@ swapgeom_acquire(struct g_consumer *cp) /* * Remove a reference from the g_consumer. Post a close event if - * all referneces go away. + * all references go away. */ static void swapgeom_release(struct g_consumer *cp, struct swdevt *sp) @@ -2598,7 +2598,7 @@ swapongeom_ev(void *arg, int flags) if (gp == NULL) gp = g_new_geomf(&g_swap_class, "swap"); cp = g_new_consumer(gp); - cp->index = 1; /* Number of active I/Os, plus one for being active. */ + cp->index = 1; /* Number of active I/Os, plus one for being active. */ cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; g_attach(cp, pp); /* From owner-svn-src-head@freebsd.org Thu Jul 28 15:57: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 EEB45BA7529; Thu, 28 Jul 2016 15:57:02 +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 BCBB81BD5; Thu, 28 Jul 2016 15:57:02 +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 u6SFv1mR020277; Thu, 28 Jul 2016 15:57:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SFv1aE020276; Thu, 28 Jul 2016 15:57:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201607281557.u6SFv1aE020276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 28 Jul 2016 15:57:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303448 - head/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.22 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, 28 Jul 2016 15:57:03 -0000 Author: kib Date: Thu Jul 28 15:57:01 2016 New Revision: 303448 URL: https://svnweb.freebsd.org/changeset/base/303448 Log: Do not delegate a work to geom event thread which can be done inline. In particular, swapongeom_ev() needed event thread context when swap pager configuration was performed under Giant and geom asserted that Giant is not owned. Now both of the reason went away. On the other hand, note that swpageom_release() is called from the bio_done context, and possible close cannot be performed inline. Also fix some minor issues. The swapgeom() function does not use the td argument, remove it. Recheck that the vnode passed is still VCHR and not reclaimed after the lock. Reviewed by: mav Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Thu Jul 28 15:54:17 2016 (r303447) +++ head/sys/vm/swap_pager.c Thu Jul 28 15:57:01 2016 (r303448) @@ -395,7 +395,7 @@ SYSCTL_INT(_vm, OID_AUTO, dmmax, CTLFLAG static void swp_sizecheck(void); static void swp_pager_async_iodone(struct buf *bp); -static int swapongeom(struct thread *, struct vnode *); +static int swapongeom(struct vnode *); static int swaponvp(struct thread *, struct vnode *, u_long); static int swapoff_one(struct swdevt *sp, struct ucred *cred); @@ -2019,7 +2019,7 @@ sys_swapon(struct thread *td, struct swa vp = nd.ni_vp; if (vn_isdisk(vp, &error)) { - error = swapongeom(td, vp); + error = swapongeom(vp); } else if (vp->v_type == VREG && (vp->v_mount->mnt_vfc->vfc_flags & VFCF_NETWORK) != 0 && (error = VOP_GETATTR(vp, &attr, td->td_ucred)) == 0) { @@ -2560,17 +2560,9 @@ swapgeom_close(struct thread *td, struct g_waitfor_event(swapgeom_close_ev, cp, M_WAITOK, NULL); } - -struct swh0h0 { - struct cdev *dev; - struct vnode *vp; - int error; -}; - -static void -swapongeom_ev(void *arg, int flags) +static int +swapongeom_locked(struct cdev *dev, struct vnode *vp) { - struct swh0h0 *swh; struct g_provider *pp; struct g_consumer *cp; static struct g_geom *gp; @@ -2578,20 +2570,15 @@ swapongeom_ev(void *arg, int flags) u_long nblks; int error; - swh = arg; - swh->error = 0; - pp = g_dev_getprovider(swh->dev); - if (pp == NULL) { - swh->error = ENODEV; - return; - } + pp = g_dev_getprovider(dev); + if (pp == NULL) + return (ENODEV); mtx_lock(&sw_dev_mtx); TAILQ_FOREACH(sp, &swtailq, sw_list) { cp = sp->sw_id; if (cp != NULL && cp->provider == pp) { mtx_unlock(&sw_dev_mtx); - swh->error = EBUSY; - return; + return (EBUSY); } } mtx_unlock(&sw_dev_mtx); @@ -2608,34 +2595,31 @@ swapongeom_ev(void *arg, int flags) * set an exclusive count :-( */ error = g_access(cp, 1, 1, 0); - if (error) { + if (error != 0) { g_detach(cp); g_destroy_consumer(cp); - swh->error = error; - return; + return (error); } nblks = pp->mediasize / DEV_BSIZE; - swaponsomething(swh->vp, cp, nblks, swapgeom_strategy, - swapgeom_close, dev2udev(swh->dev), + swaponsomething(vp, cp, nblks, swapgeom_strategy, + swapgeom_close, dev2udev(dev), (pp->flags & G_PF_ACCEPT_UNMAPPED) != 0 ? SW_UNMAPPED : 0); - swh->error = 0; + return (0); } static int -swapongeom(struct thread *td, struct vnode *vp) +swapongeom(struct vnode *vp) { int error; - struct swh0h0 swh; vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - - swh.dev = vp->v_rdev; - swh.vp = vp; - swh.error = 0; - /* XXX: direct call when Giant untangled */ - error = g_waitfor_event(swapongeom_ev, &swh, M_WAITOK, NULL); - if (!error) - error = swh.error; + if (vp->v_type != VCHR || (vp->v_iflag & VI_DOOMED) != 0) { + error = ENOENT; + } else { + g_topology_lock(); + error = swapongeom_locked(vp->v_rdev, vp); + g_topology_unlock(); + } VOP_UNLOCK(vp, 0); return (error); } From owner-svn-src-head@freebsd.org Thu Jul 28 16:02: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 CB201BA7758; Thu, 28 Jul 2016 16:02:31 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EE411278; Thu, 28 Jul 2016 16:02:31 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6SG2Urp023729; Thu, 28 Jul 2016 16:02:30 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SG2U3V023728; Thu, 28 Jul 2016 16:02:30 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201607281602.u6SG2U3V023728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 28 Jul 2016 16:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303449 - head/usr.sbin/newsyslog 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.22 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, 28 Jul 2016 16:02:31 -0000 Author: ed Date: Thu Jul 28 16:02:30 2016 New Revision: 303449 URL: https://svnweb.freebsd.org/changeset/base/303449 Log: Clean up use of basename() and dirname(). Pull copies of the input pathname string before calling basename() and dirname() to make this comply to POSIX. Free these copies at the end of this function. While there, remove the duplication of the 's' -> 'logfname' string. There is no need for this. Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Thu Jul 28 15:57:01 2016 (r303448) +++ head/usr.sbin/newsyslog/newsyslog.c Thu Jul 28 16:02:30 2016 (r303449) @@ -2286,26 +2286,29 @@ mtime_old_timelog(const char *file) time_t t; struct dirent *dp; DIR *dirp; - char *s, *logfname, *dir; + char *logfname, *logfnamebuf, *dir, *dirbuf; t = -1; - if ((dir = dirname(file)) == NULL) { - warn("dirname() of '%s'", file); + if ((dirbuf = strdup(file)) == NULL) { + warn("strdup() of '%s'", file); return (t); } - if ((s = basename(file)) == NULL) { - warn("basename() of '%s'", file); + dir = dirname(dirbuf); + if ((logfnamebuf = strdup(file)) == NULL) { + warn("strdup() of '%s'", file); + free(dirbuf); return (t); - } else if (s[0] == '/') { - warnx("Invalid log filename '%s'", s); - return (t); - } else if ((logfname = strdup(s)) == NULL) - err(1, "strdup()"); + } + logfname = basename(logfnamebuf); + if (logfname[0] == '/') { + warnx("Invalid log filename '%s'", logfname); + goto out; + } if ((dirp = opendir(dir)) == NULL) { warn("Cannot open log directory '%s'", dir); - return (t); + goto out; } dir_fd = dirfd(dirp); /* Open the archive dir and find the most recent archive of logfname. */ @@ -2322,6 +2325,9 @@ mtime_old_timelog(const char *file) } closedir(dirp); +out: + free(dirbuf); + free(logfnamebuf); return (t); } From owner-svn-src-head@freebsd.org Thu Jul 28 16:06: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 A3CE2BA78F1; Thu, 28 Jul 2016 16:06:39 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76EB71577; Thu, 28 Jul 2016 16:06:39 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6SG6bZH023912; Thu, 28 Jul 2016 16:06:37 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SG6bEx023911; Thu, 28 Jul 2016 16:06:37 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201607281606.u6SG6bEx023911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 28 Jul 2016 16:06:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303450 - head/usr.bin/xinstall 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.22 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, 28 Jul 2016 16:06:39 -0000 Author: ed Date: Thu Jul 28 16:06:37 2016 New Revision: 303450 URL: https://svnweb.freebsd.org/changeset/base/303450 Log: Pull a copy of the input string before calling basename() and dirname(). POSIX allows implementations of these functions to modify their input. Modified: head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Thu Jul 28 16:02:30 2016 (r303449) +++ head/usr.bin/xinstall/xinstall.c Thu Jul 28 16:06:37 2016 (r303450) @@ -656,7 +656,7 @@ makelink(const char *from_name, const ch } if (dolink & LN_RELATIVE) { - char *cp, *d, *s; + char *to_name_copy, *cp, *d, *s; if (*from_name != '/') { /* this is already a relative link */ @@ -674,7 +674,10 @@ makelink(const char *from_name, const ch * The last component of to_name may be a symlink, * so use realpath to resolve only the directory. */ - cp = dirname(to_name); + to_name_copy = strdup(to_name); + if (to_name_copy == NULL) + err(EX_OSERR, "%s: strdup", to_name); + cp = dirname(to_name_copy); if (realpath(cp, dst) == NULL) err(EX_OSERR, "%s: realpath", cp); /* .. and add the last component. */ @@ -682,9 +685,11 @@ makelink(const char *from_name, const ch if (strlcat(dst, "/", sizeof(dst)) > sizeof(dst)) errx(1, "resolved pathname too long"); } - cp = basename(to_name); + strcpy(to_name_copy, to_name); + cp = basename(to_name_copy); if (strlcat(dst, cp, sizeof(dst)) > sizeof(dst)) errx(1, "resolved pathname too long"); + free(to_name_copy); /* Trim common path components. */ for (s = src, d = dst; *s == *d; s++, d++) From owner-svn-src-head@freebsd.org Thu Jul 28 16: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 AA19CBA7C0B; Thu, 28 Jul 2016 16:20:28 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 855B11E05; Thu, 28 Jul 2016 16:20:28 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6SGKRNB027764; Thu, 28 Jul 2016 16:20:27 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SGKRAp027759; Thu, 28 Jul 2016 16:20:27 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201607281620.u6SGKRAp027759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 28 Jul 2016 16:20:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303451 - in head: include lib/libc/gen 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.22 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, 28 Jul 2016 16:20:28 -0000 Author: ed Date: Thu Jul 28 16:20:27 2016 New Revision: 303451 URL: https://svnweb.freebsd.org/changeset/base/303451 Log: Fix up prototypes of basename(3) and dirname(3) to comply to POSIX. POSIX allows these functions to be implemented in a way that the resulting string is stored in the input buffer. Though some may find this annoying, this has the advantage that it makes it possible to implement this function in a thread-safe way. It also means that they can be implemented in a way that they work for paths of arbitrary length, as the output string of these functions is never longer than max(1, len(input)). Portable code already needs to be written with this in mind, so in my opinion it makes very little sense to allow the existing behaviour. Prevent the base system from falling back to this by switching over to POSIX prototypes. I'm not going to bump the __FreeBSD_version for this. The reason is that it's possible to account for this change in a portable way, without depending on a specific version of FreeBSD. An exp-run was done some time ago. As far as I know, all regressions as a result of this have already been fixed. I'll give this change some time to settle. In the long run I want to replace our copies by ones that are thread-safe and don't depend on PATH_MAX/MAXPATHLEN. Modified: head/include/libgen.h head/lib/libc/gen/basename.3 head/lib/libc/gen/basename.c head/lib/libc/gen/dirname.3 head/lib/libc/gen/dirname.c Modified: head/include/libgen.h ============================================================================== --- head/include/libgen.h Thu Jul 28 16:06:37 2016 (r303450) +++ head/include/libgen.h Thu Jul 28 16:20:27 2016 (r303451) @@ -34,9 +34,9 @@ #include __BEGIN_DECLS -char *basename(const char *); +char *basename(char *); char *basename_r(const char *, char *); -char *dirname(const char *); +char *dirname(char *); __END_DECLS #endif /* !_LIBGEN_H_ */ Modified: head/lib/libc/gen/basename.3 ============================================================================== --- head/lib/libc/gen/basename.3 Thu Jul 28 16:06:37 2016 (r303450) +++ head/lib/libc/gen/basename.3 Thu Jul 28 16:20:27 2016 (r303451) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 31, 2010 +.Dd July 28, 2016 .Dt BASENAME 3 .Os .Sh NAME @@ -25,7 +25,7 @@ .Sh SYNOPSIS .In libgen.h .Ft char * -.Fn basename "const char *path" +.Fn basename "char *path" .Ft char * .Fn basename_r "const char *path" "char *bname" .Sh DESCRIPTION Modified: head/lib/libc/gen/basename.c ============================================================================== --- head/lib/libc/gen/basename.c Thu Jul 28 16:06:37 2016 (r303450) +++ head/lib/libc/gen/basename.c Thu Jul 28 16:20:27 2016 (r303451) @@ -66,7 +66,7 @@ basename_r(const char *path, char *bname } char * -basename(const char *path) +basename(char *path) { static char *bname = NULL; Modified: head/lib/libc/gen/dirname.3 ============================================================================== --- head/lib/libc/gen/dirname.3 Thu Jul 28 16:06:37 2016 (r303450) +++ head/lib/libc/gen/dirname.3 Thu Jul 28 16:20:27 2016 (r303451) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 12, 2006 +.Dd July 28, 2016 .Dt DIRNAME 3 .Os .Sh NAME @@ -25,7 +25,7 @@ .Sh SYNOPSIS .In libgen.h .Ft char * -.Fn dirname "const char *path" +.Fn dirname "char *path" .Sh DESCRIPTION The .Fn dirname Modified: head/lib/libc/gen/dirname.c ============================================================================== --- head/lib/libc/gen/dirname.c Thu Jul 28 16:06:37 2016 (r303450) +++ head/lib/libc/gen/dirname.c Thu Jul 28 16:20:27 2016 (r303451) @@ -26,7 +26,7 @@ __FBSDID("$FreeBSD$"); #include char * -dirname(const char *path) +dirname(char *path) { static char *dname = NULL; size_t len; From owner-svn-src-head@freebsd.org Thu Jul 28 16:54: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 22A3ABA72DC; Thu, 28 Jul 2016 16:54:14 +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 E36B41FE3; Thu, 28 Jul 2016 16:54: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 u6SGsDFq042664; Thu, 28 Jul 2016 16:54:13 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SGsDI0042663; Thu, 28 Jul 2016 16:54:13 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201607281654.u6SGsDI0042663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 28 Jul 2016 16:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303452 - head/usr.bin/indent 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.22 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, 28 Jul 2016 16:54:14 -0000 Author: pfg Date: Thu Jul 28 16:54:12 2016 New Revision: 303452 URL: https://svnweb.freebsd.org/changeset/base/303452 Log: indent: avoid calling write(2) with a negative second parameter. negative_returns: n is passed to a parameter that cannot be negative. Fix a style issue while here. CID: 1008107 Modified: head/usr.bin/indent/indent.c Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Thu Jul 28 16:20:27 2016 (r303451) +++ head/usr.bin/indent/indent.c Thu Jul 28 16:54:12 2016 (r303452) @@ -1213,7 +1213,7 @@ bakcopy(void) bakchn = creat(bakfile, 0600); if (bakchn < 0) err(1, "%s", bakfile); - while ((n = read(fileno(input), buff, sizeof buff)) != 0) + while ((n = read(fileno(input), buff, sizeof(buff))) > 0) if (write(bakchn, buff, n) != n) err(1, "%s", bakfile); if (n < 0) From owner-svn-src-head@freebsd.org Thu Jul 28 17:18: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 CC7FABA77DB; Thu, 28 Jul 2016 17:18:03 +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 9CA9E1D47; Thu, 28 Jul 2016 17:18:03 +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 u6SHI2hw050257; Thu, 28 Jul 2016 17:18:02 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SHI2oB050255; Thu, 28 Jul 2016 17:18:02 GMT (envelope-from br@FreeBSD.org) Message-Id: <201607281718.u6SHI2oB050255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 28 Jul 2016 17:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303453 - in head: share/mk 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.22 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, 28 Jul 2016 17:18:03 -0000 Author: br Date: Thu Jul 28 17:18:02 2016 New Revision: 303453 URL: https://svnweb.freebsd.org/changeset/base/303453 Log: Normalise the CWARNFLAGS inter-word spacing: remove all leading and trailing space, and convert multiple consecutive spaces to single space. This helps to keep build output looking good. Modified: head/share/mk/bsd.sys.mk head/sys/conf/kern.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Thu Jul 28 16:54:12 2016 (r303452) +++ head/share/mk/bsd.sys.mk Thu Jul 28 17:18:02 2016 (r303453) @@ -190,7 +190,7 @@ CFLAGS+= ${SSP_CFLAGS} # Allow user-specified additional warning flags, plus compiler and file # specific flag overrides, unless we've overriden this... .if ${MK_WARNS} != "no" -CFLAGS+= ${CWARNFLAGS} ${CWARNFLAGS.${COMPILER_TYPE}} +CFLAGS+= ${CWARNFLAGS:M*} ${CWARNFLAGS.${COMPILER_TYPE}} CFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} .endif Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Thu Jul 28 16:54:12 2016 (r303452) +++ head/sys/conf/kern.mk Thu Jul 28 17:18:02 2016 (r303453) @@ -214,7 +214,7 @@ CFLAGS+= -fstack-protector CFLAGS+= -gdwarf-2 .endif -CFLAGS+= ${CWARNFLAGS} ${CWARNFLAGS.${.IMPSRC:T}} +CFLAGS+= ${CWARNFLAGS:M*} ${CWARNFLAGS.${.IMPSRC:T}} CFLAGS+= ${CFLAGS.${COMPILER_TYPE}} ${CFLAGS.${.IMPSRC:T}} # Tell bmake not to mistake standard targets for things to be searched for From owner-svn-src-head@freebsd.org Thu Jul 28 17:37: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 49A15BA7CD2; Thu, 28 Jul 2016 17:37:13 +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 18F0419F1; Thu, 28 Jul 2016 17:37:13 +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 u6SHbCiA057752; Thu, 28 Jul 2016 17:37:12 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SHbCa5057751; Thu, 28 Jul 2016 17:37:12 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201607281737.u6SHbCa5057751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 28 Jul 2016 17:37:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303454 - head/sys/dev/cxgbe 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.22 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, 28 Jul 2016 17:37:13 -0000 Author: jhb Date: Thu Jul 28 17:37:12 2016 New Revision: 303454 URL: https://svnweb.freebsd.org/changeset/base/303454 Log: Mark spg_len and fl_pktshift static. These variables are no longer exported to t4_netmap.c after r296478. Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Thu Jul 28 17:18:02 2016 (r303453) +++ head/sys/dev/cxgbe/t4_sge.c Thu Jul 28 17:37:12 2016 (r303454) @@ -81,7 +81,7 @@ __FBSDID("$FreeBSD$"); * Ethernet frames are DMA'd at this byte offset into the freelist buffer. * 0-7 are valid values. */ -int fl_pktshift = 2; +static int fl_pktshift = 2; TUNABLE_INT("hw.cxgbe.fl_pktshift", &fl_pktshift); /* @@ -98,7 +98,7 @@ TUNABLE_INT("hw.cxgbe.fl_pad", &fl_pad); * -1: driver should figure out a good value. * 64 or 128 are the only other valid values. */ -int spg_len = -1; +static int spg_len = -1; TUNABLE_INT("hw.cxgbe.spg_len", &spg_len); /* From owner-svn-src-head@freebsd.org Thu Jul 28 18:39: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 877C6BA7B99; Thu, 28 Jul 2016 18:39:31 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 62AC417C1; Thu, 28 Jul 2016 18:39:31 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6SIdUms079820; Thu, 28 Jul 2016 18:39:30 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SIdUVf079817; Thu, 28 Jul 2016 18:39:30 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201607281839.u6SIdUVf079817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Thu, 28 Jul 2016 18:39:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303455 - in head/sys: 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.22 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, 28 Jul 2016 18:39:31 -0000 Author: stevek Date: Thu Jul 28 18:39:30 2016 New Revision: 303455 URL: https://svnweb.freebsd.org/changeset/base/303455 Log: Remove BSD and USL copyright and update license block in in_prot.c, as the code in this file was written by Robert N. M. Waston. Move cr_can* prototypes from sys/systm.h to sys/proc.h Reported by: rwatson Reviewed by: rwatson Approved by: sjg (mentor) Differential Revision: https://reviews.freebsd.org/D7345 Modified: head/sys/netinet/in_prot.c head/sys/sys/proc.h head/sys/sys/systm.h Modified: head/sys/netinet/in_prot.c ============================================================================== --- head/sys/netinet/in_prot.c Thu Jul 28 17:37:12 2016 (r303454) +++ head/sys/netinet/in_prot.c Thu Jul 28 18:39:30 2016 (r303455) @@ -1,15 +1,7 @@ /*- - * Copyright (c) 1982, 1986, 1989, 1990, 1991, 1993 - * The Regents of the University of California. - * (c) UNIX System Laboratories, Inc. * Copyright (c) 2000-2001 Robert N. M. Watson. * All rights reserved. * - * All or some portions of this file are derived from material licensed - * to the University of California by American Telephone and Telegraph - * Co. or Unix System Laboratories, Inc. and are reproduced herein with - * the permission of UNIX System Laboratories, Inc. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -18,14 +10,11 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * 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 REGENTS OR CONTRIBUTORS BE LIABLE + * 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) @@ -34,7 +23,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)kern_prot.c 8.6 (Berkeley) 1/21/94 */ /* Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Thu Jul 28 17:37:12 2016 (r303454) +++ head/sys/sys/proc.h Thu Jul 28 18:39:30 2016 (r303455) @@ -971,6 +971,10 @@ int pget(pid_t pid, int flags, struct pr void ast(struct trapframe *framep); struct thread *choosethread(void); +int cr_cansee(struct ucred *u1, struct ucred *u2); +int cr_canseesocket(struct ucred *cred, struct socket *so); +int cr_canseeothergids(struct ucred *u1, struct ucred *u2); +int cr_canseeotheruids(struct ucred *u1, struct ucred *u2); int cr_cansignal(struct ucred *cred, struct proc *proc, int signum); int enterpgrp(struct proc *p, pid_t pgid, struct pgrp *pgrp, struct session *sess); Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Thu Jul 28 17:37:12 2016 (r303454) +++ head/sys/sys/systm.h Thu Jul 28 18:39:30 2016 (r303455) @@ -313,11 +313,6 @@ extern int cpu_deepest_sleep; extern int cpu_disable_c2_sleep; extern int cpu_disable_c3_sleep; -int cr_cansee(struct ucred *u1, struct ucred *u2); -int cr_canseesocket(struct ucred *cred, struct socket *so); -int cr_canseeothergids(struct ucred *u1, struct ucred *u2); -int cr_canseeotheruids(struct ucred *u1, struct ucred *u2); - char *kern_getenv(const char *name); void freeenv(char *env); int getenv_int(const char *name, int *data); From owner-svn-src-head@freebsd.org Thu Jul 28 18:40: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 5D7D6BA7D09; Thu, 28 Jul 2016 18:40:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E2CF19DE; Thu, 28 Jul 2016 18:40:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6SIehA3080676; Thu, 28 Jul 2016 18:40:43 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SIehtJ080675; Thu, 28 Jul 2016 18:40:43 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201607281840.u6SIehtJ080675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 28 Jul 2016 18:40:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303456 - 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.22 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, 28 Jul 2016 18:40:44 -0000 Author: dim Date: Thu Jul 28 18:40:43 2016 New Revision: 303456 URL: https://svnweb.freebsd.org/changeset/base/303456 Log: Add tblgen to ObsoleteFiles.inc, as it was renamed to llvm-tblgen. Noticed by: pluknet MFC after: 3 days Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Jul 28 18:39:30 2016 (r303455) +++ head/ObsoleteFiles.inc Thu Jul 28 18:40:43 2016 (r303456) @@ -229,6 +229,7 @@ OLD_LIBS+=usr/lib/libdevinfo.so.5 OLD_LIBS+=usr/lib32/libdevinfo.so.5 # 20160305: new clang import which bumps version from 3.7.1 to 3.8.0. OLD_FILES+=usr/bin/macho-dump +OLD_FILES+=usr/bin/tblgen OLD_FILES+=usr/lib/clang/3.7.1/include/sanitizer/allocator_interface.h OLD_FILES+=usr/lib/clang/3.7.1/include/sanitizer/asan_interface.h OLD_FILES+=usr/lib/clang/3.7.1/include/sanitizer/common_interface_defs.h From owner-svn-src-head@freebsd.org Thu Jul 28 19:32: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 5C00FBA7911; Thu, 28 Jul 2016 19:32:26 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2ECC41768; Thu, 28 Jul 2016 19:32:26 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6SJWP0i001610; Thu, 28 Jul 2016 19:32:25 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SJWPCX001609; Thu, 28 Jul 2016 19:32:25 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201607281932.u6SJWPCX001609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Thu, 28 Jul 2016 19:32:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303457 - 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.22 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, 28 Jul 2016 19:32:26 -0000 Author: gallatin Date: Thu Jul 28 19:32:25 2016 New Revision: 303457 URL: https://svnweb.freebsd.org/changeset/base/303457 Log: Call tcp_notify() directly to shoot down routes, rather than calling in_pcbnotifyall(). This avoids lock contention on tcbinfo due to in_pcbnotifyall() holding the tcbinfo write lock while walking all connections. Reviewed by: rrs, karels MFC after: 2 weeks Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D7251 Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu Jul 28 18:40:43 2016 (r303456) +++ head/sys/netinet/tcp_subr.c Thu Jul 28 19:32:25 2016 (r303457) @@ -1950,11 +1950,7 @@ tcp_ctlinput(int cmd, struct sockaddr *s else if (V_icmp_may_rst && (cmd == PRC_UNREACH_ADMIN_PROHIB || cmd == PRC_UNREACH_PORT || cmd == PRC_TIMXCEED_INTRANS) && ip) notify = tcp_drop_syn_sent; - else if (PRC_IS_REDIRECT(cmd)) { - /* signal EHOSTDOWN, as it flushes the cached route */ - in_pcbnotifyall(&V_tcbinfo, faddr, EHOSTDOWN, notify); - return; - } + /* * Hostdead is ugly because it goes linearly through all PCBs. * XXX: We never get this from ICMP, otherwise it makes an @@ -1975,7 +1971,12 @@ tcp_ctlinput(int cmd, struct sockaddr *s INP_INFO_RLOCK(&V_tcbinfo); inp = in_pcblookup(&V_tcbinfo, faddr, th->th_dport, ip->ip_src, th->th_sport, INPLOOKUP_WLOCKPCB, NULL); - if (inp != NULL) { + if (inp != NULL && PRC_IS_REDIRECT(cmd)) { + /* signal EHOSTDOWN, as it flushes the cached route */ + inp = (*notify)(inp, EHOSTDOWN); + if (inp != NULL) + INP_WUNLOCK(inp); + } else if (inp != NULL) { if (!(inp->inp_flags & INP_TIMEWAIT) && !(inp->inp_flags & INP_DROPPED) && !(inp->inp_socket == NULL)) { From owner-svn-src-head@freebsd.org Thu Jul 28 20:51: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 DB65EBA7C6F; Thu, 28 Jul 2016 20:51:30 +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 AE7A7138F; Thu, 28 Jul 2016 20:51:30 +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 u6SKpTBs030804; Thu, 28 Jul 2016 20:51:29 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SKpTpx030803; Thu, 28 Jul 2016 20:51:29 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201607282051.u6SKpTpx030803@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 28 Jul 2016 20:51:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303461 - 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.22 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, 28 Jul 2016 20:51:31 -0000 Author: jhb Date: Thu Jul 28 20:51:29 2016 New Revision: 303461 URL: https://svnweb.freebsd.org/changeset/base/303461 Log: Note that not all optional ptrace events use SIGTRAP. New child processes attached due to PTRACE_FORK use SIGSTOP instead of SIGTRAP. All other ptrace events use SIGTRAP. Modified: head/lib/libc/sys/ptrace.2 Modified: head/lib/libc/sys/ptrace.2 ============================================================================== --- head/lib/libc/sys/ptrace.2 Thu Jul 28 20:31:30 2016 (r303460) +++ head/lib/libc/sys/ptrace.2 Thu Jul 28 20:51:29 2016 (r303461) @@ -2,7 +2,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd July 18, 2016 +.Dd July 28, 2016 .Dt PTRACE 2 .Os .Sh NAME @@ -74,11 +74,15 @@ A traced process may report additional s events in the traced process. These additional signal stops are reported as .Dv SIGTRAP +or +.Dv SIGSTOP signals. The tracing process can use the .Dv PT_LWPINFO request to determine which events are associated with a .Dv SIGTRAP +or +.Dv SIGSTOP signal. Note that multiple events may be associated with a single signal. For example, events indicated by the @@ -88,10 +92,16 @@ and .Dv PL_FLAG_EXEC flags are also reported as a system call exit event .Pq Dv PL_FLAG_SCX . +The signal stop for a new child process enabled via +.Dv PTRACE_FORK +will report a +.Dv SIGSTOP +signal. +All other additional signal stops use +.Dv SIGTRAP . .Pp Each traced process has a tracing event mask. An event in the traced process only reports a -.Dv SIGTRAP signal stop if the corresponding flag is set in the tracing event mask. The current set of tracing event flags include: .Bl -tag -width ".Dv PTRACE_SYSCALL" From owner-svn-src-head@freebsd.org Thu Jul 28 21:27: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 4543ABA7716; Thu, 28 Jul 2016 21:27:48 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 167231A6A; Thu, 28 Jul 2016 21:27:48 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6SLRl47042118; Thu, 28 Jul 2016 21:27:47 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SLRl2B042117; Thu, 28 Jul 2016 21:27:47 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201607282127.u6SLRl2B042117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 28 Jul 2016 21:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303463 - head/sys/modules 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.22 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, 28 Jul 2016 21:27:48 -0000 Author: brooks Date: Thu Jul 28 21:27:47 2016 New Revision: 303463 URL: https://svnweb.freebsd.org/changeset/base/303463 Log: cxgbe's firmware module fails to build on mips64 as well as mips32 so disable for all mips. Sponsored by: DARPA, AFRL Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu Jul 28 21:16:18 2016 (r303462) +++ head/sys/modules/Makefile Thu Jul 28 21:27:47 2016 (r303463) @@ -508,7 +508,7 @@ _txp= txp .endif .if ${MK_SOURCELESS_UCODE} != "no" && ${MACHINE_CPUARCH} != "arm" && \ - ${MACHINE_ARCH:C/mips(el)?/mips/} != "mips" && \ + ${MACHINE_CPUARCH} != "mips" && \ ${MACHINE_ARCH} != "powerpc" && ${MACHINE_CPUARCH} != "riscv" _cxgbe= cxgbe .endif From owner-svn-src-head@freebsd.org Thu Jul 28 21:29: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 76D71BA77AA; Thu, 28 Jul 2016 21:29:06 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E61D1C14; Thu, 28 Jul 2016 21:29:06 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6SLT5WV042212; Thu, 28 Jul 2016 21:29:05 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SLT4CH042204; Thu, 28 Jul 2016 21:29:04 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201607282129.u6SLT4CH042204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 28 Jul 2016 21:29:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303464 - in head/sys: amd64/linux amd64/linux32 compat/freebsd32 compat/svr4 i386/ibcs2 i386/linux 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.22 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, 28 Jul 2016 21:29:06 -0000 Author: brooks Date: Thu Jul 28 21:29:04 2016 New Revision: 303464 URL: https://svnweb.freebsd.org/changeset/base/303464 Log: Don't create pointless backups of generated files in "make sysent". Any sensible workflow will include a revision control system from which to restore the old files if required. In normal usage, developers just have to clean up the mess. Reviewed by: jhb Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D7353 Modified: head/sys/amd64/linux/Makefile head/sys/amd64/linux32/Makefile head/sys/compat/freebsd32/Makefile head/sys/compat/svr4/Makefile head/sys/i386/ibcs2/Makefile head/sys/i386/linux/Makefile head/sys/kern/Makefile Modified: head/sys/amd64/linux/Makefile ============================================================================== --- head/sys/amd64/linux/Makefile Thu Jul 28 21:27:47 2016 (r303463) +++ head/sys/amd64/linux/Makefile Thu Jul 28 21:29:04 2016 (r303464) @@ -9,9 +9,4 @@ sysent: linux_sysent.c linux_syscall.h linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c: \ ../../kern/makesyscalls.sh syscalls.master syscalls.conf - -mv -f linux_sysent.c linux_sysent.c.bak - -mv -f linux_syscall.h linux_syscall.h.bak - -mv -f linux_proto.h linux_proto.h.bak - -mv -f linux_syscalls.c linux_syscalls.c.bak - -mv -f linux_systrace_args.c linux_systrace_args.c.bak sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf Modified: head/sys/amd64/linux32/Makefile ============================================================================== --- head/sys/amd64/linux32/Makefile Thu Jul 28 21:27:47 2016 (r303463) +++ head/sys/amd64/linux32/Makefile Thu Jul 28 21:29:04 2016 (r303464) @@ -9,9 +9,4 @@ sysent: linux32_sysent.c linux32_syscal linux32_sysent.c linux32_syscall.h linux32_proto.h linux32_syscalls.c linux32_systrace_args.c: ../../kern/makesyscalls.sh \ syscalls.master syscalls.conf - -mv -f linux32_sysent.c linux32_sysent.c.bak - -mv -f linux32_syscall.h linux32_syscall.h.bak - -mv -f linux32_proto.h linux32_proto.h.bak - -mv -f linux32_syscalls.c linux32_syscalls.c.bak - -mv -f linux32_systrace_args.c linux32_systrace_args.c.bak sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf Modified: head/sys/compat/freebsd32/Makefile ============================================================================== --- head/sys/compat/freebsd32/Makefile Thu Jul 28 21:27:47 2016 (r303463) +++ head/sys/compat/freebsd32/Makefile Thu Jul 28 21:29:04 2016 (r303464) @@ -9,11 +9,6 @@ sysent: freebsd32_sysent.c freebsd32_sy freebsd32_sysent.c freebsd32_syscalls.c freebsd32_syscall.h freebsd32_proto.h freebsd32_systrace_args.c : \ ../../kern/makesyscalls.sh syscalls.master syscalls.conf - -mv -f freebsd32_sysent.c freebsd32_sysent.c.bak - -mv -f freebsd32_syscalls.c freebsd32_syscalls.c.bak - -mv -f freebsd32_syscall.h freebsd32_syscall.h.bak - -mv -f freebsd32_proto.h freebsd32_proto.h.bak - -mv -f freebsd32_systrace_args.c freebsd32_systrace_args.c.bak sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf clean: Modified: head/sys/compat/svr4/Makefile ============================================================================== --- head/sys/compat/svr4/Makefile Thu Jul 28 21:27:47 2016 (r303463) +++ head/sys/compat/svr4/Makefile Thu Jul 28 21:29:04 2016 (r303464) @@ -9,9 +9,5 @@ sysent: svr4_sysent.c svr4_syscall.h sv svr4_syscallnames.c svr4_sysent.c svr4_syscall.h svr4_proto.h: \ ../../kern/makesyscalls.sh syscalls.master syscalls.conf - -mv -f svr4_syscallnames.c svr4_syscallnames.c.bak - -mv -f svr4_sysent.c svr4_sysent.c.bak - -mv -f svr4_syscall.h svr4_syscall.h.bak - -mv -f svr4_proto.h svr4_proto.h.bak sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf Modified: head/sys/i386/ibcs2/Makefile ============================================================================== --- head/sys/i386/ibcs2/Makefile Thu Jul 28 21:27:47 2016 (r303463) +++ head/sys/i386/ibcs2/Makefile Thu Jul 28 21:29:04 2016 (r303464) @@ -9,24 +9,16 @@ sysent: ibcs2_sysent.c ibcs2_syscall.h ibcs2_sysent.c ibcs2_syscall.h ibcs2_proto.h: ../../kern/makesyscalls.sh \ syscalls.master syscalls.conf - -mv -f ibcs2_sysent.c ibcs2_sysent.c.bak - -mv -f ibcs2_syscall.h ibcs2_syscall.h.bak - -mv -f ibcs2_proto.h ibcs2_proto.h.bak sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf isc_sysent: ibcs2_isc_sysent.c ibcs2_isc_syscall.h ibcs2_isc_sysent.c ibcs2_isc_syscall.h : ../../kern/makesyscalls.sh \ syscalls.isc syscalls.isc.conf - -mv -f ibcs2_isc_sysent.c ibcs2_isc_sysent.c.bak - -mv -f ibcs2_isc_syscall.h ibcs2_isc_syscall.h.bak sh ../../kern/makesyscalls.sh syscalls.isc syscalls.isc.conf xenix_sysent: ibcs2_xenix_sysent.c ibcs2_xenix_syscall.h ibcs2_xenix.h ibcs2_xenix_sysent.c ibcs2_xenix_syscall.h ibcs2_xenix.h: \ ../../kern/makesyscalls.sh syscalls.xenix syscalls.xenix.conf - -mv -f ibcs2_xenix_sysent.c ibcs2_xenix_sysent.c.bak - -mv -f ibcs2_xenix_syscall.h ibcs2_xenix_syscall.h.bak - -mv -f ibcs2_xenix.h ibcs2_xenix.h.bak sh ../../kern/makesyscalls.sh syscalls.xenix syscalls.xenix.conf Modified: head/sys/i386/linux/Makefile ============================================================================== --- head/sys/i386/linux/Makefile Thu Jul 28 21:27:47 2016 (r303463) +++ head/sys/i386/linux/Makefile Thu Jul 28 21:29:04 2016 (r303464) @@ -9,9 +9,4 @@ sysent: linux_sysent.c linux_syscall.h linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c: \ ../../kern/makesyscalls.sh syscalls.master syscalls.conf - -mv -f linux_sysent.c linux_sysent.c.bak - -mv -f linux_syscall.h linux_syscall.h.bak - -mv -f linux_proto.h linux_proto.h.bak - -mv -f linux_syscalls.c linux_syscalls.c.bak - -mv -f linux_systrace_args.c linux_systrace_args.c.bak sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf Modified: head/sys/kern/Makefile ============================================================================== --- head/sys/kern/Makefile Thu Jul 28 21:27:47 2016 (r303463) +++ head/sys/kern/Makefile Thu Jul 28 21:29:04 2016 (r303464) @@ -12,10 +12,4 @@ sysent: init_sysent.c syscalls.c ../sys/ init_sysent.c syscalls.c systrace_args.c ../sys/syscall.h \ ../sys/syscall.mk ../sys/sysproto.h: makesyscalls.sh syscalls.master \ capabilities.conf - -mv -f init_sysent.c init_sysent.c.bak - -mv -f syscalls.c syscalls.c.bak - -mv -f systrace_args.c systrace_args.c.bak - -mv -f ../sys/syscall.h ../sys/syscall.h.bak - -mv -f ../sys/syscall.mk ../sys/syscall.mk.bak - -mv -f ../sys/sysproto.h ../sys/sysproto.h.bak sh makesyscalls.sh syscalls.master From owner-svn-src-head@freebsd.org Thu Jul 28 22:30: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 D2DA8BA5AE6; Thu, 28 Jul 2016 22:30:49 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89F2714AB; Thu, 28 Jul 2016 22:30:49 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6SMUmqR065162; Thu, 28 Jul 2016 22:30:48 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SMUmm8065156; Thu, 28 Jul 2016 22:30:48 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201607282230.u6SMUmm8065156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Thu, 28 Jul 2016 22:30:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303465 - head/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.22 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, 28 Jul 2016 22:30:49 -0000 Author: alc Date: Thu Jul 28 22:30:48 2016 New Revision: 303465 URL: https://svnweb.freebsd.org/changeset/base/303465 Log: Remove any mention of cache (PG_CACHE) pages from the comments in vm_pageout_scan(). That function has not cached pages since r284376. MFC after: 3 days Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Thu Jul 28 21:29:04 2016 (r303464) +++ head/sys/vm/vm_pageout.c Thu Jul 28 22:30:48 2016 (r303465) @@ -872,7 +872,7 @@ unlock_mp: * vm_pageout_scan does the dirty work for the pageout daemon. * * pass 0 - Update active LRU/deactivate pages - * pass 1 - Move inactive to cache or free + * pass 1 - Free inactive pages * pass 2 - Launder dirty pages */ static void @@ -915,8 +915,7 @@ vm_pageout_scan(struct vm_domain *vmd, i addl_page_shortage = 0; /* - * Calculate the number of pages we want to either free or move - * to the cache. + * Calculate the number of pages that we want to free. */ if (pass > 0) { deficit = atomic_readandclear_int(&vm_pageout_deficit); @@ -943,11 +942,10 @@ vm_pageout_scan(struct vm_domain *vmd, i vnodes_skipped = 0; /* - * Start scanning the inactive queue for pages we can move to the - * cache or free. The scan will stop when the target is reached or - * we have scanned the entire inactive queue. Note that m->act_count - * is not used to form decisions for the inactive queue, only for the - * active queue. + * Start scanning the inactive queue for pages that we can free. The + * scan will stop when we reach the target or we have scanned the + * entire queue. (Note that m->act_count is not used to make + * decisions for the inactive queue, only for the active queue.) */ pq = &vmd->vmd_pagequeues[PQ_INACTIVE]; maxscan = pq->pq_cnt; @@ -1170,8 +1168,8 @@ relock_queue: #if !defined(NO_SWAPPING) /* - * Wakeup the swapout daemon if we didn't cache or free the targeted - * number of pages. + * Wakeup the swapout daemon if we didn't free the targeted number of + * pages. */ if (vm_swap_enabled && page_shortage > 0) vm_req_vmdaemon(VM_SWAP_NORMAL); @@ -1179,7 +1177,7 @@ relock_queue: /* * Wakeup the sync daemon if we skipped a vnode in a writeable object - * and we didn't cache or free enough pages. + * and we didn't free enough pages. */ if (vnodes_skipped > 0 && page_shortage > vm_cnt.v_free_target - vm_cnt.v_free_min) From owner-svn-src-head@freebsd.org Thu Jul 28 22:40: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 1417EBA5D3D; Thu, 28 Jul 2016 22:40:33 +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 DB3CA1939; Thu, 28 Jul 2016 22:40:32 +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 u6SMeWBe068259; Thu, 28 Jul 2016 22:40:32 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SMeWh6068258; Thu, 28 Jul 2016 22:40:32 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201607282240.u6SMeWh6068258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 28 Jul 2016 22:40:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303466 - 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.22 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, 28 Jul 2016 22:40:33 -0000 Author: imp Date: Thu Jul 28 22:40:31 2016 New Revision: 303466 URL: https://svnweb.freebsd.org/changeset/base/303466 Log: Kill a few stray debug printfs. Modified: head/sys/dev/nvme/nvme_sim.c Modified: head/sys/dev/nvme/nvme_sim.c ============================================================================== --- head/sys/dev/nvme/nvme_sim.c Thu Jul 28 22:30:48 2016 (r303465) +++ head/sys/dev/nvme/nvme_sim.c Thu Jul 28 22:40:31 2016 (r303466) @@ -133,8 +133,6 @@ nvme_sim_action(struct cam_sim *sim, uni ns = sim2ns(sim); ctrlr = sim2ctrlr(sim); - printf("Sim action: ctrlr %p ns %p\n", ctrlr, ns); - mtx_assert(&ctrlr->lock, MA_OWNED); switch (ccb->ccb_h.func_code) { @@ -310,8 +308,6 @@ nvme_sim_new_ns(struct nvme_namespace *n sc->s_ns = ns; - printf("Our SIM's softc %p ctrlr %p ns %p\n", sc, ctrlr, ns); - /* * XXX this is creating one bus per ns, but it should be one * XXX target per controller, and one LUN per namespace. @@ -349,7 +345,6 @@ nvme_sim_new_ns(struct nvme_namespace *n sc->s_path->device->nvme_cdata = nvme_ctrlr_get_data(ns->ctrlr); /* Scan bus */ - printf("Initiate rescan of the bus\n"); nvme_sim_rescan_target(ctrlr, sc->s_path); mtx_unlock(&ctrlr->lock); From owner-svn-src-head@freebsd.org Thu Jul 28 22:42: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 9ED62BA5EA3; Thu, 28 Jul 2016 22:42:42 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 6756A1D06; Thu, 28 Jul 2016 22:42:41 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id D0071783F51; Fri, 29 Jul 2016 08:42:34 +1000 (AEST) Date: Fri, 29 Jul 2016 08:42:33 +1000 (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: r303446 - head/sys/vm In-Reply-To: <201607281549.u6SFnqQK016697@repo.freebsd.org> Message-ID: <20160729075631.L944@besplex.bde.org> References: <201607281549.u6SFnqQK016697@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=OtmysHLt c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=Te4QX_xqBi-zt0O5ZrAA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 28 Jul 2016 22:42:42 -0000 On Thu, 28 Jul 2016, Konstantin Belousov wrote: > Log: > Fix style and typo. > > Modified: head/sys/vm/swap_pager.c > ============================================================================== > --- head/sys/vm/swap_pager.c Thu Jul 28 15:33:19 2016 (r303445) > +++ head/sys/vm/swap_pager.c Thu Jul 28 15:49:51 2016 (r303446) > @@ -390,8 +390,8 @@ static int dmmax; > static int nswap_lowat = 128; /* in pages, swap_pager_almost_full warn */ > static int nswap_hiwat = 512; /* in pages, swap_pager_almost_full warn */ > > -SYSCTL_INT(_vm, OID_AUTO, dmmax, > - CTLFLAG_RD, &dmmax, 0, "Maximum size of a swap block"); > +SYSCTL_INT(_vm, OID_AUTO, dmmax, CTLFLAG_RD, &dmmax, 0, > + "Maximum size of a swap block"); This fixes the indentation, but only moves the style bug in the long-line splitting. The first line of a SYSCTL_ is conventionally split after CTFLAG* if this would not leave it too long. This puts the variable name in an easier-to-read place and inhibits verbose descriptions. The line splitting for the first is now consistently broken for all nearby sysctls. There are many style bugs in the descriptions in neary sysctls: - some are terminated by a "." - most are too long, using poor wording to make them longer. Some say "amount", and some say "size". Both of these words are almost redundant and do little to describe the units. Apparently, sizes are in bytes. Some of the amounts are apparently also in bytes, but swap_maxpages is dimensionless. Its name tells you more in half the space as it description "Maximum amount of swap supported". - the description for vm.overcommit is especially bad. It takes multiple sentences with misformatting and a long line with misformatting to refer to the man page for details. Otherwise, it basically says "Enable overcommit". Its only unobvious point is that the man page is tuning(7) and not vm(7nonexistent). I haven't found anuthing better than zgrep -r in /usr/shar/man for finding man page references. vm.overcommit is also badly described in getrlimit(2). This adds to the verboseness using "Please see" and expanding "details" to "complete description of". sysctl -da | grep '\.$' | wc on freefall finds only 102 descriptions with a trailing "." in 4115 lines. The pattern ": [^A-Z] matches 1580 lines. 1410 of the 1580 uncapitalized lines have a leading 'dev' and most of these style bugs are in auto-generated spam. The spam gives useless descriptions like %parent: "parent device". IIRC, the strings for this spam are not duplicated in the kernel, so they don't waste space there, but this means that they cannot contain any useful context-dependent information. '[Aa]mount' is mercifully unpopular. It matches just 20 lines, mostly near here and in vfs_bio. Bruce Bruce From owner-svn-src-head@freebsd.org Thu Jul 28 22:49: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 40660BA5F3D; Thu, 28 Jul 2016 22:49:40 +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 139991EF8; Thu, 28 Jul 2016 22:49:40 +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 D0581B985; Thu, 28 Jul 2016 18:49:38 -0400 (EDT) From: John Baldwin To: Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303464 - in head/sys: amd64/linux amd64/linux32 compat/freebsd32 compat/svr4 i386/ibcs2 i386/linux kern Date: Thu, 28 Jul 2016 15:04:33 -0700 Message-ID: <3961167.qhi1ygCMQO@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201607282129.u6SLT4CH042204@repo.freebsd.org> References: <201607282129.u6SLT4CH042204@repo.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); Thu, 28 Jul 2016 18:49:38 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 28 Jul 2016 22:49:40 -0000 On Thursday, July 28, 2016 09:29:04 PM Brooks Davis wrote: > Author: brooks > Date: Thu Jul 28 21:29:04 2016 > New Revision: 303464 > URL: https://svnweb.freebsd.org/changeset/base/303464 > > Log: > Don't create pointless backups of generated files in "make sysent". > > Any sensible workflow will include a revision control system from which > to restore the old files if required. In normal usage, developers just > have to clean up the mess. > > Reviewed by: jhb > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D7353 Goes back a long time: https://svnweb.freebsd.org/csrg?view=revision&revision=38725 Even then CSRG was using SCCS. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Jul 28 22:55: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 74ED6BA7145; Thu, 28 Jul 2016 22:55:16 +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 3791D14A2; Thu, 28 Jul 2016 22:55:16 +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 u6SMtFu6075234; Thu, 28 Jul 2016 22:55:15 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SMtEq7075228; Thu, 28 Jul 2016 22:55:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201607282255.u6SMtEq7075228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 28 Jul 2016 22:55:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303467 - in head/sys/cam: . ata nvme 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.22 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, 28 Jul 2016 22:55:16 -0000 Author: imp Date: Thu Jul 28 22:55:14 2016 New Revision: 303467 URL: https://svnweb.freebsd.org/changeset/base/303467 Log: Switch to linker sets to find the xport callback object. This eliminates the need to special case everything in cam_xpt for new transports. It is now a failure to not have a transport object when registering the bus as well. You can still, however, create a transport that's unspecified (XPT_) Differential Revision: https://reviews.freebsd.org/D7289 Modified: head/sys/cam/ata/ata_xpt.c head/sys/cam/cam_xpt.c head/sys/cam/cam_xpt_internal.h head/sys/cam/nvme/nvme_xpt.c head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Thu Jul 28 22:40:31 2016 (r303466) +++ head/sys/cam/ata/ata_xpt.c Thu Jul 28 22:55:14 2016 (r303467) @@ -195,18 +195,24 @@ static int atapi_dma = 1; TUNABLE_INT("hw.ata.ata_dma", &ata_dma); TUNABLE_INT("hw.ata.atapi_dma", &atapi_dma); -static struct xpt_xport ata_xport = { +static struct xpt_xport_ops ata_xport_ops = { .alloc_device = ata_alloc_device, .action = ata_action, .async = ata_dev_async, .announce = ata_announce_periph, }; +#define ATA_XPT_XPORT(x, X) \ +static struct xpt_xport ata_xport_ ## x = { \ + .xport = XPORT_ ## X, \ + .name = #x, \ + .ops = &ata_xport_ops, \ +}; \ +CAM_XPT_XPORT(ata_xport_ ## x); -struct xpt_xport * -ata_get_xport(void) -{ - return (&ata_xport); -} +ATA_XPT_XPORT(ata, ATA); +ATA_XPT_XPORT(sata, SATA); + +#undef ATA_XPORT_XPORT static void probe_periph_init() Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Thu Jul 28 22:40:31 2016 (r303466) +++ head/sys/cam/cam_xpt.c Thu Jul 28 22:55:14 2016 (r303467) @@ -1043,7 +1043,7 @@ xpt_announce_periph(struct cam_periph *p periph->unit_number, path->device->serial_num); } /* Announce transport details. */ - (*(path->bus->xport->announce))(periph); + (*(path->bus->xport->ops->announce))(periph); /* Announce command queueing. */ if (path->device->inq_flags & SID_CmdQue || path->device->flags & CAM_DEV_TAG_AFTER_COUNT) { @@ -2464,7 +2464,7 @@ xpt_action(union ccb *start_ccb) xpt_action_name(start_ccb->ccb_h.func_code))); start_ccb->ccb_h.status = CAM_REQ_INPROG; - (*(start_ccb->ccb_h.path->bus->xport->action))(start_ccb); + (*(start_ccb->ccb_h.path->bus->xport->ops->action))(start_ccb); } void @@ -3482,9 +3482,9 @@ xpt_compile_path(struct cam_path *new_pa struct cam_ed *new_device; new_device = - (*(bus->xport->alloc_device))(bus, - target, - lun_id); + (*(bus->xport->ops->alloc_device))(bus, + target, + lun_id); if (new_device == NULL) { status = CAM_RESRC_UNAVAIL; } else { @@ -3832,11 +3832,18 @@ xpt_release_ccb(union ccb *free_ccb) /* Functions accessed by SIM drivers */ -static struct xpt_xport xport_default = { +static struct xpt_xport_ops xport_default_ops = { .alloc_device = xpt_alloc_device_default, .action = xpt_action_default, .async = xpt_dev_async_default, }; +static struct xpt_xport xport_default = { + .xport = XPORT_UNKNOWN, + .name = "unknown", + .ops = &xport_default_ops, +}; + +CAM_XPT_XPORT(xport_default); /* * A sim structure, listing the SIM entry points and instance @@ -3909,26 +3916,20 @@ xpt_bus_register(struct cam_sim *sim, de xpt_action((union ccb *)&cpi); if (cpi.ccb_h.status == CAM_REQ_CMP) { - switch (cpi.transport) { - case XPORT_SPI: - case XPORT_SAS: - case XPORT_FC: - case XPORT_USB: - case XPORT_ISCSI: - case XPORT_SRP: - case XPORT_PPB: - new_bus->xport = scsi_get_xport(); - break; - case XPORT_ATA: - case XPORT_SATA: - new_bus->xport = ata_get_xport(); - break; - case XPORT_NVME: - new_bus->xport = nvme_get_xport(); - break; - default: - new_bus->xport = &xport_default; - break; + struct xpt_xport **xpt; + + SET_FOREACH(xpt, cam_xpt_xport_set) { + if ((*xpt)->xport == cpi.transport) { + new_bus->xport = *xpt; + break; + } + } + if (new_bus->xport == NULL) { + xpt_print_path(path); + printf("No transport found for %d\n", cpi.transport); + xpt_release_bus(new_bus); + free(path, M_CAMXPT); + return (CAM_RESRC_UNAVAIL); } } @@ -4138,7 +4139,7 @@ xpt_async_process_dev(struct cam_ed *dev } else relock = 0; - (*(device->target->bus->xport->async))(async_code, + (*(device->target->bus->xport->ops->async))(async_code, device->target->bus, device->target, device, async_arg); xpt_async_bcast(&device->asyncs, async_code, path, async_arg); Modified: head/sys/cam/cam_xpt_internal.h ============================================================================== --- head/sys/cam/cam_xpt_internal.h Thu Jul 28 22:40:31 2016 (r303466) +++ head/sys/cam/cam_xpt_internal.h Thu Jul 28 22:55:14 2016 (r303467) @@ -48,7 +48,7 @@ typedef void (*xpt_dev_async_func)(u_int void *async_arg); typedef void (*xpt_announce_periph_func)(struct cam_periph *periph); -struct xpt_xport { +struct xpt_xport_ops { xpt_alloc_device_func alloc_device; xpt_release_device_func reldev; xpt_action_func action; @@ -56,6 +56,16 @@ struct xpt_xport { xpt_announce_periph_func announce; }; +struct xpt_xport { + cam_xport xport; + const char *name; + struct xpt_xport_ops *ops; +}; + +SET_DECLARE(cam_xpt_xport_set, struct xpt_xport); +#define CAM_XPT_XPORT(data) \ + DATA_SET(cam_xpt_xport_set, data) + /* * The CAM EDT (Existing Device Table) contains the device information for * all devices for all busses in the system. The table contains a @@ -167,10 +177,6 @@ struct cam_path { struct cam_ed *device; }; -struct xpt_xport * scsi_get_xport(void); -struct xpt_xport * ata_get_xport(void); -struct xpt_xport * nvme_get_xport(void); - struct cam_ed * xpt_alloc_device(struct cam_eb *bus, struct cam_et *target, lun_id_t lun_id); Modified: head/sys/cam/nvme/nvme_xpt.c ============================================================================== --- head/sys/cam/nvme/nvme_xpt.c Thu Jul 28 22:40:31 2016 (r303466) +++ head/sys/cam/nvme/nvme_xpt.c Thu Jul 28 22:55:14 2016 (r303467) @@ -153,19 +153,23 @@ static void nvme_dev_async(u_int32_t as static void nvme_action(union ccb *start_ccb); static void nvme_announce_periph(struct cam_periph *periph); -static struct xpt_xport nvme_xport = { +static struct xpt_xport_ops nvme_xport_ops = { .alloc_device = nvme_alloc_device, .action = nvme_action, .async = nvme_dev_async, .announce = nvme_announce_periph, }; +#define NVME_XPT_XPORT(x, X) \ +static struct xpt_xport nvme_xport_ ## x = { \ + .xport = XPORT_ ## X, \ + .name = #x, \ + .ops = &nvme_xport_ops, \ +}; \ +CAM_XPT_XPORT(nvme_xport_ ## x); -struct xpt_xport * -nvme_get_xport(void) -{ +NVME_XPT_XPORT(nvme, NVME); - return (&nvme_xport); -} +#undef NVME_XPT_XPORT static void nvme_probe_periph_init() Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Thu Jul 28 22:40:31 2016 (r303466) +++ head/sys/cam/scsi/scsi_xpt.c Thu Jul 28 22:55:14 2016 (r303467) @@ -590,18 +590,29 @@ static void scsi_dev_async(u_int32_t as static void scsi_action(union ccb *start_ccb); static void scsi_announce_periph(struct cam_periph *periph); -static struct xpt_xport scsi_xport = { +static struct xpt_xport_ops scsi_xport_ops = { .alloc_device = scsi_alloc_device, .action = scsi_action, .async = scsi_dev_async, .announce = scsi_announce_periph, }; +#define SCSI_XPT_XPORT(x, X) \ +static struct xpt_xport scsi_xport_ ## x = { \ + .xport = XPORT_ ## X, \ + .name = #x, \ + .ops = &scsi_xport_ops, \ +}; \ +CAM_XPT_XPORT(scsi_xport_ ## x); + +SCSI_XPT_XPORT(spi, SPI); +SCSI_XPT_XPORT(sas, SAS); +SCSI_XPT_XPORT(fc, FC); +SCSI_XPT_XPORT(usb, USB); +SCSI_XPT_XPORT(iscsi, ISCSI); +SCSI_XPT_XPORT(srp, SRP); +SCSI_XPT_XPORT(ppb, PPB); -struct xpt_xport * -scsi_get_xport(void) -{ - return (&scsi_xport); -} +#undef SCSI_XPORT_XPORT static void probe_periph_init() From owner-svn-src-head@freebsd.org Thu Jul 28 22: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 D4E6ABA716C; Thu, 28 Jul 2016 22:55:23 +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 92CA615C8; Thu, 28 Jul 2016 22:55:23 +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 u6SMtM2I075284; Thu, 28 Jul 2016 22:55:22 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SMtMXw075277; Thu, 28 Jul 2016 22:55:22 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201607282255.u6SMtMXw075277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 28 Jul 2016 22:55:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303468 - in head/sys: cam cam/ata cam/nvme cam/scsi 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.22 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, 28 Jul 2016 22:55:24 -0000 Author: imp Date: Thu Jul 28 22:55:21 2016 New Revision: 303468 URL: https://svnweb.freebsd.org/changeset/base/303468 Log: Move protocol specific stuff into a linker set object that's per-protocol. This reduces the number scsi symbols references by cam_xpt significantly, and eliminates all ata / nvme symbols. There's still some NVME / ATA specific code for dealing with XPT_NVME_IO and XPT_ATA_IO respectively, and a bunch of scsi-specific code, but this is progress. Differential Revision: https://reviews.freebsd.org/D7289 Modified: head/sys/cam/ata/ata_xpt.c head/sys/cam/cam_xpt.c head/sys/cam/cam_xpt_internal.h head/sys/cam/nvme/nvme_xpt.c head/sys/cam/scsi/scsi_xpt.c head/sys/conf/files Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Thu Jul 28 22:55:14 2016 (r303467) +++ head/sys/cam/ata/ata_xpt.c Thu Jul 28 22:55:21 2016 (r303468) @@ -188,6 +188,11 @@ static void ata_dev_async(u_int32_t asy void *async_arg); static void ata_action(union ccb *start_ccb); static void ata_announce_periph(struct cam_periph *periph); +static void ata_proto_announce(struct cam_ed *device); +static void ata_proto_denounce(struct cam_ed *device); +static void ata_proto_debug_out(union ccb *ccb); +static void semb_proto_announce(struct cam_ed *device); +static void semb_proto_denounce(struct cam_ed *device); static int ata_dma = 1; static int atapi_dma = 1; @@ -214,6 +219,43 @@ ATA_XPT_XPORT(sata, SATA); #undef ATA_XPORT_XPORT +static struct xpt_proto_ops ata_proto_ops_ata = { + .announce = ata_proto_announce, + .denounce = ata_proto_denounce, + .debug_out = ata_proto_debug_out, +}; +static struct xpt_proto ata_proto_ata = { + .proto = PROTO_ATA, + .name = "ata", + .ops = &ata_proto_ops_ata, +}; + +static struct xpt_proto_ops ata_proto_ops_satapm = { + .announce = ata_proto_announce, + .denounce = ata_proto_denounce, + .debug_out = ata_proto_debug_out, +}; +static struct xpt_proto ata_proto_satapm = { + .proto = PROTO_SATAPM, + .name = "satapm", + .ops = &ata_proto_ops_satapm, +}; + +static struct xpt_proto_ops ata_proto_ops_semb = { + .announce = semb_proto_announce, + .denounce = semb_proto_denounce, + .debug_out = ata_proto_debug_out, +}; +static struct xpt_proto ata_proto_semb = { + .proto = PROTO_SEMB, + .name = "semb", + .ops = &ata_proto_ops_semb, +}; + +CAM_XPT_PROTO(ata_proto_ata); +CAM_XPT_PROTO(ata_proto_satapm); +CAM_XPT_PROTO(ata_proto_semb); + static void probe_periph_init() { @@ -2094,3 +2136,40 @@ ata_announce_periph(struct cam_periph *p } printf("\n"); } + +static void +ata_proto_announce(struct cam_ed *device) +{ + ata_print_ident(&device->ident_data); +} + +static void +ata_proto_denounce(struct cam_ed *device) +{ + ata_print_ident_short(&device->ident_data); +} + +static void +semb_proto_announce(struct cam_ed *device) +{ + semb_print_ident((struct sep_identify_data *)&device->ident_data); +} + +static void +semb_proto_denounce(struct cam_ed *device) +{ + semb_print_ident_short((struct sep_identify_data *)&device->ident_data); +} + +static void +ata_proto_debug_out(union ccb *ccb) +{ + char cdb_str[(sizeof(struct ata_cmd) * 3) + 1]; + + if (ccb->ccb_h.func_code != XPT_ATA_IO) + return; + + CAM_DEBUG(ccb->ccb_h.path, + CAM_DEBUG_CDB,("%s. ACB: %s\n", ata_op_string(&ccb->ataio.cmd), + ata_cmd_string(&ccb->ataio.cmd, cdb_str, sizeof(cdb_str)))); +} Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Thu Jul 28 22:55:14 2016 (r303467) +++ head/sys/cam/cam_xpt.c Thu Jul 28 22:55:21 2016 (r303468) @@ -746,6 +746,19 @@ cam_module_event_handler(module_t mod, i return 0; } +static struct xpt_proto * +xpt_proto_find(cam_proto proto) +{ + struct xpt_proto **pp; + + SET_FOREACH(pp, cam_xpt_proto_set) { + if ((*pp)->proto == proto) + return *pp; + } + + return NULL; +} + static void xpt_rescan_done(struct cam_periph *periph, union ccb *done_ccb) { @@ -1012,6 +1025,7 @@ void xpt_announce_periph(struct cam_periph *periph, char *announce_string) { struct cam_path *path = periph->path; + struct xpt_proto *proto; cam_periph_assert(periph, MA_OWNED); periph->flags |= CAM_PERIPH_ANNOUNCED; @@ -1025,25 +1039,20 @@ xpt_announce_periph(struct cam_periph *p path->target->target_id, (uintmax_t)path->device->lun_id); printf("%s%d: ", periph->periph_name, periph->unit_number); - if (path->device->protocol == PROTO_SCSI) - scsi_print_inquiry(&path->device->inq_data); - else if (path->device->protocol == PROTO_ATA || - path->device->protocol == PROTO_SATAPM) - ata_print_ident(&path->device->ident_data); - else if (path->device->protocol == PROTO_SEMB) - semb_print_ident( - (struct sep_identify_data *)&path->device->ident_data); - else if (path->device->protocol == PROTO_NVME) - nvme_print_ident(path->device->nvme_cdata, path->device->nvme_data); + proto = xpt_proto_find(path->device->protocol); + if (proto) + proto->ops->announce(path->device); else - printf("Unknown protocol device\n"); + printf("%s%d: Unknown protocol device %d\n", + periph->periph_name, periph->unit_number, + path->device->protocol); if (path->device->serial_num_len > 0) { /* Don't wrap the screen - print only the first 60 chars */ printf("%s%d: Serial Number %.60s\n", periph->periph_name, periph->unit_number, path->device->serial_num); } /* Announce transport details. */ - (*(path->bus->xport->ops->announce))(periph); + path->bus->xport->ops->announce(periph); /* Announce command queueing. */ if (path->device->inq_flags & SID_CmdQue || path->device->flags & CAM_DEV_TAG_AFTER_COUNT) { @@ -1069,6 +1078,7 @@ void xpt_denounce_periph(struct cam_periph *periph) { struct cam_path *path = periph->path; + struct xpt_proto *proto; cam_periph_assert(periph, MA_OWNED); printf("%s%d at %s%d bus %d scbus%d target %d lun %jx\n", @@ -1080,18 +1090,13 @@ xpt_denounce_periph(struct cam_periph *p path->target->target_id, (uintmax_t)path->device->lun_id); printf("%s%d: ", periph->periph_name, periph->unit_number); - if (path->device->protocol == PROTO_SCSI) - scsi_print_inquiry_short(&path->device->inq_data); - else if (path->device->protocol == PROTO_ATA || - path->device->protocol == PROTO_SATAPM) - ata_print_ident_short(&path->device->ident_data); - else if (path->device->protocol == PROTO_SEMB) - semb_print_ident_short( - (struct sep_identify_data *)&path->device->ident_data); - else if (path->device->protocol == PROTO_NVME) - nvme_print_ident(path->device->nvme_cdata, path->device->nvme_data); + proto = xpt_proto_find(path->device->protocol); + if (proto) + proto->ops->denounce(path->device); else - printf("Unknown protocol device"); + printf("%s%d: Unknown protocol device %d\n", + periph->periph_name, periph->unit_number, + path->device->protocol); if (path->device->serial_num_len > 0) printf(" s/n %.60s", path->device->serial_num); printf(" detached\n"); @@ -3234,7 +3239,6 @@ restart: static void xpt_run_devq(struct cam_devq *devq) { - char cdb_str[(SCSI_MAX_CDBLEN * 3) + 1]; int lock; CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_run_devq\n")); @@ -3246,6 +3250,7 @@ xpt_run_devq(struct cam_devq *devq) struct cam_ed *device; union ccb *work_ccb; struct cam_sim *sim; + struct xpt_proto *proto; device = (struct cam_ed *)camq_remove(&devq->send_queue, CAMQ_HEAD); @@ -3311,32 +3316,12 @@ xpt_run_devq(struct cam_devq *devq) work_ccb->ccb_h.flags &= ~CAM_TAG_ACTION_VALID; } - switch (work_ccb->ccb_h.func_code) { - case XPT_SCSI_IO: - CAM_DEBUG(work_ccb->ccb_h.path, - CAM_DEBUG_CDB,("%s. CDB: %s\n", - scsi_op_desc(work_ccb->csio.cdb_io.cdb_bytes[0], - &device->inq_data), - scsi_cdb_string(work_ccb->csio.cdb_io.cdb_bytes, - cdb_str, sizeof(cdb_str)))); - break; - case XPT_ATA_IO: - CAM_DEBUG(work_ccb->ccb_h.path, - CAM_DEBUG_CDB,("%s. ACB: %s\n", - ata_op_string(&work_ccb->ataio.cmd), - ata_cmd_string(&work_ccb->ataio.cmd, - cdb_str, sizeof(cdb_str)))); - break; - case XPT_NVME_IO: - CAM_DEBUG(work_ccb->ccb_h.path, - CAM_DEBUG_CDB,("%s. NCB: %s\n", - nvme_op_string(&work_ccb->nvmeio.cmd), - nvme_cmd_string(&work_ccb->nvmeio.cmd, - cdb_str, sizeof(cdb_str)))); - break; - default: - break; - } + KASSERT(device == work_ccb->ccb_h.path->device, + ("device (%p) / path->device (%p) mismatch", + device, work_ccb->ccb_h.path->device)); + proto = xpt_proto_find(device->protocol); + if (proto && proto->ops->debug_out) + proto->ops->debug_out(work_ccb); /* * Device queues can be shared among multiple SIM instances Modified: head/sys/cam/cam_xpt_internal.h ============================================================================== --- head/sys/cam/cam_xpt_internal.h Thu Jul 28 22:55:14 2016 (r303467) +++ head/sys/cam/cam_xpt_internal.h Thu Jul 28 22:55:21 2016 (r303468) @@ -66,6 +66,26 @@ SET_DECLARE(cam_xpt_xport_set, struct xp #define CAM_XPT_XPORT(data) \ DATA_SET(cam_xpt_xport_set, data) +typedef void (*xpt_proto_announce_func)(struct cam_ed *); +typedef void (*xpt_proto_debug_out_func)(union ccb *); + +struct xpt_proto_ops { + xpt_proto_announce_func announce; + xpt_proto_announce_func denounce; + xpt_proto_debug_out_func debug_out; +}; + +struct xpt_proto { + cam_proto proto; + const char *name; + struct xpt_proto_ops *ops; +}; + +SET_DECLARE(cam_xpt_proto_set, struct xpt_proto); +#define CAM_XPT_PROTO(data) \ + DATA_SET(cam_xpt_proto_set, data) + + /* * The CAM EDT (Existing Device Table) contains the device information for * all devices for all busses in the system. The table contains a Modified: head/sys/cam/nvme/nvme_xpt.c ============================================================================== --- head/sys/cam/nvme/nvme_xpt.c Thu Jul 28 22:55:14 2016 (r303467) +++ head/sys/cam/nvme/nvme_xpt.c Thu Jul 28 22:55:21 2016 (r303468) @@ -152,6 +152,9 @@ static void nvme_dev_async(u_int32_t as void *async_arg); static void nvme_action(union ccb *start_ccb); static void nvme_announce_periph(struct cam_periph *periph); +static void nvme_proto_announce(struct cam_ed *device); +static void nvme_proto_denounce(struct cam_ed *device); +static void nvme_proto_debug_out(union ccb *ccb); static struct xpt_xport_ops nvme_xport_ops = { .alloc_device = nvme_alloc_device, @@ -171,6 +174,18 @@ NVME_XPT_XPORT(nvme, NVME); #undef NVME_XPT_XPORT +static struct xpt_proto_ops nvme_proto_ops = { + .announce = nvme_proto_announce, + .denounce = nvme_proto_denounce, + .debug_out = nvme_proto_debug_out, +}; +static struct xpt_proto nvme_proto = { + .proto = PROTO_NVME, + .name = "nvme", + .ops = &nvme_proto_ops, +}; +CAM_XPT_PROTO(nvme_proto); + static void nvme_probe_periph_init() { @@ -602,3 +617,29 @@ nvme_announce_periph(struct cam_periph * /* XXX NVME STUFF HERE */ printf("\n"); } + +static void +nvme_proto_announce(struct cam_ed *device) +{ + nvme_print_ident(device->nvme_cdata, device->nvme_data); +} + +static void +nvme_proto_denounce(struct cam_ed *device) +{ + nvme_print_ident(device->nvme_cdata, device->nvme_data); +} + +static void +nvme_proto_debug_out(union ccb *ccb) +{ + char cdb_str[(sizeof(struct nvme_command) * 3) + 1]; + + if (ccb->ccb_h.func_code != XPT_NVME_IO) + return; + + CAM_DEBUG(ccb->ccb_h.path, + CAM_DEBUG_CDB,("%s. NCB: %s\n", nvme_op_string(&ccb->nvmeio.cmd), + nvme_cmd_string(&ccb->nvmeio.cmd, cdb_str, sizeof(cdb_str)))); +} + Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Thu Jul 28 22:55:14 2016 (r303467) +++ head/sys/cam/scsi/scsi_xpt.c Thu Jul 28 22:55:21 2016 (r303468) @@ -589,6 +589,9 @@ static void scsi_dev_async(u_int32_t as void *async_arg); static void scsi_action(union ccb *start_ccb); static void scsi_announce_periph(struct cam_periph *periph); +static void scsi_proto_announce(struct cam_ed *device); +static void scsi_proto_denounce(struct cam_ed *device); +static void scsi_proto_debug_out(union ccb *ccb); static struct xpt_xport_ops scsi_xport_ops = { .alloc_device = scsi_alloc_device, @@ -614,6 +617,18 @@ SCSI_XPT_XPORT(ppb, PPB); #undef SCSI_XPORT_XPORT +static struct xpt_proto_ops scsi_proto_ops = { + .announce = scsi_proto_announce, + .denounce = scsi_proto_denounce, + .debug_out = scsi_proto_debug_out, +}; +static struct xpt_proto scsi_proto = { + .proto = PROTO_SCSI, + .name = "scsi", + .ops = &scsi_proto_ops, +}; +CAM_XPT_PROTO(scsi_proto); + static void probe_periph_init() { @@ -3100,3 +3115,30 @@ scsi_announce_periph(struct cam_periph * printf("\n"); } +static void +scsi_proto_announce(struct cam_ed *device) +{ + scsi_print_inquiry(&device->inq_data); +} + +static void +scsi_proto_denounce(struct cam_ed *device) +{ + scsi_print_inquiry_short(&device->inq_data); +} + +static void +scsi_proto_debug_out(union ccb *ccb) +{ + char cdb_str[(SCSI_MAX_CDBLEN * 3) + 1]; + struct cam_ed *device; + + if (ccb->ccb_h.func_code != XPT_SCSI_IO) + return; + + device = ccb->ccb_h.path->device; + CAM_DEBUG(ccb->ccb_h.path, + CAM_DEBUG_CDB,("%s. CDB: %s\n", + scsi_op_desc(ccb->csio.cdb_io.cdb_bytes[0], &device->inq_data), + scsi_cdb_string(ccb->csio.cdb_io.cdb_bytes, cdb_str, sizeof(cdb_str)))); +} Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jul 28 22:55:14 2016 (r303467) +++ head/sys/conf/files Thu Jul 28 22:55:21 2016 (r303468) @@ -86,9 +86,9 @@ cam/cam_xpt.c optional scbus cam/ata/ata_all.c optional scbus cam/ata/ata_xpt.c optional scbus cam/ata/ata_pmp.c optional scbus -cam/nvme/nvme_all.c optional scbus +cam/nvme/nvme_all.c optional scbus nvmd !nvd cam/nvme/nvme_da.c optional scbus nvme da !nvd -cam/nvme/nvme_xpt.c optional scbus +cam/nvme/nvme_xpt.c optional scbus nvmd !nvd cam/scsi/scsi_xpt.c optional scbus cam/scsi/scsi_all.c optional scbus cam/scsi/scsi_cd.c optional cd From owner-svn-src-head@freebsd.org Fri Jul 29 03:16: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 15D42BA7B62; Fri, 29 Jul 2016 03:16:53 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E432E14EC; Fri, 29 Jul 2016 03:16:52 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6T3GqWg071663; Fri, 29 Jul 2016 03:16:52 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6T3GpPp071658; Fri, 29 Jul 2016 03:16:51 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201607290316.u6T3GpPp071658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 29 Jul 2016 03:16:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303470 - in head/sys/dev/hyperv: include vmbus 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.22 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, 29 Jul 2016 03:16:53 -0000 Author: sephe Date: Fri Jul 29 03:16:51 2016 New Revision: 303470 URL: https://svnweb.freebsd.org/changeset/base/303470 Log: hyperv/vmbus: Reindent function declarations. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7344 Modified: head/sys/dev/hyperv/include/hyperv.h head/sys/dev/hyperv/include/hyperv_busdma.h head/sys/dev/hyperv/include/vmbus.h head/sys/dev/hyperv/vmbus/vmbus_chanvar.h head/sys/dev/hyperv/vmbus/vmbus_var.h Modified: head/sys/dev/hyperv/include/hyperv.h ============================================================================== --- head/sys/dev/hyperv/include/hyperv.h Fri Jul 29 00:00:54 2016 (r303469) +++ head/sys/dev/hyperv/include/hyperv.h Fri Jul 29 03:16:51 2016 (r303470) @@ -42,7 +42,7 @@ struct hyperv_guid { #define HYPERV_GUID_STRLEN 40 -int hyperv_guid2str(const struct hyperv_guid *, char *, size_t); +int hyperv_guid2str(const struct hyperv_guid *, char *, size_t); /** * @brief Get physical address from virtual Modified: head/sys/dev/hyperv/include/hyperv_busdma.h ============================================================================== --- head/sys/dev/hyperv/include/hyperv_busdma.h Fri Jul 29 00:00:54 2016 (r303469) +++ head/sys/dev/hyperv/include/hyperv_busdma.h Fri Jul 29 03:16:51 2016 (r303470) @@ -39,11 +39,11 @@ struct hyperv_dma { bus_dmamap_t hv_dmap; }; -void hyperv_dma_map_paddr(void *arg, bus_dma_segment_t *segs, int nseg, - int error); -void *hyperv_dmamem_alloc(bus_dma_tag_t parent_dtag, bus_size_t alignment, - bus_addr_t boundary, bus_size_t size, struct hyperv_dma *dma, - int flags); -void hyperv_dmamem_free(struct hyperv_dma *dma, void *ptr); +void hyperv_dma_map_paddr(void *arg, bus_dma_segment_t *segs, + int nseg, int error); +void *hyperv_dmamem_alloc(bus_dma_tag_t parent_dtag, + bus_size_t alignment, bus_addr_t boundary, bus_size_t size, + struct hyperv_dma *dma, int flags); +void hyperv_dmamem_free(struct hyperv_dma *dma, void *ptr); #endif /* !_HYPERV_BUSDMA_H_ */ Modified: head/sys/dev/hyperv/include/vmbus.h ============================================================================== --- head/sys/dev/hyperv/include/vmbus.h Fri Jul 29 00:00:54 2016 (r303469) +++ head/sys/dev/hyperv/include/vmbus.h Fri Jul 29 03:16:51 2016 (r303470) @@ -116,45 +116,47 @@ vmbus_get_channel(device_t dev) return device_get_ivars(dev); } -int vmbus_chan_open(struct vmbus_channel *chan, - int txbr_size, int rxbr_size, const void *udata, int udlen, - vmbus_chan_callback_t cb, void *cbarg); -void vmbus_chan_close(struct vmbus_channel *chan); - -int vmbus_chan_gpadl_connect(struct vmbus_channel *chan, - bus_addr_t paddr, int size, uint32_t *gpadl); -int vmbus_chan_gpadl_disconnect(struct vmbus_channel *chan, - uint32_t gpadl); +int vmbus_chan_open(struct vmbus_channel *chan, + int txbr_size, int rxbr_size, const void *udata, int udlen, + vmbus_chan_callback_t cb, void *cbarg); +void vmbus_chan_close(struct vmbus_channel *chan); + +int vmbus_chan_gpadl_connect(struct vmbus_channel *chan, + bus_addr_t paddr, int size, uint32_t *gpadl); +int vmbus_chan_gpadl_disconnect(struct vmbus_channel *chan, + uint32_t gpadl); -void vmbus_chan_cpu_set(struct vmbus_channel *chan, int cpu); -void vmbus_chan_cpu_rr(struct vmbus_channel *chan); +void vmbus_chan_cpu_set(struct vmbus_channel *chan, int cpu); +void vmbus_chan_cpu_rr(struct vmbus_channel *chan); struct vmbus_channel * - vmbus_chan_cpu2chan(struct vmbus_channel *chan, int cpu); -void vmbus_chan_set_readbatch(struct vmbus_channel *chan, bool on); + vmbus_chan_cpu2chan(struct vmbus_channel *chan, int cpu); +void vmbus_chan_set_readbatch(struct vmbus_channel *chan, bool on); struct vmbus_channel ** - vmbus_subchan_get(struct vmbus_channel *pri_chan, int subchan_cnt); -void vmbus_subchan_rel(struct vmbus_channel **subchan, int subchan_cnt); -void vmbus_subchan_drain(struct vmbus_channel *pri_chan); - -int vmbus_chan_recv(struct vmbus_channel *chan, void *data, int *dlen, - uint64_t *xactid); -int vmbus_chan_recv_pkt(struct vmbus_channel *chan, - struct vmbus_chanpkt_hdr *pkt, int *pktlen); - -int vmbus_chan_send(struct vmbus_channel *chan, uint16_t type, - uint16_t flags, void *data, int dlen, uint64_t xactid); -int vmbus_chan_send_sglist(struct vmbus_channel *chan, - struct vmbus_gpa sg[], int sglen, void *data, int dlen, - uint64_t xactid); -int vmbus_chan_send_prplist(struct vmbus_channel *chan, - struct vmbus_gpa_range *prp, int prp_cnt, void *data, int dlen, - uint64_t xactid); - -uint32_t vmbus_chan_id(const struct vmbus_channel *chan); -uint32_t vmbus_chan_subidx(const struct vmbus_channel *chan); -bool vmbus_chan_is_primary(const struct vmbus_channel *chan); + vmbus_subchan_get(struct vmbus_channel *pri_chan, + int subchan_cnt); +void vmbus_subchan_rel(struct vmbus_channel **subchan, + int subchan_cnt); +void vmbus_subchan_drain(struct vmbus_channel *pri_chan); + +int vmbus_chan_recv(struct vmbus_channel *chan, void *data, int *dlen, + uint64_t *xactid); +int vmbus_chan_recv_pkt(struct vmbus_channel *chan, + struct vmbus_chanpkt_hdr *pkt, int *pktlen); + +int vmbus_chan_send(struct vmbus_channel *chan, uint16_t type, + uint16_t flags, void *data, int dlen, uint64_t xactid); +int vmbus_chan_send_sglist(struct vmbus_channel *chan, + struct vmbus_gpa sg[], int sglen, void *data, int dlen, + uint64_t xactid); +int vmbus_chan_send_prplist(struct vmbus_channel *chan, + struct vmbus_gpa_range *prp, int prp_cnt, void *data, + int dlen, uint64_t xactid); + +uint32_t vmbus_chan_id(const struct vmbus_channel *chan); +uint32_t vmbus_chan_subidx(const struct vmbus_channel *chan); +bool vmbus_chan_is_primary(const struct vmbus_channel *chan); const struct hyperv_guid * - vmbus_chan_guid_inst(const struct vmbus_channel *chan); + vmbus_chan_guid_inst(const struct vmbus_channel *chan); #endif /* !_VMBUS_H_ */ Modified: head/sys/dev/hyperv/vmbus/vmbus_chanvar.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_chanvar.h Fri Jul 29 00:00:54 2016 (r303469) +++ head/sys/dev/hyperv/vmbus/vmbus_chanvar.h Fri Jul 29 03:16:51 2016 (r303470) @@ -155,9 +155,10 @@ struct vmbus_channel { struct vmbus_softc; struct vmbus_message; -void vmbus_event_proc(struct vmbus_softc *, int); -void vmbus_event_proc_compat(struct vmbus_softc *, int); -void vmbus_chan_msgproc(struct vmbus_softc *, const struct vmbus_message *); -void vmbus_chan_destroy_all(struct vmbus_softc *); +void vmbus_event_proc(struct vmbus_softc *, int); +void vmbus_event_proc_compat(struct vmbus_softc *, int); +void vmbus_chan_msgproc(struct vmbus_softc *, + const struct vmbus_message *); +void vmbus_chan_destroy_all(struct vmbus_softc *); #endif /* !_VMBUS_CHANVAR_H_ */ Modified: head/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_var.h Fri Jul 29 00:00:54 2016 (r303469) +++ head/sys/dev/hyperv/vmbus/vmbus_var.h Fri Jul 29 03:16:51 2016 (r303470) @@ -142,20 +142,23 @@ struct trapframe; struct vmbus_message; struct vmbus_msghc; -void vmbus_handle_intr(struct trapframe *); -int vmbus_add_child(struct vmbus_channel *); -int vmbus_delete_child(struct vmbus_channel *); -void vmbus_et_intr(struct trapframe *); -uint32_t vmbus_gpadl_alloc(struct vmbus_softc *); +void vmbus_handle_intr(struct trapframe *); +int vmbus_add_child(struct vmbus_channel *); +int vmbus_delete_child(struct vmbus_channel *); +void vmbus_et_intr(struct trapframe *); +uint32_t vmbus_gpadl_alloc(struct vmbus_softc *); -struct vmbus_msghc *vmbus_msghc_get(struct vmbus_softc *, size_t); -void vmbus_msghc_put(struct vmbus_softc *, struct vmbus_msghc *); -void *vmbus_msghc_dataptr(struct vmbus_msghc *); -int vmbus_msghc_exec_noresult(struct vmbus_msghc *); -int vmbus_msghc_exec(struct vmbus_softc *, struct vmbus_msghc *); -const struct vmbus_message *vmbus_msghc_wait_result(struct vmbus_softc *, - struct vmbus_msghc *); -void vmbus_msghc_wakeup(struct vmbus_softc *, const struct vmbus_message *); -void vmbus_msghc_reset(struct vmbus_msghc *, size_t); +struct vmbus_msghc * + vmbus_msghc_get(struct vmbus_softc *, size_t); +void vmbus_msghc_put(struct vmbus_softc *, struct vmbus_msghc *); +void *vmbus_msghc_dataptr(struct vmbus_msghc *); +int vmbus_msghc_exec_noresult(struct vmbus_msghc *); +int vmbus_msghc_exec(struct vmbus_softc *, struct vmbus_msghc *); +const struct vmbus_message * + vmbus_msghc_wait_result(struct vmbus_softc *, + struct vmbus_msghc *); +void vmbus_msghc_wakeup(struct vmbus_softc *, + const struct vmbus_message *); +void vmbus_msghc_reset(struct vmbus_msghc *, size_t); #endif /* !_VMBUS_VAR_H_ */ From owner-svn-src-head@freebsd.org Fri Jul 29 05:48: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 A4D3FBA7B94 for ; Fri, 29 Jul 2016 05:48:40 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x231.google.com (mail-yw0-x231.google.com [IPv6:2607:f8b0:4002: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 60817180A for ; Fri, 29 Jul 2016 05:48:40 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x231.google.com with SMTP id z8so106446158ywa.1 for ; Thu, 28 Jul 2016 22:48:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=IePbSNiKaHKkA/gjJILO6BFQGNuwQmAz+wFCCenXmxs=; b=0j1iZXrqDe5uoStfBF8FIYtvy/Pw/MhVaIsGlznUUUp75jgiN5LsOhF6PHxzYfdTmr SinU3LkQdFfBimUyhFvlDDk4YGZKMz2BTDsQWTNU6R0TKJ+OdTTUcAq+mpw+aYuIbtg+ ryLlR9GvR+FRkM/FgfMzMBAWMQSG/OjVm0H+QY1cwqkTxmY+Hs5c/MVaMurI5c6M1tkc yHAE/CpfrQe98bMrEhM89e0J/KXvhXhb7rWqZ0R1YUWhk9qhdmoJTDAxj1i0Vlk6t9YV mLUUq/Uz0PDGK7dXeScayyitYYNVmjaKjRO74OVLZlX/LV1IbkExmJ7smuujEvlfKMEt /Dlw== 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:from:date :message-id:subject:to:cc; bh=IePbSNiKaHKkA/gjJILO6BFQGNuwQmAz+wFCCenXmxs=; b=kSyrjE9MVSfO1LjRt6l4iKl6akexWnSdilaeOvEse76T75mX/Ti37ed/3ETtgSn4V8 bJBRpmxNb4o9PlGWHPIjZ9/a+0jF2THfFrTBa7R+Ad9Xx0xdMvISknN6vDURysGIDxD9 SbNRkRyyNMWUGKB9JT1jOtTp64YOU1gM7/4BRFKDUGpKVT4k9NodE0jBtpLJ78fullcV 2s26tdkafBEnXCFABe+y2awocQYalOBPtoX3skZjUusdWnJZ0ukReacIv4T2jm2NMJWF wtt7jGHNDRrdncPXfJfUAtbD+66DuIYNJJn4rfPGfXS5fHef3GUtTeWFBrMI+EKBHfBm unCA== X-Gm-Message-State: AEkoouvidvjYsksuQLi1/GhHKyYjc0cgQdUgJIET1Vok79U+A3CXmonWo52uqXn+15hsGDSuHrQEU+AqvcO54Q== X-Received: by 10.129.98.2 with SMTP id w2mr11111371ywb.313.1469771319386; Thu, 28 Jul 2016 22:48:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.201.71 with HTTP; Thu, 28 Jul 2016 22:48:39 -0700 (PDT) In-Reply-To: <201607282129.u6SLT4CH042204@repo.freebsd.org> References: <201607282129.u6SLT4CH042204@repo.freebsd.org> From: Ed Schouten Date: Fri, 29 Jul 2016 07:48:39 +0200 Message-ID: Subject: Re: svn commit: r303464 - in head/sys: amd64/linux amd64/linux32 compat/freebsd32 compat/svr4 i386/ibcs2 i386/linux kern To: Brooks Davis Cc: src-committers , 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.22 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, 29 Jul 2016 05:48:40 -0000 2016-07-28 23:29 GMT+02:00 Brooks Davis : > Log: > Don't create pointless backups of generated files in "make sysent". > > Any sensible workflow will include a revision control system from which > to restore the old files if required. In normal usage, developers just > have to clean up the mess. Thank you! -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Fri Jul 29 05:49: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 1E9E2BA7BEE; Fri, 29 Jul 2016 05:49:14 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F06FC19CB; Fri, 29 Jul 2016 05:49:13 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6T5nDQe026462; Fri, 29 Jul 2016 05:49:13 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6T5nCgT026457; Fri, 29 Jul 2016 05:49:12 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201607290549.u6T5nCgT026457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 29 Jul 2016 05:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303471 - head/sys/dev/hyperv/vmbus 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.22 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, 29 Jul 2016 05:49:14 -0000 Author: sephe Date: Fri Jul 29 05:49:12 2016 New Revision: 303471 URL: https://svnweb.freebsd.org/changeset/base/303471 Log: hyperv/vmbus: Forward declare static functions MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7346 Modified: head/sys/dev/hyperv/vmbus/hyperv.c head/sys/dev/hyperv/vmbus/vmbus.c head/sys/dev/hyperv/vmbus/vmbus_br.c head/sys/dev/hyperv/vmbus/vmbus_chan.c head/sys/dev/hyperv/vmbus/vmbus_et.c Modified: head/sys/dev/hyperv/vmbus/hyperv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hyperv.c Fri Jul 29 03:16:51 2016 (r303470) +++ head/sys/dev/hyperv/vmbus/hyperv.c Fri Jul 29 05:49:12 2016 (r303471) @@ -67,13 +67,15 @@ struct hypercall_ctx { struct hyperv_dma hc_dma; }; -static u_int hyperv_get_timecount(struct timecounter *tc); +static u_int hyperv_get_timecount(struct timecounter *); +static bool hyperv_identify(void); +static void hypercall_memfree(void); -u_int hyperv_features; -u_int hyperv_recommends; +u_int hyperv_features; +u_int hyperv_recommends; -static u_int hyperv_pm_features; -static u_int hyperv_features3; +static u_int hyperv_pm_features; +static u_int hyperv_features3; static struct timecounter hyperv_timecounter = { .tc_get_timecount = hyperv_get_timecount, Modified: head/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus.c Fri Jul 29 03:16:51 2016 (r303470) +++ head/sys/dev/hyperv/vmbus/vmbus.c Fri Jul 29 05:49:12 2016 (r303471) @@ -81,6 +81,17 @@ struct vmbus_msghc_ctx { #define VMBUS_MSGHC_CTXF_DESTROY 0x0001 +static int vmbus_probe(device_t); +static int vmbus_attach(device_t); +static int vmbus_detach(device_t); +static int vmbus_read_ivar(device_t, device_t, int, + uintptr_t *); +static int vmbus_child_pnpinfo_str(device_t, device_t, + char *, size_t); +static uint32_t vmbus_get_version_method(device_t, device_t); +static int vmbus_probe_guid_method(device_t, device_t, + const struct hyperv_guid *); + static int vmbus_init(struct vmbus_softc *); static int vmbus_connect(struct vmbus_softc *, uint32_t); static int vmbus_req_channels(struct vmbus_softc *sc); @@ -93,8 +104,17 @@ static void vmbus_scan_done(struct vmb const struct vmbus_message *); static void vmbus_chanmsg_handle(struct vmbus_softc *, const struct vmbus_message *); - +static void vmbus_msg_task(void *, int); +static void vmbus_synic_setup(void *); +static void vmbus_synic_teardown(void *); static int vmbus_sysctl_version(SYSCTL_HANDLER_ARGS); +static int vmbus_dma_alloc(struct vmbus_softc *); +static void vmbus_dma_free(struct vmbus_softc *); +static int vmbus_intr_setup(struct vmbus_softc *); +static void vmbus_intr_teardown(struct vmbus_softc *); +static int vmbus_doattach(struct vmbus_softc *); +static void vmbus_event_proc_dummy(struct vmbus_softc *, + int); static struct vmbus_msghc_ctx *vmbus_msghc_ctx_create(bus_dma_tag_t); static void vmbus_msghc_ctx_destroy( Modified: head/sys/dev/hyperv/vmbus/vmbus_br.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_br.c Fri Jul 29 03:16:51 2016 (r303470) +++ head/sys/dev/hyperv/vmbus/vmbus_br.c Fri Jul 29 05:49:12 2016 (r303471) @@ -41,6 +41,10 @@ /* Increase bufing index */ #define VMBUS_BR_IDXINC(idx, inc, sz) (((idx) + (inc)) % (sz)) +static int vmbus_br_sysctl_state(SYSCTL_HANDLER_ARGS); +static int vmbus_br_sysctl_state_bin(SYSCTL_HANDLER_ARGS); +static void vmbus_br_setup(struct vmbus_br *, void *, int); + static int vmbus_br_sysctl_state(SYSCTL_HANDLER_ARGS) { Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_chan.c Fri Jul 29 03:16:51 2016 (r303470) +++ head/sys/dev/hyperv/vmbus/vmbus_chan.c Fri Jul 29 05:49:12 2016 (r303471) @@ -47,17 +47,28 @@ __FBSDID("$FreeBSD$"); #include #include -static void vmbus_chan_update_evtflagcnt(struct vmbus_softc *, - const struct vmbus_channel *); - -static void vmbus_chan_task(void *, int); -static void vmbus_chan_task_nobatch(void *, int); -static void vmbus_chan_detach_task(void *, int); - -static void vmbus_chan_msgproc_choffer(struct vmbus_softc *, - const struct vmbus_message *); -static void vmbus_chan_msgproc_chrescind(struct vmbus_softc *, - const struct vmbus_message *); +static void vmbus_chan_update_evtflagcnt( + struct vmbus_softc *, + const struct vmbus_channel *); +static void vmbus_chan_close_internal( + struct vmbus_channel *); +static int vmbus_chan_sysctl_mnf(SYSCTL_HANDLER_ARGS); +static void vmbus_chan_sysctl_create( + struct vmbus_channel *); +static struct vmbus_channel *vmbus_chan_alloc(struct vmbus_softc *); +static void vmbus_chan_free(struct vmbus_channel *); +static int vmbus_chan_add(struct vmbus_channel *); +static void vmbus_chan_cpu_default(struct vmbus_channel *); + +static void vmbus_chan_task(void *, int); +static void vmbus_chan_task_nobatch(void *, int); +static void vmbus_chan_detach_task(void *, int); + +static void vmbus_chan_msgproc_choffer(struct vmbus_softc *, + const struct vmbus_message *); +static void vmbus_chan_msgproc_chrescind( + struct vmbus_softc *, + const struct vmbus_message *); /* * Vmbus channel message processing. Modified: head/sys/dev/hyperv/vmbus/vmbus_et.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_et.c Fri Jul 29 03:16:51 2016 (r303470) +++ head/sys/dev/hyperv/vmbus/vmbus_et.c Fri Jul 29 05:49:12 2016 (r303471) @@ -56,6 +56,13 @@ __FBSDID("$FreeBSD$"); CPUID_HV_MSR_SYNIC | \ CPUID_HV_MSR_SYNTIMER) +static void vmbus_et_identify(driver_t *, device_t); +static int vmbus_et_probe(device_t); +static int vmbus_et_attach(device_t); +static int vmbus_et_detach(device_t); +static int vmbus_et_start(struct eventtimer *, sbintime_t, + sbintime_t); + static struct eventtimer vmbus_et; static __inline uint64_t From owner-svn-src-head@freebsd.org Fri Jul 29 05:58: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 DB062BA7DB3; Fri, 29 Jul 2016 05:58:25 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C2681E41; Fri, 29 Jul 2016 05:58:25 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6T5wOcu030029; Fri, 29 Jul 2016 05:58:24 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6T5wO06030027; Fri, 29 Jul 2016 05:58:24 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201607290558.u6T5wO06030027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 29 Jul 2016 05:58:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303472 - head/sys/dev/hyperv/vmbus 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.22 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, 29 Jul 2016 05:58:26 -0000 Author: sephe Date: Fri Jul 29 05:58:24 2016 New Revision: 303472 URL: https://svnweb.freebsd.org/changeset/base/303472 Log: hyperv/vmbus: Move driver glue to the beginning of the files Just as most of other drivers do. And move sysinit function close to its SYSINIT. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7347 Modified: head/sys/dev/hyperv/vmbus/vmbus.c head/sys/dev/hyperv/vmbus/vmbus_et.c Modified: head/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus.c Fri Jul 29 05:49:12 2016 (r303471) +++ head/sys/dev/hyperv/vmbus/vmbus.c Fri Jul 29 05:58:24 2016 (r303472) @@ -142,6 +142,40 @@ vmbus_chanmsg_handlers[VMBUS_CHANMSG_TYP VMBUS_CHANMSG_PROC_WAKEUP(CONNECT_RESP) }; +static device_method_t vmbus_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, vmbus_probe), + DEVMETHOD(device_attach, vmbus_attach), + DEVMETHOD(device_detach, vmbus_detach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + + /* Bus interface */ + DEVMETHOD(bus_add_child, bus_generic_add_child), + DEVMETHOD(bus_print_child, bus_generic_print_child), + DEVMETHOD(bus_read_ivar, vmbus_read_ivar), + DEVMETHOD(bus_child_pnpinfo_str, vmbus_child_pnpinfo_str), + + /* Vmbus interface */ + DEVMETHOD(vmbus_get_version, vmbus_get_version_method), + DEVMETHOD(vmbus_probe_guid, vmbus_probe_guid_method), + + DEVMETHOD_END +}; + +static driver_t vmbus_driver = { + "vmbus", + vmbus_methods, + sizeof(struct vmbus_softc) +}; + +static devclass_t vmbus_devclass; + +DRIVER_MODULE(vmbus, acpi, vmbus_driver, vmbus_devclass, NULL, NULL); +MODULE_DEPEND(vmbus, acpi, 1, 1, 1); +MODULE_VERSION(vmbus, 1); + static struct vmbus_msghc * vmbus_msghc_alloc(bus_dma_tag_t parent_dtag) { @@ -1248,26 +1282,6 @@ vmbus_attach(device_t dev) return (0); } -static void -vmbus_sysinit(void *arg __unused) -{ - struct vmbus_softc *sc = vmbus_get_softc(); - - if (vm_guest != VM_GUEST_HV || sc == NULL) - return; - -#ifndef EARLY_AP_STARTUP - /* - * If the system has already booted and thread - * scheduling is possible, as indicated by the - * global cold set to zero, we just call the driver - * initialization directly. - */ - if (!cold) -#endif - vmbus_doattach(sc); -} - static int vmbus_detach(device_t dev) { @@ -1297,45 +1311,30 @@ vmbus_detach(device_t dev) return (0); } -static device_method_t vmbus_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, vmbus_probe), - DEVMETHOD(device_attach, vmbus_attach), - DEVMETHOD(device_detach, vmbus_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), - - /* Bus interface */ - DEVMETHOD(bus_add_child, bus_generic_add_child), - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_read_ivar, vmbus_read_ivar), - DEVMETHOD(bus_child_pnpinfo_str, vmbus_child_pnpinfo_str), - - /* Vmbus interface */ - DEVMETHOD(vmbus_get_version, vmbus_get_version_method), - DEVMETHOD(vmbus_probe_guid, vmbus_probe_guid_method), - - DEVMETHOD_END -}; - -static driver_t vmbus_driver = { - "vmbus", - vmbus_methods, - sizeof(struct vmbus_softc) -}; +#ifndef EARLY_AP_STARTUP -static devclass_t vmbus_devclass; +static void +vmbus_sysinit(void *arg __unused) +{ + struct vmbus_softc *sc = vmbus_get_softc(); -DRIVER_MODULE(vmbus, acpi, vmbus_driver, vmbus_devclass, NULL, NULL); -MODULE_DEPEND(vmbus, acpi, 1, 1, 1); -MODULE_VERSION(vmbus, 1); + if (vm_guest != VM_GUEST_HV || sc == NULL) + return; -#ifndef EARLY_AP_STARTUP + /* + * If the system has already booted and thread + * scheduling is possible, as indicated by the + * global cold set to zero, we just call the driver + * initialization directly. + */ + if (!cold) + vmbus_doattach(sc); +} /* * NOTE: * We have to start as the last step of SI_SUB_SMP, i.e. after SMP is * initialized. */ SYSINIT(vmbus_initialize, SI_SUB_SMP, SI_ORDER_ANY, vmbus_sysinit, NULL); -#endif + +#endif /* !EARLY_AP_STARTUP */ Modified: head/sys/dev/hyperv/vmbus/vmbus_et.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_et.c Fri Jul 29 05:49:12 2016 (r303471) +++ head/sys/dev/hyperv/vmbus/vmbus_et.c Fri Jul 29 05:58:24 2016 (r303472) @@ -65,6 +65,26 @@ static int vmbus_et_start(struct event static struct eventtimer vmbus_et; +static device_method_t vmbus_et_methods[] = { + DEVMETHOD(device_identify, vmbus_et_identify), + DEVMETHOD(device_probe, vmbus_et_probe), + DEVMETHOD(device_attach, vmbus_et_attach), + DEVMETHOD(device_detach, vmbus_et_detach), + + DEVMETHOD_END +}; + +static driver_t vmbus_et_driver = { + VMBUS_ET_NAME, + vmbus_et_methods, + 0 +}; + +static devclass_t vmbus_et_devclass; + +DRIVER_MODULE(hv_et, vmbus, vmbus_et_driver, vmbus_et_devclass, NULL, NULL); +MODULE_VERSION(hv_et, 1); + static __inline uint64_t hyperv_sbintime2count(sbintime_t time) { @@ -181,22 +201,3 @@ vmbus_et_detach(device_t dev) { return (et_deregister(&vmbus_et)); } - -static device_method_t vmbus_et_methods[] = { - DEVMETHOD(device_identify, vmbus_et_identify), - DEVMETHOD(device_probe, vmbus_et_probe), - DEVMETHOD(device_attach, vmbus_et_attach), - DEVMETHOD(device_detach, vmbus_et_detach), - - DEVMETHOD_END -}; - -static driver_t vmbus_et_driver = { - VMBUS_ET_NAME, - vmbus_et_methods, - 0 -}; - -static devclass_t vmbus_et_devclass; -DRIVER_MODULE(hv_et, vmbus, vmbus_et_driver, vmbus_et_devclass, NULL, NULL); -MODULE_VERSION(hv_et, 1); From owner-svn-src-head@freebsd.org Fri Jul 29 06:10: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 2E210BA612D; Fri, 29 Jul 2016 06:10:29 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8DEE160F; Fri, 29 Jul 2016 06:10:28 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6T6ASeE033897; Fri, 29 Jul 2016 06:10:28 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6T6ARVU033895; Fri, 29 Jul 2016 06:10:27 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201607290610.u6T6ARVU033895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 29 Jul 2016 06:10:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303473 - head/sys/dev/hyperv/vmbus 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.22 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, 29 Jul 2016 06:10:29 -0000 Author: sephe Date: Fri Jul 29 06:10:27 2016 New Revision: 303473 URL: https://svnweb.freebsd.org/changeset/base/303473 Log: hyperv/vmbus: Revoke unnecessary exposure of vmbus softc MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7348 Modified: head/sys/dev/hyperv/vmbus/vmbus.c head/sys/dev/hyperv/vmbus/vmbus_var.h Modified: head/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus.c Fri Jul 29 05:58:24 2016 (r303472) +++ head/sys/dev/hyperv/vmbus/vmbus.c Fri Jul 29 06:10:27 2016 (r303473) @@ -125,7 +125,7 @@ static void vmbus_msghc_free(struct vm static struct vmbus_msghc *vmbus_msghc_get1(struct vmbus_msghc_ctx *, uint32_t); -struct vmbus_softc *vmbus_sc; +static struct vmbus_softc *vmbus_sc; extern inthand_t IDTVEC(vmbus_isr); @@ -176,6 +176,12 @@ DRIVER_MODULE(vmbus, acpi, vmbus_driver, MODULE_DEPEND(vmbus, acpi, 1, 1, 1); MODULE_VERSION(vmbus, 1); +static __inline struct vmbus_softc * +vmbus_get_softc(void) +{ + return vmbus_sc; +} + static struct vmbus_msghc * vmbus_msghc_alloc(bus_dma_tag_t parent_dtag) { Modified: head/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_var.h Fri Jul 29 05:58:24 2016 (r303472) +++ head/sys/dev/hyperv/vmbus/vmbus_var.h Fri Jul 29 06:10:27 2016 (r303473) @@ -120,20 +120,6 @@ struct vmbus_softc { #define VMBUS_FLAG_ATTACHED 0x0001 /* vmbus was attached */ #define VMBUS_FLAG_SYNIC 0x0002 /* SynIC was setup */ -extern struct vmbus_softc *vmbus_sc; - -static __inline struct vmbus_softc * -vmbus_get_softc(void) -{ - return vmbus_sc; -} - -static __inline device_t -vmbus_get_device(void) -{ - return vmbus_sc->vmbus_dev; -} - #define VMBUS_PCPU_GET(sc, field, cpu) (sc)->vmbus_pcpu[(cpu)].field #define VMBUS_PCPU_PTR(sc, field, cpu) &(sc)->vmbus_pcpu[(cpu)].field From owner-svn-src-head@freebsd.org Fri Jul 29 06:22: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 BAA8ABA644A; Fri, 29 Jul 2016 06:22:12 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A3021C88; Fri, 29 Jul 2016 06:22:12 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6T6MBic040975; Fri, 29 Jul 2016 06:22:11 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6T6MBjo040974; Fri, 29 Jul 2016 06:22:11 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201607290622.u6T6MBjo040974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 29 Jul 2016 06:22:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303474 - head/sys/dev/hyperv/storvsc 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.22 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, 29 Jul 2016 06:22:12 -0000 Author: sephe Date: Fri Jul 29 06:22:11 2016 New Revision: 303474 URL: https://svnweb.freebsd.org/changeset/base/303474 Log: hyperv/storvsc: Use busdma(9) and enable PIM_UNMAPPED by default. The UNMAPPED I/O greatly improves userland direct disk I/O performance by 35% ~ 135%. Submitted by: Hongjiang Zhang MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7195 Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri Jul 29 06:10:27 2016 (r303473) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri Jul 29 06:22:11 2016 (r303474) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -87,7 +88,10 @@ __FBSDID("$FreeBSD$"); #define VSTOR_PKT_SIZE (sizeof(struct vstor_packet) - vmscsi_size_delta) -#define HV_ALIGN(x, a) roundup2(x, a) +#define STORVSC_DATA_SEGCNT_MAX VMBUS_CHAN_PRPLIST_MAX +#define STORVSC_DATA_SEGSZ_MAX PAGE_SIZE +#define STORVSC_DATA_SIZE_MAX \ + (STORVSC_DATA_SEGCNT_MAX * STORVSC_DATA_SEGSZ_MAX) struct storvsc_softc; @@ -102,7 +106,7 @@ struct hv_sgl_page_pool{ boolean_t is_init; } g_hv_sgl_page_pool; -#define STORVSC_MAX_SG_PAGE_CNT STORVSC_MAX_IO_REQUESTS * VMBUS_CHAN_PRPLIST_MAX +#define STORVSC_MAX_SG_PAGE_CNT STORVSC_MAX_IO_REQUESTS * STORVSC_DATA_SEGCNT_MAX enum storvsc_request_type { WRITE_TYPE, @@ -110,26 +114,41 @@ enum storvsc_request_type { UNKNOWN_TYPE }; -struct hvs_gpa_range { +SYSCTL_NODE(_hw, OID_AUTO, storvsc, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "Hyper-V storage interface"); + +static u_int hv_storvsc_use_pim_unmapped = 1; +SYSCTL_INT(_hw_storvsc, OID_AUTO, use_pim_unmapped, CTLFLAG_RDTUN, + &hv_storvsc_use_pim_unmapped, 0, + "Optimize storvsc by using unmapped I/O"); + +struct hv_storvsc_sysctl { + u_long data_bio_cnt; + u_long data_vaddr_cnt; + u_long data_sg_cnt; +}; + +struct storvsc_gpa_range { struct vmbus_gpa_range gpa_range; - uint64_t gpa_page[VMBUS_CHAN_PRPLIST_MAX]; + uint64_t gpa_page[STORVSC_DATA_SEGCNT_MAX]; } __packed; struct hv_storvsc_request { - LIST_ENTRY(hv_storvsc_request) link; - struct vstor_packet vstor_packet; - int prp_cnt; - struct hvs_gpa_range prp_list; - void *sense_data; - uint8_t sense_info_len; - uint8_t retries; - union ccb *ccb; - struct storvsc_softc *softc; - struct callout callout; - struct sema synch_sema; /*Synchronize the request/response if needed */ - struct sglist *bounce_sgl; - unsigned int bounce_sgl_count; - uint64_t not_aligned_seg_bits; + LIST_ENTRY(hv_storvsc_request) link; + struct vstor_packet vstor_packet; + int prp_cnt; + struct storvsc_gpa_range prp_list; + void *sense_data; + uint8_t sense_info_len; + uint8_t retries; + union ccb *ccb; + struct storvsc_softc *softc; + struct callout callout; + struct sema synch_sema; /*Synchronize the request/response if needed */ + struct sglist *bounce_sgl; + unsigned int bounce_sgl_count; + uint64_t not_aligned_seg_bits; + bus_dmamap_t data_dmap; }; struct storvsc_softc { @@ -148,6 +167,8 @@ struct storvsc_softc { struct hv_storvsc_request hs_init_req; struct hv_storvsc_request hs_reset_req; device_t hs_dev; + bus_dma_tag_t storvsc_req_dtag; + struct hv_storvsc_sysctl sysctl_data; struct vmbus_channel *hs_cpu2chan[MAXCPU]; }; @@ -882,6 +903,77 @@ storvsc_create_cpu2chan(struct storvsc_s } } +static int +storvsc_init_requests(device_t dev) +{ + struct storvsc_softc *sc = device_get_softc(dev); + struct hv_storvsc_request *reqp; + int error, i; + + LIST_INIT(&sc->hs_free_list); + + error = bus_dma_tag_create( + bus_get_dma_tag(dev), /* parent */ + 1, /* alignment */ + PAGE_SIZE, /* boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + STORVSC_DATA_SIZE_MAX, /* maxsize */ + STORVSC_DATA_SEGCNT_MAX, /* nsegments */ + STORVSC_DATA_SEGSZ_MAX, /* maxsegsize */ + 0, /* flags */ + NULL, /* lockfunc */ + NULL, /* lockfuncarg */ + &sc->storvsc_req_dtag); + if (error) { + device_printf(dev, "failed to create storvsc dma tag\n"); + return (error); + } + + for (i = 0; i < sc->hs_drv_props->drv_max_ios_per_target; ++i) { + reqp = malloc(sizeof(struct hv_storvsc_request), + M_DEVBUF, M_WAITOK|M_ZERO); + reqp->softc = sc; + error = bus_dmamap_create(sc->storvsc_req_dtag, 0, + &reqp->data_dmap); + if (error) { + device_printf(dev, "failed to allocate storvsc " + "data dmamap\n"); + goto cleanup; + } + LIST_INSERT_HEAD(&sc->hs_free_list, reqp, link); + } + return (0); + +cleanup: + while ((reqp = LIST_FIRST(&sc->hs_free_list)) != NULL) { + LIST_REMOVE(reqp, link); + bus_dmamap_destroy(sc->storvsc_req_dtag, reqp->data_dmap); + free(reqp, M_DEVBUF); + } + return (error); +} + +static void +storvsc_sysctl(device_t dev) +{ + struct sysctl_oid_list *child; + struct sysctl_ctx_list *ctx; + struct storvsc_softc *sc; + + sc = device_get_softc(dev); + ctx = device_get_sysctl_ctx(dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); + + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "data_bio_cnt", CTLFLAG_RW, + &sc->sysctl_data.data_bio_cnt, "# of bio data block"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "data_vaddr_cnt", CTLFLAG_RW, + &sc->sysctl_data.data_vaddr_cnt, "# of vaddr data block"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "data_sg_cnt", CTLFLAG_RW, + &sc->sysctl_data.data_sg_cnt, "# of sg data block"); +} + /** * @brief StorVSC attach function * @@ -926,16 +1018,11 @@ storvsc_attach(device_t dev) sc->hs_unit = device_get_unit(dev); sc->hs_dev = dev; - LIST_INIT(&sc->hs_free_list); mtx_init(&sc->hs_lock, "hvslck", NULL, MTX_DEF); - for (i = 0; i < sc->hs_drv_props->drv_max_ios_per_target; ++i) { - reqp = malloc(sizeof(struct hv_storvsc_request), - M_DEVBUF, M_WAITOK|M_ZERO); - reqp->softc = sc; - - LIST_INSERT_HEAD(&sc->hs_free_list, reqp, link); - } + ret = storvsc_init_requests(dev); + if (ret != 0) + goto cleanup; /* create sg-list page pool */ if (FALSE == g_hv_sgl_page_pool.is_init) { @@ -945,7 +1032,7 @@ storvsc_attach(device_t dev) /* * Pre-create SG list, each SG list with - * VMBUS_CHAN_PRPLIST_MAX segments, each + * STORVSC_DATA_SEGCNT_MAX segments, each * segment has one page buffer */ for (i = 0; i < STORVSC_MAX_IO_REQUESTS; i++) { @@ -953,10 +1040,10 @@ storvsc_attach(device_t dev) M_DEVBUF, M_WAITOK|M_ZERO); sgl_node->sgl_data = - sglist_alloc(VMBUS_CHAN_PRPLIST_MAX, + sglist_alloc(STORVSC_DATA_SEGCNT_MAX, M_WAITOK|M_ZERO); - for (j = 0; j < VMBUS_CHAN_PRPLIST_MAX; j++) { + for (j = 0; j < STORVSC_DATA_SEGCNT_MAX; j++) { tmp_buff = malloc(PAGE_SIZE, M_DEVBUF, M_WAITOK|M_ZERO); @@ -1031,6 +1118,8 @@ storvsc_attach(device_t dev) mtx_unlock(&sc->hs_lock); + storvsc_sysctl(dev); + root_mount_rel(root_mount_token); return (0); @@ -1040,13 +1129,14 @@ cleanup: while (!LIST_EMPTY(&sc->hs_free_list)) { reqp = LIST_FIRST(&sc->hs_free_list); LIST_REMOVE(reqp, link); + bus_dmamap_destroy(sc->storvsc_req_dtag, reqp->data_dmap); free(reqp, M_DEVBUF); } while (!LIST_EMPTY(&g_hv_sgl_page_pool.free_sgl_list)) { sgl_node = LIST_FIRST(&g_hv_sgl_page_pool.free_sgl_list); LIST_REMOVE(sgl_node, link); - for (j = 0; j < VMBUS_CHAN_PRPLIST_MAX; j++) { + for (j = 0; j < STORVSC_DATA_SEGCNT_MAX; j++) { if (NULL != (void*)sgl_node->sgl_data->sg_segs[j].ss_paddr) { free((void*)sgl_node->sgl_data->sg_segs[j].ss_paddr, M_DEVBUF); @@ -1101,7 +1191,7 @@ storvsc_detach(device_t dev) while (!LIST_EMPTY(&sc->hs_free_list)) { reqp = LIST_FIRST(&sc->hs_free_list); LIST_REMOVE(reqp, link); - + bus_dmamap_destroy(sc->storvsc_req_dtag, reqp->data_dmap); free(reqp, M_DEVBUF); } mtx_unlock(&sc->hs_lock); @@ -1109,7 +1199,7 @@ storvsc_detach(device_t dev) while (!LIST_EMPTY(&g_hv_sgl_page_pool.free_sgl_list)) { sgl_node = LIST_FIRST(&g_hv_sgl_page_pool.free_sgl_list); LIST_REMOVE(sgl_node, link); - for (j = 0; j < VMBUS_CHAN_PRPLIST_MAX; j++){ + for (j = 0; j < STORVSC_DATA_SEGCNT_MAX; j++){ if (NULL != (void*)sgl_node->sgl_data->sg_segs[j].ss_paddr) { free((void*)sgl_node->sgl_data->sg_segs[j].ss_paddr, M_DEVBUF); @@ -1294,6 +1384,8 @@ storvsc_action(struct cam_sim *sim, unio cpi->hba_inquiry = PI_TAG_ABLE|PI_SDTR_ABLE; cpi->target_sprt = 0; cpi->hba_misc = PIM_NOBUSRESET; + if (hv_storvsc_use_pim_unmapped) + cpi->hba_misc |= PIM_UNMAPPED; cpi->hba_eng_cnt = 0; cpi->max_target = STORVSC_MAX_TARGETS; cpi->max_lun = sc->hs_drv_props->drv_max_luns_per_target; @@ -1368,6 +1460,7 @@ storvsc_action(struct cam_sim *sim, unio case XPT_SCSI_IO: case XPT_IMMED_NOTIFY: { struct hv_storvsc_request *reqp = NULL; + bus_dmamap_t dmap_saved; if (ccb->csio.cdb_len == 0) { panic("cdl_len is 0\n"); @@ -1386,7 +1479,14 @@ storvsc_action(struct cam_sim *sim, unio reqp = LIST_FIRST(&sc->hs_free_list); LIST_REMOVE(reqp, link); + /* Save the data_dmap before reset request */ + dmap_saved = reqp->data_dmap; + + /* XXX this is ugly */ bzero(reqp, sizeof(struct hv_storvsc_request)); + + /* Restore necessary bits */ + reqp->data_dmap = dmap_saved; reqp->softc = sc; ccb->ccb_h.status |= CAM_SIM_QUEUED; @@ -1642,6 +1742,35 @@ storvsc_check_bounce_buffer_sgl(bus_dma_ } /** + * Copy bus_dma segments to multiple page buffer, which requires + * the pages are compact composed except for the 1st and last pages. + */ +static void +storvsc_xferbuf_prepare(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct hv_storvsc_request *reqp = arg; + union ccb *ccb = reqp->ccb; + struct ccb_scsiio *csio = &ccb->csio; + struct storvsc_gpa_range *prplist; + int i; + + prplist = &reqp->prp_list; + prplist->gpa_range.gpa_len = csio->dxfer_len; + prplist->gpa_range.gpa_ofs = segs[0].ds_addr & PAGE_MASK; + + for (i = 0; i < nsegs; i++) { + prplist->gpa_page[i] = atop(segs[i].ds_addr); +#ifdef INVARIANTS + if (i != 0 && i != nsegs - 1) { + KASSERT((segs[i].ds_addr & PAGE_MASK) == 0 && + segs[i].ds_len == PAGE_SIZE, ("not a full page")); + } +#endif + } + reqp->prp_cnt = nsegs; +} + +/** * @brief Fill in a request structure based on a CAM control block * * Fills in a request structure based on the contents of a CAM control @@ -1656,11 +1785,9 @@ create_storvsc_request(union ccb *ccb, s { struct ccb_scsiio *csio = &ccb->csio; uint64_t phys_addr; - uint32_t bytes_to_copy = 0; - uint32_t pfn_num = 0; uint32_t pfn; uint64_t not_aligned_seg_bits = 0; - struct hvs_gpa_range *prplist; + int error; /* refer to struct vmscsi_req for meanings of these two fields */ reqp->vstor_packet.u.vm_srb.port = @@ -1704,36 +1831,26 @@ create_storvsc_request(union ccb *ccb, s return (0); } - prplist = &reqp->prp_list; - prplist->gpa_range.gpa_len = csio->dxfer_len; - switch (ccb->ccb_h.flags & CAM_DATA_MASK) { + case CAM_DATA_BIO: case CAM_DATA_VADDR: - { - bytes_to_copy = csio->dxfer_len; - phys_addr = vtophys(csio->data_ptr); - prplist->gpa_range.gpa_ofs = phys_addr & PAGE_MASK; - - while (bytes_to_copy != 0) { - int bytes, page_offset; - phys_addr = - vtophys(&csio->data_ptr[prplist->gpa_range.gpa_len - - bytes_to_copy]); - pfn = phys_addr >> PAGE_SHIFT; - prplist->gpa_page[pfn_num] = pfn; - page_offset = phys_addr & PAGE_MASK; - - bytes = min(PAGE_SIZE - page_offset, bytes_to_copy); - - bytes_to_copy -= bytes; - pfn_num++; + error = bus_dmamap_load_ccb(reqp->softc->storvsc_req_dtag, + reqp->data_dmap, ccb, storvsc_xferbuf_prepare, reqp, + BUS_DMA_NOWAIT); + if (error) { + xpt_print(ccb->ccb_h.path, + "bus_dmamap_load_ccb failed: %d\n", error); + return (error); } - reqp->prp_cnt = pfn_num; + if ((ccb->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_BIO) + reqp->softc->sysctl_data.data_bio_cnt++; + else + reqp->softc->sysctl_data.data_vaddr_cnt++; break; - } case CAM_DATA_SG: { + struct storvsc_gpa_range *prplist; int i = 0; int offset = 0; int ret; @@ -1742,13 +1859,16 @@ create_storvsc_request(union ccb *ccb, s (bus_dma_segment_t *)ccb->csio.data_ptr; u_int16_t storvsc_sg_count = ccb->csio.sglist_cnt; + prplist = &reqp->prp_list; + prplist->gpa_range.gpa_len = csio->dxfer_len; + printf("Storvsc: get SG I/O operation, %d\n", reqp->vstor_packet.u.vm_srb.data_in); - if (storvsc_sg_count > VMBUS_CHAN_PRPLIST_MAX){ + if (storvsc_sg_count > STORVSC_DATA_SEGCNT_MAX){ printf("Storvsc: %d segments is too much, " "only support %d segments\n", - storvsc_sg_count, VMBUS_CHAN_PRPLIST_MAX); + storvsc_sg_count, STORVSC_DATA_SEGCNT_MAX); return (EINVAL); } @@ -1845,6 +1965,7 @@ create_storvsc_request(union ccb *ccb, s reqp->bounce_sgl_count = 0; } + reqp->softc->sysctl_data.data_sg_cnt++; break; } default: From owner-svn-src-head@freebsd.org Fri Jul 29 08:50: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 7E556BA8F0C; Fri, 29 Jul 2016 08:50:38 +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 3DFB31508; Fri, 29 Jul 2016 08:50:38 +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 u6T8obsW094699; Fri, 29 Jul 2016 08:50:37 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6T8obFs094319; Fri, 29 Jul 2016 08:50:37 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201607290850.u6T8obFs094319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 29 Jul 2016 08:50:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303475 - in head/sys: arm64/conf conf 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.22 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, 29 Jul 2016 08:50:38 -0000 Author: andrew Date: Fri Jul 29 08:50:36 2016 New Revision: 303475 URL: https://svnweb.freebsd.org/changeset/base/303475 Log: Add a generic EHCI USB driver based on the Allwinner A10 driver. It is ACPI only for now, but wouldn't be too difficult to add support for FDT. Reviewed by: hselasky Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7352 Added: head/sys/dev/usb/controller/generic_ehci.c (contents, props changed) Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Fri Jul 29 06:22:11 2016 (r303474) +++ head/sys/arm64/conf/GENERIC Fri Jul 29 08:50:36 2016 (r303475) @@ -131,6 +131,7 @@ device pl011 options USB_DEBUG # enable debug msgs device dwcotg # DWC OTG controller device ohci # OHCI PCI->USB interface +device ehci # EHCI PCI->USB interface (USB 2.0) device xhci # XHCI PCI->USB interface (USB 3.0) device usb # USB Bus (required) device ukbd # Keyboard Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Fri Jul 29 06:22:11 2016 (r303474) +++ head/sys/conf/files.arm64 Fri Jul 29 08:50:36 2016 (r303475) @@ -69,6 +69,7 @@ dev/psci/psci_arm64.S optional psci dev/uart/uart_cpu_fdt.c optional uart fdt dev/uart/uart_dev_pl011.c optional uart pl011 dev/usb/controller/dwc_otg_hisi.c optional dwcotg fdt soc_hisi_hi6220 +dev/usb/controller/generic_ehci.c optional ehci acpi dev/usb/controller/generic_ohci.c optional ohci fdt dev/usb/controller/generic_usb_if.m optional ohci fdt dev/vnic/mrml_bridge.c optional vnic fdt Added: head/sys/dev/usb/controller/generic_ehci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/generic_ehci.c Fri Jul 29 08:50:36 2016 (r303475) @@ -0,0 +1,220 @@ +/*- + * Copyright (c) 2012 Ganbold Tsagaankhuu + * Copyright (c) 2016 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Andrew Turner under + * sponsorship from the FreeBSD Foundation. + * + * 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. + */ + +/* + * Generic EHCI driver based on the Allwinner A10 EHCI driver + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_bus.h" + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +static device_attach_t generic_ehci_attach; +static device_detach_t generic_ehci_detach; + +static int +generic_ehci_probe(device_t self) +{ + ACPI_HANDLE h; + + if ((h = acpi_get_handle(self)) == NULL || + !acpi_MatchHid(h, "PNP0D20")) + return (ENXIO); + + device_set_desc(self, "Generic EHCI Controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +generic_ehci_attach(device_t self) +{ + ehci_softc_t *sc = device_get_softc(self); + int err; + int rid; + + /* initialise some bus fields */ + sc->sc_bus.parent = self; + sc->sc_bus.devices = sc->sc_devices; + sc->sc_bus.devices_max = EHCI_MAX_DEVICES; + sc->sc_bus.dma_bits = 32; + + /* get all DMA memory */ + if (usb_bus_mem_alloc_all(&sc->sc_bus, + USB_GET_DMA_TAG(self), &ehci_iterate_hw_softc)) { + return (ENOMEM); + } + + sc->sc_bus.usbrev = USB_REV_2_0; + + rid = 0; + sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (!sc->sc_io_res) { + device_printf(self, "Could not map memory\n"); + goto error; + } + + sc->sc_io_tag = rman_get_bustag(sc->sc_io_res); + sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); + sc->sc_io_size = rman_get_size(sc->sc_io_res); + + rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); + if (sc->sc_irq_res == NULL) { + device_printf(self, "Could not allocate irq\n"); + goto error; + } + sc->sc_bus.bdev = device_add_child(self, "usbus", -1); + if (!sc->sc_bus.bdev) { + device_printf(self, "Could not add USB device\n"); + goto error; + } + device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); + + strlcpy(sc->sc_vendor, "Generic", sizeof(sc->sc_vendor)); + + err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, + NULL, (driver_intr_t *)ehci_interrupt, sc, &sc->sc_intr_hdl); + if (err) { + device_printf(self, "Could not setup irq, %d\n", err); + sc->sc_intr_hdl = NULL; + goto error; + } + + sc->sc_flags |= EHCI_SCFLG_DONTRESET; + + err = ehci_init(sc); + if (!err) + err = device_probe_and_attach(sc->sc_bus.bdev); + if (err) + goto error; + + return (0); + +error: + generic_ehci_detach(self); + return (ENXIO); +} + +static int +generic_ehci_detach(device_t self) +{ + ehci_softc_t *sc = device_get_softc(self); + device_t bdev; + int err; + + if (sc->sc_bus.bdev) { + bdev = sc->sc_bus.bdev; + device_detach(bdev); + device_delete_child(self, bdev); + } + /* during module unload there are lots of children leftover */ + device_delete_children(self); + + if (sc->sc_irq_res && sc->sc_intr_hdl) { + /* + * only call ehci_detach() after ehci_init() + */ + ehci_detach(sc); + + err = bus_teardown_intr(self, sc->sc_irq_res, sc->sc_intr_hdl); + + if (err) + /* XXX or should we panic? */ + device_printf(self, "Could not tear down irq, %d\n", + err); + sc->sc_intr_hdl = NULL; + } + + if (sc->sc_irq_res) { + bus_release_resource(self, SYS_RES_IRQ, 0, sc->sc_irq_res); + sc->sc_irq_res = NULL; + } + if (sc->sc_io_res) { + bus_release_resource(self, SYS_RES_MEMORY, 0, + sc->sc_io_res); + sc->sc_io_res = NULL; + } + usb_bus_mem_free_all(&sc->sc_bus, &ehci_iterate_hw_softc); + + return (0); +} + +static device_method_t ehci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, generic_ehci_probe), + DEVMETHOD(device_attach, generic_ehci_attach), + DEVMETHOD(device_detach, generic_ehci_detach), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + + DEVMETHOD_END +}; + +static driver_t ehci_driver = { + .name = "ehci", + .methods = ehci_methods, + .size = sizeof(ehci_softc_t), +}; + +static devclass_t ehci_devclass; + +DRIVER_MODULE(ehci, acpi, ehci_driver, ehci_devclass, 0, 0); +MODULE_DEPEND(ehci, usb, 1, 1, 1); From owner-svn-src-head@freebsd.org Fri Jul 29 11:33: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 316C6BA3BC4; Fri, 29 Jul 2016 11:33:02 +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 040CB1E18; Fri, 29 Jul 2016 11:33:01 +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 u6TBX1Bx055549; Fri, 29 Jul 2016 11:33:01 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TBX1WO055548; Fri, 29 Jul 2016 11:33:01 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201607291133.u6TBX1WO055548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 29 Jul 2016 11:33:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303476 - head/sys/dev/usb/template 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.22 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, 29 Jul 2016 11:33:02 -0000 Author: trasz Date: Fri Jul 29 11:33:01 2016 New Revision: 303476 URL: https://svnweb.freebsd.org/changeset/base/303476 Log: Fix MTP description in the comment. MFC after: 1 month Modified: head/sys/dev/usb/template/usb_template_mtp.c Modified: head/sys/dev/usb/template/usb_template_mtp.c ============================================================================== --- head/sys/dev/usb/template/usb_template_mtp.c Fri Jul 29 08:50:36 2016 (r303475) +++ head/sys/dev/usb/template/usb_template_mtp.c Fri Jul 29 11:33:01 2016 (r303476) @@ -26,7 +26,7 @@ */ /* - * This file contains the USB templates for an USB Message Transfer + * This file contains the USB templates for an USB Media Transfer * Protocol device. * * NOTE: It is common practice that MTP devices use some dummy From owner-svn-src-head@freebsd.org Fri Jul 29 11:33: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 A9AFEBA3C1C; Fri, 29 Jul 2016 11:33:24 +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 76C731F82; Fri, 29 Jul 2016 11:33:24 +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 u6TBXNJI055604; Fri, 29 Jul 2016 11:33:23 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TBXN29055603; Fri, 29 Jul 2016 11:33:23 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201607291133.u6TBXN29055603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 29 Jul 2016 11:33:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303477 - head/sys/dev/usb 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.22 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, 29 Jul 2016 11:33:24 -0000 Author: trasz Date: Fri Jul 29 11:33:23 2016 New Revision: 303477 URL: https://svnweb.freebsd.org/changeset/base/303477 Log: Improve error message. MFC after: 1 month Modified: head/sys/dev/usb/usb_device.c Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Fri Jul 29 11:33:01 2016 (r303476) +++ head/sys/dev/usb/usb_device.c Fri Jul 29 11:33:23 2016 (r303477) @@ -1724,8 +1724,8 @@ usb_alloc_device(device_t parent_dev, st /* Setup USB descriptors */ err = (usb_temp_setup_by_index_p) (udev, usb_template); if (err) { - DPRINTFN(0, "setting up USB template failed maybe the USB " - "template module has not been loaded\n"); + DPRINTFN(0, "setting up USB template failed - " + "usb_template(4) not loaded?\n"); goto done; } } From owner-svn-src-head@freebsd.org Fri Jul 29 12:15: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 2ADBABA8ABD; Fri, 29 Jul 2016 12:15:56 +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 F185B1A2E; Fri, 29 Jul 2016 12:15:55 +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 u6TCFtgu071019; Fri, 29 Jul 2016 12:15:55 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TCFt5S071018; Fri, 29 Jul 2016 12:15:55 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201607291215.u6TCFt5S071018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 29 Jul 2016 12:15:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303478 - head/sys/fs/autofs 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.22 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, 29 Jul 2016 12:15:56 -0000 Author: trasz Date: Fri Jul 29 12:15:55 2016 New Revision: 303478 URL: https://svnweb.freebsd.org/changeset/base/303478 Log: Remove write-only variable. MFC after: 1 month Modified: head/sys/fs/autofs/autofs_vnops.c Modified: head/sys/fs/autofs/autofs_vnops.c ============================================================================== --- head/sys/fs/autofs/autofs_vnops.c Fri Jul 29 11:33:23 2016 (r303477) +++ head/sys/fs/autofs/autofs_vnops.c Fri Jul 29 12:15:55 2016 (r303478) @@ -138,11 +138,9 @@ autofs_trigger_vn(struct vnode *vp, cons struct vnode **newvp) { struct autofs_node *anp; - struct autofs_mount *amp; int error, lock_flags; anp = vp->v_data; - amp = VFSTOAUTOFS(vp->v_mount); /* * Release the vnode lock, so that other operations, in partcular From owner-svn-src-head@freebsd.org Fri Jul 29 12:29: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 A8F7FBA8EB5; Fri, 29 Jul 2016 12:29:18 +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 789D313D6; Fri, 29 Jul 2016 12:29:18 +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 u6TCTHw0074871; Fri, 29 Jul 2016 12:29:17 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TCTHq9074870; Fri, 29 Jul 2016 12:29:17 GMT (envelope-from br@FreeBSD.org) Message-Id: <201607291229.u6TCTHq9074870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 29 Jul 2016 12:29:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303479 - head/sys/cddl/dev/fbt/riscv 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.22 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, 29 Jul 2016 12:29:18 -0000 Author: br Date: Fri Jul 29 12:29:17 2016 New Revision: 303479 URL: https://svnweb.freebsd.org/changeset/base/303479 Log: Remove unused variables. Modified: head/sys/cddl/dev/fbt/riscv/fbt_isa.c Modified: head/sys/cddl/dev/fbt/riscv/fbt_isa.c ============================================================================== --- head/sys/cddl/dev/fbt/riscv/fbt_isa.c Fri Jul 29 12:15:55 2016 (r303478) +++ head/sys/cddl/dev/fbt/riscv/fbt_isa.c Fri Jul 29 12:29:17 2016 (r303479) @@ -82,11 +82,9 @@ fbt_provide_module_function(linker_file_ linker_symval_t *symval, void *opaque) { fbt_probe_t *fbt, *retfbt; - uint32_t *target, *start; uint32_t *instr, *limit; const char *name; char *modname; - int offs; modname = opaque; name = symval->name; From owner-svn-src-head@freebsd.org Fri Jul 29 12:30: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 58095BA8F24; Fri, 29 Jul 2016 12:30:35 +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 24A3815E8; Fri, 29 Jul 2016 12:30:35 +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 u6TCUYdo076957; Fri, 29 Jul 2016 12:30:34 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TCUYKA076955; Fri, 29 Jul 2016 12:30:34 GMT (envelope-from br@FreeBSD.org) Message-Id: <201607291230.u6TCUYKA076955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 29 Jul 2016 12:30:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303480 - in head/sys/modules/dtrace: . dtraceall 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.22 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, 29 Jul 2016 12:30:35 -0000 Author: br Date: Fri Jul 29 12:30:33 2016 New Revision: 303480 URL: https://svnweb.freebsd.org/changeset/base/303480 Log: Include FBT to modules build on RISC-V. Modified: head/sys/modules/dtrace/Makefile head/sys/modules/dtrace/dtraceall/dtraceall.c Modified: head/sys/modules/dtrace/Makefile ============================================================================== --- head/sys/modules/dtrace/Makefile Fri Jul 29 12:29:17 2016 (r303479) +++ head/sys/modules/dtrace/Makefile Fri Jul 29 12:30:33 2016 (r303480) @@ -24,7 +24,9 @@ SUBDIR+= fbt fasttrap .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" SUBDIR+= systrace_freebsd32 .endif -.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" +.if ${MACHINE_CPUARCH} == "aarch64" || \ + ${MACHINE_CPUARCH} == "arm" || \ + ${MACHINE_CPUARCH} == "riscv" SUBDIR+= fbt .endif .include Modified: head/sys/modules/dtrace/dtraceall/dtraceall.c ============================================================================== --- head/sys/modules/dtrace/dtraceall/dtraceall.c Fri Jul 29 12:29:17 2016 (r303479) +++ head/sys/modules/dtrace/dtraceall/dtraceall.c Fri Jul 29 12:30:33 2016 (r303480) @@ -70,7 +70,7 @@ MODULE_DEPEND(dtraceall, dtmalloc, 1, 1, MODULE_DEPEND(dtraceall, dtnfscl, 1, 1, 1); #endif #if defined(__aarch64__) || defined(__amd64__) || defined(__arm__) || \ - defined(__i386__) || defined(__powerpc__) + defined(__i386__) || defined(__powerpc__) || defined(__riscv__) MODULE_DEPEND(dtraceall, fbt, 1, 1, 1); #endif #if defined(__amd64__) || defined(__i386__) From owner-svn-src-head@freebsd.org Fri Jul 29 15:24: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 35729BA81D1; Fri, 29 Jul 2016 15:24:51 +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 069BB1F77; Fri, 29 Jul 2016 15:24:50 +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 u6TFOoZP041795; Fri, 29 Jul 2016 15:24:50 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TFOo8x041794; Fri, 29 Jul 2016 15:24:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201607291524.u6TFOo8x041794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 29 Jul 2016 15:24:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303481 - 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.22 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, 29 Jul 2016 15:24:51 -0000 Author: imp Date: Fri Jul 29 15:24:50 2016 New Revision: 303481 URL: https://svnweb.freebsd.org/changeset/base/303481 Log: Fix typo. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Jul 29 12:30:33 2016 (r303480) +++ head/sys/conf/files Fri Jul 29 15:24:50 2016 (r303481) @@ -86,9 +86,9 @@ cam/cam_xpt.c optional scbus cam/ata/ata_all.c optional scbus cam/ata/ata_xpt.c optional scbus cam/ata/ata_pmp.c optional scbus -cam/nvme/nvme_all.c optional scbus nvmd !nvd +cam/nvme/nvme_all.c optional scbus nvme !nvd cam/nvme/nvme_da.c optional scbus nvme da !nvd -cam/nvme/nvme_xpt.c optional scbus nvmd !nvd +cam/nvme/nvme_xpt.c optional scbus nvme !nvd cam/scsi/scsi_xpt.c optional scbus cam/scsi/scsi_all.c optional scbus cam/scsi/scsi_cd.c optional cd From owner-svn-src-head@freebsd.org Fri Jul 29 16: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 9CFB8BA8D1D; Fri, 29 Jul 2016 16:09:06 +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 6FDD11AD2; Fri, 29 Jul 2016 16:09:06 +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 u6TG95ra057065; Fri, 29 Jul 2016 16:09:05 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TG95BG057064; Fri, 29 Jul 2016 16:09:05 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201607291609.u6TG95BG057064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 29 Jul 2016 16:09:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303482 - head/usr.bin/indent 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.22 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, 29 Jul 2016 16:09:06 -0000 Author: pfg Date: Fri Jul 29 16:09:05 2016 New Revision: 303482 URL: https://svnweb.freebsd.org/changeset/base/303482 Log: indent(1): Avoid out of bound access of array codebuf. dump_line() requires s_code to be a string, because it will call count_spaces(). Differential Revision: https://reviews.freebsd.org/D6966 (Partial) Obtained from: Piotr Stefaniak Modified: head/usr.bin/indent/indent.c Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Fri Jul 29 15:24:50 2016 (r303481) +++ head/usr.bin/indent/indent.c Fri Jul 29 16:09:05 2016 (r303482) @@ -979,8 +979,10 @@ check_type: if (ps.want_blank) *e_code++ = ' '; ps.want_blank = false; - if (dec_ind && s_code != e_code) + if (dec_ind && s_code != e_code) { + *e_code = '\0'; dump_line(); + } dec_ind = 0; } } From owner-svn-src-head@freebsd.org Fri Jul 29 16:14: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 5FE1ABA8F5B; Fri, 29 Jul 2016 16:14:04 +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 2FFAF1155; Fri, 29 Jul 2016 16:14:04 +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 u6TGE3fL060512; Fri, 29 Jul 2016 16:14:03 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TGE35m060511; Fri, 29 Jul 2016 16:14:03 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201607291614.u6TGE35m060511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 29 Jul 2016 16:14:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303483 - head/usr.bin/indent 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.22 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, 29 Jul 2016 16:14:04 -0000 Author: pfg Date: Fri Jul 29 16:14:03 2016 New Revision: 303483 URL: https://svnweb.freebsd.org/changeset/base/303483 Log: indent(1): Avoid potential use-after-free. last_bl is a char pointer that tracks the last blank character in a comment, which is used for wrapping long comment lines. Since the underlying array may be reallocated, make sure last_bl is up to date when that happens. Differential Revision: https://reviews.freebsd.org/D6966 (Partial) Obtained from: Piotr Stefaniak Modified: head/usr.bin/indent/indent_globs.h Modified: head/usr.bin/indent/indent_globs.h ============================================================================== --- head/usr.bin/indent/indent_globs.h Fri Jul 29 16:09:05 2016 (r303482) +++ head/usr.bin/indent/indent_globs.h Fri Jul 29 16:14:03 2016 (r303483) @@ -71,6 +71,7 @@ FILE *output; /* the output file if (combuf == NULL) \ err(1, NULL); \ e_com = combuf + (e_com-s_com) + 1; \ + last_bl = combuf + (last_bl-s_com) + 1; \ l_com = combuf + nsize - 5; \ s_com = combuf + 1; \ } From owner-svn-src-head@freebsd.org Fri Jul 29 16:17: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 8261CBA8FEA; Fri, 29 Jul 2016 16:17:55 +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 481F5132A; Fri, 29 Jul 2016 16:17:55 +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 u6TGHsMu060674; Fri, 29 Jul 2016 16:17:54 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TGHsPE060673; Fri, 29 Jul 2016 16:17:54 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201607291617.u6TGHsPE060673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 29 Jul 2016 16:17:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303484 - head/usr.bin/indent 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.22 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, 29 Jul 2016 16:17:55 -0000 Author: pfg Date: Fri Jul 29 16:17:54 2016 New Revision: 303484 URL: https://svnweb.freebsd.org/changeset/base/303484 Log: indent(1): Fix breakage caused by single comment following "else". indent(1) simply wasn't taught that "else" may be followed by a comment without any opening brace anywhere on the line, so it was very confused in such cases. Differential Revision: https://reviews.freebsd.org/D6966 (Partial) Obtained from: Piotr Stefaniak Modified: head/usr.bin/indent/indent.c Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Fri Jul 29 16:14:03 2016 (r303483) +++ head/usr.bin/indent/indent.c Fri Jul 29 16:17:54 2016 (r303484) @@ -319,6 +319,8 @@ main(int argc, char **argv) switch (type_code) { case newline: ++line_no; + if (sc_end != NULL) + goto sw_buffer; /* dump comment, if any */ flushed_nl = true; case form_feed: break; /* form feeds and newlines found here will be From owner-svn-src-head@freebsd.org Fri Jul 29 16:20: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 72388BA70F0; Fri, 29 Jul 2016 16:20:09 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-oi0-x22a.google.com (mail-oi0-x22a.google.com [IPv6:2607:f8b0:4003:c06::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 35B6615D1; Fri, 29 Jul 2016 16:20:09 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-oi0-x22a.google.com with SMTP id l72so112923409oig.2; Fri, 29 Jul 2016 09:20:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=YR/9klZb4TCJFfphROkZaZ0uIeKlWgybqdLZ16q2mA0=; b=ZW8wSPkw6IFhuAOf8BuGLf8AaNz7kQwbdP3+GOMVyWxGJ2QweO0vOhR3z/BAZKZZWf kdpa1ogl35XdMewxCYDbaIfIAOByoJ4lSiiAoWq1ziZcCz0uQA4bhd8kJIdSsKNr+2G4 sqO7rt5VcRlD4E74bljuBcX2S8H/a/UM5DH9Mmzr3KvdI2yw3aHCWTt0NbZHEkO5fZgK n9QLOD8MnA8fVcxJAB3naKWEKs1LWH1Jax74lVBbObFUOY5heBgoWP4ze5i/wH3MAQMX 7mjxFjHvMsFlxDcuxA8VFeIePF3KlrCsGOO80Hayzj+7veb0QhbStvA2AtxB2Dkaitmo 14Sw== 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:from:date :message-id:subject:to:cc; bh=YR/9klZb4TCJFfphROkZaZ0uIeKlWgybqdLZ16q2mA0=; b=KEvzD4T73H+10oLasMxZTC8fLUS6Gk/VsI/UKk2j60xeP38+fVznYdXu9icnXoJu2d Z3QOsJpetuRze1aByg7J5/H3D5myjNVVTF3o+GbFzAloh58Pc7VUWH+glIZA8YgDJq5Z VbLGwu6op39mAl8oT0JNFKjSm0wgkmVWYDJn0Hz0s9n1EYT+VwL+oFEQxl+q4eYdVsDF 1/VsySeboh8EWjBHGT1dT4anbJJY1JcNVrRiRUKERUIlIDQt0DqcWWX1xd+MUqoUjtaE BKrzPEmXkP+aYntDGl5GuwpuEtsHPWItcin1KixW1ko59hhISXmMOB5h7DrPjq/5HxPH aMeg== X-Gm-Message-State: AEkoouvzYtMOVJZ0DtE3VzR7xvJKU9MMCcvsaXHtg0sCl24D1QfQ8+grL76l9Lz2ToN+fOGn1d7RbwHxzon1sg== X-Received: by 10.157.9.248 with SMTP id 53mr26864292otz.35.1469809208296; Fri, 29 Jul 2016 09:20:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.44.176 with HTTP; Fri, 29 Jul 2016 09:20:07 -0700 (PDT) In-Reply-To: <201607291617.u6TGHsPE060673@repo.freebsd.org> References: <201607291617.u6TGHsPE060673@repo.freebsd.org> From: Benjamin Kaduk Date: Fri, 29 Jul 2016 11:20:07 -0500 Message-ID: Subject: Re: svn commit: r303484 - head/usr.bin/indent To: "Pedro F. Giffuni" 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.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 29 Jul 2016 16:20:09 -0000 On Fri, Jul 29, 2016 at 11:17 AM, Pedro F. Giffuni wrote: > Author: pfg > Date: Fri Jul 29 16:17:54 2016 > New Revision: 303484 > URL: https://svnweb.freebsd.org/changeset/base/303484 > > Log: > indent(1): Fix breakage caused by single comment following "else". > > indent(1) simply wasn't taught that "else" may be followed by a comment > without any opening brace anywhere on the line, so it was very confused > in such cases. > > Wrong commit message? I see no 'else' in this change. (I guess core's guidance is to revert and recommit with correct message, these days.) -Ben > Differential Revision: https://reviews.freebsd.org/D6966 (Partial) > Obtained from: Piotr Stefaniak > > Modified: > head/usr.bin/indent/indent.c > > Modified: head/usr.bin/indent/indent.c > > ============================================================================== > --- head/usr.bin/indent/indent.c Fri Jul 29 16:14:03 2016 > (r303483) > +++ head/usr.bin/indent/indent.c Fri Jul 29 16:17:54 2016 > (r303484) > @@ -319,6 +319,8 @@ main(int argc, char **argv) > switch (type_code) { > case newline: > ++line_no; > + if (sc_end != NULL) > + goto sw_buffer; /* dump comment, if any */ > flushed_nl = true; > case form_feed: > break; /* form feeds and newlines found here will > be > _______________________________________________ > 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 Fri Jul 29 16:23: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 CCEB6BA7270; Fri, 29 Jul 2016 16:23:01 +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 8FE9D19E2; Fri, 29 Jul 2016 16:23:01 +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 u6TGN0EE064306; Fri, 29 Jul 2016 16:23:00 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TGN08u064305; Fri, 29 Jul 2016 16:23:00 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201607291623.u6TGN08u064305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 29 Jul 2016 16:23:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303485 - head/usr.bin/indent 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.22 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, 29 Jul 2016 16:23:01 -0000 Author: pfg Date: Fri Jul 29 16:23:00 2016 New Revision: 303485 URL: https://svnweb.freebsd.org/changeset/base/303485 Log: indent(1): fix struct termination detection. Semicolons inside struct declarations don't end the declarations. Differential Revision: https://reviews.freebsd.org/D6966 (Partial) Obtained from: Piotr Stefaniak Modified: head/usr.bin/indent/indent.c Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Fri Jul 29 16:17:54 2016 (r303484) +++ head/usr.bin/indent/indent.c Fri Jul 29 16:23:00 2016 (r303485) @@ -701,8 +701,10 @@ check_type: break; case semicolon: /* got a ';' */ - ps.in_or_st = false;/* we are not in an initialization or - * structure declaration */ + if (ps.dec_nest == 0) { + /* we are not in an initialization or structure declaration */ + ps.in_or_st = false; + } scase = false; /* these will only need resetting in an error */ squest = 0; if (ps.last_token == rparen && rparen_count == 0) From owner-svn-src-head@freebsd.org Fri Jul 29 16:24: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 7FAB0BA7303; Fri, 29 Jul 2016 16:24:33 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-oi0-x230.google.com (mail-oi0-x230.google.com [IPv6:2607:f8b0:4003:c06::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 42F331B76; Fri, 29 Jul 2016 16:24:33 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-oi0-x230.google.com with SMTP id w18so113062155oiw.3; Fri, 29 Jul 2016 09:24:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=IhAiyfzVv+bLnbB32YUfzkQYY5qBIupWdPaytKO5lvs=; b=OwpnjhylJVObobQypb6mjnLRpPyJE+QB3kfDHHIkVymiN8xgAvUTcGDD7roGtkj1/6 W6cRkbzVfRF4X27snQ9g5+rgUCvJvTDxOkcolXsiWTlDoTAyHwK9pRSUXOI8iFA/4ukk wQPGjbnCgOqWfIWsiOVgLaUAiP4LqIqgPPmHkkL0IFNd3+aYCNftEI1YPqHs5K8ZDlFn coXyxR1j4E6Gztl/ypK9mVlqhx77QRAEoNTN3PPMikfSq0G85kwSlVbd5vILhOgGe0XH SQ9Lrj3Q3LAxaLhflxpQ+9XsX/AuFHZsX15gTt2t25Nh98tM2cuG5cMADlAtJm8oy7y0 0o8w== 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:from:date :message-id:subject:to:cc; bh=IhAiyfzVv+bLnbB32YUfzkQYY5qBIupWdPaytKO5lvs=; b=G7B64rETjwhLJFLFIRqAzRxjTwXfivRa/V5Mqfik9oMvCYMNtWUePKEPGHh6PoFgcG 8XFXgGnjNOvRcPn5SzIJzf6Y0zei/1VYVJ4mXjEtypRkFciQ8hMPQENEXejbb7+TCGvB AbDTSeaoQ8HAG13VJTAeZglulc/lAxbz92rrZAM4keFrrzgNDC8NGqED/G2hrH5/WFry EUTCYS1bcsPPJ+g7e3YSsbESWt4VNNoC+ehjr0hY48ihayrPIQ3NPLJ7M189a7z0grtC gnF119BOn4NvzcfAB7eS87U/mClX8/8RU96Mewp+mh67rnxrmM+42iiZrsbIHz3TEavn 83tQ== X-Gm-Message-State: AEkooutxrHMScyUvEEw/2McFfKtbaspD1JnAs6POpU8POZhbYWIpy3yNHMeCR4Yusn4zyk0beKPBtax/JWJFMQ== X-Received: by 10.202.222.70 with SMTP id v67mr5617807oig.194.1469809472454; Fri, 29 Jul 2016 09:24:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.44.176 with HTTP; Fri, 29 Jul 2016 09:24:31 -0700 (PDT) In-Reply-To: References: <201607291617.u6TGHsPE060673@repo.freebsd.org> From: Benjamin Kaduk Date: Fri, 29 Jul 2016 11:24:31 -0500 Message-ID: Subject: Re: svn commit: r303484 - head/usr.bin/indent To: "Pedro F. Giffuni" 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.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 29 Jul 2016 16:24:33 -0000 On Fri, Jul 29, 2016 at 11:20 AM, Benjamin Kaduk wrote: > On Fri, Jul 29, 2016 at 11:17 AM, Pedro F. Giffuni > wrote: > >> Author: pfg >> Date: Fri Jul 29 16:17:54 2016 >> New Revision: 303484 >> URL: https://svnweb.freebsd.org/changeset/base/303484 >> >> Log: >> indent(1): Fix breakage caused by single comment following "else". >> >> indent(1) simply wasn't taught that "else" may be followed by a comment >> without any opening brace anywhere on the line, so it was very confused >> in such cases. >> >> > Wrong commit message? I see no 'else' in this change. > (I guess core's guidance is to revert and recommit with correct message, > these days.) > Nevermind, I think I see what's going on here, now. -Ben From owner-svn-src-head@freebsd.org Fri Jul 29 16:25:10 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 D401EBA7370; Fri, 29 Jul 2016 16:25:10 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8AA931CF8; Fri, 29 Jul 2016 16:25:10 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6TGP91r064448; Fri, 29 Jul 2016 16:25:09 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TGP9MS064446; Fri, 29 Jul 2016 16:25:09 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201607291625.u6TGP9MS064446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 29 Jul 2016 16:25:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303486 - head/lib/libc/gen 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.22 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, 29 Jul 2016 16:25:10 -0000 Author: ed Date: Fri Jul 29 16:25:09 2016 New Revision: 303486 URL: https://svnweb.freebsd.org/changeset/base/303486 Log: Mention that basename(3) and dirname(3) will change in the future. Update the existing manual pages for basename(3) and dirname(3) to mention that in future versions of FreeBSD, these functions will no longer use internal buffers for storing the results. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D7356 Modified: head/lib/libc/gen/basename.3 head/lib/libc/gen/dirname.3 Modified: head/lib/libc/gen/basename.3 ============================================================================== --- head/lib/libc/gen/basename.3 Fri Jul 29 16:23:00 2016 (r303485) +++ head/lib/libc/gen/basename.3 Fri Jul 29 16:25:09 2016 (r303486) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 28, 2016 +.Dd July 29, 2016 .Dt BASENAME 3 .Os .Sh NAME @@ -61,8 +61,16 @@ function returns a pointer to internal storage space allocated on the first call that will be overwritten by subsequent calls. +.Pp +Other vendor implementations of +.Fn basename +may store their result in the input buffer, +making it safe to use in multithreaded applications. +Future versions of +.Fx +will follow this approach as well. .Fn basename_r -is therefore preferred for threaded applications. +will then become obsolete. .Sh RETURN VALUES On successful completion, .Fn basename Modified: head/lib/libc/gen/dirname.3 ============================================================================== --- head/lib/libc/gen/dirname.3 Fri Jul 29 16:23:00 2016 (r303485) +++ head/lib/libc/gen/dirname.3 Fri Jul 29 16:25:09 2016 (r303486) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 28, 2016 +.Dd July 29, 2016 .Dt DIRNAME 3 .Os .Sh NAME @@ -56,10 +56,11 @@ by subsequent calls. .Pp Other vendor implementations of .Fn dirname -may modify the contents of the string passed to -.Fn dirname ; -this should be taken into account when writing code which calls this function -if portability is desired. +may store their result in the input buffer, +making it safe to use in multithreaded applications. +Future versions of +.Fx +will follow this approach as well. .Sh RETURN VALUES On successful completion, .Fn dirname From owner-svn-src-head@freebsd.org Fri Jul 29 16:28: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 E0BCFBA74B5; Fri, 29 Jul 2016 16:28:52 +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 B06011F4B; Fri, 29 Jul 2016 16:28:52 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6TGSp7u064606; Fri, 29 Jul 2016 16:28:51 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TGSpKT064605; Fri, 29 Jul 2016 16:28:51 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201607291628.u6TGSpKT064605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 29 Jul 2016 16:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303487 - head/usr.bin/indent 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.22 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, 29 Jul 2016 16:28:53 -0000 Author: pfg Date: Fri Jul 29 16:28:51 2016 New Revision: 303487 URL: https://svnweb.freebsd.org/changeset/base/303487 Log: indent(1): fix struct termination detection. Small style cleanup while here. Differential Revision: https://reviews.freebsd.org/D6966 (Partial) Obtained from: Piotr Stefaniak Modified: head/usr.bin/indent/lexi.c Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Fri Jul 29 16:25:09 2016 (r303486) +++ head/usr.bin/indent/lexi.c Fri Jul 29 16:28:51 2016 (r303487) @@ -191,15 +191,13 @@ lexi(void) } } while (1) { - if (!(seensfx & 1) && - (*buf_ptr == 'U' || *buf_ptr == 'u')) { + if (!(seensfx & 1) && (*buf_ptr == 'U' || *buf_ptr == 'u')) { CHECK_SIZE_TOKEN; *e_token++ = *buf_ptr++; seensfx |= 1; continue; } - if (!(seensfx & 2) && - (*buf_ptr == 'L' || *buf_ptr == 'l')) { + if (!(seensfx & 2) && strchr("fFlL", *buf_ptr)) { CHECK_SIZE_TOKEN; if (buf_ptr[1] == buf_ptr[0]) *e_token++ = *buf_ptr++; From owner-svn-src-head@freebsd.org Fri Jul 29 16:33: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 15907BA7672; Fri, 29 Jul 2016 16:33:47 +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 D66E1155B; Fri, 29 Jul 2016 16:33:46 +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 u6TGXkBg068065; Fri, 29 Jul 2016 16:33:46 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TGXjVY068064; Fri, 29 Jul 2016 16:33:45 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201607291633.u6TGXjVY068064@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: Fri, 29 Jul 2016 16:33:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303488 - 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.22 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, 29 Jul 2016 16:33:47 -0000 Author: royger Date: Fri Jul 29 16:33:45 2016 New Revision: 303488 URL: https://svnweb.freebsd.org/changeset/base/303488 Log: xen-netfront: fix trying to send packets with disconnected netfront In certain circumstances xn_txq_mq_start might be called with num_queues == 0 during the resume phase after a migration, which can trigger a KASSERT. Fix this by making sure the carrier is on before trying to transmit, or else return that the queues are full. Just as a note, I haven't been able to reproduce this crash on my test systems, but I still think it's possible and worth fixing. Reported by: Karl Pielorz Sponsored by: Citrix Systems R&D MFC after: 5 days Reviewed by: Wei Liu Differential revision: https://reviews.freebsd.org/D7349 Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Fri Jul 29 16:28:51 2016 (r303487) +++ head/sys/dev/xen/netfront/netfront.c Fri Jul 29 16:33:45 2016 (r303488) @@ -2157,6 +2157,9 @@ xn_txq_mq_start(struct ifnet *ifp, struc np = ifp->if_softc; npairs = np->num_queues; + if (!netfront_carrier_ok(np)) + return (ENOBUFS); + KASSERT(npairs != 0, ("called with 0 available queues")); /* check if flowid is set */ From owner-svn-src-head@freebsd.org Fri Jul 29 16:34:17 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 9EC28BA76E4; Fri, 29 Jul 2016 16:34:17 +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 6B84E1702; Fri, 29 Jul 2016 16:34: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 u6TGYGOK068127; Fri, 29 Jul 2016 16:34:16 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TGYGwA068126; Fri, 29 Jul 2016 16:34:16 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201607291634.u6TGYGwA068126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 29 Jul 2016 16:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303489 - head/usr.bin/indent 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.22 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, 29 Jul 2016 16:34:17 -0000 Author: pfg Date: Fri Jul 29 16:34:16 2016 New Revision: 303489 URL: https://svnweb.freebsd.org/changeset/base/303489 Log: indent(1): Removed whitespace shouldn't be considered in column calculations. This piece of code removed tabs and space characters from after colons that follow labels by decrementing the e_lab (end of label) "pointer" which is later used to calculate the width of the string that fprintf() puts into "output". But pad_output() gets the length from the actual string, so it miscalculated what the current column is. Fixed by putting a string terminator at the e_lab "pointer". Differential Revision: https://reviews.freebsd.org/D6966 (Partial) Obtained from: Piotr Stefaniak Modified: head/usr.bin/indent/io.c Modified: head/usr.bin/indent/io.c ============================================================================== --- head/usr.bin/indent/io.c Fri Jul 29 16:33:45 2016 (r303488) +++ head/usr.bin/indent/io.c Fri Jul 29 16:34:16 2016 (r303489) @@ -116,6 +116,7 @@ dump_line(void) } while (e_lab > s_lab && (e_lab[-1] == ' ' || e_lab[-1] == '\t')) e_lab--; + *e_lab = '\0'; cur_col = pad_output(1, compute_label_target()); if (s_lab[0] == '#' && (strncmp(s_lab, "#else", 5) == 0 || strncmp(s_lab, "#endif", 6) == 0)) { From owner-svn-src-head@freebsd.org Fri Jul 29 16:34: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 29420BA77C1; Fri, 29 Jul 2016 16:34:56 +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 D054618CC; Fri, 29 Jul 2016 16:34:55 +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 u6TGYtjZ068192; Fri, 29 Jul 2016 16:34:55 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TGYt3L068191; Fri, 29 Jul 2016 16:34:55 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201607291634.u6TGYt3L068191@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: Fri, 29 Jul 2016 16:34:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303490 - head/sys/x86/xen 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.22 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, 29 Jul 2016 16:34:56 -0000 Author: royger Date: Fri Jul 29 16:34:54 2016 New Revision: 303490 URL: https://svnweb.freebsd.org/changeset/base/303490 Log: xen-intr: fix removal of event channels during resume Event channel handlers cannot be removed during resume because there might be an interrupt thread running on a CPU currently blocked in the cpususpend_handler, which prevents the call to intr_remove_handler from finishing and completely freezes the system during resume. r291022 tried to fix this by allowing recursion in intr_remove_handler, but that's clearly not enough. Instead don't remove the handlers at the interrupt resume phase, and let each driver remove the handler by itself during resume. In order to do this, change the opaque event channel handler cookie to use the global interrupt vector instead of the event channel port. The event channel port cannot be used because after resume all event channels are reset, and the port numbers can change. Sponsored by: Citrix Systems R&D MFC after: 5 days Modified: head/sys/x86/xen/xen_intr.c Modified: head/sys/x86/xen/xen_intr.c ============================================================================== --- head/sys/x86/xen/xen_intr.c Fri Jul 29 16:34:16 2016 (r303489) +++ head/sys/x86/xen/xen_intr.c Fri Jul 29 16:34:54 2016 (r303490) @@ -130,8 +130,6 @@ struct xenisrc { u_int xi_masked:1; }; -#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) - static void xen_intr_suspend(struct pic *); static void xen_intr_resume(struct pic *, bool suspend_cancelled); static void xen_intr_enable_source(struct intsrc *isrc); @@ -422,7 +420,7 @@ xen_intr_bind_isrc(struct xenisrc **isrc mtx_unlock(&xen_intr_isrc_lock); /* Assign the opaque handler (the event channel port) */ - *port_handlep = &isrc->xi_port; + *port_handlep = &isrc->xi_vector; #ifdef SMP if (type == EVTCHN_TYPE_PORT) { @@ -468,16 +466,17 @@ xen_intr_bind_isrc(struct xenisrc **isrc static struct xenisrc * xen_intr_isrc(xen_intr_handle_t handle) { - evtchn_port_t port; + int vector; if (handle == NULL) return (NULL); - port = *(evtchn_port_t *)handle; - if (!is_valid_evtchn(port) || port >= NR_EVENT_CHANNELS) - return (NULL); + vector = *(int *)handle; + KASSERT(vector >= FIRST_EVTCHN_INT && + vector < (FIRST_EVTCHN_INT + xen_intr_auto_vector_count), + ("Xen interrupt vector is out of range")); - return (xen_intr_port_to_isrc[port]); + return ((struct xenisrc *)intr_lookup_source(vector)); } /** @@ -780,10 +779,6 @@ xen_intr_resume(struct pic *unused, bool xen_rebind_virq(isrc); break; default: - intr_remove_handler(isrc->xi_cookie); - isrc->xi_cpu = 0; - isrc->xi_type = EVTCHN_TYPE_UNBOUND; - isrc->xi_cookie = NULL; break; } } From owner-svn-src-head@freebsd.org Fri Jul 29 16:36: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 F3FB7BA789E; Fri, 29 Jul 2016 16:35:59 +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 C42EB1AEE; Fri, 29 Jul 2016 16:35:59 +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 u6TGZwV4068278; Fri, 29 Jul 2016 16:35:58 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TGZwsg068277; Fri, 29 Jul 2016 16:35:58 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201607291635.u6TGZwsg068277@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: Fri, 29 Jul 2016 16:35:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303491 - head/sys/x86/x86 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.22 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, 29 Jul 2016 16:36:00 -0000 Author: royger Date: Fri Jul 29 16:35:58 2016 New Revision: 303491 URL: https://svnweb.freebsd.org/changeset/base/303491 Log: Revert r291022: x86/intr: allow mutex recursion in intr_remove_handler This was only needed for Xen, and a better way to deal with this issue has been found, so this commit can be reverted. Sponsored by: Citrix Systems R&D MFC after: 5 days Reviewed by: kib Differential revision: https://reviews.freebsd.org/D7363 Modified: head/sys/x86/x86/intr_machdep.c Modified: head/sys/x86/x86/intr_machdep.c ============================================================================== --- head/sys/x86/x86/intr_machdep.c Fri Jul 29 16:34:54 2016 (r303490) +++ head/sys/x86/x86/intr_machdep.c Fri Jul 29 16:35:58 2016 (r303491) @@ -197,28 +197,19 @@ int intr_remove_handler(void *cookie) { struct intsrc *isrc; - int error, mtx_owned; + int error; isrc = intr_handler_source(cookie); error = intr_event_remove_handler(cookie); if (error == 0) { - /* - * Recursion is needed here so PICs can remove interrupts - * while resuming. It was previously not possible due to - * intr_resume holding the intr_table_lock and - * intr_remove_handler recursing on it. - */ - mtx_owned = mtx_owned(&intr_table_lock); - if (mtx_owned == 0) - mtx_lock(&intr_table_lock); + mtx_lock(&intr_table_lock); isrc->is_handlers--; if (isrc->is_handlers == 0) { isrc->is_pic->pic_disable_source(isrc, PIC_NO_EOI); isrc->is_pic->pic_disable_intr(isrc); } intrcnt_updatename(isrc); - if (mtx_owned == 0) - mtx_unlock(&intr_table_lock); + mtx_unlock(&intr_table_lock); } return (error); } From owner-svn-src-head@freebsd.org Fri Jul 29 16:43: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 30A1BBA7B9C; Fri, 29 Jul 2016 16:43:53 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF128118F; Fri, 29 Jul 2016 16:43:52 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6TGhqhe071779; Fri, 29 Jul 2016 16:43:52 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TGhq6f071778; Fri, 29 Jul 2016 16:43:52 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201607291643.u6TGhq6f071778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 29 Jul 2016 16:43:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303492 - head/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.22 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, 29 Jul 2016 16:43:53 -0000 Author: alc Date: Fri Jul 29 16:43:51 2016 New Revision: 303492 URL: https://svnweb.freebsd.org/changeset/base/303492 Log: Remove a probe declaration that has been unused since r292469, when vm_pageout_grow_cache() was replaced. MFC after: 3 days Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Fri Jul 29 16:35:58 2016 (r303491) +++ head/sys/vm/vm_pageout.c Fri Jul 29 16:43:51 2016 (r303492) @@ -139,7 +139,6 @@ SYSINIT(pagedaemon, SI_SUB_KTHREAD_PAGE, &page_kp); SDT_PROVIDER_DEFINE(vm); -SDT_PROBE_DEFINE(vm, , , vm__lowmem_cache); SDT_PROBE_DEFINE(vm, , , vm__lowmem_scan); #if !defined(NO_SWAPPING) From owner-svn-src-head@freebsd.org Fri Jul 29 17:06: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 AB0ABBA8342; Fri, 29 Jul 2016 17:06:53 +0000 (UTC) (envelope-from email@piotr-stefaniak.me) Received: from BLU004-OMC2S26.hotmail.com (blu004-omc2s26.hotmail.com [65.55.111.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "*.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C4281E91; Fri, 29 Jul 2016 17:06:52 +0000 (UTC) (envelope-from email@piotr-stefaniak.me) Received: from BLU436-SMTP77 ([65.55.111.73]) by BLU004-OMC2S26.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Fri, 29 Jul 2016 10:06:46 -0700 X-TMN: [BHzpjpjXXdSTSNUOhDAkkHBYGKtS0DuV] X-Originating-Email: [email@piotr-stefaniak.me] Message-ID: Subject: Re: svn commit: r303487 - head/usr.bin/indent To: "Pedro F. Giffuni" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201607291628.u6TGSpKT064605@repo.freebsd.org> From: Piotr Stefaniak Date: Fri, 29 Jul 2016 19:06:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <201607291628.u6TGSpKT064605@repo.freebsd.org> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 29 Jul 2016 17:06:46.0270 (UTC) FILETIME=[967289E0:01D1E9BB] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 29 Jul 2016 17:06:53 -0000 On 2016-07-29 18:28, Pedro F. Giffuni wrote: > Author: pfg > Date: Fri Jul 29 16:28:51 2016 > New Revision: 303487 > URL: https://svnweb.freebsd.org/changeset/base/303487 > > Log: > indent(1): fix struct termination detection. > > Small style cleanup while here. Wrong commit message. Actually committed here is: Support "f" and "F" floating constant suffixes. > Differential Revision: https://reviews.freebsd.org/D6966 (Partial) > Obtained from: Piotr Stefaniak > > Modified: > head/usr.bin/indent/lexi.c > > Modified: head/usr.bin/indent/lexi.c > ============================================================================== > --- head/usr.bin/indent/lexi.c Fri Jul 29 16:25:09 2016 (r303486) > +++ head/usr.bin/indent/lexi.c Fri Jul 29 16:28:51 2016 (r303487) > @@ -191,15 +191,13 @@ lexi(void) > } > } > while (1) { > - if (!(seensfx & 1) && > - (*buf_ptr == 'U' || *buf_ptr == 'u')) { > + if (!(seensfx & 1) && (*buf_ptr == 'U' || *buf_ptr == 'u')) { > CHECK_SIZE_TOKEN; > *e_token++ = *buf_ptr++; > seensfx |= 1; > continue; > } > - if (!(seensfx & 2) && > - (*buf_ptr == 'L' || *buf_ptr == 'l')) { > + if (!(seensfx & 2) && strchr("fFlL", *buf_ptr)) { > CHECK_SIZE_TOKEN; > if (buf_ptr[1] == buf_ptr[0]) > *e_token++ = *buf_ptr++; > _______________________________________________ > 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 Fri Jul 29 17: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 5DB08BA857A; Fri, 29 Jul 2016 17:15:43 +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 271E81861; Fri, 29 Jul 2016 17:15:43 +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 u6THFgd5082802; Fri, 29 Jul 2016 17:15:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6THFg5l082797; Fri, 29 Jul 2016 17:15:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201607291715.u6THFg5l082797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 29 Jul 2016 17:15:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303494 - in head: share/man/man4 sys/dev/ntb sys/dev/ntb/if_ntb 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.22 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, 29 Jul 2016 17:15:43 -0000 Author: mav Date: Fri Jul 29 17:15:41 2016 New Revision: 303494 URL: https://svnweb.freebsd.org/changeset/base/303494 Log: Once more refactor KPI between ntb_transport(4) and if_ntb(4).. New design allows to attach multiple consumers to ntb_transport(4) instance. Previous design obtained from Linux theoretically allowed that, but was not practically usable (Linux also has only one consumer driver now). Modified: head/share/man/man4/if_ntb.4 head/share/man/man4/ntb_transport.4 head/sys/dev/ntb/if_ntb/if_ntb.c head/sys/dev/ntb/ntb_transport.c head/sys/dev/ntb/ntb_transport.h Modified: head/share/man/man4/if_ntb.4 ============================================================================== --- head/share/man/man4/if_ntb.4 Fri Jul 29 17:12:31 2016 (r303493) +++ head/share/man/man4/if_ntb.4 Fri Jul 29 17:15:41 2016 (r303494) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 10, 2016 +.Dd July 29, 2016 .Dt IF_NTB 4 .Os .Sh NAME @@ -49,7 +49,7 @@ The following tunables are settable from .Bl -ohang .It Va hw.if_ntb.num_queues Number of transport queues to use per interface. -Default is 1. +Default is unlimited. .El .Sh DESCRIPTION The @@ -84,3 +84,6 @@ Later improvements were done by .An Conrad E. Meyer Aq Mt cem@FreeBSD.org and .An Alexander Motin Aq Mt mav@FreeBSD.org . +.Sh BUGS +Linux supports only one queue per interface, so manual configuration +may be required for compatibility. Modified: head/share/man/man4/ntb_transport.4 ============================================================================== --- head/share/man/man4/ntb_transport.4 Fri Jul 29 17:12:31 2016 (r303493) +++ head/share/man/man4/ntb_transport.4 Fri Jul 29 17:15:41 2016 (r303494) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 10, 2016 +.Dd July 29, 2016 .Dt NTB_TRANSPORT 4 .Os .Sh NAME @@ -44,10 +44,15 @@ The following tunables are settable from .It Va hw.ntb_transport.debug_level Driver debug level. The default value is 0, higher means more verbose. -.It Va hw.ntb_transport.max_num_clients -Number of bidirectional queues to setup. -The default value is 0, that means one queue per available memory window. -Maximal number is limited by number of doorbells. +.It Va hint.ntb_transport. Ns Ar X Ns Va .config +Configures queues allocation for consumer devices, separated by commas. +Each device can be configured as: "[:]", where: +.Va name +is a name of the driver which should attach the device (empty means any), +.Va queues +is a number of queues to allocate (empty means automatic), +The default configuration is empty string, which means single device +with one queue per memory window allowing any driver attachment. .El .Sh DESCRIPTION The Modified: head/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- head/sys/dev/ntb/if_ntb/if_ntb.c Fri Jul 29 17:12:31 2016 (r303493) +++ head/sys/dev/ntb/if_ntb/if_ntb.c Fri Jul 29 17:15:41 2016 (r303494) @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); static SYSCTL_NODE(_hw, OID_AUTO, if_ntb, CTLFLAG_RW, 0, "if_ntb"); -static unsigned g_if_ntb_num_queues = 1; +static unsigned g_if_ntb_num_queues = UINT_MAX; SYSCTL_UINT(_hw_if_ntb, OID_AUTO, num_queues, CTLFLAG_RWTUN, &g_if_ntb_num_queues, 0, "Number of queues per interface"); @@ -144,7 +144,8 @@ ntb_net_attach(device_t dev) if_initname(ifp, device_get_name(dev), device_get_unit(dev)); if_setdev(ifp, dev); - sc->num_queues = g_if_ntb_num_queues; + sc->num_queues = min(g_if_ntb_num_queues, + ntb_transport_queue_count(dev)); sc->queues = malloc(sc->num_queues * sizeof(struct ntb_net_queue), M_DEVBUF, M_WAITOK | M_ZERO); sc->mtu = INT_MAX; @@ -152,8 +153,7 @@ ntb_net_attach(device_t dev) q = &sc->queues[i]; q->sc = sc; q->ifp = ifp; - q->qp = ntb_transport_create_queue(q, - device_get_parent(dev), &handlers); + q->qp = ntb_transport_create_queue(dev, i, &handlers, q); if (q->qp == NULL) break; sc->mtu = imin(sc->mtu, ntb_transport_max_size(q->qp)); @@ -167,6 +167,7 @@ ntb_net_attach(device_t dev) callout_init(&q->queue_full, 1); } sc->num_queues = i; + device_printf(dev, "%d queue(s)\n", sc->num_queues); if_setinitfn(ifp, ntb_net_init); if_setsoftc(ifp, sc); Modified: head/sys/dev/ntb/ntb_transport.c ============================================================================== --- head/sys/dev/ntb/ntb_transport.c Fri Jul 29 17:12:31 2016 (r303493) +++ head/sys/dev/ntb/ntb_transport.c Fri Jul 29 17:15:41 2016 (r303494) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -64,13 +63,6 @@ __FBSDID("$FreeBSD$"); #include "ntb.h" #include "ntb_transport.h" -#define QP_SETSIZE 64 -BITSET_DEFINE(_qpset, QP_SETSIZE); -#define test_bit(pos, addr) BIT_ISSET(QP_SETSIZE, (pos), (addr)) -#define set_bit(pos, addr) BIT_SET(QP_SETSIZE, (pos), (addr)) -#define clear_bit(pos, addr) BIT_CLR(QP_SETSIZE, (pos), (addr)) -#define ffs_bit(addr) BIT_FFS(QP_SETSIZE, (addr)) - #define KTR_NTB KTR_SPARE3 #define NTB_TRANSPORT_VERSION 4 @@ -94,12 +86,6 @@ SYSCTL_UQUAD(_hw_ntb_transport, OID_AUTO "If enabled (non-zero), limit the size of large memory windows. " "Both sides of the NTB MUST set the same value here."); -static unsigned max_num_clients; -SYSCTL_UINT(_hw_ntb_transport, OID_AUTO, max_num_clients, CTLFLAG_RDTUN, - &max_num_clients, 0, "Maximum number of NTB transport clients. " - "0 (default) - use all available NTB memory windows; " - "positive integer N - Limit to N memory windows."); - static unsigned enable_xeon_watchdog; SYSCTL_UINT(_hw_ntb_transport, OID_AUTO, enable_xeon_watchdog, CTLFLAG_RDTUN, &enable_xeon_watchdog, 0, "If non-zero, write a register every second to " @@ -200,14 +186,21 @@ struct ntb_transport_mw { bus_addr_t dma_addr; }; +struct ntb_transport_child { + device_t dev; + int qpoff; + int qpcnt; + struct ntb_transport_child *next; +}; + struct ntb_transport_ctx { device_t dev; + struct ntb_transport_child *child; struct ntb_transport_mw *mw_vec; struct ntb_transport_qp *qp_vec; - struct _qpset qp_bitmap; - struct _qpset qp_bitmap_free; unsigned mw_count; unsigned qp_count; + uint64_t qp_bitmap; volatile bool link_is_up; struct callout link_work; struct callout link_watchdog; @@ -242,7 +235,6 @@ enum { NTBT_MW0_SZ_LOW, NTBT_MW1_SZ_HIGH, NTBT_MW1_SZ_LOW, - NTBT_MAX_SPAD, /* * Some NTB-using hardware have a watchdog to work around NTB hangs; if @@ -332,13 +324,44 @@ static int ntb_transport_attach(device_t dev) { struct ntb_transport_ctx *nt = device_get_softc(dev); + struct ntb_transport_child **cpp = &nt->child; + struct ntb_transport_child *nc; struct ntb_transport_mw *mw; - uint64_t qp_bitmap; - int rc; - unsigned i; + uint64_t db_bitmap; + int rc, i, db_count, spad_count, qp, qpu, qpo, qpt; + char cfg[128] = ""; + char buf[32]; + char *n, *np, *c, *name; nt->dev = dev; nt->mw_count = ntb_mw_count(dev); + spad_count = ntb_spad_count(dev); + db_bitmap = ntb_db_valid_mask(dev); + db_count = flsll(db_bitmap); + KASSERT(db_bitmap == (1 << db_count) - 1, + ("Doorbells are not sequential (%jx).\n", db_bitmap)); + + device_printf(dev, "%d memory windows, %d scratchpads, " + "%d doorbells\n", nt->mw_count, spad_count, db_count); + + if (nt->mw_count == 0) { + device_printf(dev, "At least 1 memory window required.\n"); + return (ENXIO); + } + if (spad_count < 6) { + device_printf(dev, "At least 6 scratchpads required.\n"); + return (ENXIO); + } + if (spad_count < 4 + 2 * nt->mw_count) { + nt->mw_count = (spad_count - 4) / 2; + device_printf(dev, "Scratchpads enough only for %d " + "memory windows.\n", nt->mw_count); + } + if (db_bitmap == 0) { + device_printf(dev, "At least one doorbell required.\n"); + return (ENXIO); + } + nt->mw_vec = malloc(nt->mw_count * sizeof(*nt->mw_vec), M_NTB_T, M_WAITOK | M_ZERO); for (i = 0; i < nt->mw_count; i++) { @@ -360,25 +383,59 @@ ntb_transport_attach(device_t dev) ntb_printf(0, "Unable to set mw%d caching\n", i); } - qp_bitmap = ntb_db_valid_mask(dev); - nt->qp_count = flsll(qp_bitmap); - KASSERT(nt->qp_count != 0, ("bogus db bitmap")); - nt->qp_count -= 1; - - if (max_num_clients != 0 && max_num_clients < nt->qp_count) - nt->qp_count = max_num_clients; - else if (nt->mw_count < nt->qp_count) - nt->qp_count = nt->mw_count; - KASSERT(nt->qp_count <= QP_SETSIZE, ("invalid qp_count")); + qpu = 0; + qpo = imin(db_count, nt->mw_count); + qpt = db_count; + + snprintf(buf, sizeof(buf), "hint.%s.%d.config", device_get_name(dev), + device_get_unit(dev)); + TUNABLE_STR_FETCH(buf, cfg, sizeof(cfg)); + n = cfg; + i = 0; + while ((c = strsep(&n, ",")) != NULL) { + np = c; + name = strsep(&np, ":"); + if (name != NULL && name[0] == 0) + name = NULL; + qp = (np && np[0] != 0) ? strtol(np, NULL, 10) : qpo - qpu; + if (qp <= 0) + qp = 1; + + if (qp > qpt - qpu) { + device_printf(dev, "Not enough resources for config\n"); + break; + } + + nc = malloc(sizeof(*nc), M_DEVBUF, M_WAITOK | M_ZERO); + nc->qpoff = qpu; + nc->qpcnt = qp; + nc->dev = device_add_child(dev, name, -1); + if (nc->dev == NULL) { + device_printf(dev, "Can not add child.\n"); + break; + } + device_set_ivars(nc->dev, nc); + *cpp = nc; + cpp = &nc->next; + + if (bootverbose) { + device_printf(dev, "%d \"%s\": queues %d", + i, name, qpu); + if (qp > 1) + printf("-%d", qpu + qp - 1); + printf("\n"); + } + + qpu += qp; + i++; + } + nt->qp_count = qpu; nt->qp_vec = malloc(nt->qp_count * sizeof(*nt->qp_vec), M_NTB_T, M_WAITOK | M_ZERO); - for (i = 0; i < nt->qp_count; i++) { - set_bit(i, &nt->qp_bitmap); - set_bit(i, &nt->qp_bitmap_free); + for (i = 0; i < nt->qp_count; i++) ntb_transport_init_queue(nt, i); - } callout_init(&nt->link_work, 0); callout_init(&nt->link_watchdog, 0); @@ -394,10 +451,7 @@ ntb_transport_attach(device_t dev) if (enable_xeon_watchdog != 0) callout_reset(&nt->link_watchdog, 0, xeon_link_watchdog_hb, nt); - /* Attach children to this transport */ - device_add_child(dev, NULL, -1); bus_generic_attach(dev); - return (0); err: @@ -410,25 +464,25 @@ static int ntb_transport_detach(device_t dev) { struct ntb_transport_ctx *nt = device_get_softc(dev); - struct _qpset qp_bitmap_alloc; - uint8_t i; - - /* Detach & delete all children */ - device_delete_children(dev); + struct ntb_transport_child **cpp = &nt->child; + struct ntb_transport_child *nc; + int error = 0, i; + + while ((nc = *cpp) != NULL) { + *cpp = (*cpp)->next; + error = device_delete_child(dev, nc->dev); + if (error) + break; + free(nc, M_DEVBUF); + } + KASSERT(nt->qp_bitmap == 0, + ("Some queues not freed on detach (%jx)", nt->qp_bitmap)); ntb_transport_link_cleanup(nt); taskqueue_drain(taskqueue_swi, &nt->link_cleanup); callout_drain(&nt->link_work); callout_drain(&nt->link_watchdog); - BIT_COPY(QP_SETSIZE, &nt->qp_bitmap, &qp_bitmap_alloc); - BIT_NAND(QP_SETSIZE, &qp_bitmap_alloc, &nt->qp_bitmap_free); - - /* Verify that all the QPs are freed */ - for (i = 0; i < nt->qp_count; i++) - if (test_bit(i, &qp_bitmap_alloc)) - ntb_transport_free_queue(&nt->qp_vec[i]); - ntb_link_disable(dev); ntb_clear_ctx(dev); @@ -440,6 +494,14 @@ ntb_transport_detach(device_t dev) return (0); } +int +ntb_transport_queue_count(device_t dev) +{ + struct ntb_transport_child *nc = device_get_ivars(dev); + + return (nc->qpcnt); +} + static void ntb_transport_init_queue(struct ntb_transport_ctx *nt, unsigned int qp_num) { @@ -507,6 +569,7 @@ ntb_transport_init_queue(struct ntb_tran void ntb_transport_free_queue(struct ntb_transport_qp *qp) { + struct ntb_transport_ctx *nt = qp->transport; struct ntb_queue_entry *entry; if (qp == NULL) @@ -532,7 +595,7 @@ ntb_transport_free_queue(struct ntb_tran while ((entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q))) free(entry, M_NTB_T); - set_bit(qp->qp_num, &qp->transport->qp_bitmap_free); + nt->qp_bitmap &= ~(1 << qp->qp_num); } /** @@ -550,24 +613,20 @@ ntb_transport_free_queue(struct ntb_tran * RETURNS: pointer to newly created ntb_queue, NULL on error. */ struct ntb_transport_qp * -ntb_transport_create_queue(void *data, device_t dev, - const struct ntb_queue_handlers *handlers) +ntb_transport_create_queue(device_t dev, int q, + const struct ntb_queue_handlers *handlers, void *data) { - struct ntb_transport_ctx *nt = device_get_softc(dev); + struct ntb_transport_child *nc = device_get_ivars(dev); + struct ntb_transport_ctx *nt = device_get_softc(device_get_parent(dev)); struct ntb_queue_entry *entry; struct ntb_transport_qp *qp; - unsigned int free_queue; int i; - free_queue = ffs_bit(&nt->qp_bitmap_free); - if (free_queue == 0) + if (q < 0 || q >= nc->qpcnt) return (NULL); - /* decrement free_queue to make it zero based */ - free_queue--; - - qp = &nt->qp_vec[free_queue]; - clear_bit(qp->qp_num, &nt->qp_bitmap_free); + qp = &nt->qp_vec[nc->qpoff + q]; + nt->qp_bitmap |= (1 << qp->qp_num); qp->cb_data = data; qp->rx_handler = handlers->rx_handler; qp->tx_handler = handlers->tx_handler; @@ -944,24 +1003,19 @@ ntb_transport_doorbell_callback(void *da { struct ntb_transport_ctx *nt = data; struct ntb_transport_qp *qp; - struct _qpset db_bits; uint64_t vec_mask; unsigned qp_num; - BIT_COPY(QP_SETSIZE, &nt->qp_bitmap, &db_bits); - BIT_NAND(QP_SETSIZE, &db_bits, &nt->qp_bitmap_free); - vec_mask = ntb_db_vector_mask(nt->dev, vector); + vec_mask &= nt->qp_bitmap; if ((vec_mask & (vec_mask - 1)) != 0) vec_mask &= ntb_db_read(nt->dev); while (vec_mask != 0) { qp_num = ffsll(vec_mask) - 1; - if (test_bit(qp_num, &db_bits)) { - qp = &nt->qp_vec[qp_num]; - if (qp->link_is_up) - taskqueue_enqueue(qp->rxc_tq, &qp->rxc_db_work); - } + qp = &nt->qp_vec[qp_num]; + if (qp->link_is_up) + taskqueue_enqueue(qp->rxc_tq, &qp->rxc_db_work); vec_mask &= ~(1ull << qp_num); } @@ -1219,19 +1273,16 @@ static void ntb_transport_link_cleanup(struct ntb_transport_ctx *nt) { struct ntb_transport_qp *qp; - struct _qpset qp_bitmap_alloc; - unsigned i; - - BIT_COPY(QP_SETSIZE, &nt->qp_bitmap, &qp_bitmap_alloc); - BIT_NAND(QP_SETSIZE, &qp_bitmap_alloc, &nt->qp_bitmap_free); + int i; /* Pass along the info to any clients */ - for (i = 0; i < nt->qp_count; i++) - if (test_bit(i, &qp_bitmap_alloc)) { + for (i = 0; i < nt->qp_count; i++) { + if ((nt->qp_bitmap & (1 << i)) != 0) { qp = &nt->qp_vec[i]; ntb_qp_link_cleanup(qp); callout_drain(&qp->link_work); } + } if (!nt->link_is_up) callout_drain(&nt->link_work); @@ -1241,8 +1292,7 @@ ntb_transport_link_cleanup(struct ntb_tr * goes down, blast them now to give them a sane value the next * time they are accessed */ - for (i = 0; i < NTBT_MAX_SPAD; i++) - ntb_spad_write(nt->dev, i, 0); + ntb_spad_clear(nt->dev); } static void Modified: head/sys/dev/ntb/ntb_transport.h ============================================================================== --- head/sys/dev/ntb/ntb_transport.h Fri Jul 29 17:12:31 2016 (r303493) +++ head/sys/dev/ntb/ntb_transport.h Fri Jul 29 17:15:41 2016 (r303494) @@ -43,12 +43,13 @@ struct ntb_queue_handlers { void (*event_handler)(void *data, enum ntb_link_event status); }; -unsigned char ntb_transport_qp_num(struct ntb_transport_qp *qp); -unsigned int ntb_transport_max_size(struct ntb_transport_qp *qp); +int ntb_transport_queue_count(device_t dev); struct ntb_transport_qp * -ntb_transport_create_queue(void *data, device_t dev, - const struct ntb_queue_handlers *handlers); +ntb_transport_create_queue(device_t dev, int q, + const struct ntb_queue_handlers *handlers, void *data); void ntb_transport_free_queue(struct ntb_transport_qp *qp); +unsigned char ntb_transport_qp_num(struct ntb_transport_qp *qp); +unsigned int ntb_transport_max_size(struct ntb_transport_qp *qp); int ntb_transport_rx_enqueue(struct ntb_transport_qp *qp, void *cb, void *data, unsigned int len); int ntb_transport_tx_enqueue(struct ntb_transport_qp *qp, void *cb, void *data, From owner-svn-src-head@freebsd.org Fri Jul 29 17:18: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 34DF0BA85E5; Fri, 29 Jul 2016 17:18:49 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FFBE1A52; Fri, 29 Jul 2016 17:18:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6THImhv082941; Fri, 29 Jul 2016 17:18:48 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6THIm7R082938; Fri, 29 Jul 2016 17:18:48 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201607291718.u6THIm7R082938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 29 Jul 2016 17:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303495 - in head: include/xlocale lib/libc/locale 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.22 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, 29 Jul 2016 17:18:49 -0000 Author: ed Date: Fri Jul 29 17:18:47 2016 New Revision: 303495 URL: https://svnweb.freebsd.org/changeset/base/303495 Log: Change the return type of freelocale(3) to void. Our version of this function currently returns an integer indicating failure or success, whereas POSIX specifies that this function has no return value. It returns void. Patch up the header, sources and man page to use the right type. While there, use the opportunity to simplify the body of this function. Theoretically speaking, this change breaks the ABI of this function. That said, I have yet to find any code that makes use of freelocale()'s return value. I couldn't find any of it in the base system, nor did an exp-run reveal any breakage caused by this change. PR: 211394 (exp-run) Modified: head/include/xlocale/_locale.h head/lib/libc/locale/freelocale.3 head/lib/libc/locale/xlocale.c Modified: head/include/xlocale/_locale.h ============================================================================== --- head/include/xlocale/_locale.h Fri Jul 29 17:15:41 2016 (r303494) +++ head/include/xlocale/_locale.h Fri Jul 29 17:18:47 2016 (r303495) @@ -48,7 +48,7 @@ typedef struct _xlocale *locale_t; #endif locale_t duplocale(locale_t base); -int freelocale(locale_t loc); +void freelocale(locale_t loc); locale_t newlocale(int mask, const char *locale, locale_t base); const char *querylocale(int mask, locale_t loc); locale_t uselocale(locale_t loc); Modified: head/lib/libc/locale/freelocale.3 ============================================================================== --- head/lib/libc/locale/freelocale.3 Fri Jul 29 17:15:41 2016 (r303494) +++ head/lib/libc/locale/freelocale.3 Fri Jul 29 17:18:47 2016 (r303495) @@ -26,7 +26,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd September 17, 2011 +.Dd July 26, 2016 .Dt FREELOCALE 3 .Os .Sh NAME @@ -39,7 +39,7 @@ or .Lb libc .Sh SYNOPSIS .In locale.h -.Ft int +.Ft void .Fn freelocale "locale_t locale" .Sh DESCRIPTION Frees a @@ -47,8 +47,6 @@ Frees a This relinquishes any resources held exclusively by this locale. Note that locales share reference-counted components, so a call to this function is not guaranteed to free all of the components. -.Sh RETURN VALUES -Returns 0 on success or -1 on error. .Sh SEE ALSO .Xr duplocale 3 , .Xr localeconv 3 , @@ -57,12 +55,5 @@ Returns 0 on success or -1 on error. .Xr uselocale 3 , .Xr xlocale 3 .Sh STANDARDS -The -.Fn freelocale -function -differs from -.St -p1003.1-2008 -in that its return type is -.Vt int -rather than -.Vt void . +This function conforms to +.St -p1003.1-2008 . Modified: head/lib/libc/locale/xlocale.c ============================================================================== --- head/lib/libc/locale/xlocale.c Fri Jul 29 17:15:41 2016 (r303494) +++ head/lib/libc/locale/xlocale.c Fri Jul 29 17:18:47 2016 (r303495) @@ -325,20 +325,18 @@ locale_t duplocale(locale_t base) * Free a locale_t. This is quite a poorly named function. It actually * disclaims a reference to a locale_t, rather than freeing it. */ -int +void freelocale(locale_t loc) { - /* Fail if we're passed something that isn't a locale. */ - if ((NULL == loc) || (LC_GLOBAL_LOCALE == loc)) { - return (-1); - } - /* If we're passed the global locale, pretend that we freed it but don't - * actually do anything. */ - if (&__xlocale_global_locale == loc) { - return (0); - } - xlocale_release(loc); - return (0); + + /* + * Fail if we're passed something that isn't a locale. If we're + * passed the global locale, pretend that we freed it but don't + * actually do anything. + */ + if (loc != NULL && loc != LC_GLOBAL_LOCALE && + loc != &__xlocale_global_locale) + xlocale_release(loc); } /* From owner-svn-src-head@freebsd.org Fri Jul 29 17:54: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 A6F62BA8DB7; Fri, 29 Jul 2016 17:54:22 +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 6A5AE13E5; Fri, 29 Jul 2016 17:54:22 +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 u6THsLXF098041; Fri, 29 Jul 2016 17:54:21 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6THsLl5098040; Fri, 29 Jul 2016 17:54:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201607291754.u6THsLl5098040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 29 Jul 2016 17:54:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303497 - head/sys/dev/pci 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.22 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, 29 Jul 2016 17:54:22 -0000 Author: jhb Date: Fri Jul 29 17:54:21 2016 New Revision: 303497 URL: https://svnweb.freebsd.org/changeset/base/303497 Log: Add a loader tunable (hw.pci.enable_pcie_hp) to disable PCI-e HotPlug. Some systems and/or devices (such as riser cards) do not include a non-compliant implementation of PCI-e HotPlug that can result in devices not being attached (e.g. the HotPlug code might assume that a card is being unplugged and will power the slot off and detach it). This tunable can be set to 0 to disable support for PCI-e HotPlug ignoring the incorrect HotPlug state on these slots. PR: 211081 Reported by: Sergey Renkas (SuperMicro X7 riser card) Reported by: Jeffrey E Pieper (Intel X520 adapter) MFC after: 1 week Relnotes: yes Modified: head/sys/dev/pci/pci_pci.c Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Fri Jul 29 17:28:14 2016 (r303496) +++ head/sys/dev/pci/pci_pci.c Fri Jul 29 17:54:21 2016 (r303497) @@ -907,11 +907,19 @@ pcib_set_mem_decode(struct pcib_softc *s /* * PCI-express HotPlug support. */ +static int pci_enable_pcie_hp = 1; +SYSCTL_INT(_hw_pci, OID_AUTO, enable_pcie_hp, CTLFLAG_RDTUN, + &pci_enable_pcie_hp, 0, + "Enable support for native PCI-express HotPlug."); + static void pcib_probe_hotplug(struct pcib_softc *sc) { device_t dev; + if (!pci_enable_pcie_hp) + return; + dev = sc->dev; if (pci_find_cap(dev, PCIY_EXPRESS, NULL) != 0) return; From owner-svn-src-head@freebsd.org Fri Jul 29 17: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 E9275BA8E17; Fri, 29 Jul 2016 17:55:39 +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 BBB2515FF; Fri, 29 Jul 2016 17:55:39 +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 u6THtcLu098169; Fri, 29 Jul 2016 17:55:38 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6THtcWh098168; Fri, 29 Jul 2016 17:55:38 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201607291755.u6THtcWh098168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 29 Jul 2016 17:55:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303498 - head/usr.bin/indent 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.22 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, 29 Jul 2016 17:55:40 -0000 Author: pfg Date: Fri Jul 29 17:55:38 2016 New Revision: 303498 URL: https://svnweb.freebsd.org/changeset/base/303498 Log: Revert r303487: Wrong commit log. Will be brought back with the correct log. Modified: head/usr.bin/indent/lexi.c Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Fri Jul 29 17:54:21 2016 (r303497) +++ head/usr.bin/indent/lexi.c Fri Jul 29 17:55:38 2016 (r303498) @@ -191,13 +191,15 @@ lexi(void) } } while (1) { - if (!(seensfx & 1) && (*buf_ptr == 'U' || *buf_ptr == 'u')) { + if (!(seensfx & 1) && + (*buf_ptr == 'U' || *buf_ptr == 'u')) { CHECK_SIZE_TOKEN; *e_token++ = *buf_ptr++; seensfx |= 1; continue; } - if (!(seensfx & 2) && strchr("fFlL", *buf_ptr)) { + if (!(seensfx & 2) && + (*buf_ptr == 'L' || *buf_ptr == 'l')) { CHECK_SIZE_TOKEN; if (buf_ptr[1] == buf_ptr[0]) *e_token++ = *buf_ptr++; From owner-svn-src-head@freebsd.org Fri Jul 29 18:00: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 70096BA8F35; Fri, 29 Jul 2016 18:00:11 +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 42E0B17EE; Fri, 29 Jul 2016 18:00:11 +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 u6TI0AuC098432; Fri, 29 Jul 2016 18:00:10 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TI0Acv098431; Fri, 29 Jul 2016 18:00:10 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201607291800.u6TI0Acv098431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 29 Jul 2016 18:00:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303499 - head/usr.bin/indent 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.22 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, 29 Jul 2016 18:00:11 -0000 Author: pfg Date: Fri Jul 29 18:00:10 2016 New Revision: 303499 URL: https://svnweb.freebsd.org/changeset/base/303499 Log: indent(1): Support "f" and "F" floating constant suffixes. Actually this just brings back r303487 with the correct commit log. Differential Revision: https://reviews.freebsd.org/D6966 (Partial) Obtained from: Piotr Stefaniak Modified: head/usr.bin/indent/lexi.c Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Fri Jul 29 17:55:38 2016 (r303498) +++ head/usr.bin/indent/lexi.c Fri Jul 29 18:00:10 2016 (r303499) @@ -191,15 +191,13 @@ lexi(void) } } while (1) { - if (!(seensfx & 1) && - (*buf_ptr == 'U' || *buf_ptr == 'u')) { + if (!(seensfx & 1) && (*buf_ptr == 'U' || *buf_ptr == 'u')) { CHECK_SIZE_TOKEN; *e_token++ = *buf_ptr++; seensfx |= 1; continue; } - if (!(seensfx & 2) && - (*buf_ptr == 'L' || *buf_ptr == 'l')) { + if (!(seensfx & 2) && strchr("fFlL", *buf_ptr)) { CHECK_SIZE_TOKEN; if (buf_ptr[1] == buf_ptr[0]) *e_token++ = *buf_ptr++; From owner-svn-src-head@freebsd.org Fri Jul 29 18:04: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 0B721BA70FB; Fri, 29 Jul 2016 18:04:04 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x232.google.com (mail-pf0-x232.google.com [IPv6:2607:f8b0:400e:c00::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 D11391C58; Fri, 29 Jul 2016 18:04:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x232.google.com with SMTP id y134so34822127pfg.0; Fri, 29 Jul 2016 11:04:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=alTPm5iCtjB38I+cFxW1hxUH+DeSV0dLvFxGBd4bx14=; b=FaWFxafQfMA5vhgBXb/Z2fx5v+ECyqITJLM5PumBSP5ZUAQIFPgxD4x7BmRnot602g Uoz0MdTxePh1EroB4DD54Hezym6LzLc9LryHTNKvlfjuLJJ3yaa+ocWnziGGHv5U+b6i 2c/nlvxYiC/H42zyrj1cnaZ45MS3BXWCVPh/4bGbNIA6Lq3b92RSHJDnWa/aveNyhuiM R/VdlxFeNCR/kK5EWJHDhB38dszJNxphkQJQ8UTL2HNCARBnuND00kklUaO5K0Yu/1Uz ulIHmvjBF4Y5YmTeQlqGB+PPhmjzCJHGozFPozPfQY+O7mfWChCWCygql78WY+fBiftn xyMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=alTPm5iCtjB38I+cFxW1hxUH+DeSV0dLvFxGBd4bx14=; b=MKupJBHqKNoaj/JtB4Lw9zBsG8913dMxvpIBgumAzjaNhSDuD3rpXDsz1RDFMGxQHN /ByF7/3++M/39cJ3usPDuXDBAfkfkjf+3itFj5P5NPdttvrdb/di9jcaDX4wPJvMdfKC mngDRnh/zAiw1zCyqi/KOT8l6zwHPWFLkfoiBwOD/xssLvLdFjQdDplQYeO+uRR9imEz dI83DdV01JhilYpZ6YlIVOdBD51JJS5i0miI0veCVDjHuPtRnikWv4V7lCANHsn4cEWO bFCjl97X62ugXYn0enCFL69DOxJ78gJdTOXcX2QLYwldS8VNPGcaitGz1ngKLCtCjC0j JSlA== X-Gm-Message-State: AEkoousm7lWfB8Lmh1ZCWzNUDjgZXmrHPVAiCMsOilooVCny29F3TLCmzJpg27FC8gLwBw== X-Received: by 10.98.134.77 with SMTP id x74mr70939115pfd.21.1469815443128; Fri, 29 Jul 2016 11:04:03 -0700 (PDT) Received: from [100.199.216.151] ([172.56.42.25]) by smtp.gmail.com with ESMTPSA id h66sm26582766pfe.58.2016.07.29.11.04.02 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Jul 2016 11:04:02 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r303497 - head/sys/dev/pci From: Ngie Cooper X-Mailer: iPhone Mail (13F69) In-Reply-To: <201607291754.u6THsLl5098040@repo.freebsd.org> Date: Fri, 29 Jul 2016 11:04:01 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: References: <201607291754.u6THsLl5098040@repo.freebsd.org> To: John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 29 Jul 2016 18:04:04 -0000 > On Jul 29, 2016, at 10:54, John Baldwin wrote: > > Author: jhb > Date: Fri Jul 29 17:54:21 2016 > New Revision: 303497 > URL: https://svnweb.freebsd.org/changeset/base/303497 > > Log: > Add a loader tunable (hw.pci.enable_pcie_hp) to disable PCI-e HotPlug. > > Some systems and/or devices (such as riser cards) do not include a > non-compliant implementation of PCI-e HotPlug that can result in devices > not being attached (e.g. the HotPlug code might assume that a card is > being unplugged and will power the slot off and detach it). This > tunable can be set to 0 to disable support for PCI-e HotPlug ignoring > the incorrect HotPlug state on these slots. > > PR: 211081 > Reported by: Sergey Renkas (SuperMicro X7 riser card) > Reported by: Jeffrey E Pieper > (Intel X520 adapter) > MFC after: 1 week > Relnotes: yes Should this be done on a per-bus basis? Thanks! -Ngie From owner-svn-src-head@freebsd.org Fri Jul 29 18:10: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 0366FBA7352 for ; Fri, 29 Jul 2016 18:10:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm16.bullet.mail.bf1.yahoo.com (nm16.bullet.mail.bf1.yahoo.com [98.139.212.175]) (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 AF3E51237 for ; Fri, 29 Jul 2016 18:10:19 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1469815818; bh=QVzCnp47ozMBuvYChquj8AUQlkv/5Fhrh4TJu4L2ZC0=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=gkjkTII44WvcpQS+55GA9NRvc1NUIjdOKsDeah5KEnoHhkFryJkc14E9dKaVCJWdVemsH2vNXuu2be4HqwJ2ZGeNVWhcIGPfHzuh+Ycsigg/sv0ZxT7j1XY3hyUSZ+tUlE7CRzIFS5TNvF4T7skBd/azJwFF27AcypyBydAwNvQyWbsQmjCcOgjfGvAWBVVxPwX7Rs57HbeeIGe4LUvjT6JUhy6Pyj0h3cfjWOmuWTdfkAWCvil9y1XENuqs/OiUgm2CRQbvJTFVi3/tgCfq8ZiXS0QRAqZzttmY2mD6aOJwkj/ps0dBJWGQfjMQ934p32bn4mF2sStqyRn5EbnXsQ== Received: from [66.196.81.171] by nm16.bullet.mail.bf1.yahoo.com with NNFMP; 29 Jul 2016 18:10:18 -0000 Received: from [68.142.230.77] by tm17.bullet.mail.bf1.yahoo.com with NNFMP; 29 Jul 2016 18:10:18 -0000 Received: from [127.0.0.1] by smtp234.mail.bf1.yahoo.com with NNFMP; 29 Jul 2016 18:10:18 -0000 X-Yahoo-Newman-Id: 98285.36077.bm@smtp234.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: zuMEhNUVM1nqekJ2hvojiTOWvdF7XVgCIRvomHfwp6kAF3t l3gp60G6qeWWIZUKgguFqahjMvfgxEmmy08B99FhJyD1YQ4BlFv0Hyg5QpWO tuGNW3GR2rWmP1MAm7rKVL_fBuIJOb6pJ7vWZC4XyTmceg..lNB71mKDET1i of1jDiuiC.LUsUKn4ycB2VHgrQxcxsA5DZnD1K.UxITFkzfX.XwMfCcovteG scvLx73ZZxywaYbZmgQXtHcMkF5iTBnjwyhgG9.0O.qznNC_MP7DYBYFgvKL HNPZrg.ODQ7i2WgGAJbKlPwRuR1pQBK3ZuXAxqpNbnfT5b2hnDfExekn6cZt Bo82_OduSNV4GCQ7Q9_pExQ8BgXXBGDp3TB4rTioAolDGqOxWwkZDqkpSZW1 W4wyEQHDoNZTJCJh2b8AmDXHiwHydQLT5XJ6j3OyGlu.csnvd8zTNzX3eI7. eZKICUULiiNmE5rFnnD_5SX8q6qluIFYutZIwxZrgVgqMDzVtNGqOZQOaf.v UFIOXFNrvLw.xv7qch0EvhQwrx1SOxJhtsO7nzT9.HiDJ4A-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r303484 - head/usr.bin/indent To: Benjamin Kaduk References: <201607291617.u6TGHsPE060673@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Pedro Giffuni Message-ID: Date: Fri, 29 Jul 2016 13:10:26 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.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.22 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, 29 Jul 2016 18:10:20 -0000 On 07/29/16 11:24, Benjamin Kaduk wrote: > On Fri, Jul 29, 2016 at 11:20 AM, Benjamin Kaduk > wrote: > > On Fri, Jul 29, 2016 at 11:17 AM, Pedro F. Giffuni > wrote: > > Author: pfg > Date: Fri Jul 29 16:17:54 2016 > New Revision: 303484 > URL: https://svnweb.freebsd.org/changeset/base/303484 > > Log: > indent(1): Fix breakage caused by single comment following "else". > > indent(1) simply wasn't taught that "else" may be followed by > a comment > without any opening brace anywhere on the line, so it was very > confused > in such cases. > > > Wrong commit message? I see no 'else' in this change. > (I guess core's guidance is to revert and recommit with correct > message, these days.) > > > Nevermind, I think I see what's going on here, now. > No problem. It would be great to have more eyes helping review the changes here: https://github.com/pstef/freebsd_indent/commits/master I only got started with a first batch of them. Regards, Pedro. From owner-svn-src-head@freebsd.org Fri Jul 29 18: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 25AFDBA7639; Fri, 29 Jul 2016 18:13:09 +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 060F217FE; Fri, 29 Jul 2016 18:13:09 +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 13A19B945; Fri, 29 Jul 2016 14:13:07 -0400 (EDT) From: John Baldwin To: Ngie Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303497 - head/sys/dev/pci Date: Fri, 29 Jul 2016 11:11:27 -0700 Message-ID: <2350179.pmqWqTZJad@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: References: <201607291754.u6THsLl5098040@repo.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); Fri, 29 Jul 2016 14:13:07 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 29 Jul 2016 18:13:09 -0000 On Friday, July 29, 2016 11:04:01 AM Ngie Cooper wrote: > > > On Jul 29, 2016, at 10:54, John Baldwin wrote: > > > > Author: jhb > > Date: Fri Jul 29 17:54:21 2016 > > New Revision: 303497 > > URL: https://svnweb.freebsd.org/changeset/base/303497 > > > > Log: > > Add a loader tunable (hw.pci.enable_pcie_hp) to disable PCI-e HotPlug. > > > > Some systems and/or devices (such as riser cards) do not include a > > non-compliant implementation of PCI-e HotPlug that can result in devices > > not being attached (e.g. the HotPlug code might assume that a card is > > being unplugged and will power the slot off and detach it). This > > tunable can be set to 0 to disable support for PCI-e HotPlug ignoring > > the incorrect HotPlug state on these slots. > > > > PR: 211081 > > Reported by: Sergey Renkas (SuperMicro X7 riser card) > > Reported by: Jeffrey E Pieper > > (Intel X520 adapter) > > MFC after: 1 week > > Relnotes: yes > > Should this be done on a per-bus basis? For now this is just a way to disable it globally. If need be we could add a separate hint to do it per-bridge (hint.pcib.X.hp=0/1 or some such). I'm still working with the Intel folks to see if I can narrow down exactly what makes this chip unhappy to see if I can include a workaround. Both of these devices use a chip from PLX to manage an internal PCI bridge. In both cases the PLX chip reports that a mechnical latch is open (PCI HP supports an optional latch that can be opened to release a card so it can be removed), but neither device has a real latch (so the sensor has not been wired correctly in either device). However, just bypassing the sensor check isn't sufficient to allow the devices behind the bridge to probe. -- John Baldwin From owner-svn-src-head@freebsd.org Fri Jul 29 18:18: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 4E66EBA76D3 for ; Fri, 29 Jul 2016 18:18:28 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm46-vm5.bullet.mail.bf1.yahoo.com (nm46-vm5.bullet.mail.bf1.yahoo.com [216.109.115.108]) (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 07AE11A40 for ; Fri, 29 Jul 2016 18:18:27 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1469814666; bh=tH2dIaQeYjixIstTI07uq8FTVkw6D2trEChBUwsz6I0=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=EOPflyX5srl18jGT5VGklxqShunaA0bujyjPGbpuAIrZhh00iz/NaZ5HGewD1djdAiC+2WdZXgywHvQiNFbwDPAYdzKUBVHHnWUChk+lCgCmsHS39CUa+cRcp1f7G5Q6aQDFW8TOHHpH9p1706dVyTubqxoOT0fk4PprFZNn42jH/igliGaETCho3Gq1HsJXd6y8nPQ7nWOIS4yb4YL2JDrm39biMe0p4U6ZvfXbbTISWWKKSjtmEAInsWmrd8L0FqM3saCtTif4KFqKqPVG63NUusAMBLjXnSQ4oy0OYlrMMdlBl5p8mzzYG5nN8WWn4ydE9ACLMGFW1gro7sfKBg== Received: from [66.196.81.172] by nm46.bullet.mail.bf1.yahoo.com with NNFMP; 29 Jul 2016 17:51:06 -0000 Received: from [98.139.213.11] by tm18.bullet.mail.bf1.yahoo.com with NNFMP; 29 Jul 2016 17:51:06 -0000 Received: from [127.0.0.1] by smtp111.mail.bf1.yahoo.com with NNFMP; 29 Jul 2016 17:51:06 -0000 X-Yahoo-Newman-Id: 760962.50589.bm@smtp111.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: ehjq8DMVM1kirzJu1ypBlA.5R7pAJtm8H2Js7pF3lwhdU5P D1tMsi8I2aP3qHmaeiIYPVmGa6X_e_7kiZUAoqWZo2H3pRJgd2qHoAsr9m5b jifhxivGGQaYy9.4dGyQu6PIoUZZL9ciH43ywMiWfH9Q5tE.Kl.f__RcdLJx LJwZtl8MlpTB_wxeRAjI09NnQsy2c_ie_hdrVVbW4iqLgH9VUKynAv85Gt4F nVg93kJRZxuovCCu.O9ziJvNWDURX2rH2XRrV72gyUwMDJVURrgqZ9uMA4XT ofxC8n22s4WHabVH1Uh_E4gGLUbmJHFZwXV_KLnhiXOgi0rZ9NSUXX0OUe9Q tKGofHAIszVvYN6Xdpsb1H4w2TN64Lxz_xDTn3eRyfAT5uRKt.Y709IeIakf Gcby8F0m8HDwr5ONzPo9eSTXM8TLuOGcR6C16_oelMzazHGldrZKtzoR2F7A HPBbqJpY.NR27x0Xn3B_ZR4RgiDJfnYqqTlwjqGsFvkX4Gd8LXSesLxK6XZM wksEx9YIkG4tJRexouSsrtUNC71IBvo5CXMybi4RcNe6yRA-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r303487 - head/usr.bin/indent To: Piotr Stefaniak , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201607291628.u6TGSpKT064605@repo.freebsd.org> From: Pedro Giffuni Message-ID: <2ca98ccf-4c45-530a-0a60-cfc4e964d395@FreeBSD.org> Date: Fri, 29 Jul 2016 12:51:14 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: 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.22 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, 29 Jul 2016 18:18:28 -0000 On 07/29/16 12:06, Piotr Stefaniak wrote: > On 2016-07-29 18:28, Pedro F. Giffuni wrote: >> Author: pfg >> Date: Fri Jul 29 16:28:51 2016 >> New Revision: 303487 >> URL: https://svnweb.freebsd.org/changeset/base/303487 >> >> Log: >> indent(1): fix struct termination detection. >> >> Small style cleanup while here. > > Wrong commit message. Actually committed here is: Support "f" and "F" > floating constant suffixes. > Argggh .. yes will fix sorry.. will fix.. reverting :(. Pedro. From owner-svn-src-head@freebsd.org Fri Jul 29 18:26: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 EABE9BA78EF; Fri, 29 Jul 2016 18:26:16 +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 C4D4E1EA9; Fri, 29 Jul 2016 18:26:16 +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 u6TIQF7X009125; Fri, 29 Jul 2016 18:26:15 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TIQFlM009123; Fri, 29 Jul 2016 18:26:15 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201607291826.u6TIQFlM009123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 29 Jul 2016 18:26:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303501 - in head: sys/kern tests/sys/aio 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.22 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, 29 Jul 2016 18:26:17 -0000 Author: jhb Date: Fri Jul 29 18:26:15 2016 New Revision: 303501 URL: https://svnweb.freebsd.org/changeset/base/303501 Log: Fix locking issues with aio_fsync(). - Use correct lock in aio_cancel_sync when dequeueing job. - Add _locked variants of aio_set/clear_cancel_function and use those to avoid lock recursion when adding and removing fsync jobs to the per-process sync queue. - While here, add a basic test for aio_fsync(). PR: 211390 Reported by: Randy Westlund MFC after: 1 week Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D7339 Modified: head/sys/kern/vfs_aio.c head/tests/sys/aio/aio_test.c Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Fri Jul 29 18:10:59 2016 (r303500) +++ head/sys/kern/vfs_aio.c Fri Jul 29 18:26:15 2016 (r303501) @@ -311,6 +311,7 @@ static void aio_proc_rundown_exec(void * static int aio_qphysio(struct proc *p, struct kaiocb *job); static void aio_daemon(void *param); static void aio_bio_done_notify(struct proc *userp, struct kaiocb *job); +static bool aio_clear_cancel_function_locked(struct kaiocb *job); static int aio_kick(struct proc *userp); static void aio_kick_nowait(struct proc *userp); static void aio_kick_helper(void *context, int pending); @@ -919,7 +920,7 @@ notification_done: if (--sjob->pending > 0) continue; TAILQ_REMOVE(&ki->kaio_syncqueue, sjob, list); - if (!aio_clear_cancel_function(sjob)) + if (!aio_clear_cancel_function_locked(sjob)) continue; TAILQ_INSERT_TAIL(&ki->kaio_syncready, sjob, list); schedule_fsync = true; @@ -967,40 +968,57 @@ aio_cancel_cleared(struct kaiocb *job) return ((job->jobflags & KAIOCB_CLEARED) != 0); } -bool -aio_clear_cancel_function(struct kaiocb *job) +static bool +aio_clear_cancel_function_locked(struct kaiocb *job) { - struct kaioinfo *ki; - ki = job->userproc->p_aioinfo; - AIO_LOCK(ki); + AIO_LOCK_ASSERT(job->userproc->p_aioinfo, MA_OWNED); MPASS(job->cancel_fn != NULL); if (job->jobflags & KAIOCB_CANCELLING) { job->jobflags |= KAIOCB_CLEARED; - AIO_UNLOCK(ki); return (false); } job->cancel_fn = NULL; - AIO_UNLOCK(ki); return (true); } bool -aio_set_cancel_function(struct kaiocb *job, aio_cancel_fn_t *func) +aio_clear_cancel_function(struct kaiocb *job) { struct kaioinfo *ki; + bool ret; ki = job->userproc->p_aioinfo; AIO_LOCK(ki); - if (job->jobflags & KAIOCB_CANCELLED) { - AIO_UNLOCK(ki); + ret = aio_clear_cancel_function_locked(job); + AIO_UNLOCK(ki); + return (ret); +} + +static bool +aio_set_cancel_function_locked(struct kaiocb *job, aio_cancel_fn_t *func) +{ + + AIO_LOCK_ASSERT(job->userproc->p_aioinfo, MA_OWNED); + if (job->jobflags & KAIOCB_CANCELLED) return (false); - } job->cancel_fn = func; - AIO_UNLOCK(ki); return (true); } +bool +aio_set_cancel_function(struct kaiocb *job, aio_cancel_fn_t *func) +{ + struct kaioinfo *ki; + bool ret; + + ki = job->userproc->p_aioinfo; + AIO_LOCK(ki); + ret = aio_set_cancel_function_locked(job, func); + AIO_UNLOCK(ki); + return (ret); +} + void aio_complete(struct kaiocb *job, long status, int error) { @@ -1655,10 +1673,10 @@ aio_cancel_sync(struct kaiocb *job) struct kaioinfo *ki; ki = job->userproc->p_aioinfo; - mtx_lock(&aio_job_mtx); + AIO_LOCK(ki); if (!aio_cancel_cleared(job)) TAILQ_REMOVE(&ki->kaio_syncqueue, job, list); - mtx_unlock(&aio_job_mtx); + AIO_UNLOCK(ki); aio_cancel(job); } @@ -1718,7 +1736,8 @@ queueit: } } if (job->pending != 0) { - if (!aio_set_cancel_function(job, aio_cancel_sync)) { + if (!aio_set_cancel_function_locked(job, + aio_cancel_sync)) { AIO_UNLOCK(ki); aio_cancel(job); return (0); Modified: head/tests/sys/aio/aio_test.c ============================================================================== --- head/tests/sys/aio/aio_test.c Fri Jul 29 18:10:59 2016 (r303500) +++ head/tests/sys/aio/aio_test.c Fri Jul 29 18:26:15 2016 (r303501) @@ -924,6 +924,88 @@ ATF_TC_BODY(aio_socket_short_write_cance close(s[0]); } +/* + * This test just performs a basic test of aio_fsync(). + */ +ATF_TC_WITHOUT_HEAD(aio_fsync_test); +ATF_TC_BODY(aio_fsync_test, tc) +{ + struct aiocb synccb, *iocbp; + struct { + struct aiocb iocb; + bool done; + char *buffer; + } buffers[16]; + struct stat sb; + char pathname[PATH_MAX]; + ssize_t rval; + unsigned i; + int fd; + + ATF_REQUIRE_KERNEL_MODULE("aio"); + ATF_REQUIRE_UNSAFE_AIO(); + + strcpy(pathname, PATH_TEMPLATE); + fd = mkstemp(pathname); + ATF_REQUIRE_MSG(fd != -1, "mkstemp failed: %s", strerror(errno)); + unlink(pathname); + + ATF_REQUIRE(fstat(fd, &sb) == 0); + ATF_REQUIRE(sb.st_blksize != 0); + ATF_REQUIRE(ftruncate(fd, sb.st_blksize * nitems(buffers)) == 0); + + /* + * Queue several asynchronous write requests. Hopefully this + * forces the aio_fsync() request to be deferred. There is no + * reliable way to guarantee that however. + */ + srandomdev(); + for (i = 0; i < nitems(buffers); i++) { + buffers[i].done = false; + memset(&buffers[i].iocb, 0, sizeof(buffers[i].iocb)); + buffers[i].buffer = malloc(sb.st_blksize); + aio_fill_buffer(buffers[i].buffer, sb.st_blksize, random()); + buffers[i].iocb.aio_fildes = fd; + buffers[i].iocb.aio_buf = buffers[i].buffer; + buffers[i].iocb.aio_nbytes = sb.st_blksize; + buffers[i].iocb.aio_offset = sb.st_blksize * i; + ATF_REQUIRE(aio_write(&buffers[i].iocb) == 0); + } + + /* Queue the aio_fsync request. */ + memset(&synccb, 0, sizeof(synccb)); + synccb.aio_fildes = fd; + ATF_REQUIRE(aio_fsync(O_SYNC, &synccb) == 0); + + /* Wait for requests to complete. */ + for (;;) { + next: + rval = aio_waitcomplete(&iocbp, NULL); + ATF_REQUIRE(iocbp != NULL); + if (iocbp == &synccb) { + ATF_REQUIRE(rval == 0); + break; + } + + for (i = 0; i < nitems(buffers); i++) { + if (iocbp == &buffers[i].iocb) { + ATF_REQUIRE(buffers[i].done == false); + ATF_REQUIRE(rval == sb.st_blksize); + buffers[i].done = true; + goto next; + } + } + + ATF_REQUIRE_MSG(false, "unmatched AIO request"); + } + + for (i = 0; i < nitems(buffers); i++) + ATF_REQUIRE_MSG(buffers[i].done, + "AIO request %u did not complete", i); + + close(fd); +} + ATF_TP_ADD_TCS(tp) { @@ -937,6 +1019,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, aio_socket_two_reads); ATF_TP_ADD_TC(tp, aio_socket_blocking_short_write); ATF_TP_ADD_TC(tp, aio_socket_short_write_cancel); + ATF_TP_ADD_TC(tp, aio_fsync_test); return (atf_no_error()); } From owner-svn-src-head@freebsd.org Fri Jul 29 18:27: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 95535BA7986; Fri, 29 Jul 2016 18:27:30 +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 73DD711C8; Fri, 29 Jul 2016 18:27:30 +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 888DCB945; Fri, 29 Jul 2016 14:27:29 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303501 - in head: sys/kern tests/sys/aio Date: Fri, 29 Jul 2016 11:27:25 -0700 Message-ID: <1511522.uQBgSzC5yd@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201607291826.u6TIQFlM009123@repo.freebsd.org> References: <201607291826.u6TIQFlM009123@repo.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); Fri, 29 Jul 2016 14:27:29 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 29 Jul 2016 18:27:30 -0000 On Friday, July 29, 2016 06:26:15 PM John Baldwin wrote: > Author: jhb > Date: Fri Jul 29 18:26:15 2016 > New Revision: 303501 > URL: https://svnweb.freebsd.org/changeset/base/303501 > > Log: > Fix locking issues with aio_fsync(). > > - Use correct lock in aio_cancel_sync when dequeueing job. > - Add _locked variants of aio_set/clear_cancel_function and use those > to avoid lock recursion when adding and removing fsync jobs to the > per-process sync queue. > - While here, add a basic test for aio_fsync(). > > PR: 211390 > Reported by: Randy Westlund > MFC after: 1 week > Sponsored by: Chelsio Communications > Differential Revision: https://reviews.freebsd.org/D7339 Oops, missed: Reviewed by: kib -- John Baldwin From owner-svn-src-head@freebsd.org Fri Jul 29 19:36: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 502A3BA8EBD; Fri, 29 Jul 2016 19:36:12 +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 27B15175D; Fri, 29 Jul 2016 19:36:12 +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 u6TJaB9I035135; Fri, 29 Jul 2016 19:36:11 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TJaALj035130; Fri, 29 Jul 2016 19:36:10 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201607291936.u6TJaALj035130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 29 Jul 2016 19:36:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303502 - head/usr.bin/indent 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.22 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, 29 Jul 2016 19:36:12 -0000 Author: pfg Date: Fri Jul 29 19:36:10 2016 New Revision: 303502 URL: https://svnweb.freebsd.org/changeset/base/303502 Log: indent(1): Use NULL instead of zero for pointers. Modified: head/usr.bin/indent/args.c head/usr.bin/indent/indent.c head/usr.bin/indent/io.c head/usr.bin/indent/lexi.c head/usr.bin/indent/pr_comment.c Modified: head/usr.bin/indent/args.c ============================================================================== --- head/usr.bin/indent/args.c Fri Jul 29 18:26:15 2016 (r303501) +++ head/usr.bin/indent/args.c Fri Jul 29 19:36:10 2016 (r303502) @@ -280,9 +280,9 @@ found: break; case STDIN: - if (input == 0) + if (input == NULL) input = stdin; - if (output == 0) + if (output == NULL) output = stdout; break; Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Fri Jul 29 18:26:15 2016 (r303501) +++ head/usr.bin/indent/indent.c Fri Jul 29 19:36:10 2016 (r303502) @@ -147,11 +147,11 @@ main(int argc, char **argv) scase = ps.pcase = false; squest = 0; - sc_end = 0; - bp_save = 0; - be_save = 0; + sc_end = NULL; + bp_save = NULL; + be_save = NULL; - output = 0; + output = NULL; tabs_to_var = 0; /*--------------------------------------------------*\ @@ -328,7 +328,7 @@ main(int argc, char **argv) case lbrace: /* this is a brace that starts the compound * stmt */ - if (sc_end == 0) { /* ignore buffering if a comment wasn't + if (sc_end == NULL) { /* ignore buffering if a comment wasn't * stored up */ ps.search_brace = false; goto check_type; @@ -341,8 +341,8 @@ main(int argc, char **argv) } case comment: /* we have a comment, so we must copy it into * the buffer */ - if (!flushed_nl || sc_end != 0) { - if (sc_end == 0) { /* if this is the first comment, we + if (!flushed_nl || sc_end != NULL) { + if (sc_end == NULL) { /* if this is the first comment, we * must set up the buffer */ save_com[0] = save_com[1] = ' '; sc_end = &(save_com[2]); @@ -386,7 +386,7 @@ main(int argc, char **argv) && e_code != s_code && e_code[-1] == '}')) force_nl = false; - if (sc_end == 0) { /* ignore buffering if comment wasn't + if (sc_end == NULL) { /* ignore buffering if comment wasn't * saved up */ ps.search_brace = false; goto check_type; @@ -417,7 +417,7 @@ main(int argc, char **argv) * save_com */ *sc_end++ = ' ';/* add trailing blank, just in case */ buf_end = sc_end; - sc_end = 0; + sc_end = NULL; break; } /* end of switch */ if (type_code != 0) /* we must make this check, just in case there @@ -1101,9 +1101,9 @@ check_type: while (e_lab > s_lab && (e_lab[-1] == ' ' || e_lab[-1] == '\t')) e_lab--; - if (e_lab - s_lab == com_end && bp_save == 0) { /* comment on - * preprocessor line */ - if (sc_end == 0) /* if this is the first comment, we + /* comment on preprocessor line */ + if (e_lab - s_lab == com_end && bp_save == NULL) { + if (sc_end == NULL) /* if this is the first comment, we * must set up the buffer */ sc_end = &(save_com[0]); else { @@ -1126,7 +1126,7 @@ check_type: * save_com */ *sc_end++ = ' '; /* add trailing blank, just in case */ buf_end = sc_end; - sc_end = 0; + sc_end = NULL; } *e_lab = '\0'; /* null terminate line */ ps.pcase = false; Modified: head/usr.bin/indent/io.c ============================================================================== --- head/usr.bin/indent/io.c Fri Jul 29 18:26:15 2016 (r303501) +++ head/usr.bin/indent/io.c Fri Jul 29 19:36:10 2016 (r303502) @@ -348,10 +348,10 @@ fill_buffer(void) int i; FILE *f = input; - if (bp_save != 0) { /* there is a partly filled input buffer left */ + if (bp_save != NULL) { /* there is a partly filled input buffer left */ buf_ptr = bp_save; /* dont read anything, just switch buffers */ buf_end = be_save; - bp_save = be_save = 0; + bp_save = be_save = NULL; if (buf_ptr < buf_end) return; /* only return if there is really something in * this buffer */ Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Fri Jul 29 18:26:15 2016 (r303501) +++ head/usr.bin/indent/lexi.c Fri Jul 29 19:36:10 2016 (r303502) @@ -262,7 +262,7 @@ lexi(void) /* * This loop will check if the token is a keyword. */ - for (p = specials; (j = p->rwd) != 0; p++) { + for (p = specials; (j = p->rwd) != NULL; p++) { const char *q = s_token; /* point at scanned token */ if (*j++ != *q++ || *j++ != *q++) continue; /* This test depends on the fact that @@ -601,6 +601,6 @@ addkey(char *key, int val) * ignored */ p->rwd = key; p->rwcode = val; - p[1].rwd = 0; + p[1].rwd = NULL; p[1].rwcode = 0; } Modified: head/usr.bin/indent/pr_comment.c ============================================================================== --- head/usr.bin/indent/pr_comment.c Fri Jul 29 18:26:15 2016 (r303501) +++ head/usr.bin/indent/pr_comment.c Fri Jul 29 19:36:10 2016 (r303502) @@ -100,7 +100,7 @@ pr_comment(void) int one_liner = 1; /* true iff this comment is a one-liner */ adj_max_col = max_col; ps.just_saw_decl = 0; - last_bl = 0; /* no blanks found so far */ + last_bl = NULL; /* no blanks found so far */ ps.box_com = false; /* at first, assume that we are not in * a boxed comment or some other * comment that should not be touched */ @@ -196,7 +196,7 @@ pr_comment(void) ps.use_ff = true; /* fix so dump_line uses a form feed */ dump_line(); - last_bl = 0; + last_bl = NULL; *e_com++ = ' '; *e_com++ = '*'; *e_com++ = ' '; @@ -392,7 +392,7 @@ pr_comment(void) e_com = t; s_com[0] = s_com[1] = s_com[2] = ' '; } - if (last_bl == 0) { /* we have seen no blanks */ + if (last_bl == NULL) { /* we have seen no blanks */ last_bl = e_com; /* fake it */ *e_com++ = ' '; } @@ -408,7 +408,7 @@ pr_comment(void) *e_com++ = ' '; t_ptr = last_bl + 1; - last_bl = 0; + last_bl = NULL; if (t_ptr >= e_com) { while (*t_ptr == ' ' || *t_ptr == '\t') t_ptr++; From owner-svn-src-head@freebsd.org Fri Jul 29 20:19: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 D2E69BA8AE6; Fri, 29 Jul 2016 20:19:15 +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 A39B21355; Fri, 29 Jul 2016 20:19:15 +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 u6TKJEf2050272; Fri, 29 Jul 2016 20:19:14 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TKJE98050271; Fri, 29 Jul 2016 20:19:14 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201607292019.u6TKJE98050271@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 29 Jul 2016 20:19:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303503 - 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.22 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, 29 Jul 2016 20:19:15 -0000 Author: jhb Date: Fri Jul 29 20:19:14 2016 New Revision: 303503 URL: https://svnweb.freebsd.org/changeset/base/303503 Log: Don't treat NOCPU as a valid CPU to CPU_ISSET. If a thread is created bound to a cpuset it might already be bound before it's very first timeslice, and td_lastcpu will be NOCPU in that case. MFC after: 1 week Modified: head/sys/kern/sched_4bsd.c Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Fri Jul 29 19:36:10 2016 (r303502) +++ head/sys/kern/sched_4bsd.c Fri Jul 29 20:19:14 2016 (r303503) @@ -1241,7 +1241,7 @@ sched_pickcpu(struct thread *td) mtx_assert(&sched_lock, MA_OWNED); - if (THREAD_CAN_SCHED(td, td->td_lastcpu)) + if (td->td_lastcpu != NOCPU && THREAD_CAN_SCHED(td, td->td_lastcpu)) best = td->td_lastcpu; else best = NOCPU; From owner-svn-src-head@freebsd.org Fri Jul 29 20:33: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 81CEFBA8FA8; Fri, 29 Jul 2016 20:33:44 +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 38F071C7F; Fri, 29 Jul 2016 20:33:44 +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 u6TKXhEi057257; Fri, 29 Jul 2016 20:33:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TKXhBa057256; Fri, 29 Jul 2016 20:33:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201607292033.u6TKXhBa057256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 29 Jul 2016 20:33:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303504 - head/sys/ofed/drivers/infiniband/ulp/sdp 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.22 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, 29 Jul 2016 20:33:44 -0000 Author: markj Date: Fri Jul 29 20:33:43 2016 New Revision: 303504 URL: https://svnweb.freebsd.org/changeset/base/303504 Log: sdp: Remove Linux build files. They aren't useful here, and Linux seems to have largely abandoned SDP anyway. Sponsored by: EMC / Isilon Storage Division Deleted: head/sys/ofed/drivers/infiniband/ulp/sdp/Kconfig head/sys/ofed/drivers/infiniband/ulp/sdp/Makefile From owner-svn-src-head@freebsd.org Fri Jul 29 20:35: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 632BCBA80E1; Fri, 29 Jul 2016 20:35:06 +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 170FF1E36; Fri, 29 Jul 2016 20:35:06 +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 u6TKZ518057366; Fri, 29 Jul 2016 20:35:05 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TKZ4n8057363; Fri, 29 Jul 2016 20:35:04 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201607292035.u6TKZ4n8057363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 29 Jul 2016 20:35:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303505 - head/sys/ofed/drivers/infiniband/ulp/sdp 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.22 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, 29 Jul 2016 20:35:06 -0000 Author: markj Date: Fri Jul 29 20:35:04 2016 New Revision: 303505 URL: https://svnweb.freebsd.org/changeset/base/303505 Log: sdp: Use an mbufq for received control packets. This is simpler than the hand-rolled queue, and fixes a use-after-free. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h Fri Jul 29 20:33:43 2016 (r303504) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h Fri Jul 29 20:35:04 2016 (r303505) @@ -403,8 +403,7 @@ struct sdp_sock { struct sdp_rx_ring rx_ring; struct sdp_tx_ring tx_ring; struct rwlock lock; - struct mbuf *rx_ctl_q; - struct mbuf *rx_ctl_tail; + struct mbufq rxctlq; /* received control packets */ int qp_active; /* XXX Flag. */ int max_sge; Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Fri Jul 29 20:33:43 2016 (r303504) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Fri Jul 29 20:35:04 2016 (r303505) @@ -469,6 +469,7 @@ sdp_attach(struct socket *so, int proto, ssk->flags = 0; ssk->qp_active = 0; ssk->state = TCPS_CLOSED; + mbufq_init(&ssk->rxctlq, INT_MAX); SDP_LIST_WLOCK(); LIST_INSERT_HEAD(&sdp_list, ssk, list); sdp_count++; Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Fri Jul 29 20:33:43 2016 (r303504) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Fri Jul 29 20:35:04 2016 (r303505) @@ -459,14 +459,9 @@ sdp_process_rx_mb(struct sdp_sock *ssk, ntohl(rrch->len)); } #endif - mb->m_nextpkt = NULL; - if (ssk->rx_ctl_tail) - ssk->rx_ctl_tail->m_nextpkt = mb; - else - ssk->rx_ctl_q = mb; - ssk->rx_ctl_tail = mb; - - return 0; + if (mbufq_enqueue(&ssk->rxctlq, mb) != 0) + m_freem(mb); + return (0); } sdp_prf1(sk, NULL, "queueing %s mb\n", mid2str(h->mid)); @@ -611,11 +606,8 @@ sdp_do_posts(struct sdp_sock *ssk) return; } - while ((mb = ssk->rx_ctl_q)) { - ssk->rx_ctl_q = mb->m_nextpkt; - mb->m_nextpkt = NULL; + while ((mb = mbufq_dequeue(&ssk->rxctlq)) != NULL) sdp_process_rx_ctl_mb(ssk, mb); - } if (ssk->state == TCPS_TIME_WAIT) return; From owner-svn-src-head@freebsd.org Fri Jul 29 20:36: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 265FBBA8179; Fri, 29 Jul 2016 20:36:03 +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 EADEF1FD6; Fri, 29 Jul 2016 20:36: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 u6TKa2aI057449; Fri, 29 Jul 2016 20:36:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TKa2lX057448; Fri, 29 Jul 2016 20:36:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201607292036.u6TKa2lX057448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 29 Jul 2016 20:36:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303506 - head/sys/ofed/drivers/infiniband/ulp/sdp 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.22 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, 29 Jul 2016 20:36:03 -0000 Author: markj Date: Fri Jul 29 20:36:01 2016 New Revision: 303506 URL: https://svnweb.freebsd.org/changeset/base/303506 Log: sdp: Destroy the PCB lock before freeing to the zone. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Fri Jul 29 20:35:04 2016 (r303505) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Fri Jul 29 20:36:01 2016 (r303506) @@ -176,8 +176,8 @@ sdp_pcbfree(struct sdp_sock *ssk) sdp_tx_ring_destroy(ssk); sdp_rx_ring_destroy(ssk); rw_destroy(&ssk->rx_ring.destroyed_lock); - uma_zfree(sdp_zone, ssk); rw_destroy(&ssk->lock); + uma_zfree(sdp_zone, ssk); } /* From owner-svn-src-head@freebsd.org Fri Jul 29 20:39: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 A3B35BA82C9; Fri, 29 Jul 2016 20:39:33 +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 7034F13DB; Fri, 29 Jul 2016 20:39:33 +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 u6TKdWN4057836; Fri, 29 Jul 2016 20:39:32 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TKdWkA057835; Fri, 29 Jul 2016 20:39:32 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201607292039.u6TKdWkA057835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 29 Jul 2016 20:39:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303507 - head/sys/ofed/drivers/infiniband/ulp/sdp 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.22 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, 29 Jul 2016 20:39:33 -0000 Author: markj Date: Fri Jul 29 20:39:32 2016 New Revision: 303507 URL: https://svnweb.freebsd.org/changeset/base/303507 Log: sdp: Use the PCB as the rx completion handler argument. The generic socket may be detached from the PCB before the completion queue is drained and destroyed, so this change closes a race condition in connection teardown. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Fri Jul 29 20:36:01 2016 (r303506) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Fri Jul 29 20:39:32 2016 (r303507) @@ -665,13 +665,10 @@ sdp_process_rx(struct sdp_sock *ssk) static void sdp_rx_irq(struct ib_cq *cq, void *cq_context) { - struct socket *sk = cq_context; - struct sdp_sock *ssk = sdp_sk(sk); + struct sdp_sock *ssk; - if (cq != ssk->rx_ring.cq) { - sdp_dbg(sk, "cq = %p, ssk->cq = %p\n", cq, ssk->rx_ring.cq); - return; - } + ssk = cq_context; + KASSERT(cq == ssk->rx_ring.cq, ("%s: mismatched cq on %p", ssk)); SDPSTATS_COUNTER_INC(rx_int_count); @@ -728,7 +725,7 @@ sdp_rx_ring_create(struct sdp_sock *ssk, } rx_cq = ib_create_cq(device, sdp_rx_irq, sdp_rx_cq_event_handler, - ssk->socket, SDP_RX_SIZE, 0); + ssk, SDP_RX_SIZE, 0); if (IS_ERR(rx_cq)) { rc = PTR_ERR(rx_cq); From owner-svn-src-head@freebsd.org Fri Jul 29 20:48: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 578DABA84CE; Fri, 29 Jul 2016 20:48:43 +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 1D2271988; Fri, 29 Jul 2016 20:48:43 +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 u6TKmgtd061407; Fri, 29 Jul 2016 20:48:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TKmgRY061406; Fri, 29 Jul 2016 20:48:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201607292048.u6TKmgRY061406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 29 Jul 2016 20:48:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303508 - head/sys/ofed/drivers/infiniband/ulp/sdp 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.22 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, 29 Jul 2016 20:48:43 -0000 Author: markj Date: Fri Jul 29 20:48:42 2016 New Revision: 303508 URL: https://svnweb.freebsd.org/changeset/base/303508 Log: Fix the KASSERT format string arguments after r303507. Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Fri Jul 29 20:39:32 2016 (r303507) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Fri Jul 29 20:48:42 2016 (r303508) @@ -668,7 +668,8 @@ sdp_rx_irq(struct ib_cq *cq, void *cq_co struct sdp_sock *ssk; ssk = cq_context; - KASSERT(cq == ssk->rx_ring.cq, ("%s: mismatched cq on %p", ssk)); + KASSERT(cq == ssk->rx_ring.cq, + ("%s: mismatched cq on %p", __func__, ssk)); SDPSTATS_COUNTER_INC(rx_int_count); From owner-svn-src-head@freebsd.org Fri Jul 29 20:51: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 AB51EBA8570; Fri, 29 Jul 2016 20:51:53 +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 5FFD91C5A; Fri, 29 Jul 2016 20:51:53 +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 u6TKpqj7062213; Fri, 29 Jul 2016 20:51:52 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TKpqBY062212; Fri, 29 Jul 2016 20:51:52 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201607292051.u6TKpqBY062212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 29 Jul 2016 20:51:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303509 - head/sys/ofed/drivers/infiniband/ulp/sdp 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.22 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, 29 Jul 2016 20:51:53 -0000 Author: markj Date: Fri Jul 29 20:51:52 2016 New Revision: 303509 URL: https://svnweb.freebsd.org/changeset/base/303509 Log: sdp: Always free received control packets after they're handled. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Fri Jul 29 20:48:42 2016 (r303508) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Fri Jul 29 20:51:52 2016 (r303509) @@ -319,14 +319,14 @@ sdp_recv_completion(struct sdp_sock *ssk return mb; } -/* socket lock should be taken before calling this */ -static int +static void sdp_process_rx_ctl_mb(struct sdp_sock *ssk, struct mbuf *mb) { struct sdp_bsdh *h; struct socket *sk; SDP_WLOCK_ASSERT(ssk); + sk = ssk->socket; h = mtod(mb, struct sdp_bsdh *); switch (h->mid) { @@ -339,16 +339,13 @@ sdp_process_rx_ctl_mb(struct sdp_sock *s sdp_dbg(sk, "RX data when state = FIN_WAIT1\n"); sdp_notify(ssk, ECONNRESET); } - m_freem(mb); break; #ifdef SDP_ZCOPY case SDP_MID_RDMARDCOMPL: - m_freem(mb); break; case SDP_MID_SENDSM: sdp_handle_sendsm(ssk, ntohl(h->mseq_ack)); - m_freem(mb); break; case SDP_MID_SRCAVAIL_CANCEL: sdp_dbg_data(sk, "Handling SrcAvailCancel\n"); @@ -362,7 +359,6 @@ sdp_process_rx_ctl_mb(struct sdp_sock *s sdp_dbg(sk, "Got SrcAvailCancel - " "but no SrcAvail in process\n"); } - m_freem(mb); break; case SDP_MID_SINKAVAIL: sdp_dbg_data(sk, "Got SinkAvail - not supported: ignored\n"); @@ -373,7 +369,6 @@ sdp_process_rx_ctl_mb(struct sdp_sock *s sdp_dbg_data(sk, "Handling ABORT\n"); sdp_prf(sk, NULL, "Handling ABORT"); sdp_notify(ssk, ECONNRESET); - m_freem(mb); break; case SDP_MID_DISCONN: sdp_dbg_data(sk, "Handling DISCONN\n"); @@ -383,20 +378,17 @@ sdp_process_rx_ctl_mb(struct sdp_sock *s case SDP_MID_CHRCVBUF: sdp_dbg_data(sk, "Handling RX CHRCVBUF\n"); sdp_handle_resize_request(ssk, (struct sdp_chrecvbuf *)(h+1)); - m_freem(mb); break; case SDP_MID_CHRCVBUF_ACK: sdp_dbg_data(sk, "Handling RX CHRCVBUF_ACK\n"); sdp_handle_resize_ack(ssk, (struct sdp_chrecvbuf *)(h+1)); - m_freem(mb); break; default: /* TODO: Handle other messages */ sdp_warn(sk, "SDP: FIXME MID %d\n", h->mid); - m_freem(mb); + break; } - - return 0; + m_freem(mb); } static int From owner-svn-src-head@freebsd.org Fri Jul 29 20:52: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 66077BA8658; Fri, 29 Jul 2016 20:52:19 +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 32D741ECD; Fri, 29 Jul 2016 20:52:19 +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 u6TKqIda065039; Fri, 29 Jul 2016 20:52:18 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TKqIw7065038; Fri, 29 Jul 2016 20:52:18 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201607292052.u6TKqIw7065038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 29 Jul 2016 20:52:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303510 - 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.22 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, 29 Jul 2016 20:52:19 -0000 Author: mav Date: Fri Jul 29 20:52:18 2016 New Revision: 303510 URL: https://svnweb.freebsd.org/changeset/base/303510 Log: Clear scratchpad after MSIX negotiation to not leak garbage. 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 Fri Jul 29 20:51:52 2016 (r303509) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Fri Jul 29 20:52:18 2016 (r303510) @@ -2649,6 +2649,7 @@ msix_done: if (val != NTB_MSIX_RECEIVED) goto reschedule; + intel_ntb_spad_clear(ntb->device); ntb->peer_msix_good = true; /* Give peer time to see our NTB_MSIX_RECEIVED. */ goto reschedule; From owner-svn-src-head@freebsd.org Fri Jul 29 20:54: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 0FD20BA8706; Fri, 29 Jul 2016 20:54:45 +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 D6AE51230; Fri, 29 Jul 2016 20:54:44 +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 u6TKsicW065156; Fri, 29 Jul 2016 20:54:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TKsiV4065155; Fri, 29 Jul 2016 20:54:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201607292054.u6TKsiV4065155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 29 Jul 2016 20:54:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303511 - head/sys/ofed/drivers/infiniband/ulp/sdp 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.22 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, 29 Jul 2016 20:54:45 -0000 Author: markj Date: Fri Jul 29 20:54:43 2016 New Revision: 303511 URL: https://svnweb.freebsd.org/changeset/base/303511 Log: sdp: Use the correct socket buffer in sdp_post_recvs_needed(). Sponsored by: EMC / Isilon Storage Division Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Fri Jul 29 20:52:18 2016 (r303510) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Fri Jul 29 20:54:43 2016 (r303511) @@ -175,7 +175,7 @@ sdp_post_recvs_needed(struct sdp_sock *s return 1; buffer_size = ssk->recv_bytes; - max_bytes = max(ssk->socket->so_snd.sb_hiwat, + max_bytes = max(ssk->socket->so_rcv.sb_hiwat, (1 + SDP_MIN_TX_CREDITS) * buffer_size); max_bytes *= rcvbuf_scale; /* From owner-svn-src-head@freebsd.org Fri Jul 29 21:01: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 DE176BA88B6; Fri, 29 Jul 2016 21:01:05 +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 9F65B14FD; Fri, 29 Jul 2016 21:01:05 +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 u6TL1420068222; Fri, 29 Jul 2016 21:01:04 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TL1476068218; Fri, 29 Jul 2016 21:01:04 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201607292101.u6TL1476068218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 29 Jul 2016 21:01:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303512 - head/sys/ofed/drivers/infiniband/ulp/sdp 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.22 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, 29 Jul 2016 21:01:06 -0000 Author: markj Date: Fri Jul 29 21:01:04 2016 New Revision: 303512 URL: https://svnweb.freebsd.org/changeset/base/303512 Log: sdp: Use malloc(9) instead of the Linux compat layer. SDP transmit and receive rings are always created in a sleepable context, so we can use M_WAITOK and remove error checks. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h Fri Jul 29 20:54:43 2016 (r303511) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h Fri Jul 29 21:01:04 2016 (r303512) @@ -455,6 +455,8 @@ struct sdp_sock { #define SDP_RLOCK_ASSERT(ssk) rw_assert(&(ssk)->lock, RA_RLOCKED) #define SDP_LOCK_ASSERT(ssk) rw_assert(&(ssk)->lock, RA_LOCKED) +MALLOC_DECLARE(M_SDP); + static inline void tx_sa_reset(struct tx_srcavail_state *tx_sa) { memset((void *)&tx_sa->busy, 0, Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Fri Jul 29 20:54:43 2016 (r303511) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Fri Jul 29 21:01:04 2016 (r303512) @@ -64,6 +64,10 @@ #include __FBSDID("$FreeBSD$"); +#include +#include +#include + #include "sdp.h" #include @@ -86,7 +90,7 @@ RW_SYSINIT(sdplockinit, &sdp_lock, "SDP #define SDP_LIST_RLOCK_ASSERT() rw_assert(&sdp_lock, RW_RLOCKED) #define SDP_LIST_LOCK_ASSERT() rw_assert(&sdp_lock, RW_LOCKED) -static MALLOC_DEFINE(M_SDP, "sdp", "Socket Direct Protocol"); +MALLOC_DEFINE(M_SDP, "sdp", "Sockets Direct Protocol"); static void sdp_stop_keepalive_timer(struct socket *so); Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Fri Jul 29 20:54:43 2016 (r303511) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Fri Jul 29 21:01:04 2016 (r303512) @@ -701,25 +701,16 @@ sdp_rx_ring_create(struct sdp_sock *ssk, struct ib_cq *rx_cq; int rc = 0; - sdp_dbg(ssk->socket, "rx ring created"); INIT_WORK(&ssk->rx_comp_work, sdp_rx_comp_work); atomic_set(&ssk->rx_ring.head, 1); atomic_set(&ssk->rx_ring.tail, 1); - ssk->rx_ring.buffer = kmalloc( - sizeof *ssk->rx_ring.buffer * SDP_RX_SIZE, GFP_KERNEL); - if (!ssk->rx_ring.buffer) { - sdp_warn(ssk->socket, - "Unable to allocate RX Ring size %zd.\n", - sizeof(*ssk->rx_ring.buffer) * SDP_RX_SIZE); - - return -ENOMEM; - } + ssk->rx_ring.buffer = malloc(sizeof(*ssk->rx_ring.buffer) * SDP_RX_SIZE, + M_SDP, M_WAITOK); rx_cq = ib_create_cq(device, sdp_rx_irq, sdp_rx_cq_event_handler, ssk, SDP_RX_SIZE, 0); - if (IS_ERR(rx_cq)) { rc = PTR_ERR(rx_cq); sdp_warn(ssk->socket, "Unable to allocate RX CQ: %d.\n", rc); @@ -732,7 +723,7 @@ sdp_rx_ring_create(struct sdp_sock *ssk, return 0; err_cq: - kfree(ssk->rx_ring.buffer); + free(ssk->rx_ring.buffer, M_SDP); ssk->rx_ring.buffer = NULL; return rc; } @@ -746,8 +737,7 @@ sdp_rx_ring_destroy(struct sdp_sock *ssk if (ssk->rx_ring.buffer) { sdp_rx_ring_purge(ssk); - - kfree(ssk->rx_ring.buffer); + free(ssk->rx_ring.buffer, M_SDP); ssk->rx_ring.buffer = NULL; } Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c Fri Jul 29 20:54:43 2016 (r303511) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c Fri Jul 29 21:01:04 2016 (r303512) @@ -427,19 +427,11 @@ sdp_tx_ring_create(struct sdp_sock *ssk, atomic_set(&ssk->tx_ring.head, 1); atomic_set(&ssk->tx_ring.tail, 1); - ssk->tx_ring.buffer = kzalloc( - sizeof *ssk->tx_ring.buffer * SDP_TX_SIZE, GFP_KERNEL); - if (!ssk->tx_ring.buffer) { - rc = -ENOMEM; - sdp_warn(ssk->socket, "Can't allocate TX Ring size %zd.\n", - sizeof(*ssk->tx_ring.buffer) * SDP_TX_SIZE); - - goto out; - } + ssk->tx_ring.buffer = malloc(sizeof(*ssk->tx_ring.buffer) * SDP_TX_SIZE, + M_SDP, M_WAITOK); tx_cq = ib_create_cq(device, sdp_tx_irq, sdp_tx_cq_event_handler, ssk, SDP_TX_SIZE, 0); - if (IS_ERR(tx_cq)) { rc = PTR_ERR(tx_cq); sdp_warn(ssk->socket, "Unable to allocate TX CQ: %d.\n", rc); @@ -452,9 +444,8 @@ sdp_tx_ring_create(struct sdp_sock *ssk, return 0; err_cq: - kfree(ssk->tx_ring.buffer); + free(ssk->tx_ring.buffer, M_SDP); ssk->tx_ring.buffer = NULL; -out: return rc; } @@ -472,8 +463,7 @@ sdp_tx_ring_destroy(struct sdp_sock *ssk if (ssk->tx_ring.buffer) { sdp_tx_ring_purge(ssk); - - kfree(ssk->tx_ring.buffer); + free(ssk->tx_ring.buffer, M_SDP); ssk->tx_ring.buffer = NULL; } From owner-svn-src-head@freebsd.org Fri Jul 29 21:03: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 6EABCBA895B; Fri, 29 Jul 2016 21:03:03 +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 3EEEE1943; Fri, 29 Jul 2016 21:03:03 +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 u6TL323O068978; Fri, 29 Jul 2016 21:03:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TL32ov068977; Fri, 29 Jul 2016 21:03:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201607292103.u6TL32ov068977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 29 Jul 2016 21:03:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303513 - head/sys/ofed/drivers/infiniband/ulp/sdp 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.22 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, 29 Jul 2016 21:03:03 -0000 Author: markj Date: Fri Jul 29 21:03:02 2016 New Revision: 303513 URL: https://svnweb.freebsd.org/changeset/base/303513 Log: sdp: Destroy the RDMA ID after destroying the connection's queue pair. This is the ordering documented by rdma_destroy_qp(). Also add a useful KASSERT to sdp_pcbfree(). Sponsored by: EMC / Isilon Storage Division Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Fri Jul 29 21:01:04 2016 (r303512) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Fri Jul 29 21:03:02 2016 (r303513) @@ -160,7 +160,10 @@ sdp_pcbbind(struct sdp_sock *ssk, struct static void sdp_pcbfree(struct sdp_sock *ssk) { + KASSERT(ssk->socket == NULL, ("ssk %p socket still attached", ssk)); + KASSERT((ssk->flags & SDP_DESTROY) == 0, + ("ssk %p already destroyed", ssk)); sdp_dbg(ssk->socket, "Freeing pcb"); SDP_WLOCK_ASSERT(ssk); @@ -171,7 +174,6 @@ sdp_pcbfree(struct sdp_sock *ssk) LIST_REMOVE(ssk, list); SDP_LIST_WUNLOCK(); crfree(ssk->cred); - sdp_destroy_cma(ssk); ssk->qp_active = 0; if (ssk->qp) { ib_destroy_qp(ssk->qp); @@ -179,6 +181,7 @@ sdp_pcbfree(struct sdp_sock *ssk) } sdp_tx_ring_destroy(ssk); sdp_rx_ring_destroy(ssk); + sdp_destroy_cma(ssk); rw_destroy(&ssk->rx_ring.destroyed_lock); rw_destroy(&ssk->lock); uma_zfree(sdp_zone, ssk); From owner-svn-src-head@freebsd.org Fri Jul 29 21:03: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 DBE78BA89B3; Fri, 29 Jul 2016 21:03:31 +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 B3CCF1ABB; Fri, 29 Jul 2016 21:03:31 +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 u6TL3UgI069043; Fri, 29 Jul 2016 21:03:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TL3ULp069042; Fri, 29 Jul 2016 21:03:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201607292103.u6TL3ULp069042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 29 Jul 2016 21:03:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303514 - head/sys/dev/ntb 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.22 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, 29 Jul 2016 21:03:32 -0000 Author: mav Date: Fri Jul 29 21:03:30 2016 New Revision: 303514 URL: https://svnweb.freebsd.org/changeset/base/303514 Log: Fix NTBT_QP_LINKS negotiation. I believe it never worked correctly for more the one queue even in Linux. This fixes case when one of consumer drivers is not loaded on one side, but its queues still announced as ready if something else brought link up. While there, remove some pointless NULL checks. Modified: head/sys/dev/ntb/ntb_transport.c Modified: head/sys/dev/ntb/ntb_transport.c ============================================================================== --- head/sys/dev/ntb/ntb_transport.c Fri Jul 29 21:03:02 2016 (r303513) +++ head/sys/dev/ntb/ntb_transport.c Fri Jul 29 21:03:30 2016 (r303514) @@ -572,9 +572,6 @@ ntb_transport_free_queue(struct ntb_tran struct ntb_transport_ctx *nt = qp->transport; struct ntb_queue_entry *entry; - if (qp == NULL) - return; - callout_drain(&qp->link_work); ntb_db_set_mask(qp->dev, 1ull << qp->qp_num); @@ -694,7 +691,7 @@ ntb_transport_tx_enqueue(struct ntb_tran struct ntb_queue_entry *entry; int rc; - if (qp == NULL || !qp->link_is_up || len == 0) { + if (!qp->link_is_up || len == 0) { CTR0(KTR_NTB, "TX: link not up"); return (EINVAL); } @@ -1059,11 +1056,9 @@ ntb_transport_link_work(void *arg) size >> 32); ntb_peer_spad_write(dev, NTBT_MW0_SZ_LOW + (i * 2), size); } - ntb_peer_spad_write(dev, NTBT_NUM_MWS, nt->mw_count); - ntb_peer_spad_write(dev, NTBT_NUM_QPS, nt->qp_count); - + ntb_peer_spad_write(dev, NTBT_QP_LINKS, 0); ntb_peer_spad_write(dev, NTBT_VERSION, NTB_TRANSPORT_VERSION); /* Query the remote side for its info */ @@ -1245,16 +1240,18 @@ ntb_qp_link_work(void *arg) struct ntb_transport_qp *qp = arg; device_t dev = qp->dev; struct ntb_transport_ctx *nt = qp->transport; - uint32_t val, dummy; - - ntb_spad_read(dev, NTBT_QP_LINKS, &val); - - ntb_peer_spad_write(dev, NTBT_QP_LINKS, val | (1ull << qp->qp_num)); + int i; + uint32_t val; - /* query remote spad for qp ready bits */ - ntb_peer_spad_read(dev, NTBT_QP_LINKS, &dummy); + /* Report queues that are up on our side */ + for (i = 0, val = 0; i < nt->qp_count; i++) { + if (nt->qp_vec[i].client_ready) + val |= (1 << i); + } + ntb_peer_spad_write(dev, NTBT_QP_LINKS, val); /* See if the remote side is up */ + ntb_spad_read(dev, NTBT_QP_LINKS, &val); if ((val & (1ull << qp->qp_num)) != 0) { ntb_printf(2, "qp %d link up\n", qp->qp_num); qp->link_is_up = true; @@ -1350,17 +1347,16 @@ ntb_qp_link_cleanup(struct ntb_transport void ntb_transport_link_down(struct ntb_transport_qp *qp) { + struct ntb_transport_ctx *nt = qp->transport; + int i; uint32_t val; - if (qp == NULL) - return; - qp->client_ready = false; - - ntb_spad_read(qp->dev, NTBT_QP_LINKS, &val); - - ntb_peer_spad_write(qp->dev, NTBT_QP_LINKS, - val & ~(1 << qp->qp_num)); + for (i = 0, val = 0; i < nt->qp_count; i++) { + if (nt->qp_vec[i].client_ready) + val |= (1 << i); + } + ntb_peer_spad_write(qp->dev, NTBT_QP_LINKS, val); if (qp->link_is_up) ntb_send_link_down(qp); @@ -1379,8 +1375,6 @@ ntb_transport_link_down(struct ntb_trans bool ntb_transport_link_query(struct ntb_transport_qp *qp) { - if (qp == NULL) - return (false); return (qp->link_is_up); } @@ -1479,8 +1473,6 @@ out: */ unsigned char ntb_transport_qp_num(struct ntb_transport_qp *qp) { - if (qp == NULL) - return 0; return (qp->qp_num); } @@ -1497,9 +1489,6 @@ unsigned int ntb_transport_max_size(struct ntb_transport_qp *qp) { - if (qp == NULL) - return (0); - return (qp->tx_max_frame - sizeof(struct ntb_payload_header)); } From owner-svn-src-head@freebsd.org Fri Jul 29 21:05: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 48D64BA8A12; Fri, 29 Jul 2016 21:05:18 +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 15A761C68; Fri, 29 Jul 2016 21:05:18 +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 u6TL5HZ6069152; Fri, 29 Jul 2016 21:05:17 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TL5HYY069151; Fri, 29 Jul 2016 21:05:17 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201607292105.u6TL5HYY069151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Fri, 29 Jul 2016 21:05:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303515 - head/usr.bin/resizewin 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.22 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, 29 Jul 2016 21:05:18 -0000 Author: lidl Date: Fri Jul 29 21:05:17 2016 New Revision: 303515 URL: https://svnweb.freebsd.org/changeset/base/303515 Log: Make resizewin.1 manpage use .Fx macro Fix capitalization of "PuTTY" also. MFC after: 1 week Modified: head/usr.bin/resizewin/resizewin.1 Modified: head/usr.bin/resizewin/resizewin.1 ============================================================================== --- head/usr.bin/resizewin/resizewin.1 Fri Jul 29 21:03:30 2016 (r303514) +++ head/usr.bin/resizewin/resizewin.1 Fri Jul 29 21:05:17 2016 (r303515) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 17, 2016 +.Dd July 9, 2016 .Dt RESIZEWIN 1 .Os .Sh NAME @@ -55,10 +55,12 @@ updates the kernel's window size to matc .Pp Note that virtually all modern terninals support VT100/ANSI escape sequences, including xterm, konsole, gnome-terminal iTerm, -Terminal.app, and puTTY. +Terminal.app, and PuTTY. .Sh SEE ALSO .Xr resize 1 , .Xr stty 1 .Sh HISTORY +The .Nm -appeared in FreeBSD 11. +command first appeared in +.Fx 11 . From owner-svn-src-head@freebsd.org Fri Jul 29 21:05: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 51486BA8A69; Fri, 29 Jul 2016 21:05:38 +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 2296C1DD6; Fri, 29 Jul 2016 21:05:38 +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 u6TL5bBv069206; Fri, 29 Jul 2016 21:05:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TL5bPs069205; Fri, 29 Jul 2016 21:05:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201607292105.u6TL5bPs069205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 29 Jul 2016 21:05:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303516 - head/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.22 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, 29 Jul 2016 21:05:38 -0000 Author: markj Date: Fri Jul 29 21:05:37 2016 New Revision: 303516 URL: https://svnweb.freebsd.org/changeset/base/303516 Log: Use vm_page_undirty() instead of manually setting a page field. Reviewed by: alc MFC after: 3 days Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Fri Jul 29 21:05:17 2016 (r303515) +++ head/sys/vm/vm_page.c Fri Jul 29 21:05:37 2016 (r303516) @@ -3397,7 +3397,7 @@ vm_page_advise(vm_page_t m, int advice) * But we do make the page as freeable as we can without * actually taking the step of unmapping it. */ - m->dirty = 0; + vm_page_undirty(m); else if (advice != MADV_DONTNEED) return; From owner-svn-src-head@freebsd.org Fri Jul 29 21:11: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 9F2ADBA8CD0; Fri, 29 Jul 2016 21:11:33 +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 63244162D; Fri, 29 Jul 2016 21:11:33 +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 u6TLBWHv069770; Fri, 29 Jul 2016 21:11:32 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TLBWsO069768; Fri, 29 Jul 2016 21:11:32 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201607292111.u6TLBWsO069768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Fri, 29 Jul 2016 21:11:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303518 - head/contrib/blacklist/lib 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.22 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, 29 Jul 2016 21:11:33 -0000 Author: lidl Date: Fri Jul 29 21:11:32 2016 New Revision: 303518 URL: https://svnweb.freebsd.org/changeset/base/303518 Log: libblacklist: Do not use %m for logging, use strerror(errno) The blacklist library can accept a function to use for logging, defaulting to vsyslog(), if no function is specified. Make the blacklist library use strerror(errno) explicitly, instead of %m, so that the passed in function does not need to support the syslog specific placeholder. This matches a change already submitted and accepted upstream. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/contrib/blacklist/lib/bl.c Modified: head/contrib/blacklist/lib/bl.c ============================================================================== --- head/contrib/blacklist/lib/bl.c Fri Jul 29 21:07:17 2016 (r303517) +++ head/contrib/blacklist/lib/bl.c Fri Jul 29 21:11:32 2016 (r303518) @@ -152,8 +152,8 @@ bl_init(bl_t b, bool srv) b->b_fd = socket(PF_LOCAL, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK|SOCK_NOSIGPIPE, 0); if (b->b_fd == -1) { - bl_log(b->b_fun, LOG_ERR, "%s: socket failed (%m)", - __func__); + bl_log(b->b_fun, LOG_ERR, "%s: socket failed (%s)", + __func__, strerror(errno)); BL_UNLOCK(b); return -1; } @@ -200,8 +200,8 @@ bl_init(bl_t b, bool srv) */ if (b->b_connected != 1) { bl_log(b->b_fun, LOG_DEBUG, - "%s: connect failed for `%s' (%m)", - __func__, sun->sun_path); + "%s: connect failed for `%s' (%s)", + __func__, sun->sun_path, strerror(errno)); b->b_connected = 1; } BL_UNLOCK(b); @@ -220,8 +220,8 @@ bl_init(bl_t b, bool srv) errno = serrno; if (rv == -1) { bl_log(b->b_fun, LOG_ERR, - "%s: bind failed for `%s' (%m)", - __func__, sun->sun_path); + "%s: bind failed for `%s' (%s)", + __func__, sun->sun_path, strerror(errno)); goto out; } } @@ -260,7 +260,8 @@ bl_init(bl_t b, bool srv) if (setsockopt(b->b_fd, CRED_LEVEL, CRED_NAME, &one, (socklen_t)sizeof(one)) == -1) { bl_log(b->b_fun, LOG_ERR, "%s: setsockopt %s " - "failed (%m)", __func__, __STRING(CRED_NAME)); + "failed (%s)", __func__, __STRING(CRED_NAME), + strerror(errno)); goto out; } #endif @@ -296,7 +297,8 @@ bl_create(bool srv, const char *path, vo return b; out: free(b); - bl_log(fun, LOG_ERR, "%s: malloc failed (%m)", __func__); + bl_log(fun, LOG_ERR, "%s: malloc failed (%s)", __func__, + strerror(errno)); return NULL; } @@ -451,7 +453,8 @@ bl_recv(bl_t b) rlen = recvmsg(b->b_fd, &msg, 0); if (rlen == -1) { - bl_log(b->b_fun, LOG_ERR, "%s: recvmsg failed (%m)", __func__); + bl_log(b->b_fun, LOG_ERR, "%s: recvmsg failed (%s)", __func__, + strerror(errno)); return NULL; } From owner-svn-src-head@freebsd.org Fri Jul 29 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 CF7C8BA8D5D; Fri, 29 Jul 2016 21:12:49 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1E8B185E; Fri, 29 Jul 2016 21:12:49 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6TLCmin073084; Fri, 29 Jul 2016 21:12:48 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TLCmpb073082; Fri, 29 Jul 2016 21:12:48 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201607292112.u6TLCmpb073082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Fri, 29 Jul 2016 21:12:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303519 - head/share/man/man9 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.22 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, 29 Jul 2016 21:12:49 -0000 Author: vangyzen Date: Fri Jul 29 21:12:48 2016 New Revision: 303519 URL: https://svnweb.freebsd.org/changeset/base/303519 Log: Fix two return types in the cpuset(9) and bitset(9) man pages The *_FFS() and *_COUNT() functions return int, not size_t. MFC after: 3 days Sponsored by: Dell Inc. Modified: head/share/man/man9/bitset.9 head/share/man/man9/cpuset.9 Modified: head/share/man/man9/bitset.9 ============================================================================== --- head/share/man/man9/bitset.9 Fri Jul 29 21:11:32 2016 (r303518) +++ head/share/man/man9/bitset.9 Fri Jul 29 21:12:48 2016 (r303519) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 20, 2015 +.Dd July 29, 2016 .Dt BITSET 9 .Os .Sh NAME @@ -77,9 +77,9 @@ .Fn BIT_EMPTY "const SETSIZE" "struct STRUCTNAME *bitset" .Ft bool .Fn BIT_ISFULLSET "const SETSIZE" "struct STRUCTNAME *bitset" -.Ft size_t +.Ft int .Fn BIT_FFS "const SETSIZE" "struct STRUCTNAME *bitset" -.Ft size_t +.Ft int .Fn BIT_COUNT "const SETSIZE" "struct STRUCTNAME *bitset" .\" .Ft bool Modified: head/share/man/man9/cpuset.9 ============================================================================== --- head/share/man/man9/cpuset.9 Fri Jul 29 21:11:32 2016 (r303518) +++ head/share/man/man9/cpuset.9 Fri Jul 29 21:12:48 2016 (r303519) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 20, 2015 +.Dd July 29, 2016 .Dt CPUSET 9 .Os .Sh NAME @@ -75,9 +75,9 @@ .Fn CPU_EMPTY "cpuset_t *cpuset" .Ft bool .Fn CPU_ISFULLSET "cpuset_t *cpuset" -.Ft size_t +.Ft int .Fn CPU_FFS "cpuset_t *cpuset" -.Ft size_t +.Ft int .Fn CPU_COUNT "cpuset_t *cpuset" .\" .Ft bool From owner-svn-src-head@freebsd.org Fri Jul 29 21:18: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 8189CBA8E0D; Fri, 29 Jul 2016 21:18:21 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51DE61A77; Fri, 29 Jul 2016 21:18:21 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6TLIK7s073319; Fri, 29 Jul 2016 21:18:20 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TLIKmL073318; Fri, 29 Jul 2016 21:18:20 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201607292118.u6TLIKmL073318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Fri, 29 Jul 2016 21:18:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303520 - head/usr.bin/cpuset 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.22 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, 29 Jul 2016 21:18:21 -0000 Author: vangyzen Date: Fri Jul 29 21:18:20 2016 New Revision: 303520 URL: https://svnweb.freebsd.org/changeset/base/303520 Log: Fix markup for -j in cpuset(1) synopsis MFC after: 3 days Sponsored by: Dell Inc. Modified: head/usr.bin/cpuset/cpuset.1 Modified: head/usr.bin/cpuset/cpuset.1 ============================================================================== --- head/usr.bin/cpuset/cpuset.1 Fri Jul 29 21:12:48 2016 (r303519) +++ head/usr.bin/cpuset/cpuset.1 Fri Jul 29 21:18:20 2016 (r303520) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 8, 2015 +.Dd July 29, 2016 .Dt CPUSET 1 .Os .Sh NAME @@ -52,7 +52,7 @@ .Nm .Fl g .Op Fl cir -.Op Fl d Ar domain | j Ar jailid | Fl p Ar pid | Fl t Ar tid | Fl s Ar setid | Fl x Ar irq +.Op Fl d Ar domain | Fl j Ar jailid | Fl p Ar pid | Fl t Ar tid | Fl s Ar setid | Fl x Ar irq .Sh DESCRIPTION The .Nm From owner-svn-src-head@freebsd.org Fri Jul 29 21:37: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 DCA69BA821D; Fri, 29 Jul 2016 21:37:01 +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 ACAB21335; Fri, 29 Jul 2016 21:37:01 +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 u6TLb0v1080721; Fri, 29 Jul 2016 21:37:00 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TLb0b8080720; Fri, 29 Jul 2016 21:37:00 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201607292137.u6TLb0b8080720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 29 Jul 2016 21:37:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303521 - head/contrib/llvm/projects/libunwind/src 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.22 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, 29 Jul 2016 21:37:02 -0000 Author: emaste Date: Fri Jul 29 21:37:00 2016 New Revision: 303521 URL: https://svnweb.freebsd.org/changeset/base/303521 Log: libunwind: correct return code in unwinding trace log message Obtained from: LLVM r277215 MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/contrib/llvm/projects/libunwind/src/Unwind-EHABI.cpp Modified: head/contrib/llvm/projects/libunwind/src/Unwind-EHABI.cpp ============================================================================== --- head/contrib/llvm/projects/libunwind/src/Unwind-EHABI.cpp Fri Jul 29 21:18:20 2016 (r303520) +++ head/contrib/llvm/projects/libunwind/src/Unwind-EHABI.cpp Fri Jul 29 21:37:00 2016 (r303521) @@ -572,7 +572,7 @@ static _Unwind_Reason_Code unwind_phase2 unw_get_reg(cursor, UNW_REG_SP, &sp); if (unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_get_proc_info " - "failed => _URC_FATAL_PHASE1_ERROR\n", + "failed => _URC_FATAL_PHASE2_ERROR\n", static_cast(exception_object)); return _URC_FATAL_PHASE2_ERROR; } From owner-svn-src-head@freebsd.org Fri Jul 29 22:11: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 BB810BA88A1; Fri, 29 Jul 2016 22:11:30 +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 6BE881304; Fri, 29 Jul 2016 22:11:30 +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 u6TMBTVH092581; Fri, 29 Jul 2016 22:11:29 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TMBTEJ092580; Fri, 29 Jul 2016 22:11:29 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201607292211.u6TMBTEJ092580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 29 Jul 2016 22:11:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303522 - head/sys/dev/cxgbe 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.22 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, 29 Jul 2016 22:11:30 -0000 Author: jhb Date: Fri Jul 29 22:11:29 2016 New Revision: 303522 URL: https://svnweb.freebsd.org/changeset/base/303522 Log: Various fixes to the t4/5nex character device. - Remove null open/close methods. - Don't set d_flags to 0 explicitly. - Remove t5_cdevsw as the .d_name member isn't really used and doesn't warrant a separate cdevsw just for the name. - Use ENOTTY as the error value for an unknown ioctl request. - Use make_dev_s() to close race with setting si_drv1. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Jul 29 21:37:00 2016 (r303521) +++ head/sys/dev/cxgbe/t4_main.c Fri Jul 29 22:11:29 2016 (r303522) @@ -134,14 +134,9 @@ static driver_t vcxgbe_driver = { }; static d_ioctl_t t4_ioctl; -static d_open_t t4_open; -static d_close_t t4_close; static struct cdevsw t4_cdevsw = { .d_version = D_VERSION, - .d_flags = 0, - .d_open = t4_open, - .d_close = t4_close, .d_ioctl = t4_ioctl, .d_name = "t4nex", }; @@ -179,15 +174,6 @@ static driver_t vcxl_driver = { sizeof(struct vi_info) }; -static struct cdevsw t5_cdevsw = { - .d_version = D_VERSION, - .d_flags = 0, - .d_open = t4_open, - .d_close = t4_close, - .d_ioctl = t4_ioctl, - .d_name = "t5nex", -}; - /* ifnet + media interface */ static void cxgbe_init(void *); static int cxgbe_ioctl(struct ifnet *, unsigned long, caddr_t); @@ -681,6 +667,7 @@ t4_attach(device_t dev) { struct adapter *sc; int rc = 0, i, j, n10g, n1g, rqidx, tqidx; + struct make_dev_args mda; struct intrs_and_queues iaq; struct sge *s; uint8_t *buf; @@ -760,13 +747,16 @@ t4_attach(device_t dev) setup_memwin(sc); if (t4_init_devlog_params(sc, 0) == 0) fixup_devlog_params(sc); - sc->cdev = make_dev(is_t4(sc) ? &t4_cdevsw : &t5_cdevsw, - device_get_unit(dev), UID_ROOT, GID_WHEEL, 0600, "%s", - device_get_nameunit(dev)); - if (sc->cdev == NULL) - device_printf(dev, "failed to create nexus char device.\n"); - else - sc->cdev->si_drv1 = sc; + make_dev_args_init(&mda); + mda.mda_devsw = &t4_cdevsw; + mda.mda_uid = UID_ROOT; + mda.mda_gid = GID_WHEEL; + mda.mda_mode = 0600; + mda.mda_si_drv1 = sc; + rc = make_dev_s(&mda, &sc->cdev, "%s", device_get_nameunit(dev)); + if (rc != 0) + device_printf(dev, "failed to create nexus char device: %d.\n", + rc); /* Go no further if recovery mode has been requested. */ if (TUNABLE_INT_FETCH("hw.cxgbe.sos", &i) && i != 0) { @@ -8727,18 +8717,6 @@ t4_iterate(void (*func)(struct adapter * } static int -t4_open(struct cdev *dev, int flags, int type, struct thread *td) -{ - return (0); -} - -static int -t4_close(struct cdev *dev, int flags, int type, struct thread *td) -{ - return (0); -} - -static int t4_ioctl(struct cdev *dev, unsigned long cmd, caddr_t data, int fflag, struct thread *td) { @@ -8909,7 +8887,7 @@ t4_ioctl(struct cdev *dev, unsigned long rc = t4_set_tracer(sc, (struct t4_tracer *)data); break; default: - rc = EINVAL; + rc = ENOTTY; } return (rc); From owner-svn-src-head@freebsd.org Fri Jul 29 23:13: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 C5537BA7499; Fri, 29 Jul 2016 23:13:51 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 823A91DFA; Fri, 29 Jul 2016 23:13:51 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id BD8C33C265B; Sat, 30 Jul 2016 09:13:41 +1000 (AEST) Date: Sat, 30 Jul 2016 09:13:41 +1000 (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: r303485 - head/usr.bin/indent In-Reply-To: <201607291623.u6TGN08u064305@repo.freebsd.org> Message-ID: <20160730085927.B1012@besplex.bde.org> References: <201607291623.u6TGN08u064305@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=VIkg5I7X c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=cXlg904i9bIos2gJljoA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 29 Jul 2016 23:13:51 -0000 On Fri, 29 Jul 2016, Pedro F. Giffuni wrote: > Log: > indent(1): fix struct termination detection. > > Semicolons inside struct declarations don't end the declarations. > > Differential Revision: https://reviews.freebsd.org/D6966 (Partial) > Obtained from: Piotr Stefaniak > > Modified: > head/usr.bin/indent/indent.c > > Modified: head/usr.bin/indent/indent.c > ============================================================================== > --- head/usr.bin/indent/indent.c Fri Jul 29 16:17:54 2016 (r303484) > +++ head/usr.bin/indent/indent.c Fri Jul 29 16:23:00 2016 (r303485) > @@ -701,8 +701,10 @@ check_type: > break; > > case semicolon: /* got a ';' */ > - ps.in_or_st = false;/* we are not in an initialization or > - * structure declaration */ > + if (ps.dec_nest == 0) { > + /* we are not in an initialization or structure declaration */ > + ps.in_or_st = false; > + } This adds some style bugs. indent is written in a bad style that is very far from KNF, but perhaps it could format itself if it had an indent.pro. Part of its bad style is to use unnecessary parentheses a lot. But it mostly doesn't use unecessary braces. Except here. Another part of its bad style is to put comments to the right of the code, even when this requires misformatting them across multiple lines. The changed code gave example of both (the misformatting was to not have any whitespace between the semicolon and the comment so as to minimise comment indentation. This was actually another style bug. indent normally puts comments at the right at a tab stop even when this gives very narrow comments split across several lines). The changed code puts the comment on a line by itself. indent almost never does that elsewhere for comments about single statements. The comment here is technically for a block of compound statements, but the block has only 1 statement and was created by using excessive braces. > scase = false; /* these will only need resetting in an error */ > squest = 0; > if (ps.last_token == rparen && rparen_count == 0) Bruce From owner-svn-src-head@freebsd.org Fri Jul 29 23:30: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 AABCDBA794A; Fri, 29 Jul 2016 23:30:34 +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 779351ADF; Fri, 29 Jul 2016 23:30:34 +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 u6TNUXM5022654; Fri, 29 Jul 2016 23:30:33 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6TNUX8o022653; Fri, 29 Jul 2016 23:30:33 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201607292330.u6TNUX8o022653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 29 Jul 2016 23:30:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303523 - head/usr.bin/indent 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.22 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, 29 Jul 2016 23:30:34 -0000 Author: pfg Date: Fri Jul 29 23:30:33 2016 New Revision: 303523 URL: https://svnweb.freebsd.org/changeset/base/303523 Log: indent(1): Attempt to preserve some consistent style. Remove the excessive braces from r303485 and align the comments to the right as done in the rest of the code. This is not nice but there is no clear way to make it nice (and KNF). Pointed out by: bde Modified: head/usr.bin/indent/indent.c Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Fri Jul 29 22:11:29 2016 (r303522) +++ head/usr.bin/indent/indent.c Fri Jul 29 23:30:33 2016 (r303523) @@ -701,10 +701,9 @@ check_type: break; case semicolon: /* got a ';' */ - if (ps.dec_nest == 0) { - /* we are not in an initialization or structure declaration */ - ps.in_or_st = false; - } + if (ps.dec_nest == 0) + ps.in_or_st = false;/* we are not in an initialization or + * structure declaration */ scase = false; /* these will only need resetting in an error */ squest = 0; if (ps.last_token == rparen && rparen_count == 0) From owner-svn-src-head@freebsd.org Fri Jul 29 23:53: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 22F94BA80AE; Fri, 29 Jul 2016 23:53:23 +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 E0C5E1CDD; Fri, 29 Jul 2016 23:53:22 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 1882142446C; Sat, 30 Jul 2016 09:25:14 +1000 (AEST) Date: Sat, 30 Jul 2016 09:25:14 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Piotr Stefaniak cc: "Pedro F. Giffuni" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303487 - head/usr.bin/indent In-Reply-To: Message-ID: <20160730091349.A1012@besplex.bde.org> References: <201607291628.u6TGSpKT064605@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=OtmysHLt c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=evFOgcVC4GT5ehYdxvcA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 29 Jul 2016 23:53:23 -0000 On Fri, 29 Jul 2016, Piotr Stefaniak wrote: > On 2016-07-29 18:28, Pedro F. Giffuni wrote: >> >> Log: >> indent(1): fix struct termination detection. >> >> Small style cleanup while here. > > Wrong commit message. Actually committed here is: Support "f" and "F" > floating constant suffixes. >> ... Also: Add large style bug in the fix. >> Modified: head/usr.bin/indent/lexi.c >> ============================================================================== >> --- head/usr.bin/indent/lexi.c Fri Jul 29 16:25:09 2016 >> (r303486) >> +++ head/usr.bin/indent/lexi.c Fri Jul 29 16:28:51 2016 >> (r303487) >> @@ -191,15 +191,13 @@ lexi(void) >> } >> } >> while (1) { >> - if (!(seensfx & 1) && >> - (*buf_ptr == 'U' || *buf_ptr == 'u')) { >> + if (!(seensfx & 1) && (*buf_ptr == 'U' || *buf_ptr == 'u')) { >> CHECK_SIZE_TOKEN; >> *e_token++ = *buf_ptr++; >> seensfx |= 1; >> continue; >> } >> - if (!(seensfx & 2) && >> - (*buf_ptr == 'L' || *buf_ptr == 'l')) { >> + if (!(seensfx & 2) && strchr("fFlL", *buf_ptr)) { indent's style is mostly bad, but this doesn't seem to involve using boolean tests for non-boolean str*() functions. indent didn't use strchr() before, but it always does explict comparisons with 0 for strcmp() and strncmp(). strstr() doesn't even return an integer, so an explicit comparison is even more needed for it. Except the "found" test doesn't require negative logic like !strcmp(). >> CHECK_SIZE_TOKEN; >> if (buf_ptr[1] == buf_ptr[0]) >> *e_token++ = *buf_ptr++; Bruce From owner-svn-src-head@freebsd.org Sat Jul 30 00:00: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 6F374BA8527; Sat, 30 Jul 2016 00:00:33 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 080AF1301; Sat, 30 Jul 2016 00:00:32 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 647313C1BEE; Sat, 30 Jul 2016 10:00:05 +1000 (AEST) Date: Sat, 30 Jul 2016 10:00:05 +1000 (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: r303502 - head/usr.bin/indent In-Reply-To: <201607291936.u6TJaALj035130@repo.freebsd.org> Message-ID: <20160730092525.N1012@besplex.bde.org> References: <201607291936.u6TJaALj035130@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=OtmysHLt c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=V1RT_qUmue8vlDhu7tIA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 30 Jul 2016 00:00:33 -0000 On Fri, 29 Jul 2016, Pedro F. Giffuni wrote: > Log: > indent(1): Use NULL instead of zero for pointers. This is probably not indent's style, I doubt that you found all of the implicit NULLs. A recent commit added strstr() without even a comparison with 0. This adds some lexical style bugs. > Modified: head/usr.bin/indent/indent.c > ============================================================================== > --- head/usr.bin/indent/indent.c Fri Jul 29 18:26:15 2016 (r303501) > +++ head/usr.bin/indent/indent.c Fri Jul 29 19:36:10 2016 (r303502) > @@ -341,8 +341,8 @@ main(int argc, char **argv) > } > case comment: /* we have a comment, so we must copy it into > * the buffer */ > - if (!flushed_nl || sc_end != 0) { > - if (sc_end == 0) { /* if this is the first comment, we > + if (!flushed_nl || sc_end != NULL) { > + if (sc_end == NULL) { /* if this is the first comment, we > * must set up the buffer */ > save_com[0] = save_com[1] = ' '; > sc_end = &(save_com[2]); This breaks the formatting using blind substitution. A program named indent should be used to check the formatting. indent -l is mostly broken, but it works for comments, and indent's source code needs it to format comments more than most programs because indent puts lots of comments to the right of the code where they get moved further right by expansions. Normally, reformatting of such comments is not wanted, but it should be used for new code. I added the -[n]fcb to disable excessive reformatting of comments to the right of code. This only applies to block comments. > @@ -1101,9 +1101,9 @@ check_type: > > while (e_lab > s_lab && (e_lab[-1] == ' ' || e_lab[-1] == '\t')) > e_lab--; > - if (e_lab - s_lab == com_end && bp_save == 0) { /* comment on > - * preprocessor line */ This was a good example of indent's bad style. The comment needed to be in coulumns 64-78 to follow the style. After expansion, it needs to be in columns 72-78. But 2 of the 3 words in it are too long to fit there. > - if (sc_end == 0) /* if this is the first comment, we > + /* comment on preprocessor line */ The expansion wasn't blind, and the comment was moved to fit on new line. indent would have problems moving it, but it wouldn't move it to a wrong place -- from inside the compound statement to outside. > + if (e_lab - s_lab == com_end && bp_save == NULL) { > + if (sc_end == NULL) /* if this is the first comment, we > * must set up the buffer */ > sc_end = &(save_com[0]); > else { indent would have kept it inside the compound statement. It can then be started at the same indentation level as the code, or at the right of a blank statement. The comment could be corrected to live outside of the compound statement by adding an "if" condition to it. That is too hard for indent. The first coment inside the comment gives an example of using an "if" condition but this is not quite right here -- "if" only applies before the test. > Modified: head/usr.bin/indent/io.c > ============================================================================== > --- head/usr.bin/indent/io.c Fri Jul 29 18:26:15 2016 (r303501) > +++ head/usr.bin/indent/io.c Fri Jul 29 19:36:10 2016 (r303502) > @@ -348,10 +348,10 @@ fill_buffer(void) > int i; > FILE *f = input; > > - if (bp_save != 0) { /* there is a partly filled input buffer left */ > + if (bp_save != NULL) { /* there is a partly filled input buffer left */ The formatting was already broken here. It is especially broken since nearby lines use a smaller indentation that would work here too. > buf_ptr = bp_save; /* dont read anything, just switch buffers */ indent dont need know spelling lessons? > buf_end = be_save; > - bp_save = be_save = 0; > + bp_save = be_save = NULL; > if (buf_ptr < buf_end) > return; /* only return if there is really something in > * this buffer */ Bruce From owner-svn-src-head@freebsd.org Sat Jul 30 00:38: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 A85AFBA8EC3; Sat, 30 Jul 2016 00:38:44 +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 748341A33; Sat, 30 Jul 2016 00:38:43 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 1FE681A18CF; Sat, 30 Jul 2016 10:38:35 +1000 (AEST) Date: Sat, 30 Jul 2016 10:38:34 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303503 - head/sys/kern In-Reply-To: <201607292019.u6TKJE98050271@repo.freebsd.org> Message-ID: <20160730101227.J1336@besplex.bde.org> References: <201607292019.u6TKJE98050271@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=EfU1O6SC c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=EEXqYizhvHhXCYCvzqUA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 30 Jul 2016 00:38:44 -0000 On Fri, 29 Jul 2016, John Baldwin wrote: > Log: > Don't treat NOCPU as a valid CPU to CPU_ISSET. > > If a thread is created bound to a cpuset it might already be bound before > it's very first timeslice, and td_lastcpu will be NOCPU in that case. > > MFC after: 1 week Thanks. Did you get this from your mail queue on 2016/05/08? > > Modified: head/sys/kern/sched_4bsd.c > ============================================================================== > --- head/sys/kern/sched_4bsd.c Fri Jul 29 19:36:10 2016 (r303502) > +++ head/sys/kern/sched_4bsd.c Fri Jul 29 20:19:14 2016 (r303503) > @@ -1241,7 +1241,7 @@ sched_pickcpu(struct thread *td) > > mtx_assert(&sched_lock, MA_OWNED); > > - if (THREAD_CAN_SCHED(td, td->td_lastcpu)) > + if (td->td_lastcpu != NOCPU && THREAD_CAN_SCHED(td, td->td_lastcpu)) > best = td->td_lastcpu; > else > best = NOCPU; This bug was more fatal on amd64 than on i386. td_last_cpu has a correct (signed) type int and NOCPU is -1. THREAD_CAN_SCHED uses unsigned type. -1 becomes 0xFFFFFFFFFFFFFFFF in it on amd64 and 0xFFFFFFFF on i386. The old mail says that these get shifted to 1/4 as big, but I think the relevant value is more like 8 -- 8 bits per byte requires a byte at offset 1/8 of of these values in a byte array for a bitmap, but the array is of u_int or u_long so the array index is 1/32nd or 1/64 of these values and the memory offset is 1/8. Anyway, the final offset is small enough to not always trap on i386 only. When NOCPU was 255, t_lastcpu was u_char and the memory offset was 31 bytes. This didn't even give a buffer overrun with MAXCPU = 254. When td_lastcpu is NOCPU and the check doesn't trap, 'best' is set to NOCPU in both cases and the code works. Bruce From owner-svn-src-head@freebsd.org Sat Jul 30 01:00: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 39FEEBA73BF; Sat, 30 Jul 2016 01:00:18 +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 EF131161E; Sat, 30 Jul 2016 01:00:17 +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 u6U10HoJ056758; Sat, 30 Jul 2016 01:00:17 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6U10GNt056755; Sat, 30 Jul 2016 01:00:16 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201607300100.u6U10GNt056755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 30 Jul 2016 01:00:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303524 - in head: include lib/libc/stdio 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.22 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, 30 Jul 2016 01:00:18 -0000 Author: bapt Date: Sat Jul 30 01:00:16 2016 New Revision: 303524 URL: https://svnweb.freebsd.org/changeset/base/303524 Log: Remove _WITH_GETLINE and _WITH_DPRINTF guards When adding getline(3) and dprintf(3) into libc, those guards were added to prevent breaking too many ports. 7 years later the ports tree have been fixed, it is time to remove this FreeBSDism While here remove the extra parenthesis surrounding dprintf(3) Modified: head/include/stdio.h head/lib/libc/stdio/getline.3 head/lib/libc/stdio/printf.3 Modified: head/include/stdio.h ============================================================================== --- head/include/stdio.h Fri Jul 29 23:30:33 2016 (r303523) +++ head/include/stdio.h Sat Jul 30 01:00:16 2016 (r303524) @@ -357,44 +357,8 @@ ssize_t getdelim(char ** __restrict, si FILE *open_memstream(char **, size_t *); int renameat(int, const char *, int, const char *); int vdprintf(int, const char * __restrict, __va_list); - -/* - * Every programmer and his dog wrote functions called getline() and dprintf() - * before POSIX.1-2008 came along and decided to usurp the names, so we - * don't prototype them by default unless one of the following is true: - * a) the app has requested them specifically by defining _WITH_GETLINE or - * _WITH_DPRINTF, respectively - * b) the app has requested a POSIX.1-2008 environment via _POSIX_C_SOURCE - * c) the app defines a GNUism such as _BSD_SOURCE or _GNU_SOURCE - */ -#ifndef _WITH_GETLINE -#if defined(_BSD_SOURCE) || defined(_GNU_SOURCE) -#define _WITH_GETLINE -#elif defined(_POSIX_C_SOURCE) -#if _POSIX_C_SOURCE >= 200809 -#define _WITH_GETLINE -#endif -#endif -#endif - -#ifdef _WITH_GETLINE ssize_t getline(char ** __restrict, size_t * __restrict, FILE * __restrict); -#endif - -#ifndef _WITH_DPRINTF -#if defined(_BSD_SOURCE) || defined(_GNU_SOURCE) -#define _WITH_DPRINTF -#elif defined(_POSIX_C_SOURCE) -#if _POSIX_C_SOURCE >= 200809 -#define _WITH_DPRINTF -#endif -#endif -#endif - -#ifdef _WITH_DPRINTF -int (dprintf)(int, const char * __restrict, ...); -#endif - +int dprintf(int, const char * __restrict, ...); #endif /* __POSIX_VISIBLE >= 200809 */ /* Modified: head/lib/libc/stdio/getline.3 ============================================================================== --- head/lib/libc/stdio/getline.3 Fri Jul 29 23:30:33 2016 (r303523) +++ head/lib/libc/stdio/getline.3 Sat Jul 30 01:00:16 2016 (r303524) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 30, 2012 +.Dd July 30, 2016 .Dt GETLINE 3 .Os .Sh NAME @@ -34,7 +34,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.Fd "#define _WITH_GETLINE" .In stdio.h .Ft ssize_t .Fn getdelim "char ** restrict linep" "size_t * restrict linecapp" "int delimiter" " FILE * restrict stream" @@ -97,34 +96,6 @@ while ((linelen = getline(&line, &lineca fwrite(line, linelen, 1, stdout); free(line); .Ed -.Sh COMPATIBILITY -Many application writers used the name -.Va getline -before the -.Fn getline -function was introduced in -.St -p1003.1 , -so a prototype is not provided by default in order to avoid -compatibility problems. -Applications that wish to use the -.Fn getline -function described herein should either request a strict -.St -p1003.1-2008 -environment by defining the macro -.Dv _POSIX_C_SOURCE -to the value 200809 or greater, or by defining the macro -.Dv _WITH_GETLINE , -prior to the inclusion of -.In stdio.h . -For compatibility with GNU libc, defining either -.Dv _BSD_SOURCE -or -.Dv _GNU_SOURCE -prior to the inclusion of -.In stdio.h -will also make -.Fn getline -available. .Sh ERRORS These functions may fail if: .Bl -tag -width Er Modified: head/lib/libc/stdio/printf.3 ============================================================================== --- head/lib/libc/stdio/printf.3 Fri Jul 29 23:30:33 2016 (r303523) +++ head/lib/libc/stdio/printf.3 Sat Jul 30 01:00:16 2016 (r303524) @@ -32,7 +32,7 @@ .\" @(#)printf.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 2, 2009 +.Dd July 30, 2016 .Dt PRINTF 3 .Os .Sh NAME @@ -42,7 +42,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.Fd "#define _WITH_DPRINTF" .In stdio.h .Ft int .Fn printf "const char * restrict format" ... @@ -715,34 +714,6 @@ char *newfmt(const char *fmt, ...) } .Ed .Sh COMPATIBILITY -Many application writers used the name -.Va dprintf -before the -.Fn dprintf -function was introduced in -.St -p1003.1 , -so a prototype is not provided by default in order to avoid -compatibility problems. -Applications that wish to use the -.Fn dprintf -function described herein should either request a strict -.St -p1003.1-2008 -environment by defining the macro -.Dv _POSIX_C_SOURCE -to the value 200809 or greater, or by defining the macro -.Dv _WITH_DPRINTF , -prior to the inclusion of -.In stdio.h . -For compatibility with GNU libc, defining either -.Dv _BSD_SOURCE -or -.Dv _GNU_SOURCE -prior to the inclusion of -.In stdio.h -will also make -.Fn dprintf -available. -.Pp The conversion formats .Cm \&%D , \&%O , and From owner-svn-src-head@freebsd.org Sat Jul 30 01:04: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 1D1FCBA7557; Sat, 30 Jul 2016 01:04:20 +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 CA6CC1B03; Sat, 30 Jul 2016 01:04:19 +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 u6U14JTL060466; Sat, 30 Jul 2016 01:04:19 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6U14IIl060463; Sat, 30 Jul 2016 01:04:18 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201607300104.u6U14IIl060463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 30 Jul 2016 01:04:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303525 - head/usr.bin/indent 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.22 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, 30 Jul 2016 01:04:20 -0000 Author: pfg Date: Sat Jul 30 01:04:18 2016 New Revision: 303525 URL: https://svnweb.freebsd.org/changeset/base/303525 Log: indent(1): Yet more style issues. strchr(3) returns a pointer not a boolean. Attempt to make the style somewhat more ocnsistent with what indent had before recent changes. Pointed out by: bde Modified: head/usr.bin/indent/indent.c head/usr.bin/indent/io.c head/usr.bin/indent/lexi.c Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Sat Jul 30 01:00:16 2016 (r303524) +++ head/usr.bin/indent/indent.c Sat Jul 30 01:04:18 2016 (r303525) @@ -342,8 +342,8 @@ main(int argc, char **argv) case comment: /* we have a comment, so we must copy it into * the buffer */ if (!flushed_nl || sc_end != NULL) { - if (sc_end == NULL) { /* if this is the first comment, we - * must set up the buffer */ + if (sc_end == NULL) { /* if this is the first comment, we + * must set up the buffer */ save_com[0] = save_com[1] = ' '; sc_end = &(save_com[2]); } @@ -1100,8 +1100,8 @@ check_type: while (e_lab > s_lab && (e_lab[-1] == ' ' || e_lab[-1] == '\t')) e_lab--; - /* comment on preprocessor line */ if (e_lab - s_lab == com_end && bp_save == NULL) { + /* comment on preprocessor line */ if (sc_end == NULL) /* if this is the first comment, we * must set up the buffer */ sc_end = &(save_com[0]); Modified: head/usr.bin/indent/io.c ============================================================================== --- head/usr.bin/indent/io.c Sat Jul 30 01:00:16 2016 (r303524) +++ head/usr.bin/indent/io.c Sat Jul 30 01:04:18 2016 (r303525) @@ -348,8 +348,8 @@ fill_buffer(void) int i; FILE *f = input; - if (bp_save != NULL) { /* there is a partly filled input buffer left */ - buf_ptr = bp_save; /* dont read anything, just switch buffers */ + if (bp_save != NULL) { /* there is a partly filled input buffer left */ + buf_ptr = bp_save; /* do not read anything, just switch buffers */ buf_end = be_save; bp_save = be_save = NULL; if (buf_ptr < buf_end) Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Sat Jul 30 01:00:16 2016 (r303524) +++ head/usr.bin/indent/lexi.c Sat Jul 30 01:04:18 2016 (r303525) @@ -197,7 +197,7 @@ lexi(void) seensfx |= 1; continue; } - if (!(seensfx & 2) && strchr("fFlL", *buf_ptr)) { + if (!(seensfx & 2) && (strchr("fFlL", *buf_ptr) != NULL)) { CHECK_SIZE_TOKEN; if (buf_ptr[1] == buf_ptr[0]) *e_token++ = *buf_ptr++; From owner-svn-src-head@freebsd.org Sat Jul 30 01:07: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 072E1BA75F2 for ; Sat, 30 Jul 2016 01:07:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm27-vm1.bullet.mail.bf1.yahoo.com (nm27-vm1.bullet.mail.bf1.yahoo.com [98.139.213.148]) (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 AB50B1CB8 for ; Sat, 30 Jul 2016 01:07:21 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1469840834; bh=rwwqOocnuolyarma6YaI1thlPozL5ccJojiUjPr/YLY=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=AkXW0LNtcotSTYwR6LfYf58lvJ1vXt5umjFYeoSa18qYILeWIZID1BityEjxtH8mz0ae4Tg84Wml8qOQf5f0TnoPFD+5iouR+8+/i7p7QExG4VSoL7606rHxzhSgo8ZIpmAKuMt6l/FDVzS8YczFXjej0Lvu1nMrQe41+LMjdCqPRxhVs6BGOelygHuMbxItoLj7aMgkLNMdUzUmXUlj+UlH9yhT21eYXon8xkQnTZ4LC7bUD0ZAJto60LoIYl6CyewNdYWcAOtYDZNSrZE5fXCuDA9kxnbJZSlweZZamx9Mtw2lQEfQeVIjwdXSoP161NE2+/1CbcjNWpzEMOixaA== Received: from [98.139.215.140] by nm27.bullet.mail.bf1.yahoo.com with NNFMP; 30 Jul 2016 01:07:14 -0000 Received: from [98.139.211.193] by tm11.bullet.mail.bf1.yahoo.com with NNFMP; 30 Jul 2016 01:07:14 -0000 Received: from [127.0.0.1] by smtp202.mail.bf1.yahoo.com with NNFMP; 30 Jul 2016 01:07:14 -0000 X-Yahoo-Newman-Id: 157790.69583.bm@smtp202.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: XmnWLkMVM1m_ZF0wZrmGFtaQs49PaejaL3nm1TROHTcNw9J Reo8hDIB_Lpgn6DFNjZu48ah1bT_Q1asN2kCIpjcjOdaC7rRT_Q8dJqC7UqT M94ioGKIKQNOTUVXU0SEx_hY4PuMPgl3Bf5A17CE6A3p41HUywcCXuI8V0p0 U.7Zc6E4GafuYMLDRfYHoScJXHlB.d4lH6SZrwrz8REmhtOeCKCDoZon7Lej .CaJ7NqGsxfpAR62PGPChBdr1iEoSDetdhVy7A8dg1Ew5PVzki56ZQPzqcUS 5JPKJ_4S2WGPQVcX2d_lVpmvPIv1bkjc7pQLfIsnI2HrSxGB.m5e_.qh9EUp TyV4coIc8B5MZt9NTYy69Sw4tA73tHqfrk8dq7miDW7Y7WK1Inl_uitHx8P. IzaN6FRHD9YdaM0wa49InOC8IHPfYosuXTN0R6eq7.UbfSkytsnKGcOtva6K qaDjogn0I.5O7WJ6gai3rDfhhrkZ3k5ZY1KlIRt2MfX01sTWKuuhwbup_kA6 DCvHfXP1biyTO8curKBzWRpW.TgjVA1DBtoi7.hCmuDTRtQ-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r303502 - head/usr.bin/indent To: Bruce Evans References: <201607291936.u6TJaALj035130@repo.freebsd.org> <20160730092525.N1012@besplex.bde.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: <8aa1f19c-3bdb-7acf-9cc1-66082cbbc400@FreeBSD.org> Date: Fri, 29 Jul 2016 20:07:21 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160730092525.N1012@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.22 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, 30 Jul 2016 01:07:22 -0000 On 07/29/16 19:00, Bruce Evans wrote: > On Fri, 29 Jul 2016, Pedro F. Giffuni wrote: > >> Log: >> indent(1): Use NULL instead of zero for pointers. > > This is probably not indent's style, I doubt that you found all of the > implicit NULLs. A recent commit added strstr() without even a comparison > with 0. > > This adds some lexical style bugs. > Yikes... hurry doesn't help get commits right. Sorry. Hope r303525 is not worse than what we had before. Pedro. From owner-svn-src-head@freebsd.org Sat Jul 30 01:07: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 D3941BA7667; Sat, 30 Jul 2016 01:07:49 +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 B18C31E3B; Sat, 30 Jul 2016 01:07:49 +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 u6U17mG1060630; Sat, 30 Jul 2016 01:07:48 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6U17mJF060621; Sat, 30 Jul 2016 01:07:48 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201607300107.u6U17mJF060621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 30 Jul 2016 01:07:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303526 - in head/usr.bin: calendar checknr comm grep mandoc sdiff sed soelim uniq 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.22 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, 30 Jul 2016 01:07:49 -0000 Author: bapt Date: Sat Jul 30 01:07:47 2016 New Revision: 303526 URL: https://svnweb.freebsd.org/changeset/base/303526 Log: Remove usage of _WITH_GETLINE from usr.bin Modified: head/usr.bin/calendar/io.c head/usr.bin/checknr/checknr.c head/usr.bin/comm/comm.c head/usr.bin/grep/grep.c head/usr.bin/mandoc/Makefile head/usr.bin/sdiff/sdiff.c head/usr.bin/sed/main.c head/usr.bin/soelim/soelim.c head/usr.bin/uniq/uniq.c Modified: head/usr.bin/calendar/io.c ============================================================================== --- head/usr.bin/calendar/io.c Sat Jul 30 01:04:18 2016 (r303525) +++ head/usr.bin/calendar/io.c Sat Jul 30 01:07:47 2016 (r303526) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define _WITH_GETLINE #include #include #include Modified: head/usr.bin/checknr/checknr.c ============================================================================== --- head/usr.bin/checknr/checknr.c Sat Jul 30 01:04:18 2016 (r303525) +++ head/usr.bin/checknr/checknr.c Sat Jul 30 01:07:47 2016 (r303526) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); * structured typesetting. */ #include -#define _WITH_GETLINE #include #include #include Modified: head/usr.bin/comm/comm.c ============================================================================== --- head/usr.bin/comm/comm.c Sat Jul 30 01:04:18 2016 (r303525) +++ head/usr.bin/comm/comm.c Sat Jul 30 01:07:47 2016 (r303526) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define _WITH_GETLINE #include #include #include Modified: head/usr.bin/grep/grep.c ============================================================================== --- head/usr.bin/grep/grep.c Sat Jul 30 01:04:18 2016 (r303525) +++ head/usr.bin/grep/grep.c Sat Jul 30 01:07:47 2016 (r303526) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define _WITH_GETLINE #include #include #include Modified: head/usr.bin/mandoc/Makefile ============================================================================== --- head/usr.bin/mandoc/Makefile Sat Jul 30 01:04:18 2016 (r303525) +++ head/usr.bin/mandoc/Makefile Sat Jul 30 01:07:47 2016 (r303526) @@ -83,7 +83,6 @@ SRCS+= ${DB_SRCS} WARNS?= 2 CFLAGS+= -DHAVE_CONFIG_H \ - -D_WITH_GETLINE \ -I${.CURDIR}/../../lib/libopenbsd/ \ -I${.CURDIR}/../../contrib/sqlite3 LIBADD= openbsd sqlite3 z Modified: head/usr.bin/sdiff/sdiff.c ============================================================================== --- head/usr.bin/sdiff/sdiff.c Sat Jul 30 01:04:18 2016 (r303525) +++ head/usr.bin/sdiff/sdiff.c Sat Jul 30 01:07:47 2016 (r303526) @@ -22,7 +22,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define _WITH_GETLINE #include #include #include Modified: head/usr.bin/sed/main.c ============================================================================== --- head/usr.bin/sed/main.c Sat Jul 30 01:04:18 2016 (r303525) +++ head/usr.bin/sed/main.c Sat Jul 30 01:07:47 2016 (r303526) @@ -58,7 +58,6 @@ static const char sccsid[] = "@(#)main.c #include #include #include -#define _WITH_GETLINE #include #include #include Modified: head/usr.bin/soelim/soelim.c ============================================================================== --- head/usr.bin/soelim/soelim.c Sat Jul 30 01:04:18 2016 (r303525) +++ head/usr.bin/soelim/soelim.c Sat Jul 30 01:07:47 2016 (r303526) @@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define _WITH_GETLINE #include #include #include Modified: head/usr.bin/uniq/uniq.c ============================================================================== --- head/usr.bin/uniq/uniq.c Sat Jul 30 01:04:18 2016 (r303525) +++ head/usr.bin/uniq/uniq.c Sat Jul 30 01:07:47 2016 (r303526) @@ -53,7 +53,6 @@ static const char rcsid[] = #include #include #include -#define _WITH_GETLINE #include #include #include From owner-svn-src-head@freebsd.org Sat Jul 30 01:10: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 833C2BA772C; Sat, 30 Jul 2016 01:10:07 +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 39EE51175; Sat, 30 Jul 2016 01:10:07 +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 u6U1A6ml060772; Sat, 30 Jul 2016 01:10:06 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6U1A649060767; Sat, 30 Jul 2016 01:10:06 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201607300110.u6U1A649060767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 30 Jul 2016 01:10:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303527 - in head/usr.sbin: autofs pkg pw 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.22 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, 30 Jul 2016 01:10:07 -0000 Author: bapt Date: Sat Jul 30 01:10:05 2016 New Revision: 303527 URL: https://svnweb.freebsd.org/changeset/base/303527 Log: Remove usage of _WITH_GETLINE from usr.sbin Modified: head/usr.sbin/autofs/common.c head/usr.sbin/pkg/pkg.c head/usr.sbin/pw/pw.h head/usr.sbin/pw/pw_vpw.c head/usr.sbin/services_mkdb/services_mkdb.c Modified: head/usr.sbin/autofs/common.c ============================================================================== --- head/usr.sbin/autofs/common.c Sat Jul 30 01:07:47 2016 (r303526) +++ head/usr.sbin/autofs/common.c Sat Jul 30 01:10:05 2016 (r303527) @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define _WITH_GETLINE #include #include #include Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Sat Jul 30 01:07:47 2016 (r303526) +++ head/usr.sbin/pkg/pkg.c Sat Jul 30 01:10:05 2016 (r303527) @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define _WITH_GETLINE #include #include #include Modified: head/usr.sbin/pw/pw.h ============================================================================== --- head/usr.sbin/pw/pw.h Sat Jul 30 01:07:47 2016 (r303526) +++ head/usr.sbin/pw/pw.h Sat Jul 30 01:10:05 2016 (r303527) @@ -28,7 +28,6 @@ #include -#define _WITH_GETLINE #include #include #include Modified: head/usr.sbin/pw/pw_vpw.c ============================================================================== --- head/usr.sbin/pw/pw_vpw.c Sat Jul 30 01:07:47 2016 (r303526) +++ head/usr.sbin/pw/pw_vpw.c Sat Jul 30 01:10:05 2016 (r303527) @@ -33,7 +33,6 @@ static const char rcsid[] = #include #include #include -#define _WITH_GETLINE #include #include #include Modified: head/usr.sbin/services_mkdb/services_mkdb.c ============================================================================== --- head/usr.sbin/services_mkdb/services_mkdb.c Sat Jul 30 01:07:47 2016 (r303526) +++ head/usr.sbin/services_mkdb/services_mkdb.c Sat Jul 30 01:10:05 2016 (r303527) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define _WITH_GETLINE #include #include #include From owner-svn-src-head@freebsd.org Sat Jul 30 01:13: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 1C7F6BA7A59; Sat, 30 Jul 2016 01:13:56 +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 E304F1628; Sat, 30 Jul 2016 01:13:55 +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 u6U1DtMG064362; Sat, 30 Jul 2016 01:13:55 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6U1Dsq2064358; Sat, 30 Jul 2016 01:13:54 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201607300113.u6U1Dsq2064358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 30 Jul 2016 01:13:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303528 - in head: contrib/ofed/usr.lib/libibverbs lib/libc/stdio lib/libc/tests/stdio 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.22 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, 30 Jul 2016 01:13:56 -0000 Author: bapt Date: Sat Jul 30 01:13:54 2016 New Revision: 303528 URL: https://svnweb.freebsd.org/changeset/base/303528 Log: Remove last traces of _WITH_GETLINE Modified: head/contrib/ofed/usr.lib/libibverbs/config.h head/lib/libc/stdio/getline.c head/lib/libc/tests/stdio/getdelim_test.c Modified: head/contrib/ofed/usr.lib/libibverbs/config.h ============================================================================== --- head/contrib/ofed/usr.lib/libibverbs/config.h Sat Jul 30 01:10:05 2016 (r303527) +++ head/contrib/ofed/usr.lib/libibverbs/config.h Sat Jul 30 01:13:54 2016 (r303528) @@ -1,2 +1 @@ -#define _WITH_GETLINE #include Modified: head/lib/libc/stdio/getline.c ============================================================================== --- head/lib/libc/stdio/getline.c Sat Jul 30 01:10:05 2016 (r303527) +++ head/lib/libc/stdio/getline.c Sat Jul 30 01:13:54 2016 (r303528) @@ -27,7 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#define _WITH_GETLINE #include ssize_t Modified: head/lib/libc/tests/stdio/getdelim_test.c ============================================================================== --- head/lib/libc/tests/stdio/getdelim_test.c Sat Jul 30 01:10:05 2016 (r303527) +++ head/lib/libc/tests/stdio/getdelim_test.c Sat Jul 30 01:13:54 2016 (r303528) @@ -27,7 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#define _WITH_GETLINE #include #include #include From owner-svn-src-head@freebsd.org Sat Jul 30 01:16: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 9D27BBA7B37; Sat, 30 Jul 2016 01:16:07 +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 6FE2217A6; Sat, 30 Jul 2016 01:16:07 +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 u6U1G6Aq064484; Sat, 30 Jul 2016 01:16:06 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6U1G6bS064480; Sat, 30 Jul 2016 01:16:06 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201607300116.u6U1G6bS064480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 30 Jul 2016 01:16:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303529 - in head: contrib/libexecinfo lib/libc/stdio sys/contrib/libnv 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.22 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, 30 Jul 2016 01:16:07 -0000 Author: bapt Date: Sat Jul 30 01:16:06 2016 New Revision: 303529 URL: https://svnweb.freebsd.org/changeset/base/303529 Log: Remove usage of _WITH_DPRINTF Modified: head/contrib/libexecinfo/backtrace.c head/lib/libc/stdio/dprintf.c head/sys/contrib/libnv/nvlist.c Modified: head/contrib/libexecinfo/backtrace.c ============================================================================== --- head/contrib/libexecinfo/backtrace.c Sat Jul 30 01:13:54 2016 (r303528) +++ head/contrib/libexecinfo/backtrace.c Sat Jul 30 01:16:06 2016 (r303529) @@ -33,7 +33,6 @@ __RCSID("$NetBSD: backtrace.c,v 1.3 2013 #include #include -#define _WITH_DPRINTF #include #include #include Modified: head/lib/libc/stdio/dprintf.c ============================================================================== --- head/lib/libc/stdio/dprintf.c Sat Jul 30 01:13:54 2016 (r303528) +++ head/lib/libc/stdio/dprintf.c Sat Jul 30 01:16:06 2016 (r303529) @@ -27,7 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#define _WITH_DPRINTF #include "namespace.h" #include #include Modified: head/sys/contrib/libnv/nvlist.c ============================================================================== --- head/sys/contrib/libnv/nvlist.c Sat Jul 30 01:13:54 2016 (r303528) +++ head/sys/contrib/libnv/nvlist.c Sat Jul 30 01:16:06 2016 (r303529) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define _WITH_DPRINTF #include #include #include From owner-svn-src-head@freebsd.org Sat Jul 30 01:18: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 5AF9BBA7C13; Sat, 30 Jul 2016 01:18:50 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 259A81A14; Sat, 30 Jul 2016 01:18:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 5F27D3C28DF; Sat, 30 Jul 2016 11:18:48 +1000 (AEST) Date: Sat, 30 Jul 2016 11:18:47 +1000 (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: r303523 - head/usr.bin/indent In-Reply-To: <201607292330.u6TNUX8o022653@repo.freebsd.org> Message-ID: <20160730111829.C1526@besplex.bde.org> References: <201607292330.u6TNUX8o022653@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=OtmysHLt c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=JJnoGoR6jGnaglEbEdIA:9 a=CjuIK1q_8ugA:10 a=zH-YL7wxbLwA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 30 Jul 2016 01:18:50 -0000 On Fri, 29 Jul 2016, Pedro F. Giffuni wrote: > Log: > indent(1): Attempt to preserve some consistent style. > > Remove the excessive braces from r303485 and align the comments to the > right as done in the rest of the code. This is not nice but there is no > clear way to make it nice (and KNF). > > Pointed out by: bde Thanks. Bruce From owner-svn-src-head@freebsd.org Sat Jul 30 01:42: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 87BA8BA8369; Sat, 30 Jul 2016 01:42:38 +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 C34CB175D; Sat, 30 Jul 2016 01:42:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 58294D677F0; Sat, 30 Jul 2016 11:42:36 +1000 (AEST) Date: Sat, 30 Jul 2016 11:42:36 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Baptiste Daroussin cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303524 - in head: include lib/libc/stdio In-Reply-To: <201607300100.u6U10GNt056755@repo.freebsd.org> Message-ID: <20160730111943.B1526@besplex.bde.org> References: <201607300100.u6U10GNt056755@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=VIkg5I7X c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=wypO7mQGsu0IoGoJGhoA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 30 Jul 2016 01:42:38 -0000 On Sat, 30 Jul 2016, Baptiste Daroussin wrote: > Log: > Remove _WITH_GETLINE and _WITH_DPRINTF guards > > When adding getline(3) and dprintf(3) into libc, those guards were added > to prevent breaking too many ports. > > 7 years later the ports tree have been fixed, it is time to remove this > FreeBSDism This increases style bugs related to the ifdefs. > While here remove the extra parenthesis surrounding dprintf(3) Perhaps they weren't extra. They allowed applications that to #define dprintf and still get the function if they also #define suitable magic _WITH* macros. Now that dprintf() is fully reserved for the implementation, they are just extra because the implementation doesn't have a macro version. > Modified: head/include/stdio.h > ============================================================================== > --- head/include/stdio.h Fri Jul 29 23:30:33 2016 (r303523) > +++ head/include/stdio.h Sat Jul 30 01:00:16 2016 (r303524) > @@ -357,44 +357,8 @@ ssize_t getdelim(char ** __restrict, si > FILE *open_memstream(char **, size_t *); > int renameat(int, const char *, int, const char *); > int vdprintf(int, const char * __restrict, __va_list); > - > -/* > - * Every programmer and his dog wrote functions called getline() and dprintf() > - * before POSIX.1-2008 came along and decided to usurp the names, so we > - * don't prototype them by default unless one of the following is true: > - * a) the app has requested them specifically by defining _WITH_GETLINE or > - * _WITH_DPRINTF, respectively > - * b) the app has requested a POSIX.1-2008 environment via _POSIX_C_SOURCE > - * c) the app defines a GNUism such as _BSD_SOURCE or _GNU_SOURCE > - */ > -#ifndef _WITH_GETLINE > -#if defined(_BSD_SOURCE) || defined(_GNU_SOURCE) > -#define _WITH_GETLINE > -#elif defined(_POSIX_C_SOURCE) > -#if _POSIX_C_SOURCE >= 200809 > -#define _WITH_GETLINE > -#endif > -#endif > -#endif > - > -#ifdef _WITH_GETLINE > ssize_t getline(char ** __restrict, size_t * __restrict, FILE * __restrict); > -#endif > - > -#ifndef _WITH_DPRINTF > -#if defined(_BSD_SOURCE) || defined(_GNU_SOURCE) > -#define _WITH_DPRINTF > -#elif defined(_POSIX_C_SOURCE) > -#if _POSIX_C_SOURCE >= 200809 > -#define _WITH_DPRINTF > -#endif > -#endif > -#endif > - > -#ifdef _WITH_DPRINTF > -int (dprintf)(int, const char * __restrict, ...); > -#endif > - > +int dprintf(int, const char * __restrict, ...); > #endif /* __POSIX_VISIBLE >= 200809 */ getline and dprintf are still int this POSIX section, so they are not exposed to earlier POSIXes or C99 or C90, but they still are unsorted within this section. The unsorting made the ifdefs less unreadable (except g before d was just backwards). Now it is just an expecially bad historical order. > Modified: head/lib/libc/stdio/printf.3 This man page is almost unreadable since it has many functions in it organised in a strange order that is approximately on decreasing age and standardness. So you need grep to find anything in it. Bruce From owner-svn-src-head@freebsd.org Sat Jul 30 02:09: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 DD00EBA86EA; Sat, 30 Jul 2016 02:09:12 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD27C1EB2; Sat, 30 Jul 2016 02:09:12 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6U29Bn1082701; Sat, 30 Jul 2016 02:09:11 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6U29BXC082700; Sat, 30 Jul 2016 02:09:11 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201607300209.u6U29BXC082700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sat, 30 Jul 2016 02:09:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303530 - head/lib/libc/gen 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.22 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, 30 Jul 2016 02:09:13 -0000 Author: ache Date: Sat Jul 30 02:09:11 2016 New Revision: 303530 URL: https://svnweb.freebsd.org/changeset/base/303530 Log: Reset errno for readdirfunc() before contunue. Modified: head/lib/libc/gen/glob.c Modified: head/lib/libc/gen/glob.c ============================================================================== --- head/lib/libc/gen/glob.c Sat Jul 30 01:16:06 2016 (r303529) +++ head/lib/libc/gen/glob.c Sat Jul 30 02:09:11 2016 (r303530) @@ -781,8 +781,10 @@ glob3(Char *pathbuf, Char *pathend, Char } /* Initial DOT must be matched literally. */ - if (dp->d_name[0] == '.' && UNPROT(*pattern) != DOT) + if (dp->d_name[0] == '.' && UNPROT(*pattern) != DOT) { + errno = 0; continue; + } memset(&mbs, 0, sizeof(mbs)); dc = pathend; sc = dp->d_name; @@ -803,6 +805,7 @@ glob3(Char *pathbuf, Char *pathend, Char } if (too_long || !match(pathend, pattern, restpattern)) { *pathend = EOS; + errno = 0; continue; } err = glob2(pathbuf, --dc, pathend_last, restpattern, From owner-svn-src-head@freebsd.org Sat Jul 30 03:05: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 72D89BA7440; Sat, 30 Jul 2016 03:05:25 +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 4A8411D06; Sat, 30 Jul 2016 03:05:25 +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 u6U35OlI005895; Sat, 30 Jul 2016 03:05:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6U35ORs005889; Sat, 30 Jul 2016 03:05:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201607300305.u6U35ORs005889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 30 Jul 2016 03:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303531 - in head: . lib/librtld_db 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.22 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, 30 Jul 2016 03:05:25 -0000 Author: markj Date: Sat Jul 30 03:05:23 2016 New Revision: 303531 URL: https://svnweb.freebsd.org/changeset/base/303531 Log: librtld_db: Use the auxv to figure out where to look up loader symbols. Previously, librtld_db just hardcoded /libexec/ld-elf.so, which isn't correct for processes that aren't using the native ABI. With this change, librtld_db can be used to inspect non-native processes; in particular, dtrace -c now works for 32-bit executables on amd64. MFC after: 1 month Modified: head/Makefile.inc1 head/lib/librtld_db/Makefile head/lib/librtld_db/rtld_db.c head/lib/librtld_db/rtld_db.h head/share/mk/src.libnames.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Jul 30 02:09:11 2016 (r303530) +++ head/Makefile.inc1 Sat Jul 30 03:05:23 2016 (r303531) @@ -2095,7 +2095,9 @@ cddl/lib/libctf__L: lib/libz__L # cddl/lib/libdtrace requires lib/libproc and lib/librtld_db; it's only built # on select architectures though (see cddl/lib/Makefile) .if ${MACHINE_CPUARCH} != "sparc64" -_prebuild_libs+= lib/libproc lib/librtld_db +_prebuild_libs+= lib/libprocstat lib/libproc lib/librtld_db +lib/libproc__L: lib/libprocstat__L +lib/librtld_db__L: lib/libprocstat__L .endif .if ${MK_CRYPT} != "no" Modified: head/lib/librtld_db/Makefile ============================================================================== --- head/lib/librtld_db/Makefile Sat Jul 30 02:09:11 2016 (r303530) +++ head/lib/librtld_db/Makefile Sat Jul 30 03:05:23 2016 (r303531) @@ -14,4 +14,6 @@ CFLAGS+= -I${.CURDIR} # Avoid circular dependency, we only need the libproc.h header here. CFLAGS+= -I${.CURDIR:H}/libproc +LIBADD+= elf procstat + .include Modified: head/lib/librtld_db/rtld_db.c ============================================================================== --- head/lib/librtld_db/rtld_db.c Sat Jul 30 02:09:11 2016 (r303530) +++ head/lib/librtld_db/rtld_db.c Sat Jul 30 03:05:23 2016 (r303531) @@ -25,20 +25,30 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - */ + */ + #include __FBSDID("$FreeBSD$"); -#include -#include +#include +#include +#include #include +#include #include +#include +#include #include #include #include -#include +#include + +#include + +#include #include +#include #include #include "rtld_db.h" @@ -55,6 +65,8 @@ void rd_delete(rd_agent_t *rdap) { + if (rdap->rda_procstat != NULL) + procstat_close(rdap->rda_procstat); free(rdap); } @@ -146,9 +158,10 @@ rd_init(int version) rd_err_e rd_loadobj_iter(rd_agent_t *rdap, rl_iter_f *cb, void *clnt_data) { - int cnt, i, lastvn = 0; - rd_loadobj_t rdl; struct kinfo_vmentry *kves, *kve; + rd_loadobj_t rdl; + rd_err_e ret; + int cnt, i, lastvn; DPRINTF("%s\n", __func__); @@ -156,6 +169,9 @@ rd_loadobj_iter(rd_agent_t *rdap, rl_ite warn("ERROR: kinfo_getvmmap() failed"); return (RD_ERR); } + + ret = RD_OK; + lastvn = 0; for (i = 0; i < cnt; i++) { kve = kves + i; if (kve->kve_type == KVME_TYPE_VNODE) @@ -174,12 +190,14 @@ rd_loadobj_iter(rd_agent_t *rdap, rl_ite if (kve->kve_protection & KVME_PROT_EXEC) rdl.rdl_prot |= RD_RDL_X; strlcpy(rdl.rdl_path, kves[lastvn].kve_path, - sizeof(rdl.rdl_path)); - (*cb)(&rdl, clnt_data); + sizeof(rdl.rdl_path)); + if ((*cb)(&rdl, clnt_data) != 0) { + ret = RD_ERR; + break; + } } free(kves); - - return (RD_OK); + return (ret); } void @@ -195,13 +213,18 @@ rd_new(struct proc_handle *php) { rd_agent_t *rdap; - rdap = malloc(sizeof(rd_agent_t)); - if (rdap) { - memset(rdap, 0, sizeof(rd_agent_t)); - rdap->rda_php = php; - rd_reset(rdap); + rdap = malloc(sizeof(*rdap)); + if (rdap == NULL) + return (NULL); + + memset(rdap, 0, sizeof(rd_agent_t)); + rdap->rda_php = php; + rdap->rda_procstat = procstat_open_sysctl(); + + if (rd_reset(rdap) != RD_OK) { + rd_delete(rdap); + rdap = NULL; } - return (rdap); } @@ -231,24 +254,136 @@ rd_plt_resolution(rd_agent_t *rdap, uint return (RD_ERR); } -rd_err_e -rd_reset(rd_agent_t *rdap) +static int +rtld_syms(rd_agent_t *rdap, const char *rtldpath, u_long base) { + GElf_Shdr shdr; GElf_Sym sym; + Elf *e; + Elf_Data *data; + Elf_Scn *scn; + const char *symname; + Elf64_Word strscnidx; + int fd, i, ret; + + ret = 1; + e = NULL; + + fd = open(rtldpath, O_RDONLY); + if (fd < 0) + goto err; + + if (elf_version(EV_CURRENT) == EV_NONE) + goto err; + e = elf_begin(fd, ELF_C_READ, NULL); + if (e == NULL) { + close(fd); + goto err; + } - if (proc_name2sym(rdap->rda_php, "ld-elf.so.1", "r_debug_state", - &sym, NULL) < 0) - return (RD_ERR); - DPRINTF("found r_debug_state at 0x%lx\n", (unsigned long)sym.st_value); - rdap->rda_preinit_addr = sym.st_value; - rdap->rda_dlactivity_addr = sym.st_value; + scn = NULL; + while ((scn = elf_nextscn(e, scn)) != NULL) { + gelf_getshdr(scn, &shdr); + if (shdr.sh_type == SHT_DYNSYM) + break; + } + if (scn == NULL) + goto err; - if (proc_name2sym(rdap->rda_php, "ld-elf.so.1", "_r_debug_postinit", - &sym, NULL) < 0) + strscnidx = shdr.sh_link; + data = elf_getdata(scn, NULL); + if (data == NULL) + goto err; + + for (i = 0; gelf_getsym(data, i, &sym) != NULL; i++) { + if (GELF_ST_TYPE(sym.st_info) != STT_FUNC || + GELF_ST_BIND(sym.st_info) != STB_GLOBAL) + continue; + symname = elf_strptr(e, strscnidx, sym.st_name); + if (symname == NULL) + continue; + + if (strcmp(symname, "r_debug_state") == 0) { + rdap->rda_preinit_addr = sym.st_value + base; + rdap->rda_dlactivity_addr = sym.st_value + base; + } else if (strcmp(symname, "_r_debug_postinit") == 0) { + rdap->rda_postinit_addr = sym.st_value + base; + } + } + + if (rdap->rda_preinit_addr != 0 && + rdap->rda_postinit_addr != 0 && + rdap->rda_dlactivity_addr != 0) + ret = 0; + +err: + if (e != NULL) + (void)elf_end(e); + if (fd >= 0) + (void)close(fd); + return (ret); +} + +rd_err_e +rd_reset(rd_agent_t *rdap) +{ + struct kinfo_proc *kp; + struct kinfo_vmentry *kve; + Elf_Auxinfo *auxv; + const char *rtldpath; + u_long base; + rd_err_e rderr; + int count, i; + + kp = NULL; + auxv = NULL; + kve = NULL; + rderr = RD_ERR; + + kp = procstat_getprocs(rdap->rda_procstat, KERN_PROC_PID, + proc_getpid(rdap->rda_php), &count); + if (kp == NULL) return (RD_ERR); - DPRINTF("found _r_debug_postinit at 0x%lx\n", - (unsigned long)sym.st_value); - rdap->rda_postinit_addr = sym.st_value; + assert(count == 1); - return (RD_OK); + auxv = procstat_getauxv(rdap->rda_procstat, kp, &count); + if (auxv == NULL) + goto err; + + base = 0; + for (i = 0; i < count; i++) { + if (auxv[i].a_type == AT_BASE) { + base = auxv[i].a_un.a_val; + break; + } + } + if (i == count) + goto err; + + rtldpath = NULL; + kve = procstat_getvmmap(rdap->rda_procstat, kp, &count); + if (kve == NULL) + goto err; + for (i = 0; i < count; i++) { + if (kve[i].kve_start == base) { + rtldpath = kve[i].kve_path; + break; + } + } + if (i == count) + goto err; + + if (rtld_syms(rdap, rtldpath, base) != 0) + goto err; + + rderr = RD_OK; + +err: + if (kve != NULL) + procstat_freevmmap(rdap->rda_procstat, kve); + if (auxv != NULL) + procstat_freeauxv(rdap->rda_procstat, auxv); + if (kp != NULL) + procstat_freeprocs(rdap->rda_procstat, kp); + return (rderr); } Modified: head/lib/librtld_db/rtld_db.h ============================================================================== --- head/lib/librtld_db/rtld_db.h Sat Jul 30 02:09:11 2016 (r303530) +++ head/lib/librtld_db/rtld_db.h Sat Jul 30 03:05:23 2016 (r303531) @@ -33,9 +33,6 @@ #define _RTLD_DB_H_ #include -#include -#include - #define RD_VERSION 1 @@ -49,11 +46,17 @@ typedef enum { RD_NOMAPS } rd_err_e; +/* XXX struct rd_agent should be private. */ +struct procstat; + typedef struct rd_agent { struct proc_handle *rda_php; + uintptr_t rda_dlactivity_addr; uintptr_t rda_preinit_addr; uintptr_t rda_postinit_addr; + + struct procstat *rda_procstat; } rd_agent_t; typedef struct rd_loadobj { Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Sat Jul 30 02:09:11 2016 (r303530) +++ head/share/mk/src.libnames.mk Sat Jul 30 03:05:23 2016 (r303531) @@ -243,6 +243,7 @@ _DP_radius= md .else _DP_radius= crypto .endif +_DP_rtld_db= elf procstat _DP_procstat= kvm util elf .if ${MK_CXX} == "yes" .if ${MK_LIBCPLUSPLUS} != "no" From owner-svn-src-head@freebsd.org Sat Jul 30 03:07: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 B2DE9BA74D9; Sat, 30 Jul 2016 03:07:15 +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 7C6311EB1; Sat, 30 Jul 2016 03:07:15 +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 u6U37EIf006002; Sat, 30 Jul 2016 03:07:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6U37EAo006001; Sat, 30 Jul 2016 03:07:14 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201607300307.u6U37EAo006001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 30 Jul 2016 03:07:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303532 - head/lib/libproc 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.22 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, 30 Jul 2016 03:07:15 -0000 Author: markj Date: Sat Jul 30 03:07:14 2016 New Revision: 303532 URL: https://svnweb.freebsd.org/changeset/base/303532 Log: Add descriptions for fields in struct proc_handle. Remove the unused kq field and some unnecessary includes. MFC after: 1 month Modified: head/lib/libproc/_libproc.h Modified: head/lib/libproc/_libproc.h ============================================================================== --- head/lib/libproc/_libproc.h Sat Jul 30 03:05:23 2016 (r303531) +++ head/lib/libproc/_libproc.h Sat Jul 30 03:07:14 2016 (r303532) @@ -26,27 +26,24 @@ * $FreeBSD$ */ -#include -#include #include -#include #include + #include #include "libproc.h" struct proc_handle { pid_t pid; /* Process ID. */ - int kq; /* Kernel event queue ID. */ int flags; /* Process flags. */ int status; /* Process status (PS_*). */ int wstat; /* Process wait status. */ rd_agent_t *rdap; /* librtld_db agent */ - rd_loadobj_t *rdobjs; - size_t rdobjsz; - size_t nobjs; - struct lwpstatus lwps; - rd_loadobj_t *rdexec; /* rdobj index of program executable. */ + rd_loadobj_t *rdobjs; /* Array of loaded objects. */ + size_t rdobjsz; /* Array size. */ + size_t nobjs; /* Num. objects currently loaded. */ + rd_loadobj_t *rdexec; /* rdobj for program executable. */ + struct lwpstatus lwps; /* Process status. */ char execname[MAXPATHLEN]; /* Path to program executable. */ }; From owner-svn-src-head@freebsd.org Sat Jul 30 03:09: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 E771EBA75F8; Sat, 30 Jul 2016 03:09:24 +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 C167B12E3; Sat, 30 Jul 2016 03:09:24 +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 u6U39OYQ006119; Sat, 30 Jul 2016 03:09:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6U39NOJ006112; Sat, 30 Jul 2016 03:09:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201607300309.u6U39NOJ006112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 30 Jul 2016 03:09:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303533 - in head: lib/libproc 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.22 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, 30 Jul 2016 03:09:25 -0000 Author: markj Date: Sat Jul 30 03:09:23 2016 New Revision: 303533 URL: https://svnweb.freebsd.org/changeset/base/303533 Log: libproc: Add proc_getmodel(). This is used by libdtrace to determine the data model of target processes. This allows for the creation of pid provider probes in 32-bit processes on amd64. MFC after: 1 month Modified: head/lib/libproc/Makefile head/lib/libproc/_libproc.h head/lib/libproc/libproc.h head/lib/libproc/proc_create.c head/lib/libproc/proc_rtld.c head/lib/libproc/proc_util.c head/share/mk/src.libnames.mk Modified: head/lib/libproc/Makefile ============================================================================== --- head/lib/libproc/Makefile Sat Jul 30 03:07:14 2016 (r303532) +++ head/lib/libproc/Makefile Sat Jul 30 03:09:23 2016 (r303533) @@ -24,7 +24,7 @@ LIBADD+= cxxrt LIBADD+= supcplusplus .endif -LIBADD+= elf rtld_db util +LIBADD+= elf procstat rtld_db util .if ${MK_CDDL} != "no" LIBADD+= ctf Modified: head/lib/libproc/_libproc.h ============================================================================== --- head/lib/libproc/_libproc.h Sat Jul 30 03:07:14 2016 (r303532) +++ head/lib/libproc/_libproc.h Sat Jul 30 03:09:23 2016 (r303533) @@ -33,18 +33,22 @@ #include "libproc.h" +struct procstat; + struct proc_handle { pid_t pid; /* Process ID. */ int flags; /* Process flags. */ int status; /* Process status (PS_*). */ int wstat; /* Process wait status. */ + int model; /* Process data model. */ rd_agent_t *rdap; /* librtld_db agent */ rd_loadobj_t *rdobjs; /* Array of loaded objects. */ size_t rdobjsz; /* Array size. */ size_t nobjs; /* Num. objects currently loaded. */ rd_loadobj_t *rdexec; /* rdobj for program executable. */ struct lwpstatus lwps; /* Process status. */ - char execname[MAXPATHLEN]; /* Path to program executable. */ + struct procstat *procstat; /* libprocstat handle. */ + char execpath[MAXPATHLEN]; /* Path to program executable. */ }; #ifdef DEBUG Modified: head/lib/libproc/libproc.h ============================================================================== --- head/lib/libproc/libproc.h Sat Jul 30 03:07:14 2016 (r303532) +++ head/lib/libproc/libproc.h Sat Jul 30 03:09:23 2016 (r303533) @@ -113,6 +113,9 @@ typedef struct lwpstatus { #define FLTBPT -1 } lwpstatus_t; +#define PR_MODEL_ILP32 1 +#define PR_MODEL_LP64 2 + /* Function prototype definitions. */ __BEGIN_DECLS @@ -136,6 +139,7 @@ int proc_name2sym(struct proc_handle *, struct ctf_file *proc_name2ctf(struct proc_handle *, const char *); int proc_setflags(struct proc_handle *, int); int proc_state(struct proc_handle *); +int proc_getmodel(struct proc_handle *); pid_t proc_getpid(struct proc_handle *); int proc_wstatus(struct proc_handle *); int proc_getwstat(struct proc_handle *); Modified: head/lib/libproc/proc_create.c ============================================================================== --- head/lib/libproc/proc_create.c Sat Jul 30 03:07:14 2016 (r303532) +++ head/lib/libproc/proc_create.c Sat Jul 30 03:09:23 2016 (r303533) @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -38,57 +39,103 @@ #include #include +#include +#include + #include "_libproc.h" -static int proc_init(pid_t, int, int, struct proc_handle *); +static int getelfclass(int); +static int proc_init(pid_t, int, int, struct proc_handle **); + +static int +getelfclass(int fd) +{ + GElf_Ehdr ehdr; + Elf *e; + int class; + + class = ELFCLASSNONE; + + if ((e = elf_begin(fd, ELF_C_READ, NULL)) == NULL) + goto out; + if (gelf_getehdr(e, &ehdr) == NULL) + goto out; + class = ehdr.e_ident[EI_CLASS]; +out: + (void)elf_end(e); + return (class); +} static int -proc_init(pid_t pid, int flags, int status, struct proc_handle *phdl) +proc_init(pid_t pid, int flags, int status, struct proc_handle **pphdl) { - int mib[4], error; - size_t len; + struct kinfo_proc *kp; + struct proc_handle *phdl; + int error, class, count, fd; + + *pphdl = NULL; + if ((phdl = malloc(sizeof(*phdl))) == NULL) + return (ENOMEM); memset(phdl, 0, sizeof(*phdl)); phdl->pid = pid; phdl->flags = flags; phdl->status = status; + phdl->procstat = procstat_open_sysctl(); + if (phdl->procstat == NULL) + return (ENOMEM); - mib[0] = CTL_KERN; - mib[1] = KERN_PROC; - mib[2] = KERN_PROC_PATHNAME; - mib[3] = pid; - len = sizeof(phdl->execname); - if (sysctl(mib, 4, phdl->execname, &len, NULL, 0) != 0) { - error = errno; - DPRINTF("ERROR: cannot get pathname for child process %d", pid); + /* Obtain a path to the executable. */ + if ((kp = procstat_getprocs(phdl->procstat, KERN_PROC_PID, pid, + &count)) == NULL) + return (ENOMEM); + error = procstat_getpathname(phdl->procstat, kp, phdl->execpath, + sizeof(phdl->execpath)); + procstat_freeprocs(phdl->procstat, kp); + if (error != 0) return (error); + + /* Use it to determine the data model for the process. */ + if ((fd = open(phdl->execpath, O_RDONLY)) < 0) { + error = errno; + goto out; } - if (len == 0) - phdl->execname[0] = '\0'; + class = getelfclass(fd); + switch (class) { + case ELFCLASS64: + phdl->model = PR_MODEL_LP64; + break; + case ELFCLASS32: + phdl->model = PR_MODEL_ILP32; + break; + case ELFCLASSNONE: + default: + error = EINVAL; + break; + } + (void)close(fd); - return (0); +out: + *pphdl = phdl; + return (error); } int proc_attach(pid_t pid, int flags, struct proc_handle **pphdl) { struct proc_handle *phdl; - int error = 0; - int status; + int error, status; if (pid == 0 || pid == getpid()) return (EINVAL); + if (elf_version(EV_CURRENT) == EV_NONE) + return (ENOENT); /* * Allocate memory for the process handle, a structure containing * all things related to the process. */ - if ((phdl = malloc(sizeof(struct proc_handle))) == NULL) - return (ENOMEM); - - elf_version(EV_CURRENT); - - error = proc_init(pid, flags, PS_RUN, phdl); + error = proc_init(pid, flags, PS_RUN, &phdl); if (error != 0) goto out; @@ -106,16 +153,17 @@ proc_attach(pid_t pid, int flags, struct } /* Check for an unexpected status. */ - if (WIFSTOPPED(status) == 0) + if (!WIFSTOPPED(status)) DPRINTFX("ERROR: child process %d status 0x%x", pid, status); else phdl->status = PS_STOP; out: - if (error) + if (error && phdl != NULL) { proc_free(phdl); - else - *pphdl = phdl; + phdl = NULL; + } + *pphdl = phdl; return (error); } @@ -128,14 +176,8 @@ proc_create(const char *file, char * con int status; pid_t pid; - /* - * Allocate memory for the process handle, a structure containing - * all things related to the process. - */ - if ((phdl = malloc(sizeof(struct proc_handle))) == NULL) - return (ENOMEM); - - elf_version(EV_CURRENT); + if (elf_version(EV_CURRENT) == EV_NONE) + return (ENOENT); /* Fork a new process. */ if ((pid = vfork()) == -1) @@ -153,9 +195,10 @@ proc_create(const char *file, char * con /* Couldn't execute the file. */ _exit(2); + /* NOTREACHED */ } else { /* The parent owns the process handle. */ - error = proc_init(pid, 0, PS_IDLE, phdl); + error = proc_init(pid, 0, PS_IDLE, &phdl); if (error != 0) goto bad; @@ -167,7 +210,7 @@ proc_create(const char *file, char * con } /* Check for an unexpected status. */ - if (WIFSTOPPED(status) == 0) { + if (!WIFSTOPPED(status)) { error = errno; DPRINTFX("ERROR: child process %d status 0x%x", pid, status); goto bad; @@ -175,15 +218,19 @@ proc_create(const char *file, char * con phdl->status = PS_STOP; } bad: - if (error) + if (error && phdl != NULL) { proc_free(phdl); - else - *pphdl = phdl; + phdl = NULL; + } + *pphdl = phdl; return (error); } void proc_free(struct proc_handle *phdl) { + + if (phdl->procstat != NULL) + procstat_close(phdl->procstat); free(phdl); } Modified: head/lib/libproc/proc_rtld.c ============================================================================== --- head/lib/libproc/proc_rtld.c Sat Jul 30 03:07:14 2016 (r303532) +++ head/lib/libproc/proc_rtld.c Sat Jul 30 03:09:23 2016 (r303533) @@ -49,7 +49,7 @@ map_iter(const rd_loadobj_t *lop, void * if (phdl->rdobjs == NULL) return (-1); } - if (strcmp(lop->rdl_path, phdl->execname) == 0 && + if (strcmp(lop->rdl_path, phdl->execpath) == 0 && (lop->rdl_prot & RD_RDL_X) != 0) phdl->rdexec = &phdl->rdobjs[phdl->nobjs]; memcpy(&phdl->rdobjs[phdl->nobjs++], lop, sizeof(*lop)); Modified: head/lib/libproc/proc_util.c ============================================================================== --- head/lib/libproc/proc_util.c Sat Jul 30 03:07:14 2016 (r303532) +++ head/lib/libproc/proc_util.c Sat Jul 30 03:09:23 2016 (r303533) @@ -140,6 +140,16 @@ proc_getpid(struct proc_handle *phdl) } int +proc_getmodel(struct proc_handle *phdl) +{ + + if (phdl == NULL) + return (-1); + + return (phdl->model); +} + +int proc_wstatus(struct proc_handle *phdl) { int status; Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Sat Jul 30 03:07:14 2016 (r303532) +++ head/share/mk/src.libnames.mk Sat Jul 30 03:09:23 2016 (r303533) @@ -255,7 +255,7 @@ _DP_proc= supcplusplus .if ${MK_CDDL} != "no" _DP_proc+= ctf .endif -_DP_proc+= elf rtld_db util +_DP_proc+= elf procstat rtld_db util _DP_mp= crypto _DP_memstat= kvm _DP_magic= z From owner-svn-src-head@freebsd.org Sat Jul 30 03:09: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 5027CBA765D; Sat, 30 Jul 2016 03:09: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 03138149D; Sat, 30 Jul 2016 03:09: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 u6U39wnr006179; Sat, 30 Jul 2016 03:09:58 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6U39whe006177; Sat, 30 Jul 2016 03:09:58 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201607300309.u6U39whe006177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 30 Jul 2016 03:09:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303534 - in head/cddl/contrib/opensolaris/lib/libdtrace: arm i386 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.22 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, 30 Jul 2016 03:09:59 -0000 Author: markj Date: Sat Jul 30 03:09:57 2016 New Revision: 303534 URL: https://svnweb.freebsd.org/changeset/base/303534 Log: libdtrace: Don't hard-code the native data model. MFC after: 1 month Modified: head/cddl/contrib/opensolaris/lib/libdtrace/arm/dt_isadep.c head/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/arm/dt_isadep.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/arm/dt_isadep.c Sat Jul 30 03:09:23 2016 (r303533) +++ head/cddl/contrib/opensolaris/lib/libdtrace/arm/dt_isadep.c Sat Jul 30 03:09:57 2016 (r303534) @@ -38,9 +38,7 @@ #include #include -#if !defined(sun) -#define PR_MODEL_ILP32 1 -#define PR_MODEL_LP64 2 +#ifdef __FreeBSD__ #include #endif Modified: head/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c Sat Jul 30 03:09:23 2016 (r303533) +++ head/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c Sat Jul 30 03:09:57 2016 (r303534) @@ -39,9 +39,8 @@ #include -#ifndef illumos -#define PR_MODEL_ILP32 1 -#define PR_MODEL_LP64 2 +#ifdef __FreeBSD__ +#include #include #endif @@ -93,11 +92,7 @@ dt_pid_has_jump_table(struct ps_prochand char dmodel = Pstatus(P)->pr_dmodel; #else pid_t pid = proc_getpid(P); -#if __i386__ - char dmodel = PR_MODEL_ILP32; -#elif __amd64__ - char dmodel = PR_MODEL_LP64; -#endif + char dmodel = proc_getmodel(P); #endif /* @@ -149,11 +144,7 @@ dt_pid_create_return_probe(struct ps_pro char dmodel = Pstatus(P)->pr_dmodel; #else pid_t pid = proc_getpid(P); -#if __i386__ - char dmodel = PR_MODEL_ILP32; -#elif __amd64__ - char dmodel = PR_MODEL_LP64; -#endif + char dmodel = proc_getmodel(P); #endif /* @@ -310,11 +301,7 @@ dt_pid_create_offset_probe(struct ps_pro char dmodel = Pstatus(P)->pr_dmodel; #else pid_t pid = proc_getpid(P); -#if __i386__ - char dmodel = PR_MODEL_ILP32; -#elif __amd64__ - char dmodel = PR_MODEL_LP64; -#endif + char dmodel = proc_getmodel(P); #endif if ((text = malloc(symp->st_size)) == NULL) { @@ -393,11 +380,7 @@ dt_pid_create_glob_offset_probes(struct char dmodel = Pstatus(P)->pr_dmodel; #else pid_t pid = proc_getpid(P); -#if __i386__ - char dmodel = PR_MODEL_ILP32; -#elif __amd64__ - char dmodel = PR_MODEL_LP64; -#endif + char dmodel = proc_getmodel(P); #endif ftp->ftps_type = DTFTP_OFFSETS; From owner-svn-src-head@freebsd.org Sat Jul 30 03:11: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 66111BA7815; Sat, 30 Jul 2016 03:11:55 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 36D991743; Sat, 30 Jul 2016 03:11:55 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6U3BsvT009006; Sat, 30 Jul 2016 03:11:54 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6U3Bs2r009005; Sat, 30 Jul 2016 03:11:54 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201607300311.u6U3Bs2r009005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sat, 30 Jul 2016 03:11:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303536 - head/lib/libc/gen 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.22 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, 30 Jul 2016 03:11:55 -0000 Author: ache Date: Sat Jul 30 03:11:54 2016 New Revision: 303536 URL: https://svnweb.freebsd.org/changeset/base/303536 Log: Rework r303074 case 4. Don't immediatelly skip directory entries which cause MAXPATHLEN exceeded. Process them first through gl_errfunc() and GLOB_ERR. Modified: head/lib/libc/gen/glob.c Modified: head/lib/libc/gen/glob.c ============================================================================== --- head/lib/libc/gen/glob.c Sat Jul 30 03:11:53 2016 (r303535) +++ head/lib/libc/gen/glob.c Sat Jul 30 03:11:54 2016 (r303536) @@ -803,6 +803,13 @@ glob3(Char *pathbuf, Char *pathend, Char } sc += clen; } + if (too_long && ((pglob->gl_errfunc != NULL && + pglob->gl_errfunc(buf, ENAMETOOLONG)) || + (pglob->gl_flags & GLOB_ERR))) { + errno = ENAMETOOLONG; + err = GLOB_ABORTED; + break; + } if (too_long || !match(pathend, pattern, restpattern)) { *pathend = EOS; errno = 0; From owner-svn-src-head@freebsd.org Sat Jul 30 03:11: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 90F29BA7810; Sat, 30 Jul 2016 03:11: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 4F54E173D; Sat, 30 Jul 2016 03:11: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 u6U3BrAb008962; Sat, 30 Jul 2016 03:11:53 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6U3Brr9008960; Sat, 30 Jul 2016 03:11:53 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201607300311.u6U3Brr9008960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 30 Jul 2016 03:11:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303535 - in head/sys/cddl/contrib/opensolaris/uts: common/dtrace intel/dtrace 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.22 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, 30 Jul 2016 03:11:54 -0000 Author: markj Date: Sat Jul 30 03:11:53 2016 New Revision: 303535 URL: https://svnweb.freebsd.org/changeset/base/303535 Log: Include fasttrap handling for DATAMODEL_ILP32 when compiling for amd64. MFC after: 1 month Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Sat Jul 30 03:09:57 2016 (r303534) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Sat Jul 30 03:11:53 2016 (r303535) @@ -64,6 +64,7 @@ #include #include #include +#include #include #include #include @@ -930,6 +931,13 @@ again: ASSERT(0); } +#ifdef __FreeBSD__ + if (SV_PROC_FLAG(p, SV_LP64)) + p->p_model = DATAMODEL_LP64; + else + p->p_model = DATAMODEL_ILP32; +#endif + /* * If the ISA-dependent initialization goes to plan, go back to the * beginning and try to install this freshly made tracepoint. Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Sat Jul 30 03:09:57 2016 (r303534) +++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Sat Jul 30 03:11:53 2016 (r303535) @@ -43,11 +43,11 @@ #include #include #else -#include #include +#include #include #include -#include +#include #include #include #include @@ -283,12 +283,10 @@ fasttrap_anarg(struct reg *rp, int funct DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT | CPU_DTRACE_BADADDR); } else { #endif -#ifdef __i386 - uint32_t *stack = (uint32_t *)rp->r_esp; + uint32_t *stack = (uint32_t *)rp->r_rsp; DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); value = dtrace_fuword32(&stack[argno + shift]); DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT | CPU_DTRACE_BADADDR); -#endif #ifdef __amd64 } #endif @@ -716,7 +714,6 @@ fasttrap_fulword_noerr(const void *uaddr } #endif -#ifdef __i386__ static uint32_t fasttrap_fuword32_noerr(const void *uaddr) { @@ -727,7 +724,6 @@ fasttrap_fuword32_noerr(const void *uadd return (0); } -#endif static void fasttrap_return_common(struct reg *rp, uintptr_t pc, pid_t pid, @@ -842,7 +838,6 @@ fasttrap_usdt_args64(fasttrap_probe_t *p } #endif -#ifdef __i386__ static void fasttrap_usdt_args32(fasttrap_probe_t *probe, struct reg *rp, int argc, uint32_t *argv) @@ -860,7 +855,6 @@ fasttrap_usdt_args32(fasttrap_probe_t *p argv[i] = 0; } } -#endif static int fasttrap_do_seg(fasttrap_tracepoint_t *tp, struct reg *rp, uintptr_t *addr) @@ -1094,7 +1088,6 @@ fasttrap_pid_probe(struct reg *rp) if (tp->ftt_ids != NULL) { fasttrap_id_t *id; -#ifdef __amd64 if (p->p_model == DATAMODEL_LP64) { for (id = tp->ftt_ids; id != NULL; id = id->fti_next) { fasttrap_probe_t *probe = id->fti_probe; @@ -1136,9 +1129,8 @@ fasttrap_pid_probe(struct reg *rp) } } } else { -#else /* __amd64 */ uintptr_t s0, s1, s2, s3, s4, s5; - uint32_t *stack = (uint32_t *)rp->r_esp; + uint32_t *stack = (uint32_t *)rp->r_rsp; /* * In 32-bit mode, all arguments are passed on the @@ -1191,10 +1183,7 @@ fasttrap_pid_probe(struct reg *rp) t[2], t[3], t[4]); } } -#endif /* __amd64 */ -#ifdef __amd64 } -#endif } /* @@ -1259,12 +1248,10 @@ fasttrap_pid_probe(struct reg *rp) addr = rp->r_rsp + sizeof (uintptr_t); } else { #endif -#ifdef __i386__ uint32_t dst32; - ret = dst32 = fasttrap_fuword32((void *)rp->r_esp); + ret = dst32 = fasttrap_fuword32((void *)rp->r_rsp); dst = dst32; - addr = rp->r_esp + sizeof (uint32_t); -#endif + addr = rp->r_rsp + sizeof (uint32_t); #ifdef __amd64 } #endif @@ -1409,10 +1396,8 @@ fasttrap_pid_probe(struct reg *rp) ret = fasttrap_sulword((void *)rp->r_rsp, rp->r_rbp); } else { #endif -#ifdef __i386__ rp->r_rsp -= sizeof (uint32_t); ret = fasttrap_suword32((void *)rp->r_rsp, rp->r_rbp); -#endif #ifdef __amd64 } #endif @@ -1732,7 +1717,6 @@ fasttrap_pid_probe(struct reg *rp) i += sizeof (uint64_t); } else { #endif -#ifdef __i386__ /* * Set up the jmp to the next instruction; note that * the size of the traced instruction cancels out. @@ -1741,7 +1725,6 @@ fasttrap_pid_probe(struct reg *rp) /* LINTED - alignment */ *(uint32_t *)&scratch[i] = pc - addr - 5; i += sizeof (uint32_t); -#endif #ifdef __amd64 } #endif From owner-svn-src-head@freebsd.org Sat Jul 30 03: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 8FD8ABA7FB3; Sat, 30 Jul 2016 03:43:56 +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 596351B65; Sat, 30 Jul 2016 03:43:56 +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 u6U3ht9K020895; Sat, 30 Jul 2016 03:43:55 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6U3htdj020894; Sat, 30 Jul 2016 03:43:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201607300343.u6U3htdj020894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 30 Jul 2016 03:43:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303537 - 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.22 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, 30 Jul 2016 03:43:56 -0000 Author: markj Date: Sat Jul 30 03:43:55 2016 New Revision: 303537 URL: https://svnweb.freebsd.org/changeset/base/303537 Log: Add libprocstat prebuild library dependencies. X-MFC-With: r303531 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Jul 30 03:11:54 2016 (r303536) +++ head/Makefile.inc1 Sat Jul 30 03:43:55 2016 (r303537) @@ -2096,6 +2096,7 @@ cddl/lib/libctf__L: lib/libz__L # on select architectures though (see cddl/lib/Makefile) .if ${MACHINE_CPUARCH} != "sparc64" _prebuild_libs+= lib/libprocstat lib/libproc lib/librtld_db +lib/libprocstat__L: lib/libelf__L lib/libkvm__L lib/libutil__L lib/libproc__L: lib/libprocstat__L lib/librtld_db__L: lib/libprocstat__L .endif From owner-svn-src-head@freebsd.org Sat Jul 30 04:15: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 41D5DBA895B; Sat, 30 Jul 2016 04:15:15 +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 DBEA11DC9; Sat, 30 Jul 2016 04:15:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 02717D6676B; Sat, 30 Jul 2016 14:15:09 +1000 (AEST) Date: Sat, 30 Jul 2016 14:15:08 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Andrey A. Chernov" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303530 - head/lib/libc/gen In-Reply-To: <201607300209.u6U29BXC082700@repo.freebsd.org> Message-ID: <20160730140305.G1962@besplex.bde.org> References: <201607300209.u6U29BXC082700@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=EfU1O6SC c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=5p-0Ik2aV_OXGSlI9iwA:9 a=CjuIK1q_8ugA:10 a=oCwRYk8rWbsA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 30 Jul 2016 04:15:15 -0000 On Sat, 30 Jul 2016, Andrey A. Chernov wrote: > Log: > Reset errno for readdirfunc() before contunue. In C99, library functions are not permitted to set errno to 0. The glob() family shouldn't use a different (worse) convention, and POSIX doesn't seem to have any special wording to allow different behaviour. Bruce From owner-svn-src-head@freebsd.org Sat Jul 30 04:31: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 823B0BA8BA2 for ; Sat, 30 Jul 2016 04:31:06 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f44.google.com (mail-lf0-f44.google.com [209.85.215.44]) (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 12E08166C for ; Sat, 30 Jul 2016 04:31:05 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f44.google.com with SMTP id g62so83241239lfe.3 for ; Fri, 29 Jul 2016 21:31:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=xqAd4VFFeC5I5pqiTTVdXnTrm6QoKt+9jZPE+YT3z+k=; b=CnVw26rRvYbySCCAXmTWEGo76/Ip6hcWDw+Q2TO/OBDSR9ETyz0hgtgCzr5lz5Jb/m 3UVxTqWs/Zb3mzxf0SO2/6+q1qsLOv81MnW2/iaipTelVIbzoi8vSTV/TPYGOTx2JI9V K21QpnX+aScef9MPdYJuKwKr70Wr3ZXiEhedo56+5RNXINbcmZNw1Qz10lnd9xcEy4K1 jSrgMnnlVlmYR2gSD58sp7rWgcCacOMcN6q0GizHsrZ82mnRLEN29KVOlUcpG6nB0Vih cDnoL2uA/oNDVOyV+ygy4oozW02N2KmtdO5PDGGU/4nlMB9Wlviw05s8CdypQ4JptVk9 a/Ug== X-Gm-Message-State: AEkoouvSv/vP6AQ16MdfNafa9VZsmf4QV7BItaafyaKUagRZRTUfytJKiBEVWkQyNhC1SA== X-Received: by 10.25.41.142 with SMTP id p136mr16301321lfp.32.1469853057559; Fri, 29 Jul 2016 21:30:57 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id r196sm3242672lfd.41.2016.07.29.21.30.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Jul 2016 21:30:57 -0700 (PDT) Subject: Re: svn commit: r303530 - head/lib/libc/gen To: Bruce Evans References: <201607300209.u6U29BXC082700@repo.freebsd.org> <20160730140305.G1962@besplex.bde.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: <84c77b80-8b51-8698-f27a-7f6452867d66@freebsd.org> Date: Sat, 30 Jul 2016 07:30:55 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160730140305.G1962@besplex.bde.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 30 Jul 2016 04:31:06 -0000 On 30.07.2016 7:15, Bruce Evans wrote: > On Sat, 30 Jul 2016, Andrey A. Chernov wrote: > >> Log: >> Reset errno for readdirfunc() before contunue. > > In C99, library functions are not permitted to set errno to 0. The glob() > family shouldn't use a different (worse) convention, and POSIX doesn't > seem to have any special wording to allow different behaviour. This is historic practice for this function at least since GLOB_LIMIT was introduced (in 2001) and common across NetBSD/OpenBSD. Existent programs may relay on that to check that limit is reached and not allocation error, so with few additional overwriting from my side I add nothing new: Revision 80525 Modified Sun Jul 29 00:52:37 2001 UTC (15 years ago) by mikeh Rename the GLOB_MAXPATH flag of glob(3) to GLOB_LIMIT to be compatible with NetBSD and OpenBSD. glob(3) will now return GLOB_NOSPACE with errno set to 0 instead of GLOB_LIMIT when we match more than `gl_matchc' patterns. GLOB_MAXPATH has been left as an alias of GLOB_LIMIT to maintain backwards compatibility. errno = 0 is documented. See glob(3), GLOB_NOSPACE section too. The real problem is that glob(3) is very limited in error return codes, so they reuse existent codes with errno hack. From owner-svn-src-head@freebsd.org Sat Jul 30 04:40: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 A4D4CBA8D97; Sat, 30 Jul 2016 04:40:45 +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 775581BB7; Sat, 30 Jul 2016 04:40:45 +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 u6U4eiqb040160; Sat, 30 Jul 2016 04:40:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6U4eihT040159; Sat, 30 Jul 2016 04:40:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201607300440.u6U4eihT040159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 30 Jul 2016 04:40:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303538 - head/usr.bin/sed 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.22 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, 30 Jul 2016 04:40:45 -0000 Author: ngie Date: Sat Jul 30 04:40:44 2016 New Revision: 303538 URL: https://svnweb.freebsd.org/changeset/base/303538 Log: Explicitly test for cu_fgets returning NULL or !NULL MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/sed/compile.c Modified: head/usr.bin/sed/compile.c ============================================================================== --- head/usr.bin/sed/compile.c Sat Jul 30 03:43:55 2016 (r303537) +++ head/usr.bin/sed/compile.c Sat Jul 30 04:40:44 2016 (r303538) @@ -546,7 +546,7 @@ compile_subst(const char *p, struct s_su if ((text = realloc(text, asize)) == NULL) err(1, "realloc"); } - } while ((p = cu_fgets(&more))); + } while ((p = cu_fgets(&more)) != NULL); errx(1, "%lu: %s: unterminated substitute in regular expression", linenum, fname); /* NOTREACHED */ @@ -733,7 +733,7 @@ compile_text(size_t *ptlen) if ((text = malloc(asize)) == NULL) err(1, "malloc"); size = 0; - while ((p = cu_fgets(NULL))) { + while ((p = cu_fgets(NULL)) != NULL) { op = s = text + size; for (esc_nl = 0; *p != '\0'; p++) { if (*p == '\\' && p[1] != '\0' && *++p == '\n') From owner-svn-src-head@freebsd.org Sat Jul 30 06:18: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 E179FBA8F3B; Sat, 30 Jul 2016 06:18:29 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x243.google.com (mail-pa0-x243.google.com [IPv6:2607:f8b0:400e:c03::243]) (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 AE9FF13A2; Sat, 30 Jul 2016 06:18:29 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x243.google.com with SMTP id q2so6305063pap.0; Fri, 29 Jul 2016 23:18:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=tEuhnHT4yJZtcgiE7UosZ6PF+m3zQT7gd69dsWmqchE=; b=Olq6la+3NjcHGtm1wwIlaKaVLmlTPtTISqrsn1YukuUzL5Hx/bCvHMi7UxrA77UAQ8 96Slt0lj+ecNAZhOGKnpCa4sSLUvgK5Q+cPDXtG7xyExrsGhbGUtgat4TYVMHXjcwCqE ZPuJkW+T3l+jLLSWpxmcSigMTzBTvwkOCZ49oIGbxv2d4ZqqAYCscMGbiKJj7AdHs9Ky BsT/ilZDZbMs8Qz1aG6fN0EofHb8bOgItleBhjgJ6GDGM6j5w8r+PDwG43jFgN3BTlFQ e5H9xK9FOcBLXvYmYwQoGEKdT0LATtq6nkGNavarOcNOtZavlgQmwhpZ3oBQku3ztBUX zeaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=tEuhnHT4yJZtcgiE7UosZ6PF+m3zQT7gd69dsWmqchE=; b=KwbJ6bXXsUw4zNRKhcE465aaPPzRx3JiLklmw5/6oHnMfPd1NDaGZF11EYP6nTabdB /p1lWvaHGQlBiEHbThj8Sky0LApqdAe2xhtgzLK/2+pBQW7Yv10Z4TqqtPexv9lyZey3 cUPH3tlNx/53aOwQ9f5HA9gAxXc+TkV94tYM5n7z8gMtwR7mnh6NIW+2cP3WRI5IG1lY v1P/4zhXMpfUO3G0OEDFdcPZP1qNtaAeaoaH8Ct27Xbs5r6PkokH58yhblviX7nQjI7U WN2osK+UqUE3viiLHcFTSKARnhAS3eAuukeBaq9p2Ef4+nasK5YHxRZ5chfYOtDDAycP 1WyA== X-Gm-Message-State: AEkoousMj6YRxsZudRMHRukZyqhdZncElpFkAC9qY1kFWL1QqlDBjZW1Cs+KjXICFFWRTw== X-Received: by 10.66.216.41 with SMTP id on9mr76303891pac.86.1469859509212; Fri, 29 Jul 2016 23:18:29 -0700 (PDT) Received: from [192.168.20.9] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id u7sm29123489paz.45.2016.07.29.23.18.26 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Jul 2016 23:18:27 -0700 (PDT) Subject: Re: svn commit: r303535 - in head/sys/cddl/contrib/opensolaris/uts: common/dtrace intel/dtrace Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_18377704-992B-4880-8691-0C4C4791FBD7"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201607300311.u6U3Brr9008960@repo.freebsd.org> Date: Fri, 29 Jul 2016 23:18:25 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201607300311.u6U3Brr9008960@repo.freebsd.org> To: Mark Johnston X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 30 Jul 2016 06:18:30 -0000 --Apple-Mail=_18377704-992B-4880-8691-0C4C4791FBD7 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On Jul 29, 2016, at 20:11, Mark Johnston wrote: > > Author: markj > Date: Sat Jul 30 03:11:53 2016 > New Revision: 303535 > URL: https://svnweb.freebsd.org/changeset/base/303535 > > Log: > Include fasttrap handling for DATAMODEL_ILP32 when compiling for amd64. > > MFC after: 1 month This broke i386: https://jenkins.freebsd.org/job/FreeBSD_HEAD_i386/3722/ . Thanks, -Ngie --Apple-Mail=_18377704-992B-4880-8691-0C4C4791FBD7 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----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJXnEayAAoJEPWDqSZpMIYVkr8QAKDnLnJ/WeBNcjElIYmNekeb 8VsEFfFtdy/LYEkH8uWz7DFPenAFH5jHXCcxzaUVjvOiqzZy2UnsYrDaeDE1gKuw OfwnLImeQ0D7OR/l+eQe1Bz7zmB+VGt86ItgmJFEIFkKdwvf4DfOIP9Gfth8Ke5W k6vC87pOsuPANL3/l5EfzWZP44TCDuO+DnbH1xVViY1LzpKR9wDC0Kv68AZzSeyk 4Z1cAirm1aqvZfZqtOgQCamLCaGw+RkhNLFby39WbCuM0iNPJv6JvMzEG9l2fk8a PdleeM5WwtNpbpL8ChcZvt38n+vySmxAs9/HPxEbgcO434Ir6dNSEAL/apIvV0uP zcF7dU+HOthreavAWZL8H5ljDyGgFYcB8TwJIZWBLxuMdtfzW9ozIJSgylPawoqV YykT+0LqZI6mv6QKIIrf5r5zcYkptkcMmL4Mqd+uAik+A1AXMLvKX4afsetQE8MA izxduFdFV+qPK231zqqQEKLB6FqBQZ1HvS93SDQrhxC4UdDJKrQL7XObNgZJSMqE oa7tmMswODM0Pu0tp1WuHuTPSAWs+/EdT6l1ot6mSj9hGaBd4KmjC+jKxv/6275M L7gEZrWstJHvdx+/I2iVLC8WGfqTFd2boyLVFOx8pt0d3GwJxBEe+aWeuNiGLvJg XmZIbu6NOaAeUv3GmjvS =BHhu -----END PGP SIGNATURE----- --Apple-Mail=_18377704-992B-4880-8691-0C4C4791FBD7-- From owner-svn-src-head@freebsd.org Sat Jul 30 06:19: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 EC9D0BA900E; Sat, 30 Jul 2016 06:19:35 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B85941596; Sat, 30 Jul 2016 06:19:35 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6U6JYW5076615; Sat, 30 Jul 2016 06:19:34 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6U6JYTY076614; Sat, 30 Jul 2016 06:19:34 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201607300619.u6U6JYTY076614@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Sat, 30 Jul 2016 06:19:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303539 - head/sbin/fsdb 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.22 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, 30 Jul 2016 06:19:36 -0000 Author: araujo Date: Sat Jul 30 06:19:34 2016 New Revision: 303539 URL: https://svnweb.freebsd.org/changeset/base/303539 Log: Use nitems() from sys/param.h. Sponsored by: gandi.net (BSD Day Taiwan) Modified: head/sbin/fsdb/fsdb.c Modified: head/sbin/fsdb/fsdb.c ============================================================================== --- head/sbin/fsdb/fsdb.c Sat Jul 30 04:40:44 2016 (r303538) +++ head/sbin/fsdb/fsdb.c Sat Jul 30 06:19:34 2016 (r303539) @@ -898,7 +898,7 @@ CMDFUNCSTART(newtype) return 1; type = DIP(curinode, di_mode) & IFMT; for (tp = typenamemap; - tp < &typenamemap[sizeof(typenamemap)/sizeof(*typenamemap)]; + tp < &typenamemap[nitems(typenamemap)]; tp++) { if (!strcmp(argv[1], tp->typename)) { printf("setting type to %s\n", tp->typename); @@ -906,7 +906,7 @@ CMDFUNCSTART(newtype) break; } } - if (tp == &typenamemap[sizeof(typenamemap)/sizeof(*typenamemap)]) { + if (tp == &typenamemap[nitems(typenamemap)]) { warnx("type `%s' not known", argv[1]); warnx("try one of `file', `dir', `socket', `fifo'"); return 1; From owner-svn-src-head@freebsd.org Sat Jul 30 06:20: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 096BEBA906A; Sat, 30 Jul 2016 06:20:16 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x242.google.com (mail-pf0-x242.google.com [IPv6:2607:f8b0:400e:c00::242]) (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 CB4E51706; Sat, 30 Jul 2016 06:20:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x242.google.com with SMTP id i6so6586119pfe.0; Fri, 29 Jul 2016 23:20:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=SH0lkqjXNuJSYcI7HPP6ebuX0cLuKXrfDxj4d7ZJpng=; b=V7kgMU1EXdksit+7MX9E42+RphVJmfH+PMesRBdcdlvNQ292Q5vPgVjqV4fdHIw8RK glpl1wBQ7fNiyMyWl+fk4wo4GedCBkkwDsnowD87sWw4E+5trVJyr7n5plAADDMbmVp/ +91+qHpF0rDtveFEElfrABTfZaDBqoa8E2Dl9zUB73tbxyOWyEQ4K22arpTTg09lOedv AluyF568NhvFKRi4RYU11CDHV+OqE1nyU1TjH2d/ttN+HqVlyTQqAXYEMvGz5xbBSnYO zF01rHLmpYP1H2K1xjekNZ7WpX5o0Zt83mNVwo+Zs7ORok7IJODE5Jy3RzqK8/BLnCmA 87Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=SH0lkqjXNuJSYcI7HPP6ebuX0cLuKXrfDxj4d7ZJpng=; b=E5x7VkZMPwHG0fSHg2QVrytp/owt9xDNPMHK0t5BD96DA/XMcRHG8sDOuBIFhEsuHH 0NCImTVoozYb6K60kNLMxELFslXZWIyavkH76yddzC+u2n6uQJthkOIJk81qKigkXcz1 MBUUkLnGFbHG112EU73CXDNDvuqYp1Z4JW555szVhsW2DjaYBtPzBq74e6BV33Nel6sM DcOvuaHDHLOjjARM/KrEMhBAiGvt7PD5SBI2EkCPbpIsxdoZMzIwowfbKJYaVDIxx6J9 ydt6Uqf4qYTFRKSk8yV0Mb8TKLEhRhkDYjr/F/nSPmyRhuTp/NFal5pSM7ELl5sXsr/a kuvg== X-Gm-Message-State: AEkooutAt4/HG+NJLs0jQfoQI5JXpPUEF4FFybDT4r/tSsLwLz7R1703zIB8Ke29zNQQ1w== X-Received: by 10.98.74.201 with SMTP id c70mr75516502pfj.113.1469859615314; Fri, 29 Jul 2016 23:20:15 -0700 (PDT) Received: from [192.168.20.9] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id cp11sm29279496pac.28.2016.07.29.23.20.14 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Jul 2016 23:20:14 -0700 (PDT) Subject: Re: svn commit: r303539 - head/sbin/fsdb Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_F86FF17E-A310-4132-A3B0-4715060A2625"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201607300619.u6U6JYTY076614@repo.freebsd.org> Date: Fri, 29 Jul 2016 23:20:14 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <79B9259B-BC2C-4118-802A-84E870059F1F@gmail.com> References: <201607300619.u6U6JYTY076614@repo.freebsd.org> To: Marcelo Araujo X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 30 Jul 2016 06:20:16 -0000 --Apple-Mail=_F86FF17E-A310-4132-A3B0-4715060A2625 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On Jul 29, 2016, at 23:19, Marcelo Araujo wrote: > > Author: araujo > Date: Sat Jul 30 06:19:34 2016 > New Revision: 303539 > URL: https://svnweb.freebsd.org/changeset/base/303539 > > Log: > Use nitems() from sys/param.h. MFC after? --Apple-Mail=_F86FF17E-A310-4132-A3B0-4715060A2625 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----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJXnEceAAoJEPWDqSZpMIYVUF4QAIp5GuDk3HYijMsPWNw96a1u L0gUTx24tm6hITDC1VDavnBqohIJ9flRWHNfSHU75prA58MpD826ZJwe6XxZExkg 4Otbcxa++jSKjSGQzv1sn1Gvm2kGalIT389oD0sGuHXa3S8RumWwoaWVd6PjUCm4 QuXGuNjOHmUx70ft6rpP+JNHkIlPa/Td81ivPhwkVivQvk2wW7HJoewok9lT4+YE rJhXt5tnxV+tinb8+pN3RJFONvej00yuE5S3tWFO3BF9YVvsHFBS90kLIYlKqW4y IdHkUWCeKMLENYAXtCigYxX4sT23GRanp7pn1S2gfB34a3IjbJb8Wsu6kdT1SwQZ kIlfzhJlLayEA1fPZitzyyP9yxtPEX2KxRbnqzoYdLrNCgJaL889yKrfFMRJlJhE etCDJc7BQxG6bMM0kmmomF5LHYAFiSiB7YPOaGKLleb6M5kG9RzDulzJQvSRfmdy dfW5dN5nPCLhQIQvfHQnJFjPKT/yar3roCxE1/ODTk1OLeFK0cLYS2kAUwAnocyI HDjhnfr2fud+N5vWlC6D9y6QzVRJPONH5VHz43eyW61NpCidQteafHcjeD3r4x7U UMBecCNMCnsBzLcy3qQCvnRkWDDaY8PoN+7M04UNit0PqjBAyH6+Md6sVG/1CiSW tnTrjjS9zfksoWOY/N1P =k30o -----END PGP SIGNATURE----- --Apple-Mail=_F86FF17E-A310-4132-A3B0-4715060A2625-- From owner-svn-src-head@freebsd.org Sat Jul 30 06:32: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 08C39BA939B; Sat, 30 Jul 2016 06:32:20 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFD2B1DB2; Sat, 30 Jul 2016 06:32:19 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6U6WJ0t081531; Sat, 30 Jul 2016 06:32:19 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6U6WJc5081530; Sat, 30 Jul 2016 06:32:19 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201607300632.u6U6WJc5081530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Sat, 30 Jul 2016 06:32:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303540 - head/usr.bin/at 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.22 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, 30 Jul 2016 06:32:20 -0000 Author: araujo Date: Sat Jul 30 06:32:18 2016 New Revision: 303540 URL: https://svnweb.freebsd.org/changeset/base/303540 Log: Use nitems() from sys/param.h Sponsored by: gandi.net (BSD Day Taiwan) Modified: head/usr.bin/at/at.c Modified: head/usr.bin/at/at.c ============================================================================== --- head/usr.bin/at/at.c Sat Jul 30 06:19:34 2016 (r303539) +++ head/usr.bin/at/at.c Sat Jul 30 06:32:18 2016 (r303540) @@ -356,7 +356,7 @@ writefile(time_t runtimer, char queue) else { size_t i; - for (i=0; i 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 CFB06BA940A; Sat, 30 Jul 2016 06:33:55 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-yw0-x231.google.com (mail-yw0-x231.google.com [IPv6:2607:f8b0:4002: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 8A0B51F68; Sat, 30 Jul 2016 06:33:55 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-yw0-x231.google.com with SMTP id j12so132494167ywb.2; Fri, 29 Jul 2016 23:33:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc; bh=GICjfmfolEbG+EOpNReUhWqu9IvzgUlKfHf8wOhtzEo=; b=oav3MWm1PpYx4w13eXM56RREbe2GasXMw4PY+c6a4v06P9J0C1t5xNd36puSzx5IJg a1OJkY3oP72Hh+906wAcbebyHInttld5VRz+R4iEEJPmN487W60k7lntibe1lQ9/ODO5 lwF+yslbn9pZKqV485vlQot2v+O6kled9g7yqdf6Ab+3pPl4OmHxNXzJwB5NEt5F/2pO KJmSmvMguUUAeOE3M/q+HfQKUEtmztIiwLuqVzflnjmQaaGOcB7tPJDqxcnw6691F5T3 SUDsbH+iSLwiKk+/S/1LOW7c75/ruWs8vRcSqf9uWWcfWEr28mZZYMra4ZVoJ+U5T96q YFvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=GICjfmfolEbG+EOpNReUhWqu9IvzgUlKfHf8wOhtzEo=; b=CgJEjd/CpZNBHrlmAqoUhGIbry3k2i9XkS2YFEfYN13zOjkBi5r7AxmJdaH/TUlKdt i9C+MRGwUyOTx/4AkMlx/ZgOm6ZolPwTmxNp4yc33iiwpIAd4/+yjYJxEAezYdSIeXBX PWvpYuS2mrrluIhllFWve+x8yJ6BXLeRFmcTjqHK0um5FhgzA6Q85Y/bJuWxMaDRqKBw mFhuk9ND8G/84f/V8m7j/LI+UvODQNOGUmh/uqG4Ss1IX3t51Y9SzKZ0+CVcm5hMmVrc EMjwDhN5MaIPTV7ek9EmjgBgDC4EeWTtU/eEp8u3+18EAt1EFln2Y0bH4uAT2HoofBRP vBJA== X-Gm-Message-State: AEkoouvErm89p3HiUUviC9kLfWv04l1mulE9OxH7K9pxKbTHjWAlnYlk4Z4pRYjUgvJLG2ArW7Gq7hwDHPCKbA== X-Received: by 10.13.241.66 with SMTP id a63mr14044555ywf.162.1469860434603; Fri, 29 Jul 2016 23:33:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.56.130 with HTTP; Fri, 29 Jul 2016 23:33:54 -0700 (PDT) Reply-To: araujo@freebsd.org In-Reply-To: <79B9259B-BC2C-4118-802A-84E870059F1F@gmail.com> References: <201607300619.u6U6JYTY076614@repo.freebsd.org> <79B9259B-BC2C-4118-802A-84E870059F1F@gmail.com> From: Marcelo Araujo Date: Sat, 30 Jul 2016 14:33:54 +0800 Message-ID: Subject: Re: svn commit: r303539 - head/sbin/fsdb To: "Ngie Cooper (yaneurabeya)" 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.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 30 Jul 2016 06:33:55 -0000 2016-07-30 14:20 GMT+08:00 Ngie Cooper (yaneurabeya) : > > > On Jul 29, 2016, at 23:19, Marcelo Araujo wrote: > > > > Author: araujo > > Date: Sat Jul 30 06:19:34 2016 > > New Revision: 303539 > > URL: https://svnweb.freebsd.org/changeset/base/303539 > > > > Log: > > Use nitems() from sys/param.h. > > MFC after? > Thanks again as always you remind me. MFC after 2 weeks. -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-head@freebsd.org Sat Jul 30 06:34: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 E6EECBA9439; Sat, 30 Jul 2016 06:34:22 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-yw0-x231.google.com (mail-yw0-x231.google.com [IPv6:2607:f8b0:4002: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 A9613122B; Sat, 30 Jul 2016 06:34:22 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-yw0-x231.google.com with SMTP id r9so133138577ywg.0; Fri, 29 Jul 2016 23:34:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc; bh=QhlVvziuw1x3zwpWrqaZvQyJp2LKrBYj9JYn6MSajsk=; b=YBBWQ4pXLJ5RktDSqspx5TO2YXMyCYDRI4XzyBktnOcPl4QwNwGMuG/UIoqNyJcif3 nEpambk3otEJzzaDlv/ZnAeREJqSAHRYx9IxUjlHw9m4O+4+iAwT6xnLUx6Fo65lr7Aq Siu99lD1YAAMQG3TwXwecIldiv2CRzfDlAkWH8DJC1I73/ZJfsybpOqCd+r8Q52hBwbM sNZ7ee1BsJRTYwkLKqIe6kwUGH2Az40lt1IOWWZSFv+gDeSQkcCQAiLiuB8vH1iWHgsj pBmWMU77vcUnh6bgtgfe7LKSHCF5FrHshP/3U7qP6Wk68R30uHOtb9kKCma708K92T3c R/Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=QhlVvziuw1x3zwpWrqaZvQyJp2LKrBYj9JYn6MSajsk=; b=de8dp1Y89pumCBqL4bTzSq5eSg6/tskYoMz7AMu+DxHt3yOf66ZKxTp6qdeTUaGpfC U5EYbHdN1HTSil4SIZNSRIMifpGCGqEHDJIqbH0bxFaWwROrWv0arzHvkEQkM0oybEqk TvXikvOGhGZc6EjjfkaFmZuWEa9luEiReN36449kkigXipfUTTkBvLS7/wyxoDKJVXKX 5eBHEB5cLWumvul+Julii6djCD6iPFF3surWT4UtD/WOZnoun1u57O2xehznfV5Kn5WW CAxqo6NJT4vyqdCCYoec8yX9Fh6VUao4J7Xb3mBuke+PBPPgwAqFduzqCV0OLBPY0yzZ QiNQ== X-Gm-Message-State: AEkoouvPRuExxT2thz31Ddk4njFrZHvdEzRI2DSjOLYQiExcIXo1YOcvZBd6Ji7eQ88q4rddex4Tl3PjVkuV7Q== X-Received: by 10.129.52.68 with SMTP id b65mr11502227ywa.50.1469860461455; Fri, 29 Jul 2016 23:34:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.56.130 with HTTP; Fri, 29 Jul 2016 23:34:20 -0700 (PDT) Reply-To: araujo@freebsd.org In-Reply-To: <201607300632.u6U6WJc5081530@repo.freebsd.org> References: <201607300632.u6U6WJc5081530@repo.freebsd.org> From: Marcelo Araujo Date: Sat, 30 Jul 2016 14:34:20 +0800 Message-ID: Subject: Re: svn commit: r303540 - head/usr.bin/at To: Marcelo Araujo 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.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 30 Jul 2016 06:34:23 -0000 2016-07-30 14:32 GMT+08:00 Marcelo Araujo : > Author: araujo > Date: Sat Jul 30 06:32:18 2016 > New Revision: 303540 > URL: https://svnweb.freebsd.org/changeset/base/303540 > > Log: > Use nitems() from sys/param.h > > Sponsored by: gandi.net (BSD Day Taiwan) > > Modified: > head/usr.bin/at/at.c > > Modified: head/usr.bin/at/at.c > > ============================================================================== > --- head/usr.bin/at/at.c Sat Jul 30 06:19:34 2016 (r303539) > +++ head/usr.bin/at/at.c Sat Jul 30 06:32:18 2016 (r303540) > @@ -356,7 +356,7 @@ writefile(time_t runtimer, char queue) > else > { > size_t i; > - for (i=0; i + for (i = 0; i < nitems(no_export); i++) > { > export = export > && (strncmp(*atenv, no_export[i], > _______________________________________________ > 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" > MFC after 2 weeks. -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-head@freebsd.org Sat Jul 30 06:35: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 C4AE3BA94BC; Sat, 30 Jul 2016 06:35:50 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97A4913B9; Sat, 30 Jul 2016 06:35:50 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6U6Zn9G083705; Sat, 30 Jul 2016 06:35:49 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6U6Zn68083704; Sat, 30 Jul 2016 06:35:49 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201607300635.u6U6Zn68083704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Sat, 30 Jul 2016 06:35:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303541 - head/usr.bin/calendar 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.22 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, 30 Jul 2016 06:35:50 -0000 Author: araujo Date: Sat Jul 30 06:35:49 2016 New Revision: 303541 URL: https://svnweb.freebsd.org/changeset/base/303541 Log: Use nitems() from sys/param.h. Sponsored by: gandi.net (BSD Day Taiwan) MFC after: 2 weeks. Modified: head/usr.bin/calendar/io.c Modified: head/usr.bin/calendar/io.c ============================================================================== --- head/usr.bin/calendar/io.c Sat Jul 30 06:32:18 2016 (r303540) +++ head/usr.bin/calendar/io.c Sat Jul 30 06:35:49 2016 (r303541) @@ -117,7 +117,7 @@ cal_fopen(const char *file) return (NULL); } - for (i = 0; i < sizeof(calendarHomes)/sizeof(calendarHomes[0]) ; i++) { + for (i = 0; i < nitems(calendarHomes); i++) { if (chdir(calendarHomes[i]) != 0) continue; From owner-svn-src-head@freebsd.org Sat Jul 30 07:02: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 DE0F1BA98E3; Sat, 30 Jul 2016 07:02:34 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B08721E94; Sat, 30 Jul 2016 07:02:34 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6U72Xse094723; Sat, 30 Jul 2016 07:02:33 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6U72XSd094722; Sat, 30 Jul 2016 07:02:33 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201607300702.u6U72XSd094722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Sat, 30 Jul 2016 07:02:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303542 - head/usr.bin/gzip 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.22 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, 30 Jul 2016 07:02:35 -0000 Author: araujo Date: Sat Jul 30 07:02:33 2016 New Revision: 303542 URL: https://svnweb.freebsd.org/changeset/base/303542 Log: Use nitems() from sys/param.h. MFC after: 2 weeks. Sponsored by: gandi.net (BSD Day Taiwan) Modified: head/usr.bin/gzip/gzip.c Modified: head/usr.bin/gzip/gzip.c ============================================================================== --- head/usr.bin/gzip/gzip.c Sat Jul 30 06:35:49 2016 (r303541) +++ head/usr.bin/gzip/gzip.c Sat Jul 30 07:02:33 2016 (r303542) @@ -155,7 +155,7 @@ static suffixes_t suffixes[] = { #endif /* SMALL */ #undef SUFFIX }; -#define NUM_SUFFIXES (sizeof suffixes / sizeof suffixes[0]) +#define NUM_SUFFIXES (nitems(suffixes)) #define SUFFIX_MAXLEN 30 static const char gzip_version[] = "FreeBSD gzip 20150413"; From owner-svn-src-head@freebsd.org Sat Jul 30 07:04: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 0E713BA994C; Sat, 30 Jul 2016 07:04:48 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2C55116F; Sat, 30 Jul 2016 07:04:47 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6U74lSq094845; Sat, 30 Jul 2016 07:04:47 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6U74lXF094844; Sat, 30 Jul 2016 07:04:47 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201607300704.u6U74lXF094844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Sat, 30 Jul 2016 07:04:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303543 - head/usr.bin/locale 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.22 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, 30 Jul 2016 07:04:48 -0000 Author: araujo Date: Sat Jul 30 07:04:46 2016 New Revision: 303543 URL: https://svnweb.freebsd.org/changeset/base/303543 Log: Use nitems() from sys/param.h. MFC after: 2 weeks. Sponsored by: gandi.net (BSD Day Taiwan) Modified: head/usr.bin/locale/locale.c Modified: head/usr.bin/locale/locale.c ============================================================================== --- head/usr.bin/locale/locale.c Sat Jul 30 07:02:33 2016 (r303542) +++ head/usr.bin/locale/locale.c Sat Jul 30 07:04:46 2016 (r303543) @@ -220,10 +220,10 @@ struct _kwinfo { "(POSIX legacy)" } /* compat */ }; -#define NKWINFO (sizeof(kwinfo)/sizeof(kwinfo[0])) +#define NKWINFO (nitems(kwinfo)) const char *boguslocales[] = { "UTF-8" }; -#define NBOGUS (sizeof(boguslocales)/sizeof(boguslocales[0])) +#define NBOGUS (nitems(boguslocales)) int main(int argc, char *argv[]) From owner-svn-src-head@freebsd.org Sat Jul 30 07:05: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 2D50CBA99AA; Sat, 30 Jul 2016 07:05:34 +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 F257712F4; Sat, 30 Jul 2016 07:05:33 +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 u6U75X69094922; Sat, 30 Jul 2016 07:05:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6U75XnJ094921; Sat, 30 Jul 2016 07:05:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201607300705.u6U75XnJ094921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 30 Jul 2016 07:05:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303544 - head/sys/cddl/contrib/opensolaris/uts/intel/dtrace 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.22 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, 30 Jul 2016 07:05:34 -0000 Author: markj Date: Sat Jul 30 07:05:32 2016 New Revision: 303544 URL: https://svnweb.freebsd.org/changeset/base/303544 Log: Restore an ifdef that should not have been removed in r303535. X-MFC-With: r303535 Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Sat Jul 30 07:04:46 2016 (r303543) +++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Sat Jul 30 07:05:32 2016 (r303544) @@ -1088,6 +1088,7 @@ fasttrap_pid_probe(struct reg *rp) if (tp->ftt_ids != NULL) { fasttrap_id_t *id; +#ifdef __amd64 if (p->p_model == DATAMODEL_LP64) { for (id = tp->ftt_ids; id != NULL; id = id->fti_next) { fasttrap_probe_t *probe = id->fti_probe; @@ -1129,6 +1130,7 @@ fasttrap_pid_probe(struct reg *rp) } } } else { +#endif uintptr_t s0, s1, s2, s3, s4, s5; uint32_t *stack = (uint32_t *)rp->r_rsp; @@ -1183,7 +1185,9 @@ fasttrap_pid_probe(struct reg *rp) t[2], t[3], t[4]); } } +#ifdef __amd64 } +#endif } /* From owner-svn-src-head@freebsd.org Sat Jul 30 07:06: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 5ECA7BA9A34; Sat, 30 Jul 2016 07:06:24 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BB9C14DE; Sat, 30 Jul 2016 07:06:24 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6U76N6t095007; Sat, 30 Jul 2016 07:06:23 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6U76Nc8095006; Sat, 30 Jul 2016 07:06:23 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201607300706.u6U76Nc8095006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Sat, 30 Jul 2016 07:06:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303545 - head/usr.bin/netstat 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.22 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, 30 Jul 2016 07:06:24 -0000 Author: araujo Date: Sat Jul 30 07:06:23 2016 New Revision: 303545 URL: https://svnweb.freebsd.org/changeset/base/303545 Log: Use nitems() from sys/param.h. MFC after: 2 weeks. Sponsored by: gandi.net (BSD Day Taiwan) Modified: head/usr.bin/netstat/pfkey.c Modified: head/usr.bin/netstat/pfkey.c ============================================================================== --- head/usr.bin/netstat/pfkey.c Sat Jul 30 07:05:32 2016 (r303544) +++ head/usr.bin/netstat/pfkey.c Sat Jul 30 07:06:23 2016 (r303545) @@ -101,8 +101,7 @@ static const char *pfkey_msgtype_names ( static const char * pfkey_msgtype_names(int x) { - const int max = - sizeof(pfkey_msgtypenames)/sizeof(pfkey_msgtypenames[0]); + const int max = nitems(pfkey_msgtypenames); static char buf[20]; if (x < max && pfkey_msgtypenames[x]) From owner-svn-src-head@freebsd.org Sat Jul 30 07:08: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 AD58CBA9A98; Sat, 30 Jul 2016 07:08:04 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk0-x229.google.com (mail-qk0-x229.google.com [IPv6:2607:f8b0:400d:c09::229]) (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 65C641694; Sat, 30 Jul 2016 07:08:04 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk0-x229.google.com with SMTP id s63so108132301qkb.2; Sat, 30 Jul 2016 00:08:04 -0700 (PDT) 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-disposition:in-reply-to:user-agent; bh=RVRQxCRC8brv0EMwF1VrK1Jx3oUAmg8Nk098EHm109Y=; b=RQ2P0COrjWtTMV5LBLGx3ay+PprGoCeMElodpG9su/vDstdwvTq/4mmf4VBQsONqn1 6C67J408P2+y3RirB5d71Pk8a1v16BgNP87OMh19uWSBtLMGPDJr6n55pkEfmoErQ9jE b+t/AmaExdiqYCg4rNG2E32q5AM/5WLc28GhOdPt+Rg5Y4rERaXUIjyk3ANN6FjpMzmy FyAwdkMiVNF8rW30uylah8cmbGE/rPs82QVMAMTfrUeECfAfomtNAL20unp1SvO0ubRN Uz9mvW4KBdADHn+rRYW8Yr3fb/9dNKcuvdURUI2HDVmIvYcuSf3j+nz0D2RMM4a/bjqB k1LA== 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-disposition:in-reply-to:user-agent; bh=RVRQxCRC8brv0EMwF1VrK1Jx3oUAmg8Nk098EHm109Y=; b=XWwqC4Ph/a8nS4KB748t+IW9HBJtp7i2f54J/h66c2wU1PmRIHQyT8Nu1cQvRZt97J oI85vcmGkjPUiFCMqfG2vh6WOJA/W0ryEfnsoa4h9zmxiDPcSUxrK4xQWY5VEYiXY5b4 JBS5lN0xEY7ZihkT/x/x/h+qrxiZlfYeGWgg6gc46xlnoRBtlpoTyFQNnQA5ZTSOliyz 23keW0XiZwh2MUVhm76HD3n/iRJOOg5e0aKPfrP4AYKjDcclaiX979dYEegrZLQy+x86 TeZxfYx3HDdbxxJcamB1K67DrYq7OEjJJUxLHLdy9SxQq1q74EajBgVXJ+4q5bKnzXSA eSBg== X-Gm-Message-State: AEkoousr9/SbEzeVUPweWQW3o8TJuwXTpAWE9iPv39nlX7Ivz5OpJ1xcNTrsXwxtLWRFsQ== X-Received: by 10.55.175.132 with SMTP id y126mr58129210qke.186.1469862483564; Sat, 30 Jul 2016 00:08:03 -0700 (PDT) Received: from charmander ([104.232.114.184]) by smtp.gmail.com with ESMTPSA id n20sm12015591qtn.40.2016.07.30.00.08.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Jul 2016 00:08:02 -0700 (PDT) Sender: Mark Johnston Date: Sat, 30 Jul 2016 00:08:01 -0700 From: Mark Johnston To: "Ngie Cooper (yaneurabeya)" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303535 - in head/sys/cddl/contrib/opensolaris/uts: common/dtrace intel/dtrace Message-ID: <20160730070801.GA41940@charmander> References: <201607300311.u6U3Brr9008960@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 30 Jul 2016 07:08:04 -0000 On Fri, Jul 29, 2016 at 11:18:25PM -0700, Ngie Cooper (yaneurabeya) wrote: > > > On Jul 29, 2016, at 20:11, Mark Johnston wrote: > > > > Author: markj > > Date: Sat Jul 30 03:11:53 2016 > > New Revision: 303535 > > URL: https://svnweb.freebsd.org/changeset/base/303535 > > > > Log: > > Include fasttrap handling for DATAMODEL_ILP32 when compiling for amd64. > > > > MFC after: 1 month > > This broke i386: https://jenkins.freebsd.org/job/FreeBSD_HEAD_i386/3722/ . > Thanks, > -Ngie Sorry about that. Should be fixed with r303544. From owner-svn-src-head@freebsd.org Sat Jul 30 07:15: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 4824ABA9C50; Sat, 30 Jul 2016 07:15:55 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 184361B68; Sat, 30 Jul 2016 07:15:55 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6U7FsDe098645; Sat, 30 Jul 2016 07:15:54 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6U7Fs6p098644; Sat, 30 Jul 2016 07:15:54 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201607300715.u6U7Fs6p098644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Sat, 30 Jul 2016 07:15:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303546 - head/usr.bin/procstat 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.22 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, 30 Jul 2016 07:15:55 -0000 Author: araujo Date: Sat Jul 30 07:15:54 2016 New Revision: 303546 URL: https://svnweb.freebsd.org/changeset/base/303546 Log: Use nitems() from sys/param.h. MFC after: 2 weeks. Sponsored by: gandi.net (BSD Day Taiwan) Modified: head/usr.bin/procstat/procstat_files.c Modified: head/usr.bin/procstat/procstat_files.c ============================================================================== --- head/usr.bin/procstat/procstat_files.c Sat Jul 30 07:06:23 2016 (r303545) +++ head/usr.bin/procstat/procstat_files.c Sat Jul 30 07:15:54 2016 (r303546) @@ -235,8 +235,7 @@ static struct cap_desc { { CAP_SOCK_CLIENT, "scl" }, { CAP_SOCK_SERVER, "ssr" }, }; -static const u_int cap_desc_count = sizeof(cap_desc) / - sizeof(cap_desc[0]); +static const u_int cap_desc_count = nitems(cap_desc); static u_int width_capability(cap_rights_t *rightsp) From owner-svn-src-head@freebsd.org Sat Jul 30 07:28: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 EB637BA9E90; Sat, 30 Jul 2016 07:28:16 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC8701247; Sat, 30 Jul 2016 07:28:16 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6U7SFiN002534; Sat, 30 Jul 2016 07:28:15 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6U7SFPb002533; Sat, 30 Jul 2016 07:28:15 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201607300728.u6U7SFPb002533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Sat, 30 Jul 2016 07:28:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303547 - head/usr.bin/indent 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.22 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, 30 Jul 2016 07:28:17 -0000 Author: araujo Date: Sat Jul 30 07:28:15 2016 New Revision: 303547 URL: https://svnweb.freebsd.org/changeset/base/303547 Log: Use nitems() from sys/param.h. MFC after: 2 weeks. Sponsored by: gandi.net (BSD Day Taiwan) Modified: head/usr.bin/indent/indent.c Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Sat Jul 30 07:15:54 2016 (r303546) +++ head/usr.bin/indent/indent.c Sat Jul 30 07:28:15 2016 (r303547) @@ -1138,7 +1138,7 @@ check_type: while ((c = getc(input)) == '\n'); ungetc(c, input); } - if ((size_t)ifdef_level < sizeof(state_stack)/sizeof(state_stack[0])) { + if ((size_t)ifdef_level < nitems(state_stack)) { match_state[ifdef_level].tos = -1; state_stack[ifdef_level++] = ps; } From owner-svn-src-head@freebsd.org Sat Jul 30 08:53: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 50E3DBA9319; Sat, 30 Jul 2016 08:53:01 +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 1A6A0172C; Sat, 30 Jul 2016 08:53:00 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id DE2291A3C27; Sat, 30 Jul 2016 18:52:55 +1000 (AEST) Date: Sat, 30 Jul 2016 18:52:54 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303530 - head/lib/libc/gen In-Reply-To: <84c77b80-8b51-8698-f27a-7f6452867d66@freebsd.org> Message-ID: <20160730184454.I2661@besplex.bde.org> References: <201607300209.u6U29BXC082700@repo.freebsd.org> <20160730140305.G1962@besplex.bde.org> <84c77b80-8b51-8698-f27a-7f6452867d66@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=EfU1O6SC c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=-VkZlQZJ9cw8Qod7-jsA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 30 Jul 2016 08:53:01 -0000 On Sat, 30 Jul 2016, Andrey Chernov wrote: > On 30.07.2016 7:15, Bruce Evans wrote: >> On Sat, 30 Jul 2016, Andrey A. Chernov wrote: >> >>> Log: >>> Reset errno for readdirfunc() before contunue. >> >> In C99, library functions are not permitted to set errno to 0. The glob() >> family shouldn't use a different (worse) convention, and POSIX doesn't >> seem to have any special wording to allow different behaviour. > > This is historic practice for this function at least since GLOB_LIMIT > was introduced (in 2001) and common across NetBSD/OpenBSD. Existent > programs may relay on that to check that limit is reached and not > allocation error, so with few additional overwriting from my side I add > nothing new: > > Revision 80525 > Modified Sun Jul 29 00:52:37 2001 UTC (15 years ago) by mikeh > ... > errno = 0 is documented. See glob(3), GLOB_NOSPACE section too. Hmm. This is not in the BUGS section. Strangely, the related non-bug that glob() may fail and set errno (to a reasonable but nonstandard and undocumented value?) is in the BUGS section. I guess this is a bug in conjunction with the promise to set errno to 0 for some failures. > The real problem is that glob(3) is very limited in error return codes, > so they reuse existent codes with errno hack. It should have just used the least-unclosely-related standard errno instead of 0. Bruce From owner-svn-src-head@freebsd.org Sat Jul 30 09:25: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 D6728BA99E3; Sat, 30 Jul 2016 09:25:58 +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 98BD116C0; Sat, 30 Jul 2016 09:25:58 +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 u6U9Pv4t046443; Sat, 30 Jul 2016 09:25:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6U9PvMQ046442; Sat, 30 Jul 2016 09:25:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201607300925.u6U9PvMQ046442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 30 Jul 2016 09:25:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303548 - 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.22 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, 30 Jul 2016 09:25:58 -0000 Author: kib Date: Sat Jul 30 09:25:57 2016 New Revision: 303548 URL: https://svnweb.freebsd.org/changeset/base/303548 Log: Cache getbintime(9) answer in timehands, similarly to getnanotime(9) and getmicrotime(9). Suggested and reviewed by: bde (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 month Modified: head/sys/kern/kern_tc.c Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Sat Jul 30 07:28:15 2016 (r303547) +++ head/sys/kern/kern_tc.c Sat Jul 30 09:25:57 2016 (r303548) @@ -68,6 +68,7 @@ struct timehands { uint64_t th_scale; u_int th_offset_count; struct bintime th_offset; + struct bintime th_bintime; struct timeval th_microtime; struct timespec th_nanotime; struct bintime th_boottime; @@ -233,9 +234,8 @@ fbclock_bintime(struct bintime *bt) do { th = timehands; gen = atomic_load_acq_int(&th->th_generation); - *bt = th->th_offset; + *bt = th->th_bintime; bintime_addx(bt, th->th_scale * tc_delta(th)); - bintime_add(bt, &th->th_boottime); atomic_thread_fence_acq(); } while (gen == 0 || gen != th->th_generation); } @@ -309,8 +309,7 @@ fbclock_getbintime(struct bintime *bt) do { th = timehands; gen = atomic_load_acq_int(&th->th_generation); - *bt = th->th_offset; - bintime_add(bt, &th->th_boottime); + *bt = th->th_bintime; atomic_thread_fence_acq(); } while (gen == 0 || gen != th->th_generation); } @@ -385,9 +384,8 @@ bintime(struct bintime *bt) do { th = timehands; gen = atomic_load_acq_int(&th->th_generation); - *bt = th->th_offset; + *bt = th->th_bintime; bintime_addx(bt, th->th_scale * tc_delta(th)); - bintime_add(bt, &th->th_boottime); atomic_thread_fence_acq(); } while (gen == 0 || gen != th->th_generation); } @@ -461,8 +459,7 @@ getbintime(struct bintime *bt) do { th = timehands; gen = atomic_load_acq_int(&th->th_generation); - *bt = th->th_offset; - bintime_add(bt, &th->th_boottime); + *bt = th->th_bintime; atomic_thread_fence_acq(); } while (gen == 0 || gen != th->th_generation); } @@ -1385,6 +1382,8 @@ tc_windup(struct bintime *new_boottimebi if (bt.sec != t) th->th_boottime.sec += bt.sec - t; } + th->th_bintime = th->th_offset; + bintime_add(&th->th_bintime, &th->th_boottime); /* Update the UTC timestamps used by the get*() functions. */ /* XXX shouldn't do this here. Should force non-`get' versions. */ bintime2timeval(&bt, &th->th_microtime); @@ -1804,9 +1803,8 @@ pps_event(struct pps_state *pps, int eve /* Convert the count to a timespec. */ tcount = pps->capcount - pps->capth->th_offset_count; tcount &= pps->capth->th_counter->tc_counter_mask; - bt = pps->capth->th_offset; + bt = pps->capth->th_bintime; bintime_addx(&bt, pps->capth->th_scale * tcount); - bintime_add(&bt, &pps->capth->th_boottime); bintime2timespec(&bt, &ts); /* If the timecounter was wound up underneath us, bail out. */ From owner-svn-src-head@freebsd.org Sat Jul 30 09:45: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 09759BA9E54 for ; Sat, 30 Jul 2016 09:45:46 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x232.google.com (mail-yw0-x232.google.com [IPv6:2607:f8b0:4002:c05::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 C38F71271 for ; Sat, 30 Jul 2016 09:45:45 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x232.google.com with SMTP id u134so135129240ywg.3 for ; Sat, 30 Jul 2016 02:45:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=DEsC4o38uAdcNxqAW43BEBQxbgUPuxIDTCOgo3k8BDg=; b=y+rpUjnGaUIHzFmlYvQEqY47XVbwe4+S5/GK+Tj2c18gWMhv/KnrRVxS2tPy9lJW5z owzKjITAchQEaa+uf3mJxTtt1x7tempcrMigsgp8H0HUligcRXghS0HuicjkJBeab5Ul ot3uVa2tVGyFuq2X/ELgrR2n+nUutmv7tpIrEo6PQGTuolQL/5VNPGsQY1V1Z9+zNQb3 i056Oxj5wwc+bA8zxNZuKDCrb58s7gUyWfhHKiuM9ITDbyyMJNNcCdSjnsDLW1oI/0xw SlYerRAD/WCB2TnZ68RUP+mtM9o3P7OZCZ/k0OHQrNGENXMfs96UFKnwQbsg4VLN/Lxd FJfg== 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:from:date :message-id:subject:to:cc; bh=DEsC4o38uAdcNxqAW43BEBQxbgUPuxIDTCOgo3k8BDg=; b=A7w3Q1vKLug8eEnrwHC5LaT0C3IWgIFOnCpjgAkAU8UHRplUtcTHHooRJAUt/chvNE M9hmLzRhSn0a8aQ5DJXTmQgbFtPUWv/ZdY6+QvFCz6UJRp56jY7WwvCyB0DBGNuQ7kjL PPwf49nicv3fNbZoG7BHwkEi++XTfje6WXCwqW6BCaMIl/8uDHqXKPAZLZ+7tFeIE3U6 fUfHAC0y0TwuV9tf+5pcevnhIVYLWsZyC8ytA+R0moKk2oM7VVwC66il9EjeiCHIpSsw tbwphXf2uS8X7NAbrM62cAUP+jlf0KADAvUn4Mi1uQMn96bl8UF2+pxQtwGCcI8skAN4 iLMg== X-Gm-Message-State: AEkoouvAFuleT/HxYjVunMuoVnSbArp1gaTCkfV4+wucjRshZKZyWM+KcZ/VePkLIJdN43Qp8/V5ccei4jENvg== X-Received: by 10.129.98.2 with SMTP id w2mr16245810ywb.313.1469871944457; Sat, 30 Jul 2016 02:45:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.167.71 with HTTP; Sat, 30 Jul 2016 02:45:43 -0700 (PDT) In-Reply-To: <201607300100.u6U10GNt056755@repo.freebsd.org> References: <201607300100.u6U10GNt056755@repo.freebsd.org> From: Ed Schouten Date: Sat, 30 Jul 2016 11:45:43 +0200 Message-ID: Subject: Re: svn commit: r303524 - in head: include lib/libc/stdio To: Baptiste Daroussin Cc: src-committers , 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.22 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, 30 Jul 2016 09:45:46 -0000 Hey! 2016-07-30 3:00 GMT+02:00 Baptiste Daroussin : > Remove _WITH_GETLINE and _WITH_DPRINTF guards > > When adding getline(3) and dprintf(3) into libc, those guards were added > to prevent breaking too many ports. > > 7 years later the ports tree have been fixed, it is time to remove this > FreeBSDism > > While here remove the extra parenthesis surrounding dprintf(3) Thanks for working on this. This was also on my TODO list, but thanks for beating me to it! -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Sat Jul 30 10:32: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 20253BA6AB4; Sat, 30 Jul 2016 10:32:30 +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 D67BC1160; Sat, 30 Jul 2016 10:32:29 +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 u6UAWTi9070635; Sat, 30 Jul 2016 10:32:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6UAWScl070634; Sat, 30 Jul 2016 10:32:28 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201607301032.u6UAWScl070634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 30 Jul 2016 10:32:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303551 - head/sys/dev/ntb 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.22 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, 30 Jul 2016 10:32:30 -0000 Author: mav Date: Sat Jul 30 10:32:28 2016 New Revision: 303551 URL: https://svnweb.freebsd.org/changeset/base/303551 Log: Fix infinite loops introduced at r303429. Modified: head/sys/dev/ntb/ntb.c Modified: head/sys/dev/ntb/ntb.c ============================================================================== --- head/sys/dev/ntb/ntb.c Sat Jul 30 09:46:29 2016 (r303550) +++ head/sys/dev/ntb/ntb.c Sat Jul 30 10:32:28 2016 (r303551) @@ -206,7 +206,7 @@ ntb_link_enable(device_t ntb, enum ntb_s struct ntb_child **cpp = device_get_softc(device_get_parent(nc->dev)); struct ntb_child *nc1; - for (nc1 = *cpp; nc1 != NULL; nc1 = nc->next) { + for (nc1 = *cpp; nc1 != NULL; nc1 = nc1->next) { if (nc1->enabled) { nc->enabled = 1; return (0); @@ -226,7 +226,7 @@ ntb_link_disable(device_t ntb) if (!nc->enabled) return (0); nc->enabled = 0; - for (nc1 = *cpp; nc1 != NULL; nc1 = nc->next) { + for (nc1 = *cpp; nc1 != NULL; nc1 = nc1->next) { if (nc1->enabled) return (0); } From owner-svn-src-head@freebsd.org Sat Jul 30 15:51:17 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 BD264BA99DA; Sat, 30 Jul 2016 15:51:17 +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 902DD1D72; Sat, 30 Jul 2016 15:51:17 +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 u6UFpG9w090363; Sat, 30 Jul 2016 15:51:16 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6UFpGAH090362; Sat, 30 Jul 2016 15:51:16 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201607301551.u6UFpGAH090362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 30 Jul 2016 15:51:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303553 - head/sys/dev/ntb/if_ntb 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.22 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, 30 Jul 2016 15:51:17 -0000 Author: mav Date: Sat Jul 30 15:51:16 2016 New Revision: 303553 URL: https://svnweb.freebsd.org/changeset/base/303553 Log: Make MAC address generation more random. 'ticks' approach does not work at boot time. Modified: head/sys/dev/ntb/if_ntb/if_ntb.c Modified: head/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- head/sys/dev/ntb/if_ntb/if_ntb.c Sat Jul 30 14:47:04 2016 (r303552) +++ head/sys/dev/ntb/if_ntb/if_ntb.c Sat Jul 30 15:51:16 2016 (r303553) @@ -493,10 +493,9 @@ static void create_random_local_eui48(u_char *eaddr) { static uint8_t counter = 0; - uint32_t seed = ticks; eaddr[0] = EUI48_LOCALLY_ADMINISTERED; - memcpy(&eaddr[1], &seed, sizeof(uint32_t)); + arc4rand(&eaddr[1], 4, 0); eaddr[5] = counter++; } From owner-svn-src-head@freebsd.org Sat Jul 30 15:56: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 9C4DEBA9B8F; Sat, 30 Jul 2016 15:56:37 +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 6F387135B; Sat, 30 Jul 2016 15:56:37 +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 u6UFuar5092892; Sat, 30 Jul 2016 15:56:36 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6UFuaV3092891; Sat, 30 Jul 2016 15:56:36 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201607301556.u6UFuaV3092891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 30 Jul 2016 15:56:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303554 - 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.22 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, 30 Jul 2016 15:56:37 -0000 Author: mav Date: Sat Jul 30 15:56:36 2016 New Revision: 303554 URL: https://svnweb.freebsd.org/changeset/base/303554 Log: Block MSIX negotiation until SMP started and IRQ reshuffled. 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 Sat Jul 30 15:51:16 2016 (r303553) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Sat Jul 30 15:56:36 2016 (r303554) @@ -2605,6 +2605,17 @@ intel_ntb_user_mw_to_idx(struct ntb_soft return (uidx); } +static int msix_ready; + +static void +intel_ntb_msix_ready(void *arg __unused) +{ + + msix_ready = 1; +} +SYSINIT(intel_ntb_msix_ready, SI_SUB_SMP, SI_ORDER_ANY, + intel_ntb_msix_ready, NULL); + static void intel_ntb_exchange_msix(void *ctx) { @@ -2619,6 +2630,10 @@ intel_ntb_exchange_msix(void *ctx) if (ntb->peer_msix_done) goto msix_done; + /* Block MSIX negotiation until SMP started and IRQ reshuffled. */ + if (!msix_ready) + goto reschedule; + intel_ntb_get_msix_info(ntb); for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { intel_ntb_peer_spad_write(ntb->device, NTB_MSIX_DATA0 + i, From owner-svn-src-head@freebsd.org Sat Jul 30 17: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 C93DFBA8441; Sat, 30 Jul 2016 17:45:57 +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 95F401F6E; Sat, 30 Jul 2016 17:45:57 +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 u6UHju1T033814; Sat, 30 Jul 2016 17:45:56 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6UHju8p033813; Sat, 30 Jul 2016 17:45:56 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201607301745.u6UHju8p033813@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sat, 30 Jul 2016 17:45:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303555 - 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.22 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, 30 Jul 2016 17:45:57 -0000 Author: allanjude Date: Sat Jul 30 17:45:56 2016 New Revision: 303555 URL: https://svnweb.freebsd.org/changeset/base/303555 Log: bcache should support reads shorter than sector size dosfs (fat file systems) can perform reads of partial sectors bcache should support such reads. Submitted by: Toomas Soome Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D6475 Modified: head/sys/boot/common/bcache.c Modified: head/sys/boot/common/bcache.c ============================================================================== --- head/sys/boot/common/bcache.c Sat Jul 30 15:56:36 2016 (r303554) +++ head/sys/boot/common/bcache.c Sat Jul 30 17:45:56 2016 (r303555) @@ -303,7 +303,9 @@ read_strategy(void *devdata, int rw, dad break; } - size = i * bcache_blksize; + if (size > i * bcache_blksize) + size = i * bcache_blksize; + if (size != 0) { bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)) + offset, buf, size); From owner-svn-src-head@freebsd.org Sat Jul 30 17:53: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 DA744BA865A; Sat, 30 Jul 2016 17:53:38 +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 9CEAE1588; Sat, 30 Jul 2016 17:53:38 +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 u6UHrbUF037322; Sat, 30 Jul 2016 17:53:37 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6UHrb9v037321; Sat, 30 Jul 2016 17:53:37 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201607301753.u6UHrb9v037321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sat, 30 Jul 2016 17:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303556 - 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.22 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, 30 Jul 2016 17:53:39 -0000 Author: allanjude Date: Sat Jul 30 17:53:37 2016 New Revision: 303556 URL: https://svnweb.freebsd.org/changeset/base/303556 Log: Improve boot loader quote parsing parse() is the boot loader's interp_parse.c is too naive about quotes both single and double quotes were allowed to be mixed, and single quotes did not follow the usual semantics (re variable expansion). The old code did not check for terminating quotes This update implements: * distinguishing single and double quote * variable expansion will not be done inside single quote protected area * will preserve inner quote for values like "value 'some list'" * ending quote check. this diff does not implement ending quote order check, it shouldn't be too hard, needs some improvements on parser state machine. PR: 204602 Submitted by: Toomas Soome Relnotes: yes Differential Revision: https://reviews.freebsd.org/D6000 Modified: head/sys/boot/common/interp_parse.c Modified: head/sys/boot/common/interp_parse.c ============================================================================== --- head/sys/boot/common/interp_parse.c Sat Jul 30 17:45:56 2016 (r303555) +++ head/sys/boot/common/interp_parse.c Sat Jul 30 17:53:37 2016 (r303556) @@ -72,7 +72,13 @@ isdelim(int ch) static int isquote(int ch) { - return (ch == '\'' || ch == '"'); + return (ch == '\''); +} + +static int +isdquote(int ch) +{ + return (ch == '"'); } int @@ -81,11 +87,11 @@ parse(int *argc, char ***argv, char *str int ac; char *val, *p, *q, *copy = NULL; size_t i = 0; - char token, tmp, quote, *buf; + char token, tmp, quote, dquote, *buf; enum { STR, VAR, WHITE } state; ac = *argc = 0; - quote = 0; + dquote = quote = 0; if (!str || (p = copy = backslash(str)) == NULL) return 1; @@ -105,9 +111,19 @@ parse(int *argc, char ***argv, char *str buf[i++] = *p++; } else if (isquote(*p)) { quote = quote ? 0 : *p; - ++p; - } - else if (isspace(*p) && !quote) { + if (dquote) { /* keep quote */ + PARSE_FAIL(i == (PARSE_BUFSIZE - 1)); + buf[i++] = *p++; + } else + ++p; + } else if (isdquote(*p)) { + dquote = dquote ? 0 : *p; + if (quote) { /* keep dquote */ + PARSE_FAIL(i == (PARSE_BUFSIZE - 1)); + buf[i++] = *p++; + } else + ++p; + } else if (isspace(*p) && !quote && !dquote) { state = WHITE; if (i) { buf[i] = '\0'; @@ -115,7 +131,7 @@ parse(int *argc, char ***argv, char *str i = 0; } ++p; - } else if (*p == '$') { + } else if (*p == '$' && !quote) { token = isdelim(*(p + 1)); if (token) p += 2; @@ -157,6 +173,8 @@ parse(int *argc, char ***argv, char *str break; } } + /* missing terminating ' or " */ + PARSE_FAIL(quote || dquote); /* If at end of token, add it */ if (i && state == STR) { buf[i] = '\0'; From owner-svn-src-head@freebsd.org Sat Jul 30 19:03: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 0C32ABA9694; Sat, 30 Jul 2016 19:03:34 +0000 (UTC) (envelope-from ivadasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7E27135C; Sat, 30 Jul 2016 19:03:33 +0000 (UTC) (envelope-from ivadasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6UJ3WED062973; Sat, 30 Jul 2016 19:03:32 GMT (envelope-from ivadasz@FreeBSD.org) Received: (from ivadasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6UJ3Wi2062972; Sat, 30 Jul 2016 19:03:32 GMT (envelope-from ivadasz@FreeBSD.org) Message-Id: <201607301903.u6UJ3Wi2062972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ivadasz set sender to ivadasz@FreeBSD.org using -f From: =?UTF-8?Q?Imre_Vad=c3=a1sz?= Date: Sat, 30 Jul 2016 19:03:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303557 - head/sys/dev/iwm 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.22 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, 30 Jul 2016 19:03:34 -0000 Author: ivadasz Date: Sat Jul 30 19:03:32 2016 New Revision: 303557 URL: https://svnweb.freebsd.org/changeset/base/303557 Log: [iwm] Fix iwm_poll_bit() usage in iwm_stop_device(), fixup r303418. * iwm_poll_bit() returns 1 on success and 0 on failure, whereas iwl_poll_bit() in Linux's iwlwifi returns >= 0 on success and < 0 on failure. * Because of the wrong iwm_poll_bit return code check, no warning was printed if tx DMA stopping failed. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D7371 Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Sat Jul 30 17:53:37 2016 (r303556) +++ head/sys/dev/iwm/if_iwm.c Sat Jul 30 19:03:32 2016 (r303557) @@ -1310,8 +1310,8 @@ iwm_stop_device(struct iwm_softc *sc) } /* Wait for DMA channels to be idle */ - if (iwm_poll_bit(sc, IWM_FH_TSSR_TX_STATUS_REG, mask, mask, - 5000) < 0) { + if (!iwm_poll_bit(sc, IWM_FH_TSSR_TX_STATUS_REG, mask, mask, + 5000)) { device_printf(sc->sc_dev, "Failing on timeout while stopping DMA channel: [0x%08x]\n", IWM_READ(sc, IWM_FH_TSSR_TX_STATUS_REG)); From owner-svn-src-head@freebsd.org Sat Jul 30 19:14: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 4CD84BA98E1; Sat, 30 Jul 2016 19:14:12 +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 2B99418A6; Sat, 30 Jul 2016 19:14:12 +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 7D59FB922; Sat, 30 Jul 2016 15:14:10 -0400 (EDT) From: John Baldwin To: Alexander Motin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303554 - head/sys/dev/ntb/ntb_hw Date: Sat, 30 Jul 2016 12:11:08 -0700 Message-ID: <1813404.404lkyFkVV@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201607301556.u6UFuaV3092891@repo.freebsd.org> References: <201607301556.u6UFuaV3092891@repo.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); Sat, 30 Jul 2016 15:14:10 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 30 Jul 2016 19:14:12 -0000 On Saturday, July 30, 2016 03:56:36 PM Alexander Motin wrote: > Author: mav > Date: Sat Jul 30 15:56:36 2016 > New Revision: 303554 > URL: https://svnweb.freebsd.org/changeset/base/303554 > > Log: > Block MSIX negotiation until SMP started and IRQ reshuffled. Perhaps wrap this in #ifndef EARLY_AP_STARTUP? I am working with a user with a bug on SCHED_4BSD, but once that is fixed I plan to enable EARLY_AP_STARTUP in HEAD on x86. Would you be able to test this case with EARLY_AP_STARTUP (should work fine with ULE AFAIK) and verify you don't need it in that case? -- John Baldwin From owner-svn-src-head@freebsd.org Sat Jul 30 20:11: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 75A68BA85A6 for ; Sat, 30 Jul 2016 20:11:07 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f53.google.com (mail-lf0-f53.google.com [209.85.215.53]) (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 F1D2311FA for ; Sat, 30 Jul 2016 20:11:06 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f53.google.com with SMTP id l69so91844484lfg.1 for ; Sat, 30 Jul 2016 13:11:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=O+qF/okj5rAGEiZDQ9SGEzPMhc8DRr2Edr9qPno5qxc=; b=NfUixDokvXM/Sd/0x7pXtVb/HsQkUYwEFovPJnsRWHDBYd9UV7GPJaPP7DkkhyMOau Qi2rABta8nRivPslsd7eDr5Sv2ZY4obSYLBldDNbOwrYTgOHMgiCIZVv/v3QpnmIDoXA 9bUNeOJJuKrjAK4WfybpQ+lEtFRv5ZX7v57u2uhPDBAklqdMvcucYABdtRTvpW46J0W5 A5c4nhC51vdEkFdyzV2izLruMC+9UvlxkhMzAknM9sRevM4EKnBot70edNvhGSgMxon2 pvEpxCTQ7YNrKEsiEmtJwZNFnwOYd9VpHnGuxYbVwfAmso53rW2PLZadpYOG3+BToxlm 45Kw== X-Gm-Message-State: AEkoouumcEYBwVz4xghN5ALMl8xLmrBNyRAiLFiQL8R/YtpqQUtlf9O9B+zRf/STYdcmeA== X-Received: by 10.25.17.70 with SMTP id g67mr18601007lfi.145.1469909458707; Sat, 30 Jul 2016 13:10:58 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id 62sm3860281ljj.3.2016.07.30.13.10.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Jul 2016 13:10:58 -0700 (PDT) Subject: Re: svn commit: r303530 - head/lib/libc/gen To: Bruce Evans References: <201607300209.u6U29BXC082700@repo.freebsd.org> <20160730140305.G1962@besplex.bde.org> <84c77b80-8b51-8698-f27a-7f6452867d66@freebsd.org> <20160730184454.I2661@besplex.bde.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: <71b31670-244e-73e1-2092-4c4de5b8a692@freebsd.org> Date: Sat, 30 Jul 2016 23:10:55 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160730184454.I2661@besplex.bde.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 30 Jul 2016 20:11:07 -0000 On 30.07.2016 11:52, Bruce Evans wrote: > On Sat, 30 Jul 2016, Andrey Chernov wrote: > >> On 30.07.2016 7:15, Bruce Evans wrote: >>> On Sat, 30 Jul 2016, Andrey A. Chernov wrote: >>> >>>> Log: >>>> Reset errno for readdirfunc() before contunue. >>> >>> In C99, library functions are not permitted to set errno to 0. The >>> glob() >>> family shouldn't use a different (worse) convention, and POSIX doesn't >>> seem to have any special wording to allow different behaviour. BTW, POSIX says so too: "No function in this volume of POSIX.1-2008 shall set errno to 0." >> This is historic practice for this function at least since GLOB_LIMIT >> was introduced (in 2001) and common across NetBSD/OpenBSD. Existent >> programs may relay on that to check that limit is reached and not >> allocation error, so with few additional overwriting from my side I add >> nothing new: >> >> Revision 80525 >> Modified Sun Jul 29 00:52:37 2001 UTC (15 years ago) by mikeh >> ... >> errno = 0 is documented. See glob(3), GLOB_NOSPACE section too. > > Hmm. This is not in the BUGS section. Strangely, the related non-bug > that glob() may fail and set errno (to a reasonable but nonstandard and > undocumented value?) is in the BUGS section. I guess this is a bug > in conjunction with the promise to set errno to 0 for some failures. > >> The real problem is that glob(3) is very limited in error return codes, >> so they reuse existent codes with errno hack. > > It should have just used the least-unclosely-related standard errno > instead of 0. I was thinking about this way too, f.e. E2BIG or ERANGE are nice candidatures, but still can't decide to break cross-BSD compatibility and historic practice. From owner-svn-src-head@freebsd.org Sat Jul 30 20:31: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 ECA23BA8B01; Sat, 30 Jul 2016 20:31:13 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE06B1AE8; Sat, 30 Jul 2016 20:31:13 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6UKVChX093758; Sat, 30 Jul 2016 20:31:12 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6UKVCiE093757; Sat, 30 Jul 2016 20:31:12 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201607302031.u6UKVCiE093757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 30 Jul 2016 20:31:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303559 - head/sys/dev/pci 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.22 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, 30 Jul 2016 20:31:14 -0000 Author: bz Date: Sat Jul 30 20:31:12 2016 New Revision: 303559 URL: https://svnweb.freebsd.org/changeset/base/303559 Log: Try to declare _hw_pci for all sysctl cases needed after r303497. MFC after: 5 days X-MFC with: r303497 Modified: head/sys/dev/pci/pci_pci.c Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Sat Jul 30 20:02:08 2016 (r303558) +++ head/sys/dev/pci/pci_pci.c Sat Jul 30 20:31:12 2016 (r303559) @@ -128,9 +128,11 @@ static devclass_t pcib_devclass; DEFINE_CLASS_0(pcib, pcib_driver, pcib_methods, sizeof(struct pcib_softc)); DRIVER_MODULE(pcib, pci, pcib_driver, pcib_devclass, NULL, NULL); -#ifdef NEW_PCIB +#if defined(NEW_PCIB) || defined(PCI_HP) SYSCTL_DECL(_hw_pci); +#endif +#ifdef NEW_PCIB static int pci_clear_pcib; SYSCTL_INT(_hw_pci, OID_AUTO, clear_pcib, CTLFLAG_RDTUN, &pci_clear_pcib, 0, "Clear firmware-assigned resources for PCI-PCI bridge I/O windows."); From owner-svn-src-head@freebsd.org Sat Jul 30 20:39: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 7DE4CBA8C80; Sat, 30 Jul 2016 20:39:40 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23FAA1EBC; Sat, 30 Jul 2016 20:39:40 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6UKddU0096835; Sat, 30 Jul 2016 20:39:39 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6UKddbt096834; Sat, 30 Jul 2016 20:39:39 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201607302039.u6UKddbt096834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 30 Jul 2016 20:39:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303560 - head/usr.sbin/uathload 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.22 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, 30 Jul 2016 20:39:40 -0000 Author: bz Date: Sat Jul 30 20:39:39 2016 New Revision: 303560 URL: https://svnweb.freebsd.org/changeset/base/303560 Log: Rename devname to udevname after including stdlib.h in r303445 as gcc trips over the devname(3) and reports 'shadows a global declaration'. This should unbreak gcc based world builds. Modified: head/usr.sbin/uathload/uathload.c Modified: head/usr.sbin/uathload/uathload.c ============================================================================== --- head/usr.sbin/uathload/uathload.c Sat Jul 30 20:31:12 2016 (r303559) +++ head/usr.sbin/uathload/uathload.c Sat Jul 30 20:39:39 2016 (r303560) @@ -83,15 +83,15 @@ extern uint8_t _binary_ar5523_bin_start; extern uint8_t _binary_ar5523_bin_end; static int -getdevname(const char *devname, char *msgdev, char *datadev) +getdevname(const char *udevname, char *msgdev, char *datadev) { char *bn, *bnbuf, *dn, *dnbuf; - dnbuf = strdup(devname); + dnbuf = strdup(udevname); if (dnbuf == NULL) return (-1); dn = dirname(dnbuf); - bnbuf = strdup(devname); + bnbuf = strdup(udevname); if (bnbuf == NULL) { free(dnbuf); return (-1); @@ -121,7 +121,7 @@ usage(void) int main(int argc, char *argv[]) { - const char *fwname, *devname; + const char *fwname, *udevname; char msgdev[256], datadev[256]; struct uath_fwmsg txmsg, rxmsg; char *txdata; @@ -130,11 +130,11 @@ main(int argc, char *argv[]) int bufsize = 512, verbose = 0; ssize_t len; - devname = NULL; + udevname = NULL; while ((c = getopt(argc, argv, "d:v")) != -1) { switch (c) { case 'd': - devname = optarg; + udevname = optarg; break; case 'v': verbose = 1; @@ -147,7 +147,7 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - if (devname == NULL) + if (udevname == NULL) errx(-1, "No device name; use -d to specify the ugen device"); if (argc > 1) usage(); @@ -166,7 +166,7 @@ main(int argc, char *argv[]) err(-1, "mmap(%s)", fwname); len = sb.st_size; /* XXX verify device is an AR5005 part */ - if (getdevname(devname, msgdev, datadev)) + if (getdevname(udevname, msgdev, datadev)) err(-1, "getdevname error"); msg = open(msgdev, O_RDWR, 0); @@ -186,7 +186,7 @@ main(int argc, char *argv[]) err(-1, "%s: USB_SET_TX_TIMEOUT(%u)", datadev, UATH_DATA_TIMEOUT); - VERBOSE("Load firmware %s to %s\n", fwname, devname); + VERBOSE("Load firmware %s to %s\n", fwname, udevname); bzero(&txmsg, sizeof (struct uath_fwmsg)); txmsg.flags = htobe32(UATH_WRITE_BLOCK); From owner-svn-src-head@freebsd.org Sat Jul 30 21:07: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 C284ABA91B0; Sat, 30 Jul 2016 21:07:00 +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 914851A86; Sat, 30 Jul 2016 21:07:00 +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 u6UL6xcS008012; Sat, 30 Jul 2016 21:06:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6UL6x9Z008011; Sat, 30 Jul 2016 21:06:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201607302106.u6UL6x9Z008011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 30 Jul 2016 21:06:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303561 - 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.22 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, 30 Jul 2016 21:07:00 -0000 Author: mav Date: Sat Jul 30 21:06:59 2016 New Revision: 303561 URL: https://svnweb.freebsd.org/changeset/base/303561 Log: Wrap previous MSIX workaround into #ifndef EARLY_AP_STARTUP. With EARLY_AP_STARTUP we can successfully negotiate MSIX earlier. Requested by: jhb@ 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 Sat Jul 30 20:39:39 2016 (r303560) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Sat Jul 30 21:06:59 2016 (r303561) @@ -2605,6 +2605,7 @@ intel_ntb_user_mw_to_idx(struct ntb_soft return (uidx); } +#ifndef EARLY_AP_STARTUP static int msix_ready; static void @@ -2615,6 +2616,7 @@ intel_ntb_msix_ready(void *arg __unused) } SYSINIT(intel_ntb_msix_ready, SI_SUB_SMP, SI_ORDER_ANY, intel_ntb_msix_ready, NULL); +#endif static void intel_ntb_exchange_msix(void *ctx) @@ -2630,9 +2632,11 @@ intel_ntb_exchange_msix(void *ctx) if (ntb->peer_msix_done) goto msix_done; +#ifndef EARLY_AP_STARTUP /* Block MSIX negotiation until SMP started and IRQ reshuffled. */ if (!msix_ready) goto reschedule; +#endif intel_ntb_get_msix_info(ntb); for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { From owner-svn-src-head@freebsd.org Sat Jul 30 22:05:10 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 CF1FCBA8023 for ; Sat, 30 Jul 2016 22:05:10 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x22f.google.com (mail-yw0-x22f.google.com [IPv6:2607:f8b0:4002:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8533016F3 for ; Sat, 30 Jul 2016 22:05:10 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x22f.google.com with SMTP id z8so143858962ywa.1 for ; Sat, 30 Jul 2016 15:05:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=omVKDNEqDrigZ/lFH2hNOTNaYLrwisoDvnjs3vRr1Xc=; b=UBcqj4O82Ygbk1hCZTuDLBF5z8cWjxIff91BVDK4+/t6RKXjJrDzzg4A/wVEOO52Jz n+LwYSZp04pLWTnReOexC5ASxeg5ZiZSAvd6F5dhBp3Pzvr4IiB8cbAth83b9TFLj9bp 0rqBL3HVgDJSKFXbg7SFACXaFi+UeogoiU0Lga8GuUSS2choJ7r7lo77XjZYoHOgla9n sVOLa7pDT66HsVCVq9dLf+GXZIc59sjhwGC/5fsKnBYuYeOGPYhLltOVxkCUd51L9eYi KESXODx8lU0JHWmY8+YTQT5DpX07BUekVjMANJsBXOESNsjrRgtiagANQQq6NgpjbF/5 wWJQ== 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:from:date :message-id:subject:to:cc; bh=omVKDNEqDrigZ/lFH2hNOTNaYLrwisoDvnjs3vRr1Xc=; b=RaVaJVxQJ6CniNDmYWjlhUGGwZIqHiQfvVtPzG6+eizfL35EhC/UtqGjqI8t03l74H x1Qaqn2QjqwXK5ZTbt1Rv3rZi8vX7FecJihm1aFcJ+h7XxJWeU2mVertaJxA17ZgXW9T wtr/Lezg6cgH4Pkew+/lEbCI4Ab9Zn+JCTTvUMepov9Mto1SyVEga1+uY6Xro9Wam2Mp I9U8aoIfy3HslklPZPA/fuclRXN6P4dJPTxmXWgqbIWtZTGBu9/+umFhK8PWYnHWCSsL zJCUA1UvSqUrbrmvyZIfsKaq3+O4ZL6Khm1POl3AZEUzSIDGdFaZOAh7dz4cgzeOUAGI 1wEA== X-Gm-Message-State: AEkoous6sCjFuKOiR49uG1CzKPabvEIr/OAqmLzss3GEv5Un5XufxpdspodVIpMHcJwD3iUw7bgCS4ngpVJytw== X-Received: by 10.129.122.7 with SMTP id v7mr39186452ywc.219.1469916309740; Sat, 30 Jul 2016 15:05:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.201.71 with HTTP; Sat, 30 Jul 2016 15:05:09 -0700 (PDT) In-Reply-To: <201607302039.u6UKddbt096834@repo.freebsd.org> References: <201607302039.u6UKddbt096834@repo.freebsd.org> From: Ed Schouten Date: Sun, 31 Jul 2016 00:05:09 +0200 Message-ID: Subject: Re: svn commit: r303560 - head/usr.sbin/uathload To: "Bjoern A. Zeeb" Cc: src-committers , 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.22 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, 30 Jul 2016 22:05:10 -0000 2016-07-30 22:39 GMT+02:00 Bjoern A. Zeeb : > Rename devname to udevname after including stdlib.h in r303445 > as gcc trips over the devname(3) and reports 'shadows a global declaration'. Whoops! Sorry about that! -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Sat Jul 30 22:21: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 270B2BA841A; Sat, 30 Jul 2016 22:21:50 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB2671CFA; Sat, 30 Jul 2016 22:21:49 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6UMLnrg035552; Sat, 30 Jul 2016 22:21:49 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6UMLn4E035551; Sat, 30 Jul 2016 22:21:49 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201607302221.u6UMLn4E035551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 30 Jul 2016 22:21:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303562 - 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.22 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, 30 Jul 2016 22:21:50 -0000 Author: mjg Date: Sat Jul 30 22:21:48 2016 New Revision: 303562 URL: https://svnweb.freebsd.org/changeset/base/303562 Log: rwlock: s/READER/WRITER/ in wlock lockstat annotation Modified: head/sys/kern/kern_rwlock.c Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Sat Jul 30 21:06:59 2016 (r303561) +++ head/sys/kern/kern_rwlock.c Sat Jul 30 22:21:48 2016 (r303562) @@ -920,7 +920,7 @@ __rw_wlock_hard(volatile uintptr_t *c, u /* Record only the loops spinning and not sleeping. */ if (spin_cnt > sleep_cnt) LOCKSTAT_RECORD4(rw__spin, rw, all_time - sleep_time, - LOCKSTAT_READER, (state & RW_LOCK_READ) == 0, + LOCKSTAT_WRITER, (state & RW_LOCK_READ) == 0, (state & RW_LOCK_READ) == 0 ? 0 : RW_READERS(state)); #endif LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(rw__acquire, rw, contested, From owner-svn-src-head@freebsd.org Sat Jul 30 22:23: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 00CE6BA85C3; Sat, 30 Jul 2016 22:23:33 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C80A51FB1; Sat, 30 Jul 2016 22:23:32 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6UMNWnq037666; Sat, 30 Jul 2016 22:23:32 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6UMNWD7037665; Sat, 30 Jul 2016 22:23:32 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201607302223.u6UMNWD7037665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 30 Jul 2016 22:23:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303563 - 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.22 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, 30 Jul 2016 22:23:33 -0000 Author: mjg Date: Sat Jul 30 22:23:31 2016 New Revision: 303563 URL: https://svnweb.freebsd.org/changeset/base/303563 Log: sx: increment spin_cnt before cpu_spinwait in xlock The change is a no-op only done for consistency with the rest of the file. Modified: head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Sat Jul 30 22:21:48 2016 (r303562) +++ head/sys/kern/kern_sx.c Sat Jul 30 22:23:31 2016 (r303563) @@ -889,10 +889,10 @@ _sx_slock_hard(struct sx *sx, int opts, GIANT_SAVE(); while (SX_OWNER(sx->sx_lock) == x && TD_IS_RUNNING(owner)) { + cpu_spinwait(); #ifdef KDTRACE_HOOKS spin_cnt++; #endif - cpu_spinwait(); } KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), "running");