From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 03:32:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 739EB12F; Sun, 13 Jan 2013 03:32:50 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-we0-f174.google.com (mail-we0-f174.google.com [74.125.82.174]) by mx1.freebsd.org (Postfix) with ESMTP id 48E8C637; Sun, 13 Jan 2013 03:32:48 +0000 (UTC) Received: by mail-we0-f174.google.com with SMTP id x10so1492768wey.5 for ; Sat, 12 Jan 2013 19:32:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=lCBAz13WFsabfAqfXtgIO0i8yXz6sLJj3nK1o66fi34=; b=IC+369ljYjOVdEBVnVC57A9Hc5uNgUWhao2zo2bF23eCXHo6vTdr2GffT/IFPLkbX+ t8qFnwj3+TM3pYOh8XZZFU9rwaSefR7/YbvqGxHdQlboe2Fl57qyZEz5FrcPAg96EjEr Ucb6nZDdVLJBhoQxhEMRt/A3HFefkMFZnXc8b/PlYArqzGrll1TKg6HGfrALX30PLV1U K1i5e4DSoDjVjJd2z5wFg5wcLGqnAMvsVCdN7KK+R8yO5ODPLk9tTjgbkTYBpLkRdjwQ qb4PErzAVRl0nf8A0yx2dp9szCfKgTb068VRUVduULfiVxLvLlhG3zCc9QpJkiTUhqii WTcA== MIME-Version: 1.0 X-Received: by 10.180.33.44 with SMTP id o12mr6249141wii.28.1358047968150; Sat, 12 Jan 2013 19:32:48 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.217.57.9 with HTTP; Sat, 12 Jan 2013 19:32:48 -0800 (PST) In-Reply-To: <50F1BD69.4060104@mu.org> References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50C1BC90.90106@freebsd.org> <50C25A27.4060007@bluezbox.com> <50C26331.6030504@freebsd.org> <50C26AE9.4020600@bluezbox.com> <50C3A3D3.9000804@freebsd.org> <50C3AF72.4010902@rice.edu> <330405A1-312A-45A5-BB86-4969478D8BBD@bluezbox.com> <50D03E83.8060908@rice.edu> <50DD081E.8000409@bluezbox.com> <50EB1841.5030006@bluezbox.com> <50EB22D2.6090103@rice.edu> <50EB415F.8020405@freebsd.org> <50F04FE5.7010406@rice.edu> <50F1BD69.4060104@mu.org> Date: Sat, 12 Jan 2013 19:32:48 -0800 X-Google-Sender-Auth: 52LCZPns2O474AuVy9F2QvuVIaA Message-ID: Subject: Re: svn commit: r243631 - in head/sys: kern sys From: Adrian Chadd To: Alfred Perlstein Content-Type: text/plain; charset=ISO-8859-1 Cc: src-committers@freebsd.org, Andre Oppermann , Alan Cox , "Jayachandran C." , svn-src-all@freebsd.org, Oleksandr Tymoshenko , freebsd-arch@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 03:32:50 -0000 On 12 January 2013 11:45, Alfred Perlstein wrote: > I'm not sure if regressing to the waterfall method of development is a good > idea at this point. > > I see a light at the end of the tunnel and we to continue to just handle > these minor corner cases as we progress. > > If we move to a model where a minor bug is grounds to completely remove > helpful code then nothing will ever get done. > Allocating 512MB worth of callwheels on a 16GB MIPS machine is a little silly, don't you think? That suggests to me that the extent of which maxfiles/maxusers/etc percolates the codebase wasn't totally understood by those who wish to change it. I'd rather see some more investigative work into outlining things that need fixing and start fixing those, rather than "just change stuff and fix whatever issues creep up." I kinda hope we all understand what we're working on in the kernel a little better than that. Adrian From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 04:28:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BE006C82; Sun, 13 Jan 2013 04:28:45 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A0BEF74E; Sun, 13 Jan 2013 04:28:45 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0D4SjKa099376; Sun, 13 Jan 2013 04:28:45 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0D4SjdV099375; Sun, 13 Jan 2013 04:28:45 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201301130428.r0D4SjdV099375@svn.freebsd.org> From: Xin LI Date: Sun, 13 Jan 2013 04:28:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245361 - head/sbin/sysctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 04:28:45 -0000 Author: delphij Date: Sun Jan 13 04:28:44 2013 New Revision: 245361 URL: http://svnweb.freebsd.org/changeset/base/245361 Log: Use the right format string for line buffer. PR: bin/174910 Submitted by: Fabian Keil Modified: head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Sun Jan 13 04:14:46 2013 (r245360) +++ head/sbin/sysctl/sysctl.c Sun Jan 13 04:28:44 2013 (r245361) @@ -266,7 +266,7 @@ parse(const char *string, int lineno) if (!(kind & CTLFLAG_WR)) { if (kind & CTLFLAG_TUN) { - warnx("oid '%s' is a read only tunable%p", bufp, line); + warnx("oid '%s' is a read only tunable%s", bufp, line); warnx("Tunable values are set in /boot/loader.conf"); } else warnx("oid '%s' is read only%s", bufp, line); From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 07:14:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B281D275; Sun, 13 Jan 2013 07:14:18 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 974E89F5; Sun, 13 Jan 2013 07:14:18 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0D7EIUp050198; Sun, 13 Jan 2013 07:14:18 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0D7EHfx050184; Sun, 13 Jan 2013 07:14:17 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201301130714.r0D7EHfx050184@svn.freebsd.org> From: Bryan Venteicher Date: Sun, 13 Jan 2013 07:14:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245362 - in head/sys: amd64/conf conf i386/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.14 Precedence: list List-Id: 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, 13 Jan 2013 07:14:18 -0000 Author: bryanv Date: Sun Jan 13 07:14:16 2013 New Revision: 245362 URL: http://svnweb.freebsd.org/changeset/base/245362 Log: Add VirtIO to the i386 and amd64 GENERIC kernels This also removes the kludge from r239009 that covered only the network driver. Reviewed by: grehan Approved by: grehan (mentor) MFC after: 1 week Modified: head/sys/amd64/conf/GENERIC head/sys/amd64/conf/NOTES head/sys/conf/files head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/i386/conf/GENERIC head/sys/i386/conf/NOTES Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sun Jan 13 04:28:44 2013 (r245361) +++ head/sys/amd64/conf/GENERIC Sun Jan 13 07:14:16 2013 (r245362) @@ -332,3 +332,11 @@ device snd_via8233 # VIA VT8233x Audio device mmc # MMC/SD bus device mmcsd # MMC/SD memory card device sdhci # Generic PCI SD Host Controller + +# VirtIO support +device virtio # Generic VirtIO bus (required) +device virtio_pci # VirtIO PCI device +device vtnet # VirtIO Ethernet device +device virtio_blk # VirtIO Block device +device virtio_scsi # VirtIO SCSI device +device virtio_balloon # VirtIO Memory Balloon device Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Sun Jan 13 04:28:44 2013 (r245361) +++ head/sys/amd64/conf/NOTES Sun Jan 13 07:14:16 2013 (r245362) @@ -440,6 +440,15 @@ device safe # SafeNet 1141 options SAFE_DEBUG # enable debugging support: hw.safe.debug options SAFE_RNDTEST # enable rndtest support +# +# VirtIO support +device virtio # Generic VirtIO bus (required) +device virtio_pci # VirtIO PCI Interface +device vtnet # VirtIO Ethernet device +device virtio_blk # VirtIO Block device +device virtio_scsi # VirtIO SCSI device +device virtio_balloon # VirtIO Memory Balloon device + ##################################################################### # Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jan 13 04:28:44 2013 (r245361) +++ head/sys/conf/files Sun Jan 13 07:14:16 2013 (r245362) @@ -2276,15 +2276,6 @@ dev/utopia/idtphy.c optional utopia dev/utopia/suni.c optional utopia dev/utopia/utopia.c optional utopia dev/vge/if_vge.c optional vge -# -# virtio support -# -dev/virtio/pci/virtio_pci.c optional vtnet -dev/virtio/virtio.c optional vtnet -dev/virtio/virtqueue.c optional vtnet -dev/virtio/network/if_vtnet.c optional vtnet -dev/virtio/virtio_bus_if.m optional vtnet -dev/virtio/virtio_if.m optional vtnet dev/vkbd/vkbd.c optional vkbd dev/vr/if_vr.c optional vr pci Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sun Jan 13 04:28:44 2013 (r245361) +++ head/sys/conf/files.amd64 Sun Jan 13 07:14:16 2013 (r245362) @@ -390,6 +390,15 @@ dev/isci/scil/scif_sas_task_request.c dev/isci/scil/scif_sas_task_request_state_handlers.c optional isci dev/isci/scil/scif_sas_task_request_states.c optional isci dev/isci/scil/scif_sas_timer.c optional isci +dev/virtio/virtio.c optional virtio +dev/virtio/virtqueue.c optional virtio +dev/virtio/virtio_bus_if.m optional virtio +dev/virtio/virtio_if.m optional virtio +dev/virtio/pci/virtio_pci.c optional virtio_pci virtio pci +dev/virtio/network/if_vtnet.c optional vtnet virtio +dev/virtio/block/virtio_blk.c optional virtio_blk virtio +dev/virtio/balloon/virtio_balloon.c optional virtio_balloon virtio +dev/virtio/scsi/virtio_scsi.c optional virtio_scsi virtio scbus isa/syscons_isa.c optional sc isa/vga_isa.c optional vga kern/kern_clocksource.c standard Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Sun Jan 13 04:28:44 2013 (r245361) +++ head/sys/conf/files.i386 Sun Jan 13 07:14:16 2013 (r245362) @@ -371,6 +371,15 @@ dev/isci/scil/scif_sas_task_request.c dev/isci/scil/scif_sas_task_request_state_handlers.c optional isci dev/isci/scil/scif_sas_task_request_states.c optional isci dev/isci/scil/scif_sas_timer.c optional isci +dev/virtio/virtio.c optional virtio +dev/virtio/virtqueue.c optional virtio +dev/virtio/virtio_bus_if.m optional virtio +dev/virtio/virtio_if.m optional virtio +dev/virtio/pci/virtio_pci.c optional virtio_pci virtio pci +dev/virtio/network/if_vtnet.c optional vtnet virtio +dev/virtio/block/virtio_blk.c optional virtio_blk virtio +dev/virtio/balloon/virtio_balloon.c optional virtio_balloon virtio +dev/virtio/scsi/virtio_scsi.c optional virtio_scsi virtio scbus i386/acpica/acpi_machdep.c optional acpi acpi_wakecode.o optional acpi \ dependency "$S/i386/acpica/acpi_wakecode.S assym.s" \ Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Sun Jan 13 04:28:44 2013 (r245361) +++ head/sys/i386/conf/GENERIC Sun Jan 13 07:14:16 2013 (r245362) @@ -346,3 +346,11 @@ device snd_via8233 # VIA VT8233x Audio device mmc # MMC/SD bus device mmcsd # MMC/SD memory card device sdhci # Generic PCI SD Host Controller + +# VirtIO support +device virtio # Generic VirtIO bus (required) +device virtio_pci # VirtIO PCI device +device vtnet # VirtIO Ethernet device +device virtio_blk # VirtIO Block device +device virtio_scsi # VirtIO SCSI device +device virtio_balloon # VirtIO Memory Balloon device Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Sun Jan 13 04:28:44 2013 (r245361) +++ head/sys/i386/conf/NOTES Sun Jan 13 07:14:16 2013 (r245362) @@ -771,6 +771,15 @@ device glxiic # AMD Geode LX CS5536 Sy # device glxsb # AMD Geode LX Security Block +# +# VirtIO support +device virtio # Generic VirtIO bus (required) +device virtio_pci # VirtIO PCI Interface +device vtnet # VirtIO Ethernet device +device virtio_blk # VirtIO Block device +device virtio_scsi # VirtIO SCSI device +device virtio_balloon # VirtIO Memory Balloon device + ##################################################################### # From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 10:10:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A78C730B; Sun, 13 Jan 2013 10:10:17 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh11.mail.rice.edu (mh11.mail.rice.edu [128.42.199.30]) by mx1.freebsd.org (Postfix) with ESMTP id 7C37AE71; Sun, 13 Jan 2013 10:10:17 +0000 (UTC) Received: from mh11.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh11.mail.rice.edu (Postfix) with ESMTP id 81BE34C0245; Sun, 13 Jan 2013 04:10:16 -0600 (CST) Received: from mh11.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh11.mail.rice.edu (Postfix) with ESMTP id 62F924C026C; Sun, 13 Jan 2013 04:10:16 -0600 (CST) X-Virus-Scanned: by amavis-2.7.0 at mh11.mail.rice.edu, auth channel Received: from mh11.mail.rice.edu ([127.0.0.1]) by mh11.mail.rice.edu (mh11.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id YV5ZnCWvqjQm; Sun, 13 Jan 2013 04:10:16 -0600 (CST) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh11.mail.rice.edu (Postfix) with ESMTPSA id B26D84C0245; Sun, 13 Jan 2013 04:10:15 -0600 (CST) Message-ID: <50F28806.10505@rice.edu> Date: Sun, 13 Jan 2013 04:10:14 -0600 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Oleksandr Tymoshenko Subject: Re: svn commit: r243631 - in head/sys: kern sys References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50C1BC90.90106@freebsd.org> <50C25A27.4060007@bluezbox.com> <50C26331.6030504@freebsd.org> <50C26AE9.4020600@bluezbox.com> <50C3A3D3.9000804@freebsd.org> <50C3AF72.4010902@rice.edu> <330405A1-312A-45A5-BB86-4969478D8BBD@bluezbox.com> <50D03E83.8060908@rice.edu> <50DD081E.8000409@bluezbox.com> <50EB1841.5030006@bluezbox.com> In-Reply-To: <50EB1841.5030006@bluezbox.com> Content-Type: multipart/mixed; boundary="------------060309000103040501070209" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andre Oppermann X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 10:10:17 -0000 This is a multi-part message in MIME format. --------------060309000103040501070209 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 01/07/2013 12:47, Oleksandr Tymoshenko wrote: > On 12/27/2012 6:46 PM, Oleksandr Tymoshenko wrote: >> On 12/18/2012 1:59 AM, Alan Cox wrote: >>> On 12/17/2012 23:40, Oleksandr Tymoshenko wrote: >>>> On 2012-12-08, at 1:21 PM, Alan Cox wrote: >>>> >>>>> On 12/08/2012 14:32, Andre Oppermann wrote: >>>> .. skipped .. >>>> >>>>>> The trouble seems to come from NSFBUFS which is (512 + maxusers * >>>>>> 16) >>>>>> resulting in a kernel map of (512 + 400 * 16) * PAGE_SIZE = >>>>>> 27MB. This >>>>>> seem to be pushing it with the smaller ARM kmap layout. >>>>>> >>>>>> Does it boot and run when you set the tunable kern.ipc.nsfbufs=3500? >>>>>> >>>>>> ARM does have a direct map mode as well which doesn't require the >>>>>> allocation >>>>>> of sfbufs. I'm not sure which other problems that approach has. >>>>>> >>>>> Only a few (3?) platforms use it. It reduces the size of the user >>>>> address space, and translation between physical addresses and >>>>> direct map >>>>> addresses is not computationally trivial as it is on other >>>>> architectures, e.g., amd64, ia64. However, it does try to use large >>>>> page mappings. >>>>> >>>>> >>>>>> Hopefully alc@ (added to cc) can answer that and also why the >>>>>> kmap of >>>>>> 27MB >>>>>> manages to wrench the ARM kernel. >>>>>> >>>>> Arm does not define caps on either the buffer map size (param.h) >>>>> or the >>>>> kmem map size (vmparam.h). It would probably make sense to copy >>>>> these >>>>> definitions from i386. >>>> Adding caps didn't help. I did some digging and found out that >>>> although address range >>>> 0xc0000000 .. 0xffffffff is indeed valid for ARM in general actual >>>> KVA space varies for >>>> each specific hardware platform. This "real" KVA is defined by >>>> >>>> pair and ifI use them instead of >>> VM_MAX_KERNEL_ADDRESS> >>>> in init_param2 function my pandaboard successfully boots. Since >>>> former pair is used for defining >>>> kernel_map boundaries I believe it should be used for auto tuning >>>> as well. >>> >>> That makes sense. However, "virtual_avail" isn't the start of the >>> kernel address space. The kernel map always starts at >>> VM_MIN_KERNEL_ADDRESS. (See kmem_init().) "virtual_avail" represents >>> the next unallocated virtual address in the kernel address space at an >>> early point in initialization. "virtual_avail" and "virtual_end" >>> aren't >>> used after that, or outside the VM system. Please use >>> vm_map_min(kernel_map) and vm_map_max(kernel_map) instead. >> >> I checked: kernel_map is not available (NULL) at this point. So we >> can't use it to >> determine real KVA size. Closest thing we can get is >> virtual_avail/virtual_end pair. >> >> Andre, could you approve attached patch for commit or suggest better >> solution? > > Any update on this one? Can I proceed with commit? > Yes, I've now spent a little bit of time looking at this, and I don't see why these calculations and tunable_mbinit() need to be performed before the kernel map is initialized. Let me summarize what I found: 1. The function tunable_mbinit() now has a dependency on the global variable maxmbufmem. tunable_mbinit() is executed under SI_SUB_TUNABLES. tunable_mbinit() defines the global variable nmbclusters. The statements made in the comment at the head of tunable_mbinit() all appear to be false: /* * tunable_mbinit() has to be run before init_maxsockets() thus * the SYSINIT order below is SI_ORDER_MIDDLE while init_maxsockets() * runs at SI_ORDER_ANY. * * NB: This has to be done before VM init. */ I don't see anything in init_maxsockets() that depends on tunable_mbinit(). Moreover, the statement about "VM init" is only correct if you regard the initialization of the kernel's malloc as "VM init". 2. The function kmeminit() in kern/kern_malloc.c has a dependency on the global variable nmbclusters. kmeminit() is executed under SI_SUB_KMEM, which comes after the initialization of the virtual memory system, including the kernel map. 3. The function vm_ksubmap_init() has a dependency on the global variable maxpipekva. vm_ksubmap_init() is executed under SI_SUB_CPU, which comes after SI_SUB_KMEM. Am I missing anything? I'm attaching a patch that defers the calculation of maxpipekva until we actually need it in vm_ksubmap_init(). Any comments on this patch are welcome. Alan --------------060309000103040501070209 Content-Type: text/plain; charset=ISO-8859-15; name="maxpipekva2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="maxpipekva2.patch" Index: kern/subr_param.c =================================================================== --- kern/subr_param.c (revision 245346) +++ kern/subr_param.c (working copy) @@ -97,7 +97,6 @@ quad_t maxmbufmem; /* max mbuf memory */ pid_t pid_max = PID_MAX; long maxswzone; /* max swmeta KVA storage */ long maxbcache; /* max buffer cache KVA storage */ -long maxpipekva; /* Limit on pipe KVA */ int vm_guest; /* Running as virtual machine guest? */ u_long maxtsiz; /* max text size */ u_long dfldsiz; /* initial data size limit */ @@ -339,18 +338,6 @@ init_param2(long physpages) TUNABLE_QUAD_FETCH("kern.maxmbufmem", &maxmbufmem); if (maxmbufmem > (realmem / 4) * 3) maxmbufmem = (realmem / 4) * 3; - - /* - * The default for maxpipekva is min(1/64 of the kernel address space, - * max(1/64 of main memory, 512KB)). See sys_pipe.c for more details. - */ - maxpipekva = (physpages / 64) * PAGE_SIZE; - TUNABLE_LONG_FETCH("kern.ipc.maxpipekva", &maxpipekva); - if (maxpipekva < 512 * 1024) - maxpipekva = 512 * 1024; - if (maxpipekva > (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / 64) - maxpipekva = (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / - 64; } /* Index: kern/sys_pipe.c =================================================================== --- kern/sys_pipe.c (revision 245346) +++ kern/sys_pipe.c (working copy) @@ -207,6 +207,8 @@ static int pipeallocfail; static int piperesizefail; static int piperesizeallowed = 1; +long maxpipekva; + SYSCTL_LONG(_kern_ipc, OID_AUTO, maxpipekva, CTLFLAG_RDTUN, &maxpipekva, 0, "Pipe KVA limit"); SYSCTL_LONG(_kern_ipc, OID_AUTO, pipekva, CTLFLAG_RD, Index: vm/vm_init.c =================================================================== --- vm/vm_init.c (revision 245346) +++ vm/vm_init.c (working copy) @@ -132,12 +132,14 @@ vm_ksubmap_init(struct kva_md_info *kmi) { vm_offset_t firstaddr; caddr_t v; - vm_size_t size = 0; + vm_size_t kernel_map_size, size = 0; long physmem_est; vm_offset_t minaddr; vm_offset_t maxaddr; vm_map_t clean_map; + kernel_map_size = kernel_map->max_offset - kernel_map->min_offset; + /* * Allocate space for system data structures. * The first available kernel virtual address is in "v". @@ -163,8 +165,7 @@ again: * Discount the physical memory larger than the size of kernel_map * to avoid eating up all of KVA space. */ - physmem_est = lmin(physmem, btoc(kernel_map->max_offset - - kernel_map->min_offset)); + physmem_est = lmin(physmem, btoc(kernel_map_size)); v = kern_vfs_bio_buffer_alloc(v, physmem_est); @@ -195,6 +196,18 @@ again: pager_map->system_map = 1; exec_map = kmem_suballoc(kernel_map, &minaddr, &maxaddr, exec_map_entries * round_page(PATH_MAX + ARG_MAX), FALSE); + + /* + * The default size for the pipe submap, "maxpipekva", is min(1/64 of + * the kernel virtual address space, max(1/64 of the physical memory, + * 512KB)). See sys_pipe.c for more details. + */ + maxpipekva = ctob(physmem / 64); + TUNABLE_LONG_FETCH("kern.ipc.maxpipekva", &maxpipekva); + if (maxpipekva < 512 * 1024) + maxpipekva = 512 * 1024; + if (maxpipekva > kernel_map_size / 64) + maxpipekva = kernel_map_size / 64; pipe_map = kmem_suballoc(kernel_map, &minaddr, &maxaddr, maxpipekva, FALSE); --------------060309000103040501070209-- From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 10:38:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 29250947; Sun, 13 Jan 2013 10:38:31 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) by mx1.freebsd.org (Postfix) with ESMTP id 6C7CEF23; Sun, 13 Jan 2013 10:38:30 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1TuL1u-000Eyn-CL; Sun, 13 Jan 2013 14:43:06 +0400 Date: Sun, 13 Jan 2013 14:43:06 +0400 From: Slawa Olhovchenkov To: Alexander Motin Subject: Re: svn commit: r242314 - head/sys/geom/raid Message-ID: <20130113104306.GA27697@zxy.spb.ru> References: <201210291418.q9TEIsrZ078107@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201210291418.q9TEIsrZ078107@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 10:38:31 -0000 On Mon, Oct 29, 2012 at 02:18:54PM +0000, Alexander Motin wrote: > Author: mav > Date: Mon Oct 29 14:18:54 2012 > New Revision: 242314 > URL: http://svn.freebsd.org/changeset/base/242314 > > Log: > Make GEOM RAID more aggressive in marking volumes as clean on shutdown > and move that action from shutdown_pre_sync to shutdown_post_sync stage > to avoid extra flapping. > > ZFS tends to not close devices on shutdown, that doesn't allow GEOM RAID > to shutdown gracefully. To handle that, mark volume as clean just when > shutdown time comes and there are no active writes. > > MFC after: 2 weeks kern/113957 ? > Modified: > head/sys/geom/raid/g_raid.c > > Modified: head/sys/geom/raid/g_raid.c > ============================================================================== > --- head/sys/geom/raid/g_raid.c Mon Oct 29 13:58:11 2012 (r242313) > +++ head/sys/geom/raid/g_raid.c Mon Oct 29 14:18:54 2012 (r242314) > @@ -108,8 +108,9 @@ LIST_HEAD(, g_raid_tr_class) g_raid_tr_c > LIST_HEAD(, g_raid_volume) g_raid_volumes = > LIST_HEAD_INITIALIZER(g_raid_volumes); > > -static eventhandler_tag g_raid_pre_sync = NULL; > +static eventhandler_tag g_raid_post_sync = NULL; > static int g_raid_started = 0; > +static int g_raid_shutdown = 0; > > static int g_raid_destroy_geom(struct gctl_req *req, struct g_class *mp, > struct g_geom *gp); > @@ -881,7 +882,7 @@ g_raid_orphan(struct g_consumer *cp) > G_RAID_EVENT_DISK); > } > > -static int > +static void > g_raid_clean(struct g_raid_volume *vol, int acw) > { > struct g_raid_softc *sc; > @@ -892,22 +893,21 @@ g_raid_clean(struct g_raid_volume *vol, > sx_assert(&sc->sc_lock, SX_XLOCKED); > > // if ((sc->sc_flags & G_RAID_DEVICE_FLAG_NOFAILSYNC) != 0) > -// return (0); > +// return; > if (!vol->v_dirty) > - return (0); > + return; > if (vol->v_writes > 0) > - return (0); > + return; > if (acw > 0 || (acw == -1 && > vol->v_provider != NULL && vol->v_provider->acw > 0)) { > timeout = g_raid_clean_time - (time_uptime - vol->v_last_write); > - if (timeout > 0) > - return (timeout); > + if (!g_raid_shutdown && timeout > 0) > + return; > } > vol->v_dirty = 0; > G_RAID_DEBUG1(1, sc, "Volume %s marked as clean.", > vol->v_name); > g_raid_write_metadata(sc, vol, NULL, NULL); > - return (0); > } > > static void > @@ -1520,8 +1520,7 @@ process: > g_raid_disk_done_request(bp); > } else if (rv == EWOULDBLOCK) { > TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) { > - if (vol->v_writes == 0 && vol->v_dirty) > - g_raid_clean(vol, -1); > + g_raid_clean(vol, -1); > if (bioq_first(&vol->v_inflight) == NULL && > vol->v_tr) { > t.tv_sec = g_raid_idle_threshold / 1000000; > @@ -1783,7 +1782,7 @@ g_raid_access(struct g_provider *pp, int > error = ENXIO; > goto out; > } > - if (dcw == 0 && vol->v_dirty) > + if (dcw == 0) > g_raid_clean(vol, dcw); > vol->v_provider_open += acr + acw + ace; > /* Handle delayed node destruction. */ > @@ -2379,21 +2378,25 @@ g_raid_dumpconf(struct sbuf *sb, const c > } > > static void > -g_raid_shutdown_pre_sync(void *arg, int howto) > +g_raid_shutdown_post_sync(void *arg, int howto) > { > struct g_class *mp; > struct g_geom *gp, *gp2; > struct g_raid_softc *sc; > + struct g_raid_volume *vol; > int error; > > mp = arg; > DROP_GIANT(); > g_topology_lock(); > + g_raid_shutdown = 1; > LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) { > if ((sc = gp->softc) == NULL) > continue; > g_topology_unlock(); > sx_xlock(&sc->sc_lock); > + TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) > + g_raid_clean(vol, -1); > g_cancel_event(sc); > error = g_raid_destroy(sc, G_RAID_DESTROY_DELAYED); > if (error != 0) > @@ -2408,9 +2411,9 @@ static void > g_raid_init(struct g_class *mp) > { > > - g_raid_pre_sync = EVENTHANDLER_REGISTER(shutdown_pre_sync, > - g_raid_shutdown_pre_sync, mp, SHUTDOWN_PRI_FIRST); > - if (g_raid_pre_sync == NULL) > + g_raid_post_sync = EVENTHANDLER_REGISTER(shutdown_post_sync, > + g_raid_shutdown_post_sync, mp, SHUTDOWN_PRI_FIRST); > + if (g_raid_post_sync == NULL) > G_RAID_DEBUG(0, "Warning! Cannot register shutdown event."); > g_raid_started = 1; > } > @@ -2419,8 +2422,8 @@ static void > g_raid_fini(struct g_class *mp) > { > > - if (g_raid_pre_sync != NULL) > - EVENTHANDLER_DEREGISTER(shutdown_pre_sync, g_raid_pre_sync); > + if (g_raid_post_sync != NULL) > + EVENTHANDLER_DEREGISTER(shutdown_post_sync, g_raid_post_sync); > g_raid_started = 0; > } > > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://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 Sun Jan 13 11:38:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A3DDD2C7; Sun, 13 Jan 2013 11:38:33 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 69CC0E2; Sun, 13 Jan 2013 11:38:33 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id D346146B09; Sun, 13 Jan 2013 06:38:32 -0500 (EST) Date: Sun, 13 Jan 2013 11:38:32 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Nathan Whitehorn Subject: Re: svn commit: r245331 - head/sys/mips/mips In-Reply-To: <50F18F83.9080604@freebsd.org> Message-ID: References: <201301121553.r0CFrjRU080518@svn.freebsd.org> <50F18F83.9080604@freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 11:38:33 -0000 On Sat, 12 Jan 2013, Nathan Whitehorn wrote: >> In a sign of weakness, replicate the MIPS bus_space_generic.c to >> produce a new FDT version, which will perform necessary address >> space translation for bus_space -- the solution used in NLM's MIPS >> FDT support, but possibly not quite the right thing. This is >> inconsistent with regular I/O via the nexus and the generic >> bus_space, which instead perform translation via pmap_mapdev() >> when a resource is activated. However, it will work while I >> attempt to identify what the right way to reconcile possible >> approaches. >> >> (Another approach might be to make simplebus use Nexus's activate >> routine instead of a generic one?) >> >> Sponsored by: DARPA, AFRL > > Using nexus's instead of having a parallel universe of "FDT" things is, in > my opinion, the right way to go. It's what we do on PowerPC and SPARC with > real Open Firmware and there is no reason to do things any differently with > FDT. What I've done here is tracked the one existing FDT implementation on MIPS, from NLM XLP, effectively promoting it for use across all MIPS. We'll need to coordinate changing the model across both. I'm not sure I understand sufficiently the difference between how nexus is handling things on PowerPC/sparc64 vs MIPS such that using the generic busspace implementation doesn't work with FDT, but does on those platforms. Certainly, I was unable to use bus_space_generic on MIPS for this purpose, as it didn't to the P->V translation (that's the way around it is due to xkphys on MIPS) when used via the FDT path. Do you have insight there? Robert From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 14:30:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5A69D287; Sun, 13 Jan 2013 14:30:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4D00A78A; Sun, 13 Jan 2013 14:30:38 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DEUb2Z077395; Sun, 13 Jan 2013 14:30:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DEUbqI077393; Sun, 13 Jan 2013 14:30:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301131430.r0DEUbqI077393@svn.freebsd.org> From: Alexander Motin Date: Sun, 13 Jan 2013 14:30:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245363 - head/sys/geom/raid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 14:30:38 -0000 Author: mav Date: Sun Jan 13 14:30:37 2013 New Revision: 245363 URL: http://svnweb.freebsd.org/changeset/base/245363 Log: Improve support for disabled disks. If disabled disk disconnected and then reconnected back, leave it as disconnected. If new disk inserted instead of disabled, rebuild it and leave as enabled. Modified: head/sys/geom/raid/g_raid.c head/sys/geom/raid/md_intel.c Modified: head/sys/geom/raid/g_raid.c ============================================================================== --- head/sys/geom/raid/g_raid.c Sun Jan 13 07:14:16 2013 (r245362) +++ head/sys/geom/raid/g_raid.c Sun Jan 13 14:30:37 2013 (r245363) @@ -538,7 +538,7 @@ g_raid_report_disk_state(struct g_raid_d if (disk->d_consumer == NULL) return; if (disk->d_state == G_RAID_DISK_S_DISABLED) { - ; + s = G_STATE_ACTIVE; /* XXX */ } else if (disk->d_state == G_RAID_DISK_S_FAILED || disk->d_state == G_RAID_DISK_S_STALE_FAILED) { s = G_STATE_FAILED; Modified: head/sys/geom/raid/md_intel.c ============================================================================== --- head/sys/geom/raid/md_intel.c Sun Jan 13 07:14:16 2013 (r245362) +++ head/sys/geom/raid/md_intel.c Sun Jan 13 14:30:37 2013 (r245363) @@ -787,13 +787,9 @@ g_raid_md_intel_start_disk(struct g_raid disk_pos = intel_meta_find_disk(meta, pd->pd_disk_meta.serial); if (disk_pos < 0) { G_RAID_DEBUG1(1, sc, "Unknown, probably new or stale disk"); - /* Disabled disk is useless for us. */ - if (pd->pd_disk_meta.flags & INTEL_F_DISABLED) { - g_raid_change_disk_state(disk, G_RAID_DISK_S_DISABLED); - return (0); - } /* Failed stale disk is useless for us. */ - if (pd->pd_disk_meta.flags & INTEL_F_FAILED) { + if ((pd->pd_disk_meta.flags & INTEL_F_FAILED) && + !(pd->pd_disk_meta.flags & INTEL_F_DISABLED)) { g_raid_change_disk_state(disk, G_RAID_DISK_S_STALE_FAILED); return (0); } @@ -884,10 +880,11 @@ nofit: } /* Welcome the new disk. */ - if (resurrection) - g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); - else if (meta->disk[disk_pos].flags & INTEL_F_DISABLED) + if ((meta->disk[disk_pos].flags & INTEL_F_DISABLED) && + !(pd->pd_disk_meta.flags & INTEL_F_SPARE)) g_raid_change_disk_state(disk, G_RAID_DISK_S_DISABLED); + else if (resurrection) + g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); else if (meta->disk[disk_pos].flags & INTEL_F_FAILED) g_raid_change_disk_state(disk, G_RAID_DISK_S_FAILED); else if (meta->disk[disk_pos].flags & INTEL_F_SPARE) @@ -910,14 +907,15 @@ nofit: migr_global = 0; } - if (resurrection) { - /* Stale disk, almost same as new. */ - g_raid_change_subdisk_state(sd, - G_RAID_SUBDISK_S_NEW); - } else if (meta->disk[disk_pos].flags & INTEL_F_DISABLED) { + if ((meta->disk[disk_pos].flags & INTEL_F_DISABLED) && + !(pd->pd_disk_meta.flags & INTEL_F_SPARE)) { /* Disabled disk, useless. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NONE); + } else if (resurrection) { + /* Stale disk, almost same as new. */ + g_raid_change_subdisk_state(sd, + G_RAID_SUBDISK_S_NEW); } else if (meta->disk[disk_pos].flags & INTEL_F_FAILED) { /* Failed disk, almost useless. */ g_raid_change_subdisk_state(sd, @@ -1021,7 +1019,8 @@ nofit: /* Update status of our need for spare. */ if (mdi->mdio_started) { mdi->mdio_incomplete = - (g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE) < + (g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE) + + g_raid_ndisks(sc, G_RAID_DISK_S_DISABLED) < meta->total_disks); } @@ -1053,7 +1052,8 @@ g_raid_md_intel_refill(struct g_raid_sof update = 0; do { /* Make sure we miss anything. */ - na = g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE); + na = g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE) + + g_raid_ndisks(sc, G_RAID_DISK_S_DISABLED); if (na == meta->total_disks) break; @@ -1065,7 +1065,8 @@ g_raid_md_intel_refill(struct g_raid_sof TAILQ_FOREACH(disk, &sc->sc_disks, d_next) { if (disk->d_state == G_RAID_DISK_S_STALE) { update += g_raid_md_intel_start_disk(disk); - if (disk->d_state == G_RAID_DISK_S_ACTIVE) + if (disk->d_state == G_RAID_DISK_S_ACTIVE || + disk->d_state == G_RAID_DISK_S_DISABLED) break; } } @@ -1089,8 +1090,8 @@ g_raid_md_intel_refill(struct g_raid_sof } /* Update status of our need for spare. */ - mdi->mdio_incomplete = (g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE) < - meta->total_disks); + mdi->mdio_incomplete = (g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE) + + g_raid_ndisks(sc, G_RAID_DISK_S_DISABLED) < meta->total_disks); /* Request retaste hoping to find spare. */ if (mdi->mdio_incomplete) { @@ -2242,7 +2243,8 @@ g_raid_md_write_intel(struct g_raid_md_o pd->pd_disk_meta.flags = INTEL_F_FAILED | INTEL_F_ASSIGNED | INTEL_F_DISABLED; } else { - pd->pd_disk_meta.flags = INTEL_F_ASSIGNED; + if (!(pd->pd_disk_meta.flags & INTEL_F_DISABLED)) + pd->pd_disk_meta.flags = INTEL_F_ASSIGNED; if (pd->pd_disk_meta.id != 0xffffffff) { pd->pd_disk_meta.id = 0xffffffff; len = strlen(pd->pd_disk_meta.serial); From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 14:38:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1AA515FD; Sun, 13 Jan 2013 14:38:10 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F2F267CA; Sun, 13 Jan 2013 14:38:09 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DEc9f6079835; Sun, 13 Jan 2013 14:38:09 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DEc9xX079834; Sun, 13 Jan 2013 14:38:09 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201301131438.r0DEc9xX079834@svn.freebsd.org> From: Robert Watson Date: Sun, 13 Jan 2013 14:38:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245364 - head/sys/dev/altera/jtag_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.14 Precedence: list List-Id: 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, 13 Jan 2013 14:38:10 -0000 Author: rwatson Date: Sun Jan 13 14:38:09 2013 New Revision: 245364 URL: http://svnweb.freebsd.org/changeset/base/245364 Log: Merge Perforce changeset 219917 to head: Copy Altera JTAG UART nexus bus attachment as a starting point for an FDT bus attachment. Sponsored by: DARPA, AFRL Added: head/sys/dev/altera/jtag_uart/altera_jtag_uart_fdt.c - copied unchanged from r245363, head/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c Copied: head/sys/dev/altera/jtag_uart/altera_jtag_uart_fdt.c (from r245363, head/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/jtag_uart/altera_jtag_uart_fdt.c Sun Jan 13 14:38:09 2013 (r245364, copy of r245363, head/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c) @@ -0,0 +1,143 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include + +/* + * Nexus bus attachment for Altera JTAG UARTs. Appropriate for most Altera + * FPGA SoC-style configurations in which the IP core will be exposed to the + * processor via a memory-mapped Avalon bus. + */ +static int +altera_jtag_uart_nexus_probe(device_t dev) +{ + + device_set_desc(dev, "Altera JTAG UART"); + return (BUS_PROBE_DEFAULT); +} + +static int +altera_jtag_uart_nexus_attach(device_t dev) +{ + struct altera_jtag_uart_softc *sc; + int error; + + error = 0; + sc = device_get_softc(dev); + sc->ajus_dev = dev; + sc->ajus_unit = device_get_unit(dev); + sc->ajus_mem_rid = 0; + sc->ajus_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->ajus_mem_rid, RF_ACTIVE); + if (sc->ajus_mem_res == NULL) { + device_printf(dev, "couldn't map memory\n"); + error = ENXIO; + goto out; + } + + /* + * Interrupt support is optional -- if we can't allocate an IRQ, then + * we fall back on polling. + */ + sc->ajus_irq_rid = 0; + sc->ajus_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->ajus_irq_rid, RF_ACTIVE | RF_SHAREABLE); + if (sc->ajus_irq_res == NULL) + device_printf(dev, + "IRQ unavailable; selecting polled operation\n"); + error = altera_jtag_uart_attach(sc); +out: + if (error) { + if (sc->ajus_irq_res != NULL) + bus_release_resource(dev, SYS_RES_IRQ, + sc->ajus_irq_rid, sc->ajus_irq_res); + if (sc->ajus_mem_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, + sc->ajus_mem_rid, sc->ajus_mem_res); + } + return (error); +} + +static int +altera_jtag_uart_nexus_detach(device_t dev) +{ + struct altera_jtag_uart_softc *sc; + + sc = device_get_softc(dev); + KASSERT(sc->ajus_mem_res != NULL, ("%s: resources not allocated", + __func__)); + + altera_jtag_uart_detach(sc); + bus_release_resource(dev, SYS_RES_IRQ, sc->ajus_irq_rid, + sc->ajus_irq_res); + bus_release_resource(dev, SYS_RES_MEMORY, sc->ajus_mem_rid, + sc->ajus_mem_res); + return (0); +} + +static device_method_t altera_jtag_uart_nexus_methods[] = { + DEVMETHOD(device_probe, altera_jtag_uart_nexus_probe), + DEVMETHOD(device_attach, altera_jtag_uart_nexus_attach), + DEVMETHOD(device_detach, altera_jtag_uart_nexus_detach), + { 0, 0 } +}; + +static driver_t altera_jtag_uart_nexus_driver = { + "altera_jtag_uart", + altera_jtag_uart_nexus_methods, + sizeof(struct altera_jtag_uart_softc), +}; + +static devclass_t altera_jtag_uart_devclass; + +DRIVER_MODULE(altera_jtag_uart, nexus, altera_jtag_uart_nexus_driver, + altera_jtag_uart_devclass, 0, 0); From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 15:08:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 47EF4E28; Sun, 13 Jan 2013 15:08:18 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 37D24918; Sun, 13 Jan 2013 15:08:18 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DF8Igq088208; Sun, 13 Jan 2013 15:08:18 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DF8H4v088205; Sun, 13 Jan 2013 15:08:17 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201301131508.r0DF8H4v088205@svn.freebsd.org> From: Robert Watson Date: Sun, 13 Jan 2013 15:08:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245365 - in head/sys: dev/altera/jtag_uart mips/beri X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 15:08:18 -0000 Author: rwatson Date: Sun Jan 13 15:08:17 2013 New Revision: 245365 URL: http://svnweb.freebsd.org/changeset/base/245365 Log: Merge Perforce changeset 219918 to head: Naive first cut at an FDT bus attachment for the Altera JTAG UART. Sponsored by: DARPA, AFRL Modified: head/sys/dev/altera/jtag_uart/altera_jtag_uart_fdt.c head/sys/mips/beri/files.beri Modified: head/sys/dev/altera/jtag_uart/altera_jtag_uart_fdt.c ============================================================================== --- head/sys/dev/altera/jtag_uart/altera_jtag_uart_fdt.c Sun Jan 13 14:38:09 2013 (r245364) +++ head/sys/dev/altera/jtag_uart/altera_jtag_uart_fdt.c Sun Jan 13 15:08:17 2013 (r245365) @@ -52,21 +52,27 @@ __FBSDID("$FreeBSD$"); #include +#include +#include +#include +#include + /* - * Nexus bus attachment for Altera JTAG UARTs. Appropriate for most Altera - * FPGA SoC-style configurations in which the IP core will be exposed to the - * processor via a memory-mapped Avalon bus. + * FDT bus attachment for Altera JTAG UARTs. */ static int -altera_jtag_uart_nexus_probe(device_t dev) +altera_jtag_uart_fdt_probe(device_t dev) { - device_set_desc(dev, "Altera JTAG UART"); - return (BUS_PROBE_DEFAULT); + if (ofw_bus_is_compatible(dev, "altera,jtag_uart-11_0")) { + device_set_desc(dev, "Altera JTAG UART"); + return (BUS_PROBE_DEFAULT); + } + return (ENXIO); } static int -altera_jtag_uart_nexus_attach(device_t dev) +altera_jtag_uart_fdt_attach(device_t dev) { struct altera_jtag_uart_softc *sc; int error; @@ -108,7 +114,7 @@ out: } static int -altera_jtag_uart_nexus_detach(device_t dev) +altera_jtag_uart_fdt_detach(device_t dev) { struct altera_jtag_uart_softc *sc; @@ -124,20 +130,20 @@ altera_jtag_uart_nexus_detach(device_t d return (0); } -static device_method_t altera_jtag_uart_nexus_methods[] = { - DEVMETHOD(device_probe, altera_jtag_uart_nexus_probe), - DEVMETHOD(device_attach, altera_jtag_uart_nexus_attach), - DEVMETHOD(device_detach, altera_jtag_uart_nexus_detach), +static device_method_t altera_jtag_uart_fdt_methods[] = { + DEVMETHOD(device_probe, altera_jtag_uart_fdt_probe), + DEVMETHOD(device_attach, altera_jtag_uart_fdt_attach), + DEVMETHOD(device_detach, altera_jtag_uart_fdt_detach), { 0, 0 } }; -static driver_t altera_jtag_uart_nexus_driver = { +static driver_t altera_jtag_uart_fdt_driver = { "altera_jtag_uart", - altera_jtag_uart_nexus_methods, + altera_jtag_uart_fdt_methods, sizeof(struct altera_jtag_uart_softc), }; static devclass_t altera_jtag_uart_devclass; -DRIVER_MODULE(altera_jtag_uart, nexus, altera_jtag_uart_nexus_driver, +DRIVER_MODULE(altera_jtag_uart, simplebus, altera_jtag_uart_fdt_driver, altera_jtag_uart_devclass, 0, 0); Modified: head/sys/mips/beri/files.beri ============================================================================== --- head/sys/mips/beri/files.beri Sun Jan 13 14:38:09 2013 (r245364) +++ head/sys/mips/beri/files.beri Sun Jan 13 15:08:17 2013 (r245365) @@ -1,6 +1,7 @@ # $FreeBSD$ dev/altera/jtag_uart/altera_jtag_uart_cons.c optional altera_jtag_uart dev/altera/jtag_uart/altera_jtag_uart_tty.c optional altera_jtag_uart +dev/altera/jtag_uart/altera_jtag_uart_fdt.c optional altera_jtag_uart fdt dev/altera/jtag_uart/altera_jtag_uart_nexus.c optional altera_jtag_uart dev/terasic/de4led/terasic_de4led.c optional terasic_de4led dev/terasic/de4led/terasic_de4led_nexus.c optional terasic_de4led From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 15:10:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AEFA4FB4; Sun, 13 Jan 2013 15:10:27 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9E8A6931; Sun, 13 Jan 2013 15:10:27 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DFARX4089536; Sun, 13 Jan 2013 15:10:27 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DFARdw089528; Sun, 13 Jan 2013 15:10:27 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201301131510.r0DFARdw089528@svn.freebsd.org> From: Robert Watson Date: Sun, 13 Jan 2013 15:10:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245366 - head/sys/dev/terasic/de4led X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 15:10:27 -0000 Author: rwatson Date: Sun Jan 13 15:10:27 2013 New Revision: 245366 URL: http://svnweb.freebsd.org/changeset/base/245366 Log: Merge Perforce changeset 219921 to head: Copy DE4 LED nexus bus attachment as a starting point for an FDT attachment. Sponsored by: DARPA, AFRL Added: head/sys/dev/terasic/de4led/terasic_de4led_fdt.c - copied unchanged from r245363, head/sys/dev/terasic/de4led/terasic_de4led_nexus.c Copied: head/sys/dev/terasic/de4led/terasic_de4led_fdt.c (from r245363, head/sys/dev/terasic/de4led/terasic_de4led_nexus.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/terasic/de4led/terasic_de4led_fdt.c Sun Jan 13 15:10:27 2013 (r245366, copy of r245363, head/sys/dev/terasic/de4led/terasic_de4led_nexus.c) @@ -0,0 +1,112 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +/* + * Nexus bus attachment for the 8-element LED on the Terasic DE-4 FPGA board, + * which is hooked up to the processor via a memory-mapped Avalon bus. + */ +static int +terasic_de4led_nexus_probe(device_t dev) +{ + + device_set_desc(dev, "Terasic DE4 8-element LED"); + return (BUS_PROBE_DEFAULT); +} + +static int +terasic_de4led_nexus_attach(device_t dev) +{ + struct terasic_de4led_softc *sc; + + sc = device_get_softc(dev); + sc->tdl_dev = dev; + sc->tdl_unit = device_get_unit(dev); + sc->tdl_rid = 0; + sc->tdl_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->tdl_rid, RF_ACTIVE); + if (sc->tdl_res == NULL) { + device_printf(dev, "couldn't map memory\n"); + return (ENXIO); + } + terasic_de4led_attach(sc); + return (0); +} + +static int +terasic_de4led_nexus_detach(device_t dev) +{ + struct terasic_de4led_softc *sc; + + sc = device_get_softc(dev); + KASSERT(sc->tdl_res != NULL, ("%s: resources not allocated", + __func__)); + terasic_de4led_detach(sc); + bus_release_resource(dev, SYS_RES_MEMORY, sc->tdl_rid, sc->tdl_res); + return (0); +} + +static device_method_t terasic_de4led_nexus_methods[] = { + DEVMETHOD(device_probe, terasic_de4led_nexus_probe), + DEVMETHOD(device_attach, terasic_de4led_nexus_attach), + DEVMETHOD(device_detach, terasic_de4led_nexus_detach), + { 0, 0 } +}; + +static driver_t terasic_de4led_nexus_driver = { + "terasic_de4led", + terasic_de4led_nexus_methods, + sizeof(struct terasic_de4led_softc), +}; + +static devclass_t terasic_de4led_devclass; + +DRIVER_MODULE(terasic_de4led, nexus, terasic_de4led_nexus_driver, + terasic_de4led_devclass, 0, 0); From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 15:12:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id ED5071D3; Sun, 13 Jan 2013 15:12:35 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D668A94C; Sun, 13 Jan 2013 15:12:35 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DFCZ77090452; Sun, 13 Jan 2013 15:12:35 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DFCZTJ090450; Sun, 13 Jan 2013 15:12:35 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201301131512.r0DFCZTJ090450@svn.freebsd.org> From: Robert Watson Date: Sun, 13 Jan 2013 15:12:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245367 - in head/sys: dev/terasic/de4led mips/beri X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 15:12:36 -0000 Author: rwatson Date: Sun Jan 13 15:12:35 2013 New Revision: 245367 URL: http://svnweb.freebsd.org/changeset/base/245367 Log: Merge Perforce changeset 219922 to head: Update nexus parts in copied DE4LED attachment to use FDT. Sponsored by: DARPA, AFRL Modified: head/sys/dev/terasic/de4led/terasic_de4led_fdt.c head/sys/mips/beri/files.beri Modified: head/sys/dev/terasic/de4led/terasic_de4led_fdt.c ============================================================================== --- head/sys/dev/terasic/de4led/terasic_de4led_fdt.c Sun Jan 13 15:10:27 2013 (r245366) +++ head/sys/dev/terasic/de4led/terasic_de4led_fdt.c Sun Jan 13 15:12:35 2013 (r245367) @@ -47,6 +47,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include +#include + #include /* @@ -54,15 +59,18 @@ __FBSDID("$FreeBSD$"); * which is hooked up to the processor via a memory-mapped Avalon bus. */ static int -terasic_de4led_nexus_probe(device_t dev) +terasic_de4led_fdt_probe(device_t dev) { - device_set_desc(dev, "Terasic DE4 8-element LED"); - return (BUS_PROBE_DEFAULT); + if (ofw_bus_is_compatible(dev, "cambridge,de4led")) { + device_set_desc(dev, "Terasic DE4 8-element LED"); + return (BUS_PROBE_DEFAULT); + } + return (ENXIO); } static int -terasic_de4led_nexus_attach(device_t dev) +terasic_de4led_fdt_attach(device_t dev) { struct terasic_de4led_softc *sc; @@ -81,7 +89,7 @@ terasic_de4led_nexus_attach(device_t dev } static int -terasic_de4led_nexus_detach(device_t dev) +terasic_de4led_fdt_detach(device_t dev) { struct terasic_de4led_softc *sc; @@ -93,20 +101,20 @@ terasic_de4led_nexus_detach(device_t dev return (0); } -static device_method_t terasic_de4led_nexus_methods[] = { - DEVMETHOD(device_probe, terasic_de4led_nexus_probe), - DEVMETHOD(device_attach, terasic_de4led_nexus_attach), - DEVMETHOD(device_detach, terasic_de4led_nexus_detach), +static device_method_t terasic_de4led_fdt_methods[] = { + DEVMETHOD(device_probe, terasic_de4led_fdt_probe), + DEVMETHOD(device_attach, terasic_de4led_fdt_attach), + DEVMETHOD(device_detach, terasic_de4led_fdt_detach), { 0, 0 } }; -static driver_t terasic_de4led_nexus_driver = { +static driver_t terasic_de4led_fdt_driver = { "terasic_de4led", - terasic_de4led_nexus_methods, + terasic_de4led_fdt_methods, sizeof(struct terasic_de4led_softc), }; static devclass_t terasic_de4led_devclass; -DRIVER_MODULE(terasic_de4led, nexus, terasic_de4led_nexus_driver, +DRIVER_MODULE(terasic_de4led, simplebus, terasic_de4led_fdt_driver, terasic_de4led_devclass, 0, 0); Modified: head/sys/mips/beri/files.beri ============================================================================== --- head/sys/mips/beri/files.beri Sun Jan 13 15:10:27 2013 (r245366) +++ head/sys/mips/beri/files.beri Sun Jan 13 15:12:35 2013 (r245367) @@ -4,6 +4,7 @@ dev/altera/jtag_uart/altera_jtag_uart_tt dev/altera/jtag_uart/altera_jtag_uart_fdt.c optional altera_jtag_uart fdt dev/altera/jtag_uart/altera_jtag_uart_nexus.c optional altera_jtag_uart dev/terasic/de4led/terasic_de4led.c optional terasic_de4led +dev/terasic/de4led/terasic_de4led_fdt.c optional terasic_de4led fdt dev/terasic/de4led/terasic_de4led_nexus.c optional terasic_de4led dev/terasic/mtl/terasic_mtl.c optional terasic_mtl dev/terasic/mtl/terasic_mtl_nexus.c optional terasic_mtl From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 15:13:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 440C5348; Sun, 13 Jan 2013 15:13:26 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3688A955; Sun, 13 Jan 2013 15:13:26 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DFDQuX090600; Sun, 13 Jan 2013 15:13:26 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DFDQLk090599; Sun, 13 Jan 2013 15:13:26 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201301131513.r0DFDQLk090599@svn.freebsd.org> From: Robert Watson Date: Sun, 13 Jan 2013 15:13:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245368 - head/sys/dev/altera/sdcard X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 15:13:26 -0000 Author: rwatson Date: Sun Jan 13 15:13:25 2013 New Revision: 245368 URL: http://svnweb.freebsd.org/changeset/base/245368 Log: Merge Perforce changeset 219926 to head: Copy Altera SDCard nexus attachment as a starting point for the FDT attachment. Sponsored by: DARPA, AFRL Added: head/sys/dev/altera/sdcard/altera_sdcard_fdt.c - copied unchanged from r245363, head/sys/dev/altera/sdcard/altera_sdcard_nexus.c Copied: head/sys/dev/altera/sdcard/altera_sdcard_fdt.c (from r245363, head/sys/dev/altera/sdcard/altera_sdcard_nexus.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/sdcard/altera_sdcard_fdt.c Sun Jan 13 15:13:25 2013 (r245368, copy of r245363, head/sys/dev/altera/sdcard/altera_sdcard_nexus.c) @@ -0,0 +1,116 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include + +/* + * Nexus bus attachment for the Altera SD Card IP core. Appropriate for most + * Altera FPGA SoC-style configurations in which the IP core will be exposed + * to the processor via a memory-mapped Avalon bus. + */ +static int +altera_sdcard_nexus_probe(device_t dev) +{ + + device_set_desc(dev, "Altera Secure Data Card IP Core"); + return (BUS_PROBE_DEFAULT); +} + +static int +altera_sdcard_nexus_attach(device_t dev) +{ + struct altera_sdcard_softc *sc; + + sc = device_get_softc(dev); + sc->as_dev = dev; + sc->as_unit = device_get_unit(dev); + sc->as_rid = 0; + sc->as_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->as_rid, RF_ACTIVE); + if (sc->as_res == NULL) { + device_printf(dev, "couldn't map memory\n"); + return (ENXIO); + } + altera_sdcard_attach(sc); + return (0); +} + +static int +altera_sdcard_nexus_detach(device_t dev) +{ + struct altera_sdcard_softc *sc; + + sc = device_get_softc(dev); + KASSERT(sc->as_res != NULL, ("%s: resources not allocated", + __func__)); + altera_sdcard_detach(sc); + bus_release_resource(dev, SYS_RES_MEMORY, sc->as_rid, sc->as_res); + return (0); +} + +static device_method_t altera_sdcard_nexus_methods[] = { + DEVMETHOD(device_probe, altera_sdcard_nexus_probe), + DEVMETHOD(device_attach, altera_sdcard_nexus_attach), + DEVMETHOD(device_detach, altera_sdcard_nexus_detach), + { 0, 0 } +}; + +static driver_t altera_sdcard_nexus_driver = { + "altera_sdcardc", + altera_sdcard_nexus_methods, + sizeof(struct altera_sdcard_softc), +}; + +static devclass_t altera_sdcard_devclass; + +DRIVER_MODULE(altera_sdcard, nexus, altera_sdcard_nexus_driver, + altera_sdcard_devclass, 0, 0); From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 15:15:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A04D84C1; Sun, 13 Jan 2013 15:15:25 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 812C4965; Sun, 13 Jan 2013 15:15:25 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DFFPTn090875; Sun, 13 Jan 2013 15:15:25 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DFFPwm090873; Sun, 13 Jan 2013 15:15:25 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201301131515.r0DFFPwm090873@svn.freebsd.org> From: Robert Watson Date: Sun, 13 Jan 2013 15:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245369 - in head/sys: conf dev/altera/sdcard X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 15:15:25 -0000 Author: rwatson Date: Sun Jan 13 15:15:24 2013 New Revision: 245369 URL: http://svnweb.freebsd.org/changeset/base/245369 Log: Merge Perforce changeset 219927 to head: Implement an FDT attachment for the Altera SD Card driver Sponsored by: DARPA, AFRL Modified: head/sys/conf/files head/sys/dev/altera/sdcard/altera_sdcard_fdt.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jan 13 15:13:25 2013 (r245368) +++ head/sys/conf/files Sun Jan 13 15:15:24 2013 (r245369) @@ -641,6 +641,7 @@ dev/altera/avgen/altera_avgen.c optiona dev/altera/sdcard/altera_sdcard.c optional altera_sdcard dev/altera/sdcard/altera_sdcard_disk.c optional altera_sdcard dev/altera/sdcard/altera_sdcard_io.c optional altera_sdcard +dev/altera/sdcard/altera_sdcard_fdt.c optional altera_sdcard fdt dev/altera/sdcard/altera_sdcard_nexus.c optional altera_sdcard dev/amr/amr.c optional amr dev/amr/amr_cam.c optional amrp amr Modified: head/sys/dev/altera/sdcard/altera_sdcard_fdt.c ============================================================================== --- head/sys/dev/altera/sdcard/altera_sdcard_fdt.c Sun Jan 13 15:13:25 2013 (r245368) +++ head/sys/dev/altera/sdcard/altera_sdcard_fdt.c Sun Jan 13 15:15:24 2013 (r245369) @@ -52,21 +52,27 @@ __FBSDID("$FreeBSD$"); #include +#include +#include +#include +#include + /* - * Nexus bus attachment for the Altera SD Card IP core. Appropriate for most - * Altera FPGA SoC-style configurations in which the IP core will be exposed - * to the processor via a memory-mapped Avalon bus. + * FDT bus attachment for the Altera SD Card IP core. */ static int -altera_sdcard_nexus_probe(device_t dev) +altera_sdcard_fdt_probe(device_t dev) { - device_set_desc(dev, "Altera Secure Data Card IP Core"); - return (BUS_PROBE_DEFAULT); + if (ofw_bus_is_compatible(dev, "altera,sdcard_11_2011")) { + device_set_desc(dev, "Altera Secure Data Card IP Core"); + return (BUS_PROBE_DEFAULT); + } + return (ENXIO); } static int -altera_sdcard_nexus_attach(device_t dev) +altera_sdcard_fdt_attach(device_t dev) { struct altera_sdcard_softc *sc; @@ -85,7 +91,7 @@ altera_sdcard_nexus_attach(device_t dev) } static int -altera_sdcard_nexus_detach(device_t dev) +altera_sdcard_fdt_detach(device_t dev) { struct altera_sdcard_softc *sc; @@ -97,20 +103,20 @@ altera_sdcard_nexus_detach(device_t dev) return (0); } -static device_method_t altera_sdcard_nexus_methods[] = { - DEVMETHOD(device_probe, altera_sdcard_nexus_probe), - DEVMETHOD(device_attach, altera_sdcard_nexus_attach), - DEVMETHOD(device_detach, altera_sdcard_nexus_detach), +static device_method_t altera_sdcard_fdt_methods[] = { + DEVMETHOD(device_probe, altera_sdcard_fdt_probe), + DEVMETHOD(device_attach, altera_sdcard_fdt_attach), + DEVMETHOD(device_detach, altera_sdcard_fdt_detach), { 0, 0 } }; -static driver_t altera_sdcard_nexus_driver = { +static driver_t altera_sdcard_fdt_driver = { "altera_sdcardc", - altera_sdcard_nexus_methods, + altera_sdcard_fdt_methods, sizeof(struct altera_sdcard_softc), }; static devclass_t altera_sdcard_devclass; -DRIVER_MODULE(altera_sdcard, nexus, altera_sdcard_nexus_driver, +DRIVER_MODULE(altera_sdcard, simplebus, altera_sdcard_fdt_driver, altera_sdcard_devclass, 0, 0); From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 15:16:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B80B362F; Sun, 13 Jan 2013 15:16:18 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AA74996C; Sun, 13 Jan 2013 15:16:18 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DFGIc6090997; Sun, 13 Jan 2013 15:16:18 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DFGIhu090996; Sun, 13 Jan 2013 15:16:18 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201301131516.r0DFGIhu090996@svn.freebsd.org> From: Robert Watson Date: Sun, 13 Jan 2013 15:16:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245370 - head/sys/dev/isf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 15:16:18 -0000 Author: rwatson Date: Sun Jan 13 15:16:18 2013 New Revision: 245370 URL: http://svnweb.freebsd.org/changeset/base/245370 Log: Merge Perforce changeset 219929 to head: Replicate nexus attachment for isf(4) to become an FDT attachment. Sponsored by: DARPA, AFRL Added: head/sys/dev/isf/isf_fdt.c - copied unchanged from r245363, head/sys/dev/isf/isf_nexus.c Copied: head/sys/dev/isf/isf_fdt.c (from r245363, head/sys/dev/isf/isf_nexus.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/isf/isf_fdt.c Sun Jan 13 15:16:18 2013 (r245370, copy of r245363, head/sys/dev/isf/isf_nexus.c) @@ -0,0 +1,120 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * Copyright (c) 2012 SRI International + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include + +/* + * Nexus bus attachment for the Intel Strata Flash devices. Appropriate for + * most Altera FPGA SoC-style configurations in which the part will be exposed + * to the processor via a memory-mapped Avalon bus. + */ +static int +isf_nexus_probe(device_t dev) +{ + + device_set_desc(dev, "Intel StrataFlash NOR flash device"); + return (BUS_PROBE_DEFAULT); +} + +static int +isf_nexus_attach(device_t dev) +{ + int error; + struct isf_softc *sc; + + sc = device_get_softc(dev); + sc->isf_dev = dev; + sc->isf_unit = device_get_unit(dev); + sc->isf_rid = 0; + sc->isf_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->isf_rid, RF_ACTIVE); + if (sc->isf_res == NULL) { + device_printf(dev, "couldn't map memory\n"); + return (ENXIO); + } + error = isf_attach(sc); + if (error) + bus_release_resource(dev, SYS_RES_MEMORY, sc->isf_rid, + sc->isf_res); + return (error); +} + +static int +isf_nexus_detach(device_t dev) +{ + struct isf_softc *sc; + + sc = device_get_softc(dev); + KASSERT(sc->isf_res != NULL, ("%s: resources not allocated", + __func__)); + isf_detach(sc); + bus_release_resource(dev, SYS_RES_MEMORY, sc->isf_rid, sc->isf_res); + return (0); +} + +static device_method_t isf_nexus_methods[] = { + DEVMETHOD(device_probe, isf_nexus_probe), + DEVMETHOD(device_attach, isf_nexus_attach), + DEVMETHOD(device_detach, isf_nexus_detach), + { 0, 0 } +}; + +static driver_t isf_nexus_driver = { + "isf", + isf_nexus_methods, + sizeof(struct isf_softc), +}; + +static devclass_t isf_devclass; + +DRIVER_MODULE(isf, nexus, isf_nexus_driver, isf_devclass, 0, 0); From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 16:20:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EEAE594A; Sun, 13 Jan 2013 16:20:40 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D29BBD73; Sun, 13 Jan 2013 16:20:40 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DGKeAt010404; Sun, 13 Jan 2013 16:20:40 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DGKe9X010402; Sun, 13 Jan 2013 16:20:40 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201301131620.r0DGKe9X010402@svn.freebsd.org> From: Robert Watson Date: Sun, 13 Jan 2013 16:20:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245371 - in head/sys: conf dev/isf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 16:20:41 -0000 Author: rwatson Date: Sun Jan 13 16:20:40 2013 New Revision: 245371 URL: http://svnweb.freebsd.org/changeset/base/245371 Log: Partially merge Perforce changeset 219930 to head: Add an Intel StrataFlash (isf) driver FDT attachment. Portions of the original changeset hooking up FDT use for BERI will be merged separately. Sponsored by: DARPA, AFRL Modified: head/sys/conf/files head/sys/dev/isf/isf_fdt.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jan 13 15:16:18 2013 (r245370) +++ head/sys/conf/files Sun Jan 13 16:20:40 2013 (r245371) @@ -1416,6 +1416,7 @@ dev/iscsi/initiator/isc_soc.c optional i dev/iscsi/initiator/isc_sm.c optional iscsi_initiator scbus dev/iscsi/initiator/isc_subr.c optional iscsi_initiator scbus dev/isf/isf.c optional isf +dev/isf/isf_fdt.c optional isf fdt dev/isf/isf_nexus.c optional isf dev/isp/isp.c optional isp dev/isp/isp_freebsd.c optional isp Modified: head/sys/dev/isf/isf_fdt.c ============================================================================== --- head/sys/dev/isf/isf_fdt.c Sun Jan 13 15:16:18 2013 (r245370) +++ head/sys/dev/isf/isf_fdt.c Sun Jan 13 16:20:40 2013 (r245371) @@ -51,23 +51,29 @@ __FBSDID("$FreeBSD$"); #include +#include +#include +#include +#include + #include /* - * Nexus bus attachment for the Intel Strata Flash devices. Appropriate for - * most Altera FPGA SoC-style configurations in which the part will be exposed - * to the processor via a memory-mapped Avalon bus. + * FDT bus attachment for the Intel Strata Flash devices. */ static int -isf_nexus_probe(device_t dev) +isf_fdt_probe(device_t dev) { - device_set_desc(dev, "Intel StrataFlash NOR flash device"); - return (BUS_PROBE_DEFAULT); + if (ofw_bus_is_compatible(dev, "intel,strataflash")) { + device_set_desc(dev, "Intel StrataFlash NOR flash device"); + return (BUS_PROBE_DEFAULT); + } + return (ENXIO); } static int -isf_nexus_attach(device_t dev) +isf_fdt_attach(device_t dev) { int error; struct isf_softc *sc; @@ -90,7 +96,7 @@ isf_nexus_attach(device_t dev) } static int -isf_nexus_detach(device_t dev) +isf_fdt_detach(device_t dev) { struct isf_softc *sc; @@ -102,19 +108,19 @@ isf_nexus_detach(device_t dev) return (0); } -static device_method_t isf_nexus_methods[] = { - DEVMETHOD(device_probe, isf_nexus_probe), - DEVMETHOD(device_attach, isf_nexus_attach), - DEVMETHOD(device_detach, isf_nexus_detach), +static device_method_t isf_fdt_methods[] = { + DEVMETHOD(device_probe, isf_fdt_probe), + DEVMETHOD(device_attach, isf_fdt_attach), + DEVMETHOD(device_detach, isf_fdt_detach), { 0, 0 } }; -static driver_t isf_nexus_driver = { +static driver_t isf_fdt_driver = { "isf", - isf_nexus_methods, + isf_fdt_methods, sizeof(struct isf_softc), }; static devclass_t isf_devclass; -DRIVER_MODULE(isf, nexus, isf_nexus_driver, isf_devclass, 0, 0); +DRIVER_MODULE(isf, simplebus, isf_fdt_driver, isf_devclass, 0, 0); From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 16:21:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1D9A8AE6; Sun, 13 Jan 2013 16:21:52 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 01985D82; Sun, 13 Jan 2013 16:21:52 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DGLp2J010748; Sun, 13 Jan 2013 16:21:51 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DGLpwK010747; Sun, 13 Jan 2013 16:21:51 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201301131621.r0DGLpwK010747@svn.freebsd.org> From: Robert Watson Date: Sun, 13 Jan 2013 16:21:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245372 - head/sys/dev/terasic/mtl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 16:21:52 -0000 Author: rwatson Date: Sun Jan 13 16:21:51 2013 New Revision: 245372 URL: http://svnweb.freebsd.org/changeset/base/245372 Log: Merge Perforce changeset 219937 to head: Copy Terasic MTL nexus bus attachment as a starting point for an FDT attachment for the same driver. Sponsored by: DARPA, AFRL Added: head/sys/dev/terasic/mtl/terasic_mtl_fdt.c - copied unchanged from r245363, head/sys/dev/terasic/mtl/terasic_mtl_nexus.c Copied: head/sys/dev/terasic/mtl/terasic_mtl_fdt.c (from r245363, head/sys/dev/terasic/mtl/terasic_mtl_nexus.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/terasic/mtl/terasic_mtl_fdt.c Sun Jan 13 16:21:51 2013 (r245372, copy of r245363, head/sys/dev/terasic/mtl/terasic_mtl_nexus.c) @@ -0,0 +1,196 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include /* struct vt_mode */ +#include /* video_adapter_t */ +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +static int +terasic_mtl_nexus_probe(device_t dev) +{ + + device_set_desc(dev, "Terasic Multi-touch LCD (MTL)"); + return (BUS_PROBE_DEFAULT); +} + +static int +terasic_mtl_nexus_attach(device_t dev) +{ + struct terasic_mtl_softc *sc; + u_long pixel_maddr, text_maddr, reg_maddr; + u_long pixel_msize, text_msize, reg_msize; + int error; + + sc = device_get_softc(dev); + sc->mtl_dev = dev; + sc->mtl_unit = device_get_unit(dev); + + /* + * Query non-standard hints to find the locations of our two memory + * regions. Enforce certain alignment and size requirements. + */ + if (resource_long_value(device_get_name(dev), device_get_unit(dev), + "reg_maddr", ®_maddr) != 0 || (reg_maddr % PAGE_SIZE != 0)) { + device_printf(dev, "improper register address"); + return (ENXIO); + } + if (resource_long_value(device_get_name(dev), device_get_unit(dev), + "reg_msize", ®_msize) != 0 || (reg_msize % PAGE_SIZE != 0)) { + device_printf(dev, "improper register size"); + return (ENXIO); + } + if (resource_long_value(device_get_name(dev), device_get_unit(dev), + "pixel_maddr", &pixel_maddr) != 0 || + (pixel_maddr % PAGE_SIZE != 0)) { + device_printf(dev, "improper pixel frame buffer address"); + return (ENXIO); + } + if (resource_long_value(device_get_name(dev), device_get_unit(dev), + "pixel_msize", &pixel_msize) != 0 || + (pixel_msize % PAGE_SIZE != 0)) { + device_printf(dev, "improper pixel frame buffer size"); + return (ENXIO); + } + if (resource_long_value(device_get_name(dev), device_get_unit(dev), + "text_maddr", &text_maddr) != 0 || + (text_maddr % PAGE_SIZE != 0)) { + device_printf(dev, "improper text frame buffer address"); + return (ENXIO); + } + if (resource_long_value(device_get_name(dev), device_get_unit(dev), + "text_msize", &text_msize) != 0 || + (text_msize % PAGE_SIZE != 0)) { + device_printf(dev, "improper text frame buffer size"); + return (ENXIO); + } + + /* + * Allocate resources. + */ + sc->mtl_reg_rid = 0; + sc->mtl_reg_res = bus_alloc_resource(dev, SYS_RES_MEMORY, + &sc->mtl_reg_rid, reg_maddr, reg_maddr + reg_msize - 1, + reg_msize, RF_ACTIVE); + if (sc->mtl_reg_res == NULL) { + device_printf(dev, "couldn't map register memory\n"); + error = ENXIO; + goto error; + } + device_printf(sc->mtl_dev, "registers at mem %p-%p\n", + (void *)reg_maddr, (void *)(reg_maddr + reg_msize)); + sc->mtl_pixel_rid = 0; + sc->mtl_pixel_res = bus_alloc_resource(dev, SYS_RES_MEMORY, + &sc->mtl_pixel_rid, pixel_maddr, pixel_maddr + pixel_msize - 1, + pixel_msize, RF_ACTIVE); + if (sc->mtl_pixel_res == NULL) { + device_printf(dev, "couldn't map pixel memory\n"); + error = ENXIO; + goto error; + } + device_printf(sc->mtl_dev, "pixel frame buffer at mem %p-%p\n", + (void *)pixel_maddr, (void *)(pixel_maddr + pixel_msize)); + sc->mtl_text_rid = 0; + sc->mtl_text_res = bus_alloc_resource(dev, SYS_RES_MEMORY, + &sc->mtl_text_rid, text_maddr, text_maddr + text_msize - 1, + text_msize, RF_ACTIVE); + if (sc->mtl_text_res == NULL) { + device_printf(dev, "couldn't map text memory\n"); + error = ENXIO; + goto error; + } + device_printf(sc->mtl_dev, "text frame buffer at mem %p-%p\n", + (void *)text_maddr, (void *)(text_maddr + text_msize)); + error = terasic_mtl_attach(sc); + if (error == 0) + return (0); +error: + if (sc->mtl_text_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, sc->mtl_text_rid, + sc->mtl_text_res); + if (sc->mtl_pixel_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, sc->mtl_pixel_rid, + sc->mtl_pixel_res); + if (sc->mtl_reg_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, sc->mtl_reg_rid, + sc->mtl_reg_res); + return (error); +} + +static int +terasic_mtl_nexus_detach(device_t dev) +{ + struct terasic_mtl_softc *sc; + + sc = device_get_softc(dev); + terasic_mtl_detach(sc); + bus_release_resource(dev, SYS_RES_MEMORY, sc->mtl_text_rid, + sc->mtl_text_res); + bus_release_resource(dev, SYS_RES_MEMORY, sc->mtl_pixel_rid, + sc->mtl_pixel_res); + bus_release_resource(dev, SYS_RES_MEMORY, sc->mtl_reg_rid, + sc->mtl_reg_res); + return (0); +} + +static device_method_t terasic_mtl_nexus_methods[] = { + DEVMETHOD(device_probe, terasic_mtl_nexus_probe), + DEVMETHOD(device_attach, terasic_mtl_nexus_attach), + DEVMETHOD(device_detach, terasic_mtl_nexus_detach), + { 0, 0 } +}; + +static driver_t terasic_mtl_nexus_driver = { + "terasic_mtl", + terasic_mtl_nexus_methods, + sizeof(struct terasic_mtl_softc), +}; + +static devclass_t terasic_mtl_devclass; + +DRIVER_MODULE(mtl, nexus, terasic_mtl_nexus_driver, terasic_mtl_devclass, 0, + 0); From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 16:27:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EA0E3DF1; Sun, 13 Jan 2013 16:27:57 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C1124DCE; Sun, 13 Jan 2013 16:27:57 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DGRvg5011548; Sun, 13 Jan 2013 16:27:57 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DGRvOg011546; Sun, 13 Jan 2013 16:27:57 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201301131627.r0DGRvOg011546@svn.freebsd.org> From: Robert Watson Date: Sun, 13 Jan 2013 16:27:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245373 - in head/sys: dev/terasic/mtl mips/beri X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 16:27:58 -0000 Author: rwatson Date: Sun Jan 13 16:27:56 2013 New Revision: 245373 URL: http://svnweb.freebsd.org/changeset/base/245373 Log: Partially merge Perforce changeset 219938 to head: Write FDT attachment for the Terasic MTL (multitouch LCD) driver. Exploit the fact that FDT allows multiple memory ranges to be assigned to a device, giving us a cleaner description than device.hints does. Portions of this changeset that remove mtl from BERI device.hints and add to DTS will be merged separately. Sponsored by: DARPA, AFRL Modified: head/sys/dev/terasic/mtl/terasic_mtl_fdt.c head/sys/mips/beri/files.beri Modified: head/sys/dev/terasic/mtl/terasic_mtl_fdt.c ============================================================================== --- head/sys/dev/terasic/mtl/terasic_mtl_fdt.c Sun Jan 13 16:21:51 2013 (r245372) +++ head/sys/dev/terasic/mtl/terasic_mtl_fdt.c Sun Jan 13 16:27:56 2013 (r245373) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Robert N. M. Watson + * Copyright (c) 2012-2013 Robert N. M. Watson * All rights reserved. * * This software was developed by SRI International and the University of @@ -48,22 +48,28 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include +#include + #include static int -terasic_mtl_nexus_probe(device_t dev) +terasic_mtl_fdt_probe(device_t dev) { - device_set_desc(dev, "Terasic Multi-touch LCD (MTL)"); - return (BUS_PROBE_DEFAULT); + if (ofw_bus_is_compatible(dev, "cambridge,mtl")) { + device_set_desc(dev, "Terasic Multi-touch LCD (MTL)"); + return (BUS_PROBE_DEFAULT); + } + return (ENXIO); } static int -terasic_mtl_nexus_attach(device_t dev) +terasic_mtl_fdt_attach(device_t dev) { struct terasic_mtl_softc *sc; - u_long pixel_maddr, text_maddr, reg_maddr; - u_long pixel_msize, text_msize, reg_msize; int error; sc = device_get_softc(dev); @@ -71,80 +77,80 @@ terasic_mtl_nexus_attach(device_t dev) sc->mtl_unit = device_get_unit(dev); /* - * Query non-standard hints to find the locations of our two memory - * regions. Enforce certain alignment and size requirements. - */ - if (resource_long_value(device_get_name(dev), device_get_unit(dev), - "reg_maddr", ®_maddr) != 0 || (reg_maddr % PAGE_SIZE != 0)) { - device_printf(dev, "improper register address"); - return (ENXIO); - } - if (resource_long_value(device_get_name(dev), device_get_unit(dev), - "reg_msize", ®_msize) != 0 || (reg_msize % PAGE_SIZE != 0)) { - device_printf(dev, "improper register size"); - return (ENXIO); - } - if (resource_long_value(device_get_name(dev), device_get_unit(dev), - "pixel_maddr", &pixel_maddr) != 0 || - (pixel_maddr % PAGE_SIZE != 0)) { - device_printf(dev, "improper pixel frame buffer address"); - return (ENXIO); - } - if (resource_long_value(device_get_name(dev), device_get_unit(dev), - "pixel_msize", &pixel_msize) != 0 || - (pixel_msize % PAGE_SIZE != 0)) { - device_printf(dev, "improper pixel frame buffer size"); - return (ENXIO); - } - if (resource_long_value(device_get_name(dev), device_get_unit(dev), - "text_maddr", &text_maddr) != 0 || - (text_maddr % PAGE_SIZE != 0)) { - device_printf(dev, "improper text frame buffer address"); - return (ENXIO); - } - if (resource_long_value(device_get_name(dev), device_get_unit(dev), - "text_msize", &text_msize) != 0 || - (text_msize % PAGE_SIZE != 0)) { - device_printf(dev, "improper text frame buffer size"); - return (ENXIO); - } - - /* - * Allocate resources. + * FDT allows multiple memory resources to be defined for a device; + * query them in the order registers, pixel buffer, text buffer. + * However, we need to sanity-check that they are page-aligned and + * page-sized, so we may still abort. */ sc->mtl_reg_rid = 0; - sc->mtl_reg_res = bus_alloc_resource(dev, SYS_RES_MEMORY, - &sc->mtl_reg_rid, reg_maddr, reg_maddr + reg_msize - 1, - reg_msize, RF_ACTIVE); + sc->mtl_reg_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->mtl_reg_rid, RF_ACTIVE); if (sc->mtl_reg_res == NULL) { device_printf(dev, "couldn't map register memory\n"); error = ENXIO; goto error; } + if (rman_get_start(sc->mtl_reg_res) % PAGE_SIZE != 0) { + device_printf(dev, "improper register address"); + error = ENXIO; + goto error; + } + if (rman_get_size(sc->mtl_reg_res) % PAGE_SIZE != 0) { + device_printf(dev, "improper register size"); + error = ENXIO; + goto error; + } device_printf(sc->mtl_dev, "registers at mem %p-%p\n", - (void *)reg_maddr, (void *)(reg_maddr + reg_msize)); - sc->mtl_pixel_rid = 0; - sc->mtl_pixel_res = bus_alloc_resource(dev, SYS_RES_MEMORY, - &sc->mtl_pixel_rid, pixel_maddr, pixel_maddr + pixel_msize - 1, - pixel_msize, RF_ACTIVE); + (void *)rman_get_start(sc->mtl_reg_res), + (void *)(rman_get_start(sc->mtl_reg_res) + + rman_get_size(sc->mtl_reg_res))); + + sc->mtl_pixel_rid = 1; + sc->mtl_pixel_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->mtl_pixel_rid, RF_ACTIVE); if (sc->mtl_pixel_res == NULL) { device_printf(dev, "couldn't map pixel memory\n"); error = ENXIO; goto error; } + if (rman_get_start(sc->mtl_pixel_res) % PAGE_SIZE != 0) { + device_printf(dev, "improper pixel address"); + error = ENXIO; + goto error; + } + if (rman_get_size(sc->mtl_pixel_res) % PAGE_SIZE != 0) { + device_printf(dev, "improper pixel size"); + error = ENXIO; + goto error; + } device_printf(sc->mtl_dev, "pixel frame buffer at mem %p-%p\n", - (void *)pixel_maddr, (void *)(pixel_maddr + pixel_msize)); - sc->mtl_text_rid = 0; - sc->mtl_text_res = bus_alloc_resource(dev, SYS_RES_MEMORY, - &sc->mtl_text_rid, text_maddr, text_maddr + text_msize - 1, - text_msize, RF_ACTIVE); + (void *)rman_get_start(sc->mtl_pixel_res), + (void *)(rman_get_start(sc->mtl_pixel_res) + + rman_get_size(sc->mtl_pixel_res))); + + sc->mtl_text_rid = 2; + sc->mtl_text_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->mtl_text_rid, RF_ACTIVE); if (sc->mtl_text_res == NULL) { device_printf(dev, "couldn't map text memory\n"); error = ENXIO; goto error; } + if (rman_get_start(sc->mtl_text_res) % PAGE_SIZE != 0) { + device_printf(dev, "improper text address"); + error = ENXIO; + goto error; + } + if (rman_get_size(sc->mtl_text_res) % PAGE_SIZE != 0) { + device_printf(dev, "improper text size"); + error = ENXIO; + goto error; + } device_printf(sc->mtl_dev, "text frame buffer at mem %p-%p\n", - (void *)text_maddr, (void *)(text_maddr + text_msize)); + (void *)rman_get_start(sc->mtl_text_res), + (void *)(rman_get_start(sc->mtl_text_res) + + rman_get_size(sc->mtl_text_res))); + error = terasic_mtl_attach(sc); if (error == 0) return (0); @@ -162,7 +168,7 @@ error: } static int -terasic_mtl_nexus_detach(device_t dev) +terasic_mtl_fdt_detach(device_t dev) { struct terasic_mtl_softc *sc; @@ -177,20 +183,20 @@ terasic_mtl_nexus_detach(device_t dev) return (0); } -static device_method_t terasic_mtl_nexus_methods[] = { - DEVMETHOD(device_probe, terasic_mtl_nexus_probe), - DEVMETHOD(device_attach, terasic_mtl_nexus_attach), - DEVMETHOD(device_detach, terasic_mtl_nexus_detach), +static device_method_t terasic_mtl_fdt_methods[] = { + DEVMETHOD(device_probe, terasic_mtl_fdt_probe), + DEVMETHOD(device_attach, terasic_mtl_fdt_attach), + DEVMETHOD(device_detach, terasic_mtl_fdt_detach), { 0, 0 } }; -static driver_t terasic_mtl_nexus_driver = { +static driver_t terasic_mtl_fdt_driver = { "terasic_mtl", - terasic_mtl_nexus_methods, + terasic_mtl_fdt_methods, sizeof(struct terasic_mtl_softc), }; static devclass_t terasic_mtl_devclass; -DRIVER_MODULE(mtl, nexus, terasic_mtl_nexus_driver, terasic_mtl_devclass, 0, +DRIVER_MODULE(mtl, simplebus, terasic_mtl_fdt_driver, terasic_mtl_devclass, 0, 0); Modified: head/sys/mips/beri/files.beri ============================================================================== --- head/sys/mips/beri/files.beri Sun Jan 13 16:21:51 2013 (r245372) +++ head/sys/mips/beri/files.beri Sun Jan 13 16:27:56 2013 (r245373) @@ -7,6 +7,7 @@ dev/terasic/de4led/terasic_de4led.c opti dev/terasic/de4led/terasic_de4led_fdt.c optional terasic_de4led fdt dev/terasic/de4led/terasic_de4led_nexus.c optional terasic_de4led dev/terasic/mtl/terasic_mtl.c optional terasic_mtl +dev/terasic/mtl/terasic_mtl_fdt.c optional terasic_mtl fdt dev/terasic/mtl/terasic_mtl_nexus.c optional terasic_mtl dev/terasic/mtl/terasic_mtl_pixel.c optional terasic_mtl dev/terasic/mtl/terasic_mtl_reg.c optional terasic_mtl From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 16:36:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 141963A8; Sun, 13 Jan 2013 16:36:37 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id E2189E40; Sun, 13 Jan 2013 16:36:36 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 58B7146B2D; Sun, 13 Jan 2013 11:36:36 -0500 (EST) Date: Sun, 13 Jan 2013 16:36:36 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Andrew Thompson Subject: Re: svn commit: r245329 - head/sys/mips/beri In-Reply-To: Message-ID: References: <201301121235.r0CCZ0dI023716@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 16:36:37 -0000 On Sun, 13 Jan 2013, Andrew Thompson wrote: >> Merge Perforce change @219935 to head: >> >> Initialise Openfirmware/FDT code earlier in the FreeBSD/beri boot, >> so that the results will be available for configuring the console >> UART (eventually). >> >> Suggested by: thompsa > > Two Andrew Ts down south, we always get mixed up. ... but both very nice people. :-) Sorry about the mixup! Robert From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 16:41:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 358A6570; Sun, 13 Jan 2013 16:41:26 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0C710E68; Sun, 13 Jan 2013 16:41:26 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DGfPJ3016507; Sun, 13 Jan 2013 16:41:25 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DGfPQ7016506; Sun, 13 Jan 2013 16:41:25 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201301131641.r0DGfPQ7016506@svn.freebsd.org> From: Robert Watson Date: Sun, 13 Jan 2013 16:41:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245375 - head/sys/dev/altera/avgen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 16:41:26 -0000 Author: rwatson Date: Sun Jan 13 16:41:25 2013 New Revision: 245375 URL: http://svnweb.freebsd.org/changeset/base/245375 Log: Merge Perforce changeset 219939 to head: Start restructuring of altera_avgen(4) so that it can have an FDT attachment -- this requires first properly breaking out the current nexus attachment from the driver implementation. Sponsored by: DARPA, AFRL Added: head/sys/dev/altera/avgen/altera_avgen_nexus.c - copied unchanged from r245363, head/sys/dev/altera/avgen/altera_avgen.c Copied: head/sys/dev/altera/avgen/altera_avgen_nexus.c (from r245363, head/sys/dev/altera/avgen/altera_avgen.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/avgen/altera_avgen_nexus.c Sun Jan 13 16:41:25 2013 (r245375, copy of r245363, head/sys/dev/altera/avgen/altera_avgen.c) @@ -0,0 +1,451 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include + +/* + * Generic device driver for allowing read(), write(), and mmap() on + * memory-mapped, Avalon-attached devices. There is no actual dependence on + * Avalon, so conceivably this should just be soc_dev or similar, since many + * system-on-chip bus environments would work fine with the same code. + */ + +static d_mmap_t altera_avgen_mmap; +static d_read_t altera_avgen_read; +static d_write_t altera_avgen_write; + +static struct cdevsw avg_cdevsw = { + .d_version = D_VERSION, + .d_mmap = altera_avgen_mmap, + .d_read = altera_avgen_read, + .d_write = altera_avgen_write, + .d_name = "altera_avgen", +}; + +static int +altera_avgen_read(struct cdev *dev, struct uio *uio, int flag) +{ + struct altera_avgen_softc *sc; + u_long offset, size; +#ifdef NOTYET + uint64_t v8; +#endif + uint32_t v4; + uint16_t v2; + uint8_t v1; + u_int width; + int error; + + sc = dev->si_drv1; + if ((sc->avg_flags & ALTERA_AVALON_FLAG_READ) == 0) + return (EACCES); + width = sc->avg_width; + if (uio->uio_offset < 0 || uio->uio_offset % width != 0 || + uio->uio_resid % width != 0) + return (ENODEV); + size = rman_get_size(sc->avg_res); + if ((uio->uio_offset + uio->uio_resid < 0) || + (uio->uio_offset + uio->uio_resid > size)) + return (ENODEV); + while (uio->uio_resid > 0) { + offset = uio->uio_offset; + if (offset + width > size) + return (ENODEV); + switch (width) { + case 1: + v1 = bus_read_1(sc->avg_res, offset); + error = uiomove(&v1, sizeof(v1), uio); + break; + + case 2: + v2 = bus_read_2(sc->avg_res, offset); + error = uiomove(&v2, sizeof(v2), uio); + break; + + case 4: + v4 = bus_read_4(sc->avg_res, offset); + error = uiomove(&v4, sizeof(v4), uio); + break; + +#ifdef NOTYET + case 8: + v8 = bus_read_8(sc->avg_res, offset); + error = uiomove(&v8, sizeof(v8), uio); + break; + +#endif + + default: + panic("%s: unexpected widthment %u", __func__, width); + } + if (error) + return (error); + } + return (0); +} + +static int +altera_avgen_write(struct cdev *dev, struct uio *uio, int flag) +{ + struct altera_avgen_softc *sc; + u_long offset, size; +#ifdef NOTYET + uint64_t v8; +#endif + uint32_t v4; + uint16_t v2; + uint8_t v1; + u_int width; + int error; + + sc = dev->si_drv1; + if ((sc->avg_flags & ALTERA_AVALON_FLAG_WRITE) == 0) + return (EACCES); + width = sc->avg_width; + if (uio->uio_offset < 0 || uio->uio_offset % width != 0 || + uio->uio_resid % width != 0) + return (ENODEV); + size = rman_get_size(sc->avg_res); + while (uio->uio_resid > 0) { + offset = uio->uio_offset; + if (offset + width > size) + return (ENODEV); + switch (width) { + case 1: + error = uiomove(&v1, sizeof(v1), uio); + if (error) + return (error); + bus_write_1(sc->avg_res, offset, v1); + break; + + case 2: + error = uiomove(&v2, sizeof(v2), uio); + if (error) + return (error); + bus_write_2(sc->avg_res, offset, v2); + break; + + case 4: + error = uiomove(&v4, sizeof(v4), uio); + if (error) + return (error); + bus_write_4(sc->avg_res, offset, v4); + break; + +#ifdef NOTYET + case 8: + error = uiomove(&v8, sizeof(v8), uio); + if (error) + return (error); + bus_write_8(sc->avg_res, offset, v8); + break; +#endif + + default: + panic("%s: unexpected width %u", __func__, width); + } + } + return (0); +} + +static int +altera_avgen_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, + int nprot, vm_memattr_t *memattr) +{ + struct altera_avgen_softc *sc; + + sc = dev->si_drv1; + if (nprot & VM_PROT_READ) { + if ((sc->avg_flags & ALTERA_AVALON_FLAG_MMAP_READ) == 0) + return (EACCES); + } + if (nprot & VM_PROT_WRITE) { + if ((sc->avg_flags & ALTERA_AVALON_FLAG_MMAP_WRITE) == 0) + return (EACCES); + } + if (nprot & VM_PROT_EXECUTE) { + if ((sc->avg_flags & ALTERA_AVALON_FLAG_MMAP_EXEC) == 0) + return (EACCES); + } + if (trunc_page(offset) == offset && + rman_get_size(sc->avg_res) >= offset + PAGE_SIZE) { + *paddr = rman_get_start(sc->avg_res) + offset; + *memattr = VM_MEMATTR_UNCACHEABLE; + } else + return (ENODEV); + return (0); +} + +static int +altera_avgen_nexus_probe(device_t dev) +{ + + device_set_desc(dev, "Generic Altera Avalon device attachment"); + return (BUS_PROBE_DEFAULT); +} + +static int +altera_avgen_process_options(struct altera_avgen_softc *sc, + const char *str_fileio, const char *str_mmapio, const char *str_devname, + int devunit) +{ + const char *cp; + device_t dev = sc->avg_dev; + + /* + * Check for valid combinations of options. + */ + if (str_fileio == NULL && str_mmapio == NULL) { + device_printf(dev, + "at least one of %s or %s must be specified\n", + ALTERA_AVALON_STR_FILEIO, ALTERA_AVALON_STR_MMAPIO); + return (ENXIO); + } + if (str_devname == NULL && devunit != -1) { + device_printf(dev, "%s requires %s be specified\n", + ALTERA_AVALON_STR_DEVUNIT, ALTERA_AVALON_STR_DEVNAME); + return (ENXIO); + } + + /* + * Extract, digest, and save values. + */ + switch (sc->avg_width) { + case 1: + case 2: + case 4: +#ifdef NOTYET + case 8: +#endif + break; + + default: + device_printf(dev, "%s unsupported value %u\n", + ALTERA_AVALON_STR_WIDTH, sc->avg_width); + return (ENXIO); + } + sc->avg_flags = 0; + if (str_fileio != NULL) { + for (cp = str_fileio; *cp != '\0'; cp++) { + switch (*cp) { + case ALTERA_AVALON_CHAR_READ: + sc->avg_flags |= ALTERA_AVALON_FLAG_READ; + break; + + case ALTERA_AVALON_CHAR_WRITE: + sc->avg_flags |= ALTERA_AVALON_FLAG_WRITE; + break; + + default: + device_printf(dev, + "invalid %s character %c\n", + ALTERA_AVALON_STR_FILEIO, *cp); + return (ENXIO); + } + } + } + if (str_mmapio != NULL) { + for (cp = str_mmapio; *cp != '\0'; cp++) { + switch (*cp) { + case ALTERA_AVALON_CHAR_READ: + sc->avg_flags |= ALTERA_AVALON_FLAG_MMAP_READ; + break; + + case ALTERA_AVALON_CHAR_WRITE: + sc->avg_flags |= + ALTERA_AVALON_FLAG_MMAP_WRITE; + break; + + case ALTERA_AVALON_CHAR_EXEC: + sc->avg_flags |= ALTERA_AVALON_FLAG_MMAP_EXEC; + break; + + default: + device_printf(dev, + "invalid %s character %c\n", + ALTERA_AVALON_STR_MMAPIO, *cp); + return (ENXIO); + } + } + } + return (0); +} + +static int +altera_avgen_nexus_attach(device_t dev) +{ + struct altera_avgen_softc *sc; + const char *str_fileio, *str_mmapio; + const char *str_devname; + char devname[SPECNAMELEN + 1]; + int devunit, error; + + sc = device_get_softc(dev); + sc->avg_dev = dev; + sc->avg_unit = device_get_unit(dev); + + /* + * Query non-standard hints to find out what operations are permitted + * on the device, and whether it is cached. + */ + str_fileio = NULL; + str_mmapio = NULL; + str_devname = NULL; + devunit = -1; + sc->avg_width = 1; + error = resource_int_value(device_get_name(dev), device_get_unit(dev), + ALTERA_AVALON_STR_WIDTH, &sc->avg_width); + if (error != 0 && error != ENOENT) { + device_printf(dev, "invalid %s\n", ALTERA_AVALON_STR_WIDTH); + return (error); + } + (void)resource_string_value(device_get_name(dev), + device_get_unit(dev), ALTERA_AVALON_STR_FILEIO, &str_fileio); + (void)resource_string_value(device_get_name(dev), + device_get_unit(dev), ALTERA_AVALON_STR_MMAPIO, &str_mmapio); + (void)resource_string_value(device_get_name(dev), + device_get_unit(dev), ALTERA_AVALON_STR_DEVNAME, &str_devname); + (void)resource_int_value(device_get_name(dev), device_get_unit(dev), + ALTERA_AVALON_STR_DEVUNIT, &devunit); + error = altera_avgen_process_options(sc, str_fileio, str_mmapio, + str_devname, devunit); + if (error) + return (error); + + /* Select a device name. */ + if (str_devname != NULL) { + if (devunit != -1) + (void)snprintf(devname, sizeof(devname), "%s%d", + str_devname, devunit); + else + (void)snprintf(devname, sizeof(devname), "%s", + str_devname); + } else + snprintf(devname, sizeof(devname), "%s%d", "avgen", + sc->avg_unit); + + /* Memory allocation and checking. */ + sc->avg_rid = 0; + sc->avg_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->avg_rid, RF_ACTIVE); + if (sc->avg_res == NULL) { + device_printf(dev, "couldn't map memory\n"); + return (ENXIO); + } + if (rman_get_size(sc->avg_res) >= PAGE_SIZE || str_mmapio != NULL) { + if (rman_get_size(sc->avg_res) % PAGE_SIZE != 0) { + device_printf(dev, + "memory region not even multiple of page size\n"); + error = ENXIO; + goto error; + } + if (rman_get_start(sc->avg_res) % PAGE_SIZE != 0) { + device_printf(dev, "memory region not page-aligned\n"); + error = ENXIO; + goto error; + } + } + + /* Device node allocation. */ + if (str_devname == NULL) { + str_devname = "altera_avgen%d"; + devunit = sc->avg_unit; + } + if (devunit != -1) + sc->avg_cdev = make_dev(&avg_cdevsw, sc->avg_unit, UID_ROOT, + GID_WHEEL, S_IRUSR | S_IWUSR, str_devname, devunit); + else + sc->avg_cdev = make_dev(&avg_cdevsw, sc->avg_unit, UID_ROOT, + GID_WHEEL, S_IRUSR | S_IWUSR, str_devname); + if (sc->avg_cdev == NULL) { + device_printf(sc->avg_dev, "%s: make_dev failed\n", __func__); + error = ENXIO; + goto error; + } + /* XXXRW: Slight race between make_dev(9) and here. */ + sc->avg_cdev->si_drv1 = sc; + return (0); + +error: + bus_release_resource(dev, SYS_RES_MEMORY, sc->avg_rid, sc->avg_res); + return (error); +} + +static int +altera_avgen_nexus_detach(device_t dev) +{ + struct altera_avgen_softc *sc; + + sc = device_get_softc(dev); + destroy_dev(sc->avg_cdev); + bus_release_resource(dev, SYS_RES_MEMORY, sc->avg_rid, sc->avg_res); + return (0); +} + +static device_method_t altera_avgen_nexus_methods[] = { + DEVMETHOD(device_probe, altera_avgen_nexus_probe), + DEVMETHOD(device_attach, altera_avgen_nexus_attach), + DEVMETHOD(device_detach, altera_avgen_nexus_detach), + { 0, 0 } +}; + +static driver_t altera_avgen_nexus_driver = { + "altera_avgen", + altera_avgen_nexus_methods, + sizeof(struct altera_avgen_softc), +}; + +static devclass_t altera_avgen_devclass; + +DRIVER_MODULE(avgen, nexus, altera_avgen_nexus_driver, altera_avgen_devclass, + 0, 0); From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 16:44:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CF7077D0; Sun, 13 Jan 2013 16:44:00 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C0EDEE7F; Sun, 13 Jan 2013 16:44:00 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DGi0k8016945; Sun, 13 Jan 2013 16:44:00 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DGi0nw016938; Sun, 13 Jan 2013 16:44:00 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201301131644.r0DGi0nw016938@svn.freebsd.org> From: Robert Watson Date: Sun, 13 Jan 2013 16:44:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245376 - in head/sys: conf dev/altera/avgen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 16:44:00 -0000 Author: rwatson Date: Sun Jan 13 16:43:59 2013 New Revision: 245376 URL: http://svnweb.freebsd.org/changeset/base/245376 Log: Merge Perforce changeset 219940 to head: Rework altera_avgen(4) to cleanly(ish) separate nexus bus attachment from the driver itself. This should allow us to plug in an fdt attachment more easily. Sponsored by: DARPA, AFRL Modified: head/sys/conf/files head/sys/dev/altera/avgen/altera_avgen.c head/sys/dev/altera/avgen/altera_avgen.h head/sys/dev/altera/avgen/altera_avgen_nexus.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jan 13 16:41:25 2013 (r245375) +++ head/sys/conf/files Sun Jan 13 16:43:59 2013 (r245376) @@ -638,6 +638,7 @@ dev/aic7xxx/aic7xxx_pci.c optional ahc p dev/alc/if_alc.c optional alc pci dev/ale/if_ale.c optional ale pci dev/altera/avgen/altera_avgen.c optional altera_avgen +dev/altera/avgen/altera_avgen_nexus.c optional altera_avgen dev/altera/sdcard/altera_sdcard.c optional altera_sdcard dev/altera/sdcard/altera_sdcard_disk.c optional altera_sdcard dev/altera/sdcard/altera_sdcard_io.c optional altera_sdcard Modified: head/sys/dev/altera/avgen/altera_avgen.c ============================================================================== --- head/sys/dev/altera/avgen/altera_avgen.c Sun Jan 13 16:41:25 2013 (r245375) +++ head/sys/dev/altera/avgen/altera_avgen.c Sun Jan 13 16:43:59 2013 (r245376) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Robert N. M. Watson + * Copyright (c) 2012-2013 Robert N. M. Watson * All rights reserved. * * This software was developed by SRI International and the University of @@ -226,13 +226,6 @@ altera_avgen_mmap(struct cdev *dev, vm_o return (0); } -static int -altera_avgen_nexus_probe(device_t dev) -{ - - device_set_desc(dev, "Generic Altera Avalon device attachment"); - return (BUS_PROBE_DEFAULT); -} static int altera_avgen_process_options(struct altera_avgen_softc *sc, @@ -321,42 +314,14 @@ altera_avgen_process_options(struct alte return (0); } -static int -altera_avgen_nexus_attach(device_t dev) +int +altera_avgen_attach(struct altera_avgen_softc *sc, const char *str_fileio, + const char *str_mmapio, const char *str_devname, int devunit) { - struct altera_avgen_softc *sc; - const char *str_fileio, *str_mmapio; - const char *str_devname; + device_t dev = sc->avg_dev; char devname[SPECNAMELEN + 1]; - int devunit, error; - - sc = device_get_softc(dev); - sc->avg_dev = dev; - sc->avg_unit = device_get_unit(dev); + int error; - /* - * Query non-standard hints to find out what operations are permitted - * on the device, and whether it is cached. - */ - str_fileio = NULL; - str_mmapio = NULL; - str_devname = NULL; - devunit = -1; - sc->avg_width = 1; - error = resource_int_value(device_get_name(dev), device_get_unit(dev), - ALTERA_AVALON_STR_WIDTH, &sc->avg_width); - if (error != 0 && error != ENOENT) { - device_printf(dev, "invalid %s\n", ALTERA_AVALON_STR_WIDTH); - return (error); - } - (void)resource_string_value(device_get_name(dev), - device_get_unit(dev), ALTERA_AVALON_STR_FILEIO, &str_fileio); - (void)resource_string_value(device_get_name(dev), - device_get_unit(dev), ALTERA_AVALON_STR_MMAPIO, &str_mmapio); - (void)resource_string_value(device_get_name(dev), - device_get_unit(dev), ALTERA_AVALON_STR_DEVNAME, &str_devname); - (void)resource_int_value(device_get_name(dev), device_get_unit(dev), - ALTERA_AVALON_STR_DEVUNIT, &devunit); error = altera_avgen_process_options(sc, str_fileio, str_mmapio, str_devname, devunit); if (error) @@ -374,25 +339,15 @@ altera_avgen_nexus_attach(device_t dev) snprintf(devname, sizeof(devname), "%s%d", "avgen", sc->avg_unit); - /* Memory allocation and checking. */ - sc->avg_rid = 0; - sc->avg_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &sc->avg_rid, RF_ACTIVE); - if (sc->avg_res == NULL) { - device_printf(dev, "couldn't map memory\n"); - return (ENXIO); - } if (rman_get_size(sc->avg_res) >= PAGE_SIZE || str_mmapio != NULL) { if (rman_get_size(sc->avg_res) % PAGE_SIZE != 0) { device_printf(dev, "memory region not even multiple of page size\n"); - error = ENXIO; - goto error; + return (ENXIO); } if (rman_get_start(sc->avg_res) % PAGE_SIZE != 0) { device_printf(dev, "memory region not page-aligned\n"); - error = ENXIO; - goto error; + return (ENXIO); } } @@ -409,43 +364,16 @@ altera_avgen_nexus_attach(device_t dev) GID_WHEEL, S_IRUSR | S_IWUSR, str_devname); if (sc->avg_cdev == NULL) { device_printf(sc->avg_dev, "%s: make_dev failed\n", __func__); - error = ENXIO; - goto error; + return (ENXIO); } /* XXXRW: Slight race between make_dev(9) and here. */ sc->avg_cdev->si_drv1 = sc; return (0); - -error: - bus_release_resource(dev, SYS_RES_MEMORY, sc->avg_rid, sc->avg_res); - return (error); } -static int -altera_avgen_nexus_detach(device_t dev) +void +altera_avgen_detach(struct altera_avgen_softc *sc) { - struct altera_avgen_softc *sc; - sc = device_get_softc(dev); destroy_dev(sc->avg_cdev); - bus_release_resource(dev, SYS_RES_MEMORY, sc->avg_rid, sc->avg_res); - return (0); } - -static device_method_t altera_avgen_nexus_methods[] = { - DEVMETHOD(device_probe, altera_avgen_nexus_probe), - DEVMETHOD(device_attach, altera_avgen_nexus_attach), - DEVMETHOD(device_detach, altera_avgen_nexus_detach), - { 0, 0 } -}; - -static driver_t altera_avgen_nexus_driver = { - "altera_avgen", - altera_avgen_nexus_methods, - sizeof(struct altera_avgen_softc), -}; - -static devclass_t altera_avgen_devclass; - -DRIVER_MODULE(avgen, nexus, altera_avgen_nexus_driver, altera_avgen_devclass, - 0, 0); Modified: head/sys/dev/altera/avgen/altera_avgen.h ============================================================================== --- head/sys/dev/altera/avgen/altera_avgen.h Sun Jan 13 16:41:25 2013 (r245375) +++ head/sys/dev/altera/avgen/altera_avgen.h Sun Jan 13 16:43:59 2013 (r245376) @@ -77,7 +77,9 @@ struct altera_avgen_softc { /* * Driver setup routines from the bus attachment/teardown. */ -int altera_avgen_attach(struct altera_avgen_softc *sc); +int altera_avgen_attach(struct altera_avgen_softc *sc, + const char *str_fileio, const char *str_mmapio, + const char *str_devname, int devunit); void altera_avgen_detach(struct altera_avgen_softc *sc); #endif /* _DEV_ALTERA_AVALON_H_ */ Modified: head/sys/dev/altera/avgen/altera_avgen_nexus.c ============================================================================== --- head/sys/dev/altera/avgen/altera_avgen_nexus.c Sun Jan 13 16:41:25 2013 (r245375) +++ head/sys/dev/altera/avgen/altera_avgen_nexus.c Sun Jan 13 16:43:59 2013 (r245376) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Robert N. M. Watson + * Copyright (c) 2012-2013 Robert N. M. Watson * All rights reserved. * * This software was developed by SRI International and the University of @@ -53,179 +53,6 @@ __FBSDID("$FreeBSD$"); #include -/* - * Generic device driver for allowing read(), write(), and mmap() on - * memory-mapped, Avalon-attached devices. There is no actual dependence on - * Avalon, so conceivably this should just be soc_dev or similar, since many - * system-on-chip bus environments would work fine with the same code. - */ - -static d_mmap_t altera_avgen_mmap; -static d_read_t altera_avgen_read; -static d_write_t altera_avgen_write; - -static struct cdevsw avg_cdevsw = { - .d_version = D_VERSION, - .d_mmap = altera_avgen_mmap, - .d_read = altera_avgen_read, - .d_write = altera_avgen_write, - .d_name = "altera_avgen", -}; - -static int -altera_avgen_read(struct cdev *dev, struct uio *uio, int flag) -{ - struct altera_avgen_softc *sc; - u_long offset, size; -#ifdef NOTYET - uint64_t v8; -#endif - uint32_t v4; - uint16_t v2; - uint8_t v1; - u_int width; - int error; - - sc = dev->si_drv1; - if ((sc->avg_flags & ALTERA_AVALON_FLAG_READ) == 0) - return (EACCES); - width = sc->avg_width; - if (uio->uio_offset < 0 || uio->uio_offset % width != 0 || - uio->uio_resid % width != 0) - return (ENODEV); - size = rman_get_size(sc->avg_res); - if ((uio->uio_offset + uio->uio_resid < 0) || - (uio->uio_offset + uio->uio_resid > size)) - return (ENODEV); - while (uio->uio_resid > 0) { - offset = uio->uio_offset; - if (offset + width > size) - return (ENODEV); - switch (width) { - case 1: - v1 = bus_read_1(sc->avg_res, offset); - error = uiomove(&v1, sizeof(v1), uio); - break; - - case 2: - v2 = bus_read_2(sc->avg_res, offset); - error = uiomove(&v2, sizeof(v2), uio); - break; - - case 4: - v4 = bus_read_4(sc->avg_res, offset); - error = uiomove(&v4, sizeof(v4), uio); - break; - -#ifdef NOTYET - case 8: - v8 = bus_read_8(sc->avg_res, offset); - error = uiomove(&v8, sizeof(v8), uio); - break; - -#endif - - default: - panic("%s: unexpected widthment %u", __func__, width); - } - if (error) - return (error); - } - return (0); -} - -static int -altera_avgen_write(struct cdev *dev, struct uio *uio, int flag) -{ - struct altera_avgen_softc *sc; - u_long offset, size; -#ifdef NOTYET - uint64_t v8; -#endif - uint32_t v4; - uint16_t v2; - uint8_t v1; - u_int width; - int error; - - sc = dev->si_drv1; - if ((sc->avg_flags & ALTERA_AVALON_FLAG_WRITE) == 0) - return (EACCES); - width = sc->avg_width; - if (uio->uio_offset < 0 || uio->uio_offset % width != 0 || - uio->uio_resid % width != 0) - return (ENODEV); - size = rman_get_size(sc->avg_res); - while (uio->uio_resid > 0) { - offset = uio->uio_offset; - if (offset + width > size) - return (ENODEV); - switch (width) { - case 1: - error = uiomove(&v1, sizeof(v1), uio); - if (error) - return (error); - bus_write_1(sc->avg_res, offset, v1); - break; - - case 2: - error = uiomove(&v2, sizeof(v2), uio); - if (error) - return (error); - bus_write_2(sc->avg_res, offset, v2); - break; - - case 4: - error = uiomove(&v4, sizeof(v4), uio); - if (error) - return (error); - bus_write_4(sc->avg_res, offset, v4); - break; - -#ifdef NOTYET - case 8: - error = uiomove(&v8, sizeof(v8), uio); - if (error) - return (error); - bus_write_8(sc->avg_res, offset, v8); - break; -#endif - - default: - panic("%s: unexpected width %u", __func__, width); - } - } - return (0); -} - -static int -altera_avgen_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, - int nprot, vm_memattr_t *memattr) -{ - struct altera_avgen_softc *sc; - - sc = dev->si_drv1; - if (nprot & VM_PROT_READ) { - if ((sc->avg_flags & ALTERA_AVALON_FLAG_MMAP_READ) == 0) - return (EACCES); - } - if (nprot & VM_PROT_WRITE) { - if ((sc->avg_flags & ALTERA_AVALON_FLAG_MMAP_WRITE) == 0) - return (EACCES); - } - if (nprot & VM_PROT_EXECUTE) { - if ((sc->avg_flags & ALTERA_AVALON_FLAG_MMAP_EXEC) == 0) - return (EACCES); - } - if (trunc_page(offset) == offset && - rman_get_size(sc->avg_res) >= offset + PAGE_SIZE) { - *paddr = rman_get_start(sc->avg_res) + offset; - *memattr = VM_MEMATTR_UNCACHEABLE; - } else - return (ENODEV); - return (0); -} - static int altera_avgen_nexus_probe(device_t dev) { @@ -235,99 +62,11 @@ altera_avgen_nexus_probe(device_t dev) } static int -altera_avgen_process_options(struct altera_avgen_softc *sc, - const char *str_fileio, const char *str_mmapio, const char *str_devname, - int devunit) -{ - const char *cp; - device_t dev = sc->avg_dev; - - /* - * Check for valid combinations of options. - */ - if (str_fileio == NULL && str_mmapio == NULL) { - device_printf(dev, - "at least one of %s or %s must be specified\n", - ALTERA_AVALON_STR_FILEIO, ALTERA_AVALON_STR_MMAPIO); - return (ENXIO); - } - if (str_devname == NULL && devunit != -1) { - device_printf(dev, "%s requires %s be specified\n", - ALTERA_AVALON_STR_DEVUNIT, ALTERA_AVALON_STR_DEVNAME); - return (ENXIO); - } - - /* - * Extract, digest, and save values. - */ - switch (sc->avg_width) { - case 1: - case 2: - case 4: -#ifdef NOTYET - case 8: -#endif - break; - - default: - device_printf(dev, "%s unsupported value %u\n", - ALTERA_AVALON_STR_WIDTH, sc->avg_width); - return (ENXIO); - } - sc->avg_flags = 0; - if (str_fileio != NULL) { - for (cp = str_fileio; *cp != '\0'; cp++) { - switch (*cp) { - case ALTERA_AVALON_CHAR_READ: - sc->avg_flags |= ALTERA_AVALON_FLAG_READ; - break; - - case ALTERA_AVALON_CHAR_WRITE: - sc->avg_flags |= ALTERA_AVALON_FLAG_WRITE; - break; - - default: - device_printf(dev, - "invalid %s character %c\n", - ALTERA_AVALON_STR_FILEIO, *cp); - return (ENXIO); - } - } - } - if (str_mmapio != NULL) { - for (cp = str_mmapio; *cp != '\0'; cp++) { - switch (*cp) { - case ALTERA_AVALON_CHAR_READ: - sc->avg_flags |= ALTERA_AVALON_FLAG_MMAP_READ; - break; - - case ALTERA_AVALON_CHAR_WRITE: - sc->avg_flags |= - ALTERA_AVALON_FLAG_MMAP_WRITE; - break; - - case ALTERA_AVALON_CHAR_EXEC: - sc->avg_flags |= ALTERA_AVALON_FLAG_MMAP_EXEC; - break; - - default: - device_printf(dev, - "invalid %s character %c\n", - ALTERA_AVALON_STR_MMAPIO, *cp); - return (ENXIO); - } - } - } - return (0); -} - -static int altera_avgen_nexus_attach(device_t dev) { struct altera_avgen_softc *sc; const char *str_fileio, *str_mmapio; const char *str_devname; - char devname[SPECNAMELEN + 1]; int devunit, error; sc = device_get_softc(dev); @@ -357,22 +96,6 @@ altera_avgen_nexus_attach(device_t dev) device_get_unit(dev), ALTERA_AVALON_STR_DEVNAME, &str_devname); (void)resource_int_value(device_get_name(dev), device_get_unit(dev), ALTERA_AVALON_STR_DEVUNIT, &devunit); - error = altera_avgen_process_options(sc, str_fileio, str_mmapio, - str_devname, devunit); - if (error) - return (error); - - /* Select a device name. */ - if (str_devname != NULL) { - if (devunit != -1) - (void)snprintf(devname, sizeof(devname), "%s%d", - str_devname, devunit); - else - (void)snprintf(devname, sizeof(devname), "%s", - str_devname); - } else - snprintf(devname, sizeof(devname), "%s%d", "avgen", - sc->avg_unit); /* Memory allocation and checking. */ sc->avg_rid = 0; @@ -382,42 +105,11 @@ altera_avgen_nexus_attach(device_t dev) device_printf(dev, "couldn't map memory\n"); return (ENXIO); } - if (rman_get_size(sc->avg_res) >= PAGE_SIZE || str_mmapio != NULL) { - if (rman_get_size(sc->avg_res) % PAGE_SIZE != 0) { - device_printf(dev, - "memory region not even multiple of page size\n"); - error = ENXIO; - goto error; - } - if (rman_get_start(sc->avg_res) % PAGE_SIZE != 0) { - device_printf(dev, "memory region not page-aligned\n"); - error = ENXIO; - goto error; - } - } - - /* Device node allocation. */ - if (str_devname == NULL) { - str_devname = "altera_avgen%d"; - devunit = sc->avg_unit; - } - if (devunit != -1) - sc->avg_cdev = make_dev(&avg_cdevsw, sc->avg_unit, UID_ROOT, - GID_WHEEL, S_IRUSR | S_IWUSR, str_devname, devunit); - else - sc->avg_cdev = make_dev(&avg_cdevsw, sc->avg_unit, UID_ROOT, - GID_WHEEL, S_IRUSR | S_IWUSR, str_devname); - if (sc->avg_cdev == NULL) { - device_printf(sc->avg_dev, "%s: make_dev failed\n", __func__); - error = ENXIO; - goto error; - } - /* XXXRW: Slight race between make_dev(9) and here. */ - sc->avg_cdev->si_drv1 = sc; - return (0); - -error: - bus_release_resource(dev, SYS_RES_MEMORY, sc->avg_rid, sc->avg_res); + error = altera_avgen_attach(sc, str_fileio, str_mmapio, str_devname, + devunit); + if (error != 0) + bus_release_resource(dev, SYS_RES_MEMORY, sc->avg_rid, + sc->avg_res); return (error); } @@ -427,7 +119,7 @@ altera_avgen_nexus_detach(device_t dev) struct altera_avgen_softc *sc; sc = device_get_softc(dev); - destroy_dev(sc->avg_cdev); + altera_avgen_detach(sc); bus_release_resource(dev, SYS_RES_MEMORY, sc->avg_rid, sc->avg_res); return (0); } From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 16:44:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 955EF94C; Sun, 13 Jan 2013 16:44:46 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 79068E8A; Sun, 13 Jan 2013 16:44:46 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DGikgF017068; Sun, 13 Jan 2013 16:44:46 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DGikj7017067; Sun, 13 Jan 2013 16:44:46 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201301131644.r0DGikj7017067@svn.freebsd.org> From: Robert Watson Date: Sun, 13 Jan 2013 16:44:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245377 - head/sys/dev/altera/avgen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 16:44:46 -0000 Author: rwatson Date: Sun Jan 13 16:44:45 2013 New Revision: 245377 URL: http://svnweb.freebsd.org/changeset/base/245377 Log: Merge Perforce changeset 219941 to head: Copy altera_avgen(4) nexus attachment as a starting point for an FDT attachment. Sponsored by: DARPA, AFRL Added: head/sys/dev/altera/avgen/altera_avgen_fdt.c - copied unchanged from r245376, head/sys/dev/altera/avgen/altera_avgen_nexus.c Copied: head/sys/dev/altera/avgen/altera_avgen_fdt.c (from r245376, head/sys/dev/altera/avgen/altera_avgen_nexus.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/avgen/altera_avgen_fdt.c Sun Jan 13 16:44:45 2013 (r245377, copy of r245376, head/sys/dev/altera/avgen/altera_avgen_nexus.c) @@ -0,0 +1,143 @@ +/*- + * Copyright (c) 2012-2013 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include + +static int +altera_avgen_nexus_probe(device_t dev) +{ + + device_set_desc(dev, "Generic Altera Avalon device attachment"); + return (BUS_PROBE_DEFAULT); +} + +static int +altera_avgen_nexus_attach(device_t dev) +{ + struct altera_avgen_softc *sc; + const char *str_fileio, *str_mmapio; + const char *str_devname; + int devunit, error; + + sc = device_get_softc(dev); + sc->avg_dev = dev; + sc->avg_unit = device_get_unit(dev); + + /* + * Query non-standard hints to find out what operations are permitted + * on the device, and whether it is cached. + */ + str_fileio = NULL; + str_mmapio = NULL; + str_devname = NULL; + devunit = -1; + sc->avg_width = 1; + error = resource_int_value(device_get_name(dev), device_get_unit(dev), + ALTERA_AVALON_STR_WIDTH, &sc->avg_width); + if (error != 0 && error != ENOENT) { + device_printf(dev, "invalid %s\n", ALTERA_AVALON_STR_WIDTH); + return (error); + } + (void)resource_string_value(device_get_name(dev), + device_get_unit(dev), ALTERA_AVALON_STR_FILEIO, &str_fileio); + (void)resource_string_value(device_get_name(dev), + device_get_unit(dev), ALTERA_AVALON_STR_MMAPIO, &str_mmapio); + (void)resource_string_value(device_get_name(dev), + device_get_unit(dev), ALTERA_AVALON_STR_DEVNAME, &str_devname); + (void)resource_int_value(device_get_name(dev), device_get_unit(dev), + ALTERA_AVALON_STR_DEVUNIT, &devunit); + + /* Memory allocation and checking. */ + sc->avg_rid = 0; + sc->avg_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->avg_rid, RF_ACTIVE); + if (sc->avg_res == NULL) { + device_printf(dev, "couldn't map memory\n"); + return (ENXIO); + } + error = altera_avgen_attach(sc, str_fileio, str_mmapio, str_devname, + devunit); + if (error != 0) + bus_release_resource(dev, SYS_RES_MEMORY, sc->avg_rid, + sc->avg_res); + return (error); +} + +static int +altera_avgen_nexus_detach(device_t dev) +{ + struct altera_avgen_softc *sc; + + sc = device_get_softc(dev); + altera_avgen_detach(sc); + bus_release_resource(dev, SYS_RES_MEMORY, sc->avg_rid, sc->avg_res); + return (0); +} + +static device_method_t altera_avgen_nexus_methods[] = { + DEVMETHOD(device_probe, altera_avgen_nexus_probe), + DEVMETHOD(device_attach, altera_avgen_nexus_attach), + DEVMETHOD(device_detach, altera_avgen_nexus_detach), + { 0, 0 } +}; + +static driver_t altera_avgen_nexus_driver = { + "altera_avgen", + altera_avgen_nexus_methods, + sizeof(struct altera_avgen_softc), +}; + +static devclass_t altera_avgen_devclass; + +DRIVER_MODULE(avgen, nexus, altera_avgen_nexus_driver, altera_avgen_devclass, + 0, 0); From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 16:51:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id ABCE8B36; Sun, 13 Jan 2013 16:51:58 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8F31DEBD; Sun, 13 Jan 2013 16:51:58 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DGpwut019581; Sun, 13 Jan 2013 16:51:58 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DGpw3m019579; Sun, 13 Jan 2013 16:51:58 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201301131651.r0DGpw3m019579@svn.freebsd.org> From: Robert Watson Date: Sun, 13 Jan 2013 16:51:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245378 - in head/sys: conf dev/altera/avgen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 16:51:58 -0000 Author: rwatson Date: Sun Jan 13 16:51:57 2013 New Revision: 245378 URL: http://svnweb.freebsd.org/changeset/base/245378 Log: Partially merge Perforce changeset 219942 to head: Implement an FDT attachment for altera_avgen(4). Portions of the changeset updating DTS and device.hints will be merged separately. Sponsored by: DARPA, AFRL Modified: head/sys/conf/files head/sys/dev/altera/avgen/altera_avgen_fdt.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jan 13 16:44:45 2013 (r245377) +++ head/sys/conf/files Sun Jan 13 16:51:57 2013 (r245378) @@ -638,6 +638,7 @@ dev/aic7xxx/aic7xxx_pci.c optional ahc p dev/alc/if_alc.c optional alc pci dev/ale/if_ale.c optional ale pci dev/altera/avgen/altera_avgen.c optional altera_avgen +dev/altera/avgen/altera_avgen_fdt.c optional altera_avgen fdt dev/altera/avgen/altera_avgen_nexus.c optional altera_avgen dev/altera/sdcard/altera_sdcard.c optional altera_sdcard dev/altera/sdcard/altera_sdcard_disk.c optional altera_sdcard Modified: head/sys/dev/altera/avgen/altera_avgen_fdt.c ============================================================================== --- head/sys/dev/altera/avgen/altera_avgen_fdt.c Sun Jan 13 16:44:45 2013 (r245377) +++ head/sys/dev/altera/avgen/altera_avgen_fdt.c Sun Jan 13 16:51:57 2013 (r245378) @@ -51,22 +51,32 @@ __FBSDID("$FreeBSD$"); #include +#include +#include +#include +#include + #include static int -altera_avgen_nexus_probe(device_t dev) +altera_avgen_fdt_probe(device_t dev) { - device_set_desc(dev, "Generic Altera Avalon device attachment"); - return (BUS_PROBE_DEFAULT); + if (ofw_bus_is_compatible(dev, "sri-cambridge,avgen")) { + device_set_desc(dev, "Generic Altera Avalon device attachment"); + return (BUS_PROBE_DEFAULT); + } + return (ENXIO); } static int -altera_avgen_nexus_attach(device_t dev) +altera_avgen_fdt_attach(device_t dev) { struct altera_avgen_softc *sc; - const char *str_fileio, *str_mmapio; - const char *str_devname; + char *str_fileio, *str_mmapio; + char *str_devname; + phandle_t node; + pcell_t cell; int devunit, error; sc = device_get_softc(dev); @@ -74,28 +84,25 @@ altera_avgen_nexus_attach(device_t dev) sc->avg_unit = device_get_unit(dev); /* - * Query non-standard hints to find out what operations are permitted - * on the device, and whether it is cached. + * Query driver-specific OpenFirmware properties to determine how to + * expose the device via /dev. */ str_fileio = NULL; str_mmapio = NULL; str_devname = NULL; devunit = -1; sc->avg_width = 1; - error = resource_int_value(device_get_name(dev), device_get_unit(dev), - ALTERA_AVALON_STR_WIDTH, &sc->avg_width); - if (error != 0 && error != ENOENT) { - device_printf(dev, "invalid %s\n", ALTERA_AVALON_STR_WIDTH); - return (error); - } - (void)resource_string_value(device_get_name(dev), - device_get_unit(dev), ALTERA_AVALON_STR_FILEIO, &str_fileio); - (void)resource_string_value(device_get_name(dev), - device_get_unit(dev), ALTERA_AVALON_STR_MMAPIO, &str_mmapio); - (void)resource_string_value(device_get_name(dev), - device_get_unit(dev), ALTERA_AVALON_STR_DEVNAME, &str_devname); - (void)resource_int_value(device_get_name(dev), device_get_unit(dev), - ALTERA_AVALON_STR_DEVUNIT, &devunit); + node = ofw_bus_get_node(dev); + if (OF_getprop(node, "sri-cambridge,width", &cell, sizeof(cell)) > 0) + sc->avg_width = cell; + (void)OF_getprop_alloc(node, "sri-cambridge,fileio", sizeof(char), + (void **)&str_fileio); + (void)OF_getprop_alloc(node, "sri-cambridge,mmapio", sizeof(char), + (void **)&str_mmapio); + (void)OF_getprop_alloc(node, "sri-cambridge,devname", sizeof(char), + (void **)&str_devname); + if (OF_getprop(node, "sri-cambridge,devunit", &cell, sizeof(cell)) > 0) + devunit = cell; /* Memory allocation and checking. */ sc->avg_rid = 0; @@ -110,11 +117,17 @@ altera_avgen_nexus_attach(device_t dev) if (error != 0) bus_release_resource(dev, SYS_RES_MEMORY, sc->avg_rid, sc->avg_res); + if (str_fileio != NULL) + free(str_fileio, M_OFWPROP); + if (str_mmapio != NULL) + free(str_mmapio, M_OFWPROP); + if (str_devname != NULL) + free(str_devname, M_OFWPROP); return (error); } static int -altera_avgen_nexus_detach(device_t dev) +altera_avgen_fdt_detach(device_t dev) { struct altera_avgen_softc *sc; @@ -124,20 +137,20 @@ altera_avgen_nexus_detach(device_t dev) return (0); } -static device_method_t altera_avgen_nexus_methods[] = { - DEVMETHOD(device_probe, altera_avgen_nexus_probe), - DEVMETHOD(device_attach, altera_avgen_nexus_attach), - DEVMETHOD(device_detach, altera_avgen_nexus_detach), +static device_method_t altera_avgen_fdt_methods[] = { + DEVMETHOD(device_probe, altera_avgen_fdt_probe), + DEVMETHOD(device_attach, altera_avgen_fdt_attach), + DEVMETHOD(device_detach, altera_avgen_fdt_detach), { 0, 0 } }; -static driver_t altera_avgen_nexus_driver = { +static driver_t altera_avgen_fdt_driver = { "altera_avgen", - altera_avgen_nexus_methods, + altera_avgen_fdt_methods, sizeof(struct altera_avgen_softc), }; static devclass_t altera_avgen_devclass; -DRIVER_MODULE(avgen, nexus, altera_avgen_nexus_driver, altera_avgen_devclass, - 0, 0); +DRIVER_MODULE(avgen, simplebus, altera_avgen_fdt_driver, + altera_avgen_devclass, 0, 0); From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 16:53:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 76354CD4; Sun, 13 Jan 2013 16:53:32 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 636C1ED5; Sun, 13 Jan 2013 16:53:32 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DGrWub019823; Sun, 13 Jan 2013 16:53:32 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DGrWYb019821; Sun, 13 Jan 2013 16:53:32 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201301131653.r0DGrWYb019821@svn.freebsd.org> From: Robert Watson Date: Sun, 13 Jan 2013 16:53:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245379 - in head/sys/dev/terasic: de4led mtl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 16:53:32 -0000 Author: rwatson Date: Sun Jan 13 16:53:31 2013 New Revision: 245379 URL: http://svnweb.freebsd.org/changeset/base/245379 Log: Partially merge Perforce changeset 219944 to head: Consistently use the vendor name "sri-cambridge" for device compatibility strings on the BERI platform. Sponsored by: DARPA, AFRL Modified: head/sys/dev/terasic/de4led/terasic_de4led_fdt.c head/sys/dev/terasic/mtl/terasic_mtl_fdt.c Modified: head/sys/dev/terasic/de4led/terasic_de4led_fdt.c ============================================================================== --- head/sys/dev/terasic/de4led/terasic_de4led_fdt.c Sun Jan 13 16:51:57 2013 (r245378) +++ head/sys/dev/terasic/de4led/terasic_de4led_fdt.c Sun Jan 13 16:53:31 2013 (r245379) @@ -62,7 +62,7 @@ static int terasic_de4led_fdt_probe(device_t dev) { - if (ofw_bus_is_compatible(dev, "cambridge,de4led")) { + if (ofw_bus_is_compatible(dev, "sri-cambridge,de4led")) { device_set_desc(dev, "Terasic DE4 8-element LED"); return (BUS_PROBE_DEFAULT); } Modified: head/sys/dev/terasic/mtl/terasic_mtl_fdt.c ============================================================================== --- head/sys/dev/terasic/mtl/terasic_mtl_fdt.c Sun Jan 13 16:51:57 2013 (r245378) +++ head/sys/dev/terasic/mtl/terasic_mtl_fdt.c Sun Jan 13 16:53:31 2013 (r245379) @@ -59,7 +59,7 @@ static int terasic_mtl_fdt_probe(device_t dev) { - if (ofw_bus_is_compatible(dev, "cambridge,mtl")) { + if (ofw_bus_is_compatible(dev, "sri-cambridge,mtl")) { device_set_desc(dev, "Terasic Multi-touch LCD (MTL)"); return (BUS_PROBE_DEFAULT); } From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 16:57:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A8777F75; Sun, 13 Jan 2013 16:57:16 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 83377F06; Sun, 13 Jan 2013 16:57:16 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DGvGxL020368; Sun, 13 Jan 2013 16:57:16 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DGvBL0020335; Sun, 13 Jan 2013 16:57:11 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201301131657.r0DGvBL0020335@svn.freebsd.org> From: Robert Watson Date: Sun, 13 Jan 2013 16:57:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245380 - in head/sys/dev: altera/avgen altera/jtag_uart altera/sdcard isf terasic/de4led terasic/mtl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 16:57:16 -0000 Author: rwatson Date: Sun Jan 13 16:57:11 2013 New Revision: 245380 URL: http://svnweb.freebsd.org/changeset/base/245380 Log: Merge Perforce changeset 219952 to head: Make different bus attachments for Altera and Terasice device drivers share the same devclass_t. Sponsored by: DARPA, AFRL Modified: head/sys/dev/altera/avgen/altera_avgen.c head/sys/dev/altera/avgen/altera_avgen.h head/sys/dev/altera/avgen/altera_avgen_fdt.c head/sys/dev/altera/avgen/altera_avgen_nexus.c head/sys/dev/altera/jtag_uart/altera_jtag_uart.h head/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c head/sys/dev/altera/jtag_uart/altera_jtag_uart_fdt.c head/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c head/sys/dev/altera/sdcard/altera_sdcard.c head/sys/dev/altera/sdcard/altera_sdcard.h head/sys/dev/altera/sdcard/altera_sdcard_fdt.c head/sys/dev/altera/sdcard/altera_sdcard_nexus.c head/sys/dev/isf/isf.c head/sys/dev/isf/isf.h head/sys/dev/isf/isf_fdt.c head/sys/dev/isf/isf_nexus.c head/sys/dev/terasic/de4led/terasic_de4led.c head/sys/dev/terasic/de4led/terasic_de4led.h head/sys/dev/terasic/de4led/terasic_de4led_fdt.c head/sys/dev/terasic/de4led/terasic_de4led_nexus.c head/sys/dev/terasic/mtl/terasic_mtl.c head/sys/dev/terasic/mtl/terasic_mtl.h head/sys/dev/terasic/mtl/terasic_mtl_fdt.c head/sys/dev/terasic/mtl/terasic_mtl_nexus.c Modified: head/sys/dev/altera/avgen/altera_avgen.c ============================================================================== --- head/sys/dev/altera/avgen/altera_avgen.c Sun Jan 13 16:53:31 2013 (r245379) +++ head/sys/dev/altera/avgen/altera_avgen.c Sun Jan 13 16:57:11 2013 (r245380) @@ -60,6 +60,8 @@ __FBSDID("$FreeBSD$"); * system-on-chip bus environments would work fine with the same code. */ +devclass_t altera_avgen_devclass; + static d_mmap_t altera_avgen_mmap; static d_read_t altera_avgen_read; static d_write_t altera_avgen_write; Modified: head/sys/dev/altera/avgen/altera_avgen.h ============================================================================== --- head/sys/dev/altera/avgen/altera_avgen.h Sun Jan 13 16:53:31 2013 (r245379) +++ head/sys/dev/altera/avgen/altera_avgen.h Sun Jan 13 16:57:11 2013 (r245380) @@ -82,4 +82,6 @@ int altera_avgen_attach(struct altera_av const char *str_devname, int devunit); void altera_avgen_detach(struct altera_avgen_softc *sc); +extern devclass_t altera_avgen_devclass; + #endif /* _DEV_ALTERA_AVALON_H_ */ Modified: head/sys/dev/altera/avgen/altera_avgen_fdt.c ============================================================================== --- head/sys/dev/altera/avgen/altera_avgen_fdt.c Sun Jan 13 16:53:31 2013 (r245379) +++ head/sys/dev/altera/avgen/altera_avgen_fdt.c Sun Jan 13 16:57:11 2013 (r245380) @@ -150,7 +150,5 @@ static driver_t altera_avgen_fdt_driver sizeof(struct altera_avgen_softc), }; -static devclass_t altera_avgen_devclass; - DRIVER_MODULE(avgen, simplebus, altera_avgen_fdt_driver, altera_avgen_devclass, 0, 0); Modified: head/sys/dev/altera/avgen/altera_avgen_nexus.c ============================================================================== --- head/sys/dev/altera/avgen/altera_avgen_nexus.c Sun Jan 13 16:53:31 2013 (r245379) +++ head/sys/dev/altera/avgen/altera_avgen_nexus.c Sun Jan 13 16:57:11 2013 (r245380) @@ -137,7 +137,5 @@ static driver_t altera_avgen_nexus_drive sizeof(struct altera_avgen_softc), }; -static devclass_t altera_avgen_devclass; - DRIVER_MODULE(avgen, nexus, altera_avgen_nexus_driver, altera_avgen_devclass, 0, 0); Modified: head/sys/dev/altera/jtag_uart/altera_jtag_uart.h ============================================================================== --- head/sys/dev/altera/jtag_uart/altera_jtag_uart.h Sun Jan 13 16:53:31 2013 (r245379) +++ head/sys/dev/altera/jtag_uart/altera_jtag_uart.h Sun Jan 13 16:57:11 2013 (r245380) @@ -194,4 +194,6 @@ extern u_int aju_cons_jtag_missed; int altera_jtag_uart_attach(struct altera_jtag_uart_softc *sc); void altera_jtag_uart_detach(struct altera_jtag_uart_softc *sc); +extern devclass_t altera_jtag_uart_devclass; + #endif /* _DEV_ALTERA_JTAG_UART_H_ */ Modified: head/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c ============================================================================== --- head/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c Sun Jan 13 16:53:31 2013 (r245379) +++ head/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c Sun Jan 13 16:57:11 2013 (r245380) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -46,6 +47,8 @@ __FBSDID("$FreeBSD$"); #include +devclass_t altera_jtag_uart_devclass; + /* * One-byte buffer as we can't check whether the UART is readable without * actually reading from it, synchronised by a spinlock; this lock also Modified: head/sys/dev/altera/jtag_uart/altera_jtag_uart_fdt.c ============================================================================== --- head/sys/dev/altera/jtag_uart/altera_jtag_uart_fdt.c Sun Jan 13 16:53:31 2013 (r245379) +++ head/sys/dev/altera/jtag_uart/altera_jtag_uart_fdt.c Sun Jan 13 16:57:11 2013 (r245380) @@ -143,7 +143,5 @@ static driver_t altera_jtag_uart_fdt_dri sizeof(struct altera_jtag_uart_softc), }; -static devclass_t altera_jtag_uart_devclass; - DRIVER_MODULE(altera_jtag_uart, simplebus, altera_jtag_uart_fdt_driver, altera_jtag_uart_devclass, 0, 0); Modified: head/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c ============================================================================== --- head/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c Sun Jan 13 16:53:31 2013 (r245379) +++ head/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c Sun Jan 13 16:57:11 2013 (r245380) @@ -137,7 +137,5 @@ static driver_t altera_jtag_uart_nexus_d sizeof(struct altera_jtag_uart_softc), }; -static devclass_t altera_jtag_uart_devclass; - DRIVER_MODULE(altera_jtag_uart, nexus, altera_jtag_uart_nexus_driver, altera_jtag_uart_devclass, 0, 0); Modified: head/sys/dev/altera/sdcard/altera_sdcard.c ============================================================================== --- head/sys/dev/altera/sdcard/altera_sdcard.c Sun Jan 13 16:53:31 2013 (r245379) +++ head/sys/dev/altera/sdcard/altera_sdcard.c Sun Jan 13 16:57:11 2013 (r245380) @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); * 3. Handle read-only SD Cards. * 4. Tune timeouts based on real-world SD Card speeds. */ +devclass_t altera_sdcard_devclass; void altera_sdcard_attach(struct altera_sdcard_softc *sc) Modified: head/sys/dev/altera/sdcard/altera_sdcard.h ============================================================================== --- head/sys/dev/altera/sdcard/altera_sdcard.h Sun Jan 13 16:53:31 2013 (r245379) +++ head/sys/dev/altera/sdcard/altera_sdcard.h Sun Jan 13 16:57:11 2013 (r245380) @@ -244,4 +244,6 @@ void altera_sdcard_start(struct altera_s void altera_sdcard_disk_insert(struct altera_sdcard_softc *sc); void altera_sdcard_disk_remove(struct altera_sdcard_softc *sc); +extern devclass_t altera_sdcard_devclass; + #endif /* _DEV_ALTERA_SDCARD_H_ */ Modified: head/sys/dev/altera/sdcard/altera_sdcard_fdt.c ============================================================================== --- head/sys/dev/altera/sdcard/altera_sdcard_fdt.c Sun Jan 13 16:53:31 2013 (r245379) +++ head/sys/dev/altera/sdcard/altera_sdcard_fdt.c Sun Jan 13 16:57:11 2013 (r245380) @@ -116,7 +116,5 @@ static driver_t altera_sdcard_fdt_driver sizeof(struct altera_sdcard_softc), }; -static devclass_t altera_sdcard_devclass; - DRIVER_MODULE(altera_sdcard, simplebus, altera_sdcard_fdt_driver, altera_sdcard_devclass, 0, 0); Modified: head/sys/dev/altera/sdcard/altera_sdcard_nexus.c ============================================================================== --- head/sys/dev/altera/sdcard/altera_sdcard_nexus.c Sun Jan 13 16:53:31 2013 (r245379) +++ head/sys/dev/altera/sdcard/altera_sdcard_nexus.c Sun Jan 13 16:57:11 2013 (r245380) @@ -110,7 +110,5 @@ static driver_t altera_sdcard_nexus_driv sizeof(struct altera_sdcard_softc), }; -static devclass_t altera_sdcard_devclass; - DRIVER_MODULE(altera_sdcard, nexus, altera_sdcard_nexus_driver, altera_sdcard_devclass, 0, 0); Modified: head/sys/dev/isf/isf.c ============================================================================== --- head/sys/dev/isf/isf.c Sun Jan 13 16:53:31 2013 (r245379) +++ head/sys/dev/isf/isf.c Sun Jan 13 16:57:11 2013 (r245380) @@ -150,6 +150,7 @@ static void isf_task(void *arg); * physical package, due to variable block size support in the StrataFlash * part. */ +devclass_t isf_devclass; static uint16_t isf_read_reg(struct isf_softc *sc, uint16_t reg) Modified: head/sys/dev/isf/isf.h ============================================================================== --- head/sys/dev/isf/isf.h Sun Jan 13 16:53:31 2013 (r245379) +++ head/sys/dev/isf/isf.h Sun Jan 13 16:57:11 2013 (r245380) @@ -89,6 +89,8 @@ struct isf_softc { int isf_attach(struct isf_softc *sc); void isf_detach(struct isf_softc *sc); + +extern devclass_t isf_devclass; #endif /* _KERNEL */ #endif /* _DEV_ISF_H_ */ Modified: head/sys/dev/isf/isf_fdt.c ============================================================================== --- head/sys/dev/isf/isf_fdt.c Sun Jan 13 16:53:31 2013 (r245379) +++ head/sys/dev/isf/isf_fdt.c Sun Jan 13 16:57:11 2013 (r245380) @@ -121,6 +121,4 @@ static driver_t isf_fdt_driver = { sizeof(struct isf_softc), }; -static devclass_t isf_devclass; - DRIVER_MODULE(isf, simplebus, isf_fdt_driver, isf_devclass, 0, 0); Modified: head/sys/dev/isf/isf_nexus.c ============================================================================== --- head/sys/dev/isf/isf_nexus.c Sun Jan 13 16:53:31 2013 (r245379) +++ head/sys/dev/isf/isf_nexus.c Sun Jan 13 16:57:11 2013 (r245380) @@ -115,6 +115,4 @@ static driver_t isf_nexus_driver = { sizeof(struct isf_softc), }; -static devclass_t isf_devclass; - DRIVER_MODULE(isf, nexus, isf_nexus_driver, isf_devclass, 0, 0); Modified: head/sys/dev/terasic/de4led/terasic_de4led.c ============================================================================== --- head/sys/dev/terasic/de4led/terasic_de4led.c Sun Jan 13 16:53:31 2013 (r245379) +++ head/sys/dev/terasic/de4led/terasic_de4led.c Sun Jan 13 16:57:11 2013 (r245380) @@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$"); #include #include +devclass_t terasic_de4led_devclass; + static void terasic_de4led_update(struct terasic_de4led_softc *sc) { Modified: head/sys/dev/terasic/de4led/terasic_de4led.h ============================================================================== --- head/sys/dev/terasic/de4led/terasic_de4led.h Sun Jan 13 16:53:31 2013 (r245379) +++ head/sys/dev/terasic/de4led/terasic_de4led.h Sun Jan 13 16:57:11 2013 (r245380) @@ -72,4 +72,6 @@ struct terasic_de4led_softc { void terasic_de4led_attach(struct terasic_de4led_softc *sc); void terasic_de4led_detach(struct terasic_de4led_softc *sc); +extern devclass_t terasic_de4led_devclass; + #endif /* _DEV_TERASIC_DE4LED_H_ */ Modified: head/sys/dev/terasic/de4led/terasic_de4led_fdt.c ============================================================================== --- head/sys/dev/terasic/de4led/terasic_de4led_fdt.c Sun Jan 13 16:53:31 2013 (r245379) +++ head/sys/dev/terasic/de4led/terasic_de4led_fdt.c Sun Jan 13 16:57:11 2013 (r245380) @@ -114,7 +114,5 @@ static driver_t terasic_de4led_fdt_drive sizeof(struct terasic_de4led_softc), }; -static devclass_t terasic_de4led_devclass; - DRIVER_MODULE(terasic_de4led, simplebus, terasic_de4led_fdt_driver, terasic_de4led_devclass, 0, 0); Modified: head/sys/dev/terasic/de4led/terasic_de4led_nexus.c ============================================================================== --- head/sys/dev/terasic/de4led/terasic_de4led_nexus.c Sun Jan 13 16:53:31 2013 (r245379) +++ head/sys/dev/terasic/de4led/terasic_de4led_nexus.c Sun Jan 13 16:57:11 2013 (r245380) @@ -106,7 +106,5 @@ static driver_t terasic_de4led_nexus_dri sizeof(struct terasic_de4led_softc), }; -static devclass_t terasic_de4led_devclass; - DRIVER_MODULE(terasic_de4led, nexus, terasic_de4led_nexus_driver, terasic_de4led_devclass, 0, 0); Modified: head/sys/dev/terasic/mtl/terasic_mtl.c ============================================================================== --- head/sys/dev/terasic/mtl/terasic_mtl.c Sun Jan 13 16:53:31 2013 (r245379) +++ head/sys/dev/terasic/mtl/terasic_mtl.c Sun Jan 13 16:57:11 2013 (r245380) @@ -63,6 +63,9 @@ __FBSDID("$FreeBSD$"); * attached as they may be called even if the attach routine hasn't been, on * an error. */ + +devclass_t terasic_mtl_devclass; + int terasic_mtl_attach(struct terasic_mtl_softc *sc) { Modified: head/sys/dev/terasic/mtl/terasic_mtl.h ============================================================================== --- head/sys/dev/terasic/mtl/terasic_mtl.h Sun Jan 13 16:53:31 2013 (r245379) +++ head/sys/dev/terasic/mtl/terasic_mtl.h Sun Jan 13 16:57:11 2013 (r245380) @@ -159,6 +159,8 @@ struct terasic_mtl_softc { int terasic_mtl_attach(struct terasic_mtl_softc *sc); void terasic_mtl_detach(struct terasic_mtl_softc *sc); +extern devclass_t terasic_mtl_devclass; + /* * Sub-driver setup routines. */ Modified: head/sys/dev/terasic/mtl/terasic_mtl_fdt.c ============================================================================== --- head/sys/dev/terasic/mtl/terasic_mtl_fdt.c Sun Jan 13 16:53:31 2013 (r245379) +++ head/sys/dev/terasic/mtl/terasic_mtl_fdt.c Sun Jan 13 16:57:11 2013 (r245380) @@ -196,7 +196,5 @@ static driver_t terasic_mtl_fdt_driver = sizeof(struct terasic_mtl_softc), }; -static devclass_t terasic_mtl_devclass; - DRIVER_MODULE(mtl, simplebus, terasic_mtl_fdt_driver, terasic_mtl_devclass, 0, 0); Modified: head/sys/dev/terasic/mtl/terasic_mtl_nexus.c ============================================================================== --- head/sys/dev/terasic/mtl/terasic_mtl_nexus.c Sun Jan 13 16:53:31 2013 (r245379) +++ head/sys/dev/terasic/mtl/terasic_mtl_nexus.c Sun Jan 13 16:57:11 2013 (r245380) @@ -190,7 +190,5 @@ static driver_t terasic_mtl_nexus_driver sizeof(struct terasic_mtl_softc), }; -static devclass_t terasic_mtl_devclass; - DRIVER_MODULE(mtl, nexus, terasic_mtl_nexus_driver, terasic_mtl_devclass, 0, 0); From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 18:06:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 04EA4F0C; Sun, 13 Jan 2013 18:06:32 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id C16961DF; Sun, 13 Jan 2013 18:06:31 +0000 (UTC) Received: from Alfreds-MacBook-Pro-9.local (unknown [207.238.187.242]) by elvis.mu.org (Postfix) with ESMTPSA id 3E2691A3C52; Sun, 13 Jan 2013 10:06:21 -0800 (PST) Message-ID: <50F2F79C.7040109@mu.org> Date: Sun, 13 Jan 2013 13:06:20 -0500 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r243631 - in head/sys: kern sys References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50C1BC90.90106@freebsd.org> <50C25A27.4060007@bluezbox.com> <50C26331.6030504@freebsd.org> <50C26AE9.4020600@bluezbox.com> <50C3A3D3.9000804@freebsd.org> <50C3AF72.4010902@rice.edu> <330405A1-312A-45A5-BB86-4969478D8BBD@bluezbox.com> <50D03E83.8060908@rice.edu> <50DD081E.8000409@bluezbox.com> <50EB1841.5030006@bluezbox.com> <50EB22D2.6090103@rice.edu> <50EB415F.8020405@freebsd.org> <50F04FE5.7010406@rice.edu> <50F1BD69.4060104@mu.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, Andre Oppermann , Alan Cox , "Jayachandran C." , svn-src-all@freebsd.org, Oleksandr Tymoshenko , freebsd-arch@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 18:06:32 -0000 On 1/12/13 10:32 PM, Adrian Chadd wrote: > On 12 January 2013 11:45, Alfred Perlstein wrote: > >> I'm not sure if regressing to the waterfall method of development is a good >> idea at this point. >> >> I see a light at the end of the tunnel and we to continue to just handle >> these minor corner cases as we progress. >> >> If we move to a model where a minor bug is grounds to completely remove >> helpful code then nothing will ever get done. >> > Allocating 512MB worth of callwheels on a 16GB MIPS machine is a > little silly, don't you think? > > That suggests to me that the extent of which maxfiles/maxusers/etc > percolates the codebase wasn't totally understood by those who wish to > change it. > > I'd rather see some more investigative work into outlining things that > need fixing and start fixing those, rather than "just change stuff and > fix whatever issues creep up." > > I kinda hope we all understand what we're working on in the kernel a > little better than that. Cool! I'm glad people are now aware of the callwheel allocation being insane with large maxusers. I saw this about a month ago (if not longer), but since there were half a dozen people calling me an imbecile who hadn't really yet read the code I didn't want to inflame them more by fixing that with "a hack". (actually a simple fix). A simple fix is to clamp callwheel size to the previous result of a maxusers of 384 and call it a day. However the simplicity of that approach would probably inflame too many feelings so I am unsure as how to proceed. Any ideas? -Alfred From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 19:19:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id ADA8231B; Sun, 13 Jan 2013 19:19:41 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9EF9A6F0; Sun, 13 Jan 2013 19:19:41 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DJJfap061657; Sun, 13 Jan 2013 19:19:41 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DJJfNb061653; Sun, 13 Jan 2013 19:19:41 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201301131919.r0DJJfNb061653@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 13 Jan 2013 19:19:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245381 - in head: bin/sh tools/regression/bin/sh/expansion X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 19:19:41 -0000 Author: jilles Date: Sun Jan 13 19:19:40 2013 New Revision: 245381 URL: http://svnweb.freebsd.org/changeset/base/245381 Log: sh: Don't lose $? when backquoted command ends with semicolon or newline. An empty simple command was added and overwrote the exit status with 0. This affects `...` but not $(...). Example: v=`false;`; echo $? Added: head/tools/regression/bin/sh/expansion/cmdsubst14.0 (contents, props changed) head/tools/regression/bin/sh/expansion/cmdsubst15.0 (contents, props changed) Modified: head/bin/sh/parser.c Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Sun Jan 13 16:57:11 2013 (r245380) +++ head/bin/sh/parser.c Sun Jan 13 19:19:40 2013 (r245381) @@ -286,7 +286,8 @@ list(int nlflag, int erflag) tokpushback++; } checkkwd = CHKNL | CHKKWD | CHKALIAS; - if (!nlflag && !erflag && tokendlist[peektoken()]) + if (!nlflag && (erflag ? peektoken() == TEOF : + tokendlist[peektoken()])) return ntop; break; case TEOF: Added: head/tools/regression/bin/sh/expansion/cmdsubst14.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/cmdsubst14.0 Sun Jan 13 19:19:40 2013 (r245381) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +! v=`false + +` Added: head/tools/regression/bin/sh/expansion/cmdsubst15.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/cmdsubst15.0 Sun Jan 13 19:19:40 2013 (r245381) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +! v=`false; + +` From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 19:26:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7E86D658; Sun, 13 Jan 2013 19:26:34 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6EE8675A; Sun, 13 Jan 2013 19:26:34 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DJQXj4064112; Sun, 13 Jan 2013 19:26:33 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DJQXQS064110; Sun, 13 Jan 2013 19:26:33 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201301131926.r0DJQXQS064110@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 13 Jan 2013 19:26:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245382 - in head: bin/sh tools/regression/bin/sh/parser X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 19:26:34 -0000 Author: jilles Date: Sun Jan 13 19:26:33 2013 New Revision: 245382 URL: http://svnweb.freebsd.org/changeset/base/245382 Log: sh: Fix crash when parsing '{ } &'. MFC after: 1 week Added: head/tools/regression/bin/sh/parser/empty-braces1.0 (contents, props changed) Modified: head/bin/sh/parser.c Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Sun Jan 13 19:19:40 2013 (r245381) +++ head/bin/sh/parser.c Sun Jan 13 19:26:33 2013 (r245382) @@ -240,9 +240,9 @@ list(int nlflag, int erflag) n2 = andor(); tok = readtoken(); if (tok == TBACKGND) { - if (n2->type == NPIPE) { + if (n2 != NULL && n2->type == NPIPE) { n2->npipe.backgnd = 1; - } else if (n2->type == NREDIR) { + } else if (n2 != NULL && n2->type == NREDIR) { n2->type = NBACKGND; } else { n3 = (union node *)stalloc(sizeof (struct nredir)); Added: head/tools/regression/bin/sh/parser/empty-braces1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/parser/empty-braces1.0 Sun Jan 13 19:26:33 2013 (r245382) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +# Unfortunately, some scripts depend on the extension of allowing an empty +# pair of braces. + +{ } & +wait $! From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 19:39:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E83C3E08; Sun, 13 Jan 2013 19:39:14 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A973A802; Sun, 13 Jan 2013 19:39:14 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DJdEYh066925; Sun, 13 Jan 2013 19:39:14 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DJdDTl066919; Sun, 13 Jan 2013 19:39:13 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201301131939.r0DJdDTl066919@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 13 Jan 2013 19:39:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245383 - head/tools/regression/bin/sh/execution X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 19:39:15 -0000 Author: jilles Date: Sun Jan 13 19:39:13 2013 New Revision: 245383 URL: http://svnweb.freebsd.org/changeset/base/245383 Log: sh: Add some testcases related to subshells. These failed in earlier attempts to execute more subshells without forking. The patches are uncommitted. Added: head/tools/regression/bin/sh/execution/subshell1.0 (contents, props changed) head/tools/regression/bin/sh/execution/subshell1.0.stdout (contents, props changed) head/tools/regression/bin/sh/execution/subshell2.0 (contents, props changed) head/tools/regression/bin/sh/execution/subshell3.0 (contents, props changed) head/tools/regression/bin/sh/execution/subshell4.0 (contents, props changed) Added: head/tools/regression/bin/sh/execution/subshell1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/execution/subshell1.0 Sun Jan 13 19:39:13 2013 (r245383) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +(eval "cd / +v=$(printf %0100000d 1) +echo \${#v}") +echo end Added: head/tools/regression/bin/sh/execution/subshell1.0.stdout ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/execution/subshell1.0.stdout Sun Jan 13 19:39:13 2013 (r245383) @@ -0,0 +1,2 @@ +100000 +end Added: head/tools/regression/bin/sh/execution/subshell2.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/execution/subshell2.0 Sun Jan 13 19:39:13 2013 (r245383) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +f() { + x=2 +} +( + x=1 + f + [ "$x" = 2 ] +) Added: head/tools/regression/bin/sh/execution/subshell3.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/execution/subshell3.0 Sun Jan 13 19:39:13 2013 (r245383) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +(false; exit) && exit 3 +exit 0 Added: head/tools/regression/bin/sh/execution/subshell4.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/execution/subshell4.0 Sun Jan 13 19:39:13 2013 (r245383) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +(eval "set v=1"; false) && echo bad; : From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 20:45:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0D79664A; Sun, 13 Jan 2013 20:45:09 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-we0-f177.google.com (mail-we0-f177.google.com [74.125.82.177]) by mx1.freebsd.org (Postfix) with ESMTP id B80FEAB4; Sun, 13 Jan 2013 20:45:07 +0000 (UTC) Received: by mail-we0-f177.google.com with SMTP id x48so1739075wey.22 for ; Sun, 13 Jan 2013 12:45:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=Ux6Kc7xf62oVjwpPbMRBhx86a59mcVFLdG7i3kI364w=; b=PBAeqPabPhgJss31wKGaCnSfptuN/WJ24fQsuQkEkam6wUauQBOtpwdZNdkn5MrYcJ cehaxYzHHJGiIxrwrtoKyblsMTxDCi9MQUQNHzxoBSuMn7bhbFokCuiEIvOM45wmNPr0 CBBNE0AxISCwZla9Gio6W0nKO4XhrSsq0aHo0mQCLAHjAet4MKomFucMuGpRNMXTQRJS /Q49xUu3rQ36D3+eL0meZ5ql7D7mk9Me1nw7sRkTE691F68Rx5ObIjml4CCWH9IHyIPf 89JNbeic3ALJe2bbxuZqrKdSbExAZ0YVeo/mauiqn3CgWBd9C48lTs8QMPDYhguSiow1 fOdg== MIME-Version: 1.0 X-Received: by 10.180.93.133 with SMTP id cu5mr8908659wib.32.1358109906576; Sun, 13 Jan 2013 12:45:06 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.217.57.9 with HTTP; Sun, 13 Jan 2013 12:45:06 -0800 (PST) In-Reply-To: <50F2F79C.7040109@mu.org> References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50C1BC90.90106@freebsd.org> <50C25A27.4060007@bluezbox.com> <50C26331.6030504@freebsd.org> <50C26AE9.4020600@bluezbox.com> <50C3A3D3.9000804@freebsd.org> <50C3AF72.4010902@rice.edu> <330405A1-312A-45A5-BB86-4969478D8BBD@bluezbox.com> <50D03E83.8060908@rice.edu> <50DD081E.8000409@bluezbox.com> <50EB1841.5030006@bluezbox.com> <50EB22D2.6090103@rice.edu> <50EB415F.8020405@freebsd.org> <50F04FE5.7010406@rice.edu> <50F1BD69.4060104@mu.org> <50F2F79C.7040109@mu.org> Date: Sun, 13 Jan 2013 12:45:06 -0800 X-Google-Sender-Auth: NJJ1tZuTaqXvaQ9ziZpjmySGud8 Message-ID: Subject: Re: svn commit: r243631 - in head/sys: kern sys From: Adrian Chadd To: Alfred Perlstein Content-Type: text/plain; charset=ISO-8859-1 Cc: src-committers@freebsd.org, Andre Oppermann , Alan Cox , "Jayachandran C." , svn-src-all@freebsd.org, Oleksandr Tymoshenko , freebsd-arch@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 20:45:09 -0000 .. I think the "right" solution is to still review what things rely on maxusers/maxfiles/etc and figure out which make sense to scale off of a global variable, and which don't. Adrian From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 21:25:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 29E1928C; Sun, 13 Jan 2013 21:25:44 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 126EAD82; Sun, 13 Jan 2013 21:25:44 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DLPhum099316; Sun, 13 Jan 2013 21:25:43 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DLPhOP099315; Sun, 13 Jan 2013 21:25:43 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201301132125.r0DLPhOP099315@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 13 Jan 2013 21:25:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245385 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 21:25:44 -0000 Author: mjg Date: Sun Jan 13 21:25:43 2013 New Revision: 245385 URL: http://svnweb.freebsd.org/changeset/base/245385 Log: libutil: eliminate 'found' variable in gr_equal Submitted by: Christoph Mallon Modified: head/lib/libutil/gr_util.c Modified: head/lib/libutil/gr_util.c ============================================================================== --- head/lib/libutil/gr_util.c Sun Jan 13 20:35:08 2013 (r245384) +++ head/lib/libutil/gr_util.c Sun Jan 13 21:25:43 2013 (r245385) @@ -346,7 +346,6 @@ gr_equal(const struct group *gr1, const { int gr1_ndx; int gr2_ndx; - bool found; /* Check that the non-member information is the same. */ if (gr1->gr_name == NULL || gr2->gr_name == NULL) { @@ -367,17 +366,15 @@ gr_equal(const struct group *gr1, const if (gr1->gr_mem != gr2->gr_mem) return (false); } else { - for (found = false, gr1_ndx = 0; gr1->gr_mem[gr1_ndx] != NULL; - gr1_ndx++) { - for (gr2_ndx = 0; gr2->gr_mem[gr2_ndx] != NULL; - gr2_ndx++) + for (gr1_ndx = 0; gr1->gr_mem[gr1_ndx] != NULL; gr1_ndx++) { + for (gr2_ndx = 0;; gr2_ndx++) { + if (gr2->gr_mem[gr2_ndx] == NULL) + return (false); if (strcmp(gr1->gr_mem[gr1_ndx], gr2->gr_mem[gr2_ndx]) == 0) { - found = true; break; } - if (!found) - return (false); + } } /* Check that group2 does not have more members than group1. */ From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 21:26:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 651D84E0; Sun, 13 Jan 2013 21:26:58 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 568D3D95; Sun, 13 Jan 2013 21:26:58 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DLQwPE099470; Sun, 13 Jan 2013 21:26:58 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DLQwXd099469; Sun, 13 Jan 2013 21:26:58 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201301132126.r0DLQwXd099469@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 13 Jan 2013 21:26:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245386 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 21:26:58 -0000 Author: mjg Date: Sun Jan 13 21:26:57 2013 New Revision: 245386 URL: http://svnweb.freebsd.org/changeset/base/245386 Log: libutil: move group_line_format into the scop of its only user. Submitted by: Christoph Mallon Modified: head/lib/libutil/gr_util.c Modified: head/lib/libutil/gr_util.c ============================================================================== --- head/lib/libutil/gr_util.c Sun Jan 13 21:25:43 2013 (r245385) +++ head/lib/libutil/gr_util.c Sun Jan 13 21:26:57 2013 (r245386) @@ -50,8 +50,6 @@ static char group_file[PATH_MAX]; static char tempname[PATH_MAX]; static int initialized; -static const char group_line_format[] = "%s:%s:%ju:"; - /* * Initialize statics */ @@ -391,6 +389,7 @@ gr_equal(const struct group *gr1, const char * gr_make(const struct group *gr) { + const char *group_line_format = "%s:%s:%ju:"; char *line; size_t line_size; int ndx; From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 21:28:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B0DC66C8; Sun, 13 Jan 2013 21:28:47 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A396ADB3; Sun, 13 Jan 2013 21:28:47 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DLSlWd099715; Sun, 13 Jan 2013 21:28:47 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DLSlnw099714; Sun, 13 Jan 2013 21:28:47 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201301132128.r0DLSlnw099714@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 13 Jan 2013 21:28:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245387 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 21:28:47 -0000 Author: mjg Date: Sun Jan 13 21:28:47 2013 New Revision: 245387 URL: http://svnweb.freebsd.org/changeset/base/245387 Log: libutil: utilize strsep instead of strcat in a loop in gr_make Submitted by: Christoph Mallon Modified: head/lib/libutil/gr_util.c Modified: head/lib/libutil/gr_util.c ============================================================================== --- head/lib/libutil/gr_util.c Sun Jan 13 21:26:57 2013 (r245386) +++ head/lib/libutil/gr_util.c Sun Jan 13 21:28:47 2013 (r245387) @@ -390,7 +390,9 @@ char * gr_make(const struct group *gr) { const char *group_line_format = "%s:%s:%ju:"; + const char *sep; char *line; + char *p; size_t line_size; int ndx; @@ -405,16 +407,18 @@ gr_make(const struct group *gr) } /* Create the group line and fill it. */ - if ((line = malloc(line_size)) == NULL) + if ((line = p = malloc(line_size)) == NULL) return (NULL); - snprintf(line, line_size, group_line_format, gr->gr_name, gr->gr_passwd, + p += sprintf(p, group_line_format, gr->gr_name, gr->gr_passwd, (uintmax_t)gr->gr_gid); - if (gr->gr_mem != NULL) + if (gr->gr_mem != NULL) { + sep = ""; for (ndx = 0; gr->gr_mem[ndx] != NULL; ndx++) { - strcat(line, gr->gr_mem[ndx]); - if (gr->gr_mem[ndx + 1] != NULL) - strcat(line, ","); + p = stpcpy(p, sep); + p = stpcpy(p, gr->gr_mem[ndx]); + sep = ","; } + } return (line); } From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 21:32:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 56FF2A0F; Sun, 13 Jan 2013 21:32:41 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3ED3CDFC; Sun, 13 Jan 2013 21:32:41 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DLWfMN001943; Sun, 13 Jan 2013 21:32:41 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DLWf0v001942; Sun, 13 Jan 2013 21:32:41 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201301132132.r0DLWf0v001942@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 13 Jan 2013 21:32:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245388 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 21:32:41 -0000 Author: gonzo Date: Sun Jan 13 21:32:40 2013 New Revision: 245388 URL: http://svnweb.freebsd.org/changeset/base/245388 Log: Remove accidentally copypasted comment Spotted by: gavin Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Sun Jan 13 21:28:47 2013 (r245387) +++ head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Sun Jan 13 21:32:40 2013 (r245388) @@ -82,11 +82,6 @@ initarm_late_init(void) pcell_t cells[2]; int len; - /* - * It seems there is no way to let syscons framework know - * that framebuffer resolution has changed. So just try - * to fetch data from FDT and go with defaults if failed - */ system = OF_finddevice("/system"); if (system != 0) { len = OF_getprop(system, "linux,serial", &cells, sizeof(cells)); From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 22:05:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 016BCA42; Sun, 13 Jan 2013 22:05:46 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B6DE129; Sun, 13 Jan 2013 22:05:46 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DM5kiE011162; Sun, 13 Jan 2013 22:05:46 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DM5kc2011161; Sun, 13 Jan 2013 22:05:46 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201301132205.r0DM5kc2011161@svn.freebsd.org> From: Aleksandr Rybalko Date: Sun, 13 Jan 2013 22:05:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245389 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 22:05:47 -0000 Author: ray Date: Sun Jan 13 22:05:46 2013 New Revision: 245389 URL: http://svnweb.freebsd.org/changeset/base/245389 Log: Enable syscons framebuffer support for bcm2835. It makes possible to run Xorg on Raspberry Pi. o convert mmap address to physical. o add FBIOGTYPE ioctl handler - allow to get screen resolution by new xf86-video-scfb driver. Originally designed for "Efika MX" project. Sponsored by: FreeBSD Foundation Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Sun Jan 13 21:32:40 2013 (r245388) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Sun Jan 13 22:05:46 2013 (r245389) @@ -136,6 +136,7 @@ struct video_adapter_softc { int console; intptr_t fb_addr; + intptr_t fb_paddr; unsigned int fb_size; unsigned int height; @@ -222,6 +223,7 @@ bcm_fb_init(void *arg) fb_config->screen_size); va_sc->fb_addr = (intptr_t)pmap_mapdev(fb_config->base, fb_config->screen_size); + va_sc->fb_paddr = fb_config->base; va_sc->fb_size = fb_config->screen_size; va_sc->depth = fb_config->bpp; va_sc->stride = fb_config->pitch; @@ -795,7 +797,7 @@ bcmfb_mmap(video_adapter_t *adp, vm_ooff * framebuffer, since it shouldn't be touched */ if (offset < sc->stride*sc->height) { - *paddr = sc->fb_addr + offset; + *paddr = sc->fb_paddr + offset; return (0); } @@ -805,6 +807,27 @@ bcmfb_mmap(video_adapter_t *adp, vm_ooff static int bcmfb_ioctl(video_adapter_t *adp, u_long cmd, caddr_t data) { + struct video_adapter_softc *sc; + struct fbtype *fb; + + sc = (struct video_adapter_softc *)adp; + + switch (cmd) { + case FBIOGTYPE: + fb = (struct fbtype *)data; + fb->fb_type = FBTYPE_PCIMISC; + fb->fb_height = sc->height; + fb->fb_width = sc->width; + fb->fb_depth = sc->depth; + if (sc->depth <= 1 || sc->depth > 8) + fb->fb_cmsize = 0; + else + fb->fb_cmsize = 1 << sc->depth; + fb->fb_size = sc->fb_size; + break; + default: + return (fb_commonioctl(adp, cmd, data)); + } return (0); } From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 22:08:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D8C4CE8D; Sun, 13 Jan 2013 22:08:18 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CA90EC0; Sun, 13 Jan 2013 22:08:18 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DM8IMn011540; Sun, 13 Jan 2013 22:08:18 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DM8Iqp011539; Sun, 13 Jan 2013 22:08:18 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201301132208.r0DM8Iqp011539@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 13 Jan 2013 22:08:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245390 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 22:08:18 -0000 Author: mjg Date: Sun Jan 13 22:08:18 2013 New Revision: 245390 URL: http://svnweb.freebsd.org/changeset/base/245390 Log: libutil: fix typo in comment for gr_fini. Submitted by: Christoph Mallon Modified: head/lib/libutil/gr_util.c Modified: head/lib/libutil/gr_util.c ============================================================================== --- head/lib/libutil/gr_util.c Sun Jan 13 22:05:46 2013 (r245389) +++ head/lib/libutil/gr_util.c Sun Jan 13 22:08:18 2013 (r245390) @@ -316,7 +316,7 @@ gr_mkdb(void) } /* - * Clean up. Preserver errno for the caller's convenience. + * Clean up. Preserves errno for the caller's convenience. */ void gr_fini(void) From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 22:35:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 42606B4B; Sun, 13 Jan 2013 22:35:52 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1E4A3266; Sun, 13 Jan 2013 22:35:52 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DMZq1v019791; Sun, 13 Jan 2013 22:35:52 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DMZpBp019790; Sun, 13 Jan 2013 22:35:51 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201301132235.r0DMZpBp019790@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 13 Jan 2013 22:35:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245392 - head/tools/regression/bin/sh/expansion X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 22:35:52 -0000 Author: jilles Date: Sun Jan 13 22:35:51 2013 New Revision: 245392 URL: http://svnweb.freebsd.org/changeset/base/245392 Log: sh: Add testcase that $? is preserved into a simple command substitution. The test builtins/trap6.0 already uses this but having it separate eases diagnosis if this would break. Added: head/tools/regression/bin/sh/expansion/cmdsubst16.0 (contents, props changed) Added: head/tools/regression/bin/sh/expansion/cmdsubst16.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/cmdsubst16.0 Sun Jan 13 22:35:51 2013 (r245392) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +f() { return 3; } +f +[ `echo $?` = 3 ] From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 22:41:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B4925176; Sun, 13 Jan 2013 22:41:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A72DA2A6; Sun, 13 Jan 2013 22:41:58 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DMfwRP022215; Sun, 13 Jan 2013 22:41:58 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DMfwZX022214; Sun, 13 Jan 2013 22:41:58 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301132241.r0DMfwZX022214@svn.freebsd.org> From: Adrian Chadd Date: Sun, 13 Jan 2013 22:41:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245396 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 22:41:58 -0000 Author: adrian Date: Sun Jan 13 22:41:58 2013 New Revision: 245396 URL: http://svnweb.freebsd.org/changeset/base/245396 Log: If we're doing a kickpcu, make sure we flush the whole RX list rather than stopping after 128 frames. Whilst here, add in some code that lets me optionally flip back to the original behaviour of calling ath_startrecv(). Modified: head/sys/dev/ath/if_ath_rx.c Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Sun Jan 13 22:41:44 2013 (r245395) +++ head/sys/dev/ath/if_ath_rx.c Sun Jan 13 22:41:58 2013 (r245396) @@ -845,6 +845,7 @@ ath_rx_proc(struct ath_softc *sc, int re int16_t nf; u_int64_t tsf; int npkts = 0; + int kickpcu = 0; /* XXX we must not hold the ATH_LOCK here */ ATH_UNLOCK_ASSERT(sc); @@ -852,6 +853,7 @@ ath_rx_proc(struct ath_softc *sc, int re ATH_PCU_LOCK(sc); sc->sc_rxproc_cnt++; + kickpcu = sc->sc_kickpcu; ATH_PCU_UNLOCK(sc); DPRINTF(sc, ATH_DEBUG_RX_PROC, "%s: called\n", __func__); @@ -866,7 +868,7 @@ ath_rx_proc(struct ath_softc *sc, int re * latency can jump by quite a bit, causing throughput * degredation. */ - if (npkts >= ATH_RX_MAX) + if (!kickpcu && npkts >= ATH_RX_MAX) break; bf = TAILQ_FIRST(&sc->sc_rxbuf); @@ -961,6 +963,9 @@ rx_proc_next: __func__, npkts); /* XXX rxslink? */ +#if 0 + ath_startrecv(sc); +#else /* * XXX can we hold the PCU lock here? * Are there any net80211 buffer calls involved? @@ -970,6 +975,7 @@ rx_proc_next: ath_hal_rxena(ah); /* enable recv descriptors */ ath_mode_init(sc); /* set filters, etc. */ ath_hal_startpcurecv(ah); /* re-enable PCU/DMA engine */ +#endif ath_hal_intrset(ah, sc->sc_imask); sc->sc_kickpcu = 0; From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 23:00:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6A426BDC; Sun, 13 Jan 2013 23:00:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 525E0362; Sun, 13 Jan 2013 23:00:41 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DN0ftl028343; Sun, 13 Jan 2013 23:00:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DN0fJe028342; Sun, 13 Jan 2013 23:00:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301132300.r0DN0fJe028342@svn.freebsd.org> From: Alexander Motin Date: Sun, 13 Jan 2013 23:00:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245398 - head/sys/geom/raid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Jan 2013 23:00:41 -0000 Author: mav Date: Sun Jan 13 23:00:40 2013 New Revision: 245398 URL: http://svnweb.freebsd.org/changeset/base/245398 Log: - Add checks for Intel metadata version and attributes. Ignore disks with unsupported metadata types like Intel Smart Response to not corrupt them. - Improve setting of these things during metadata writing to protect from incapable BIOS'es and other implementations. Modified: head/sys/geom/raid/md_intel.c Modified: head/sys/geom/raid/md_intel.c ============================================================================== --- head/sys/geom/raid/md_intel.c Sun Jan 13 22:46:06 2013 (r245397) +++ head/sys/geom/raid/md_intel.c Sun Jan 13 23:00:40 2013 (r245398) @@ -165,6 +165,11 @@ struct intel_raid_conf { #define INTEL_ATTR_RAID1E 0x00000008 #define INTEL_ATTR_RAID5 0x00000010 #define INTEL_ATTR_RAIDCNG 0x00000020 +#define INTEL_ATTR_EXT_STRIP 0x00000040 +#define INTEL_ATTR_NVM_CACHE 0x02000000 +#define INTEL_ATTR_2TB_DISK 0x04000000 +#define INTEL_ATTR_BBM 0x08000000 +#define INTEL_ATTR_NVM_CACHE2 0x10000000 #define INTEL_ATTR_2TB 0x20000000 #define INTEL_ATTR_PM 0x40000000 #define INTEL_ATTR_CHECKSUM 0x80000000 @@ -182,6 +187,11 @@ struct intel_raid_conf { /* Here goes total_volumes of struct intel_raid_vol. */ } __packed; +#define INTEL_ATTR_SUPPORTED ( INTEL_ATTR_RAID0 | INTEL_ATTR_RAID1 | \ + INTEL_ATTR_RAID10 | INTEL_ATTR_RAID1E | INTEL_ATTR_RAID5 | \ + INTEL_ATTR_RAIDCNG | INTEL_ATTR_EXT_STRIP | INTEL_ATTR_2TB_DISK | \ + INTEL_ATTR_2TB | INTEL_ATTR_PM | INTEL_ATTR_CHECKSUM ) + #define INTEL_MAX_MD_SIZE(ndisks) \ (sizeof(struct intel_raid_conf) + \ sizeof(struct intel_raid_disk) * (ndisks - 1) + \ @@ -554,6 +564,21 @@ badsize: g_raid_md_intel_print(meta); + if (strncmp(meta->version, INTEL_VERSION_1300, 6) > 0) { + G_RAID_DEBUG(1, "Intel unsupported version: '%.6s'", + meta->version); + free(meta, M_MD_INTEL); + return (NULL); + } + + if (strncmp(meta->version, INTEL_VERSION_1300, 6) >= 0 && + (meta->attributes & ~INTEL_ATTR_SUPPORTED) != 0) { + G_RAID_DEBUG(1, "Intel unsupported attributes: 0x%08x", + meta->attributes & ~INTEL_ATTR_SUPPORTED); + free(meta, M_MD_INTEL); + return (NULL); + } + /* Validate disk indexes. */ for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); @@ -2268,6 +2293,8 @@ g_raid_md_write_intel(struct g_raid_md_o if (pd->pd_disk_pos < 0) continue; meta->disk[pd->pd_disk_pos] = pd->pd_disk_meta; + if (pd->pd_disk_meta.sectors_hi != 0) + meta->attributes |= INTEL_ATTR_2TB_DISK; } /* Fill volumes and maps. */ @@ -2297,12 +2324,16 @@ g_raid_md_write_intel(struct g_raid_md_o meta->attributes |= INTEL_ATTR_RAID1; else if (vol->v_raid_level == G_RAID_VOLUME_RL_RAID5) meta->attributes |= INTEL_ATTR_RAID5; - else + else if ((vol->v_disks_count & 1) == 0) meta->attributes |= INTEL_ATTR_RAID10; + else + meta->attributes |= INTEL_ATTR_RAID1E; + if (pv->pv_cng) + meta->attributes |= INTEL_ATTR_RAIDCNG; + if (vol->v_strip_size > 131072) + meta->attributes |= INTEL_ATTR_EXT_STRIP; - if (meta->attributes & INTEL_ATTR_2TB) - cv = INTEL_VERSION_1300; - else if (pv->pv_cng) + if (pv->pv_cng) cv = INTEL_VERSION_1206; else if (vol->v_disks_count > 4) cv = INTEL_VERSION_1204; @@ -2310,8 +2341,6 @@ g_raid_md_write_intel(struct g_raid_md_o cv = INTEL_VERSION_1202; else if (vol->v_disks_count > 2) cv = INTEL_VERSION_1201; - else if (vi > 0) - cv = INTEL_VERSION_1200; else if (vol->v_raid_level == G_RAID_VOLUME_RL_RAID1) cv = INTEL_VERSION_1100; else @@ -2321,6 +2350,8 @@ g_raid_md_write_intel(struct g_raid_md_o strlcpy(&mvol->name[0], vol->v_name, sizeof(mvol->name)); mvol->total_sectors = vol->v_mediasize / sectorsize; + mvol->state = (INTEL_ST_READ_COALESCING | + INTEL_ST_WRITE_COALESCING); if (pv->pv_cng) { mvol->state |= INTEL_ST_CLONE_N_GO; if (pv->pv_cng_man_sync) @@ -2437,7 +2468,10 @@ g_raid_md_write_intel(struct g_raid_md_o vi++; } meta->total_volumes = vi; - if (strcmp(version, INTEL_VERSION_1300) != 0) + if (vi > 1 || meta->attributes & + (INTEL_ATTR_EXT_STRIP | INTEL_ATTR_2TB_DISK | INTEL_ATTR_2TB)) + version = INTEL_VERSION_1300; + if (strcmp(version, INTEL_VERSION_1300) < 0) meta->attributes &= INTEL_ATTR_CHECKSUM; memcpy(&meta->version[0], version, sizeof(INTEL_VERSION_1000) - 1); From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 00:38:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4A2F5E5F; Mon, 14 Jan 2013 00:38:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3D30F86D; Mon, 14 Jan 2013 00:38:53 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0E0cqeo057247; Mon, 14 Jan 2013 00:38:52 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0E0cqIM057246; Mon, 14 Jan 2013 00:38:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301140038.r0E0cqIM057246@svn.freebsd.org> From: Alexander Motin Date: Mon, 14 Jan 2013 00:38:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245400 - head/sys/geom/raid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 00:38:53 -0000 Author: mav Date: Mon Jan 14 00:38:51 2013 New Revision: 245400 URL: http://svnweb.freebsd.org/changeset/base/245400 Log: Windows driver writes relative volume IDs to metadata field. Use that value as a hint for raid/rX device number to make it persistent across reboots. Modified: head/sys/geom/raid/md_intel.c Modified: head/sys/geom/raid/md_intel.c ============================================================================== --- head/sys/geom/raid/md_intel.c Sun Jan 13 23:36:21 2013 (r245399) +++ head/sys/geom/raid/md_intel.c Mon Jan 14 00:38:51 2013 (r245400) @@ -1150,7 +1150,7 @@ g_raid_md_intel_start(struct g_raid_soft for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); mmap = intel_get_map(mvol, 0); - vol = g_raid_create_volume(sc, mvol->name, -1); + vol = g_raid_create_volume(sc, mvol->name, mvol->tid - 1); pv = malloc(sizeof(*pv), M_MD_INTEL, M_WAITOK | M_ZERO); pv->pv_volume_pos = i; pv->pv_cng = (mvol->state & INTEL_ST_CLONE_N_GO) != 0; @@ -2352,6 +2352,7 @@ g_raid_md_write_intel(struct g_raid_md_o mvol->total_sectors = vol->v_mediasize / sectorsize; mvol->state = (INTEL_ST_READ_COALESCING | INTEL_ST_WRITE_COALESCING); + mvol->tid = vol->v_global_id + 1; if (pv->pv_cng) { mvol->state |= INTEL_ST_CLONE_N_GO; if (pv->pv_cng_man_sync) From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 01:09:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BA2D97CC; Mon, 14 Jan 2013 01:09:24 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 801F697B; Mon, 14 Jan 2013 01:09:24 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0E19O3E066983; Mon, 14 Jan 2013 01:09:24 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0E19NZp066979; Mon, 14 Jan 2013 01:09:23 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201301140109.r0E19NZp066979@svn.freebsd.org> From: Devin Teske Date: Mon, 14 Jan 2013 01:09:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245401 - in head/usr.sbin/bsdconfig: . networking/share security usermgmt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 01:09:24 -0000 Author: dteske Date: Mon Jan 14 01:09:23 2013 New Revision: 245401 URL: http://svnweb.freebsd.org/changeset/base/245401 Log: Add missing dialog(1) arguments to internationalize "Help"-button label. Modified: head/usr.sbin/bsdconfig/bsdconfig head/usr.sbin/bsdconfig/networking/share/device.subr head/usr.sbin/bsdconfig/security/kern_securelevel head/usr.sbin/bsdconfig/usermgmt/usermgmt Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Mon Jan 14 00:38:51 2013 (r245400) +++ head/usr.sbin/bsdconfig/bsdconfig Mon Jan 14 01:09:23 2013 (r245401) @@ -192,6 +192,7 @@ dialog_menu_main() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_exit_bsdconfig\" \ --help-button \ + --help-label \"\$msg_help\" \ ${USE_XDIALOG:+--help \"\"} \ --menu \"\$prompt\" $size $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Mon Jan 14 00:38:51 2013 (r245400) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Mon Jan 14 01:09:23 2013 (r245401) @@ -343,6 +343,7 @@ f_dialog_menu_netdev_edit() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --help-button \ + --help-label \"\$msg_help\" \ ${USE_XDIALOG:+--help \"\"} \ --menu \"\$prompt\" $size \ $menu_list \ Modified: head/usr.sbin/bsdconfig/security/kern_securelevel ============================================================================== --- head/usr.sbin/bsdconfig/security/kern_securelevel Mon Jan 14 00:38:51 2013 (r245400) +++ head/usr.sbin/bsdconfig/security/kern_securelevel Mon Jan 14 01:09:23 2013 (r245401) @@ -78,6 +78,7 @@ dialog_menu_main() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --help-button \ + --help-label \"\$msg_help\" \ ${USE_XDIALOG:+--help \"\"} \ --menu \"\$prompt\" $size \ $menu_list \ Modified: head/usr.sbin/bsdconfig/usermgmt/usermgmt ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/usermgmt Mon Jan 14 00:38:51 2013 (r245400) +++ head/usr.sbin/bsdconfig/usermgmt/usermgmt Mon Jan 14 01:09:23 2013 (r245401) @@ -88,6 +88,7 @@ dialog_menu_main() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --help-button \ + --help-label \"\$msg_help\" \ ${USE_XDIALOG:+--help \"\"} \ --menu \"\" $size $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 01:15:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 194FA9CB; Mon, 14 Jan 2013 01:15:27 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0B51E9B6; Mon, 14 Jan 2013 01:15:27 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0E1FQKb069573; Mon, 14 Jan 2013 01:15:26 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0E1FQKp069562; Mon, 14 Jan 2013 01:15:26 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201301140115.r0E1FQKp069562@svn.freebsd.org> From: Devin Teske Date: Mon, 14 Jan 2013 01:15:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245402 - in head/usr.sbin/bsdconfig: networking/share share startup X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 01:15:27 -0000 Author: dteske Date: Mon Jan 14 01:15:25 2013 New Revision: 245402 URL: http://svnweb.freebsd.org/changeset/base/245402 Log: Add new f_yesno/f_noyes wrapper functions (which take printf(1) syntax). Modified: head/usr.sbin/bsdconfig/networking/share/device.subr head/usr.sbin/bsdconfig/networking/share/hostname.subr head/usr.sbin/bsdconfig/networking/share/routing.subr head/usr.sbin/bsdconfig/share/common.subr head/usr.sbin/bsdconfig/startup/rcdelete Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Mon Jan 14 01:09:23 2013 (r245401) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Mon Jan 14 01:15:25 2013 (r245402) @@ -456,9 +456,8 @@ f_dialog_menu_netdev_edit() # Re/Apply the settings if desired # if [ ! "$dhcp" ]; then - f_dialog_yesno "Would you like to bring the $interface" \ - "interface up right now?" - if [ $? -eq $SUCCESS ]; then + if f_yesno "$msg_bring_interface_up" "$interface" + then f_show_info "$msg_bring_interface_up" "$interface" local dr="$( f_sysrc_get defaultrouter )" err Modified: head/usr.sbin/bsdconfig/networking/share/hostname.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/hostname.subr Mon Jan 14 01:09:23 2013 (r245401) +++ head/usr.sbin/bsdconfig/networking/share/hostname.subr Mon Jan 14 01:15:25 2013 (r245402) @@ -201,10 +201,8 @@ f_dialog_input_hostname() f_show_msg "$msg_activate_hostname_x11warning" \ "$( hostname )" "$hostname" else - f_dialog_yesno "$( - printf "$msg_activate_hostname" \ - "$( hostname )" "$hostname" \ - )" \ + f_yesno "$msg_activate_hostname" \ + "$( hostname )" "$hostname" \ && hostname "$hostname" fi fi Modified: head/usr.sbin/bsdconfig/networking/share/routing.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/routing.subr Mon Jan 14 01:09:23 2013 (r245401) +++ head/usr.sbin/bsdconfig/networking/share/routing.subr Mon Jan 14 01:15:25 2013 (r245402) @@ -129,11 +129,8 @@ f_dialog_input_defaultrouter() # if [ "$( f_route_get_default )" != "$defaultrouter" ]; then f_dialog_clear - f_dialog_yesno "$( - printf "$msg_activate_default_router" \ - "$( f_route_get_default )" "$defaultrouter" - )" - + f_yesno "$msg_activate_default_router" \ + "$( f_route_get_default )" "$defaultrouter" if [ $? -eq $SUCCESS ]; then local err Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Mon Jan 14 01:09:23 2013 (r245401) +++ head/usr.sbin/bsdconfig/share/common.subr Mon Jan 14 01:15:25 2013 (r245402) @@ -214,6 +214,50 @@ f_show_msg() fi } + +# f_yesno $fmt [ $opts ... ] +# +# Display a message in a dialog yes/no box using printf(1) syntax. +# +f_yesno() +{ + local msg + msg=$( printf "$@" ) + + # + # Use f_dialog_yesno from dialog.subr if possible, otherwise fall + # back to dialog(1) (without options, making it obvious when using + # un-aided system dialog). + # + if f_have f_dialog_yesno; then + f_dialog_yesno "$msg" + else + dialog --yesno "$msg" 0 0 + fi +} + +# f_noyes $fmt [ $opts ... ] +# +# Display a message in a dialog yes/no box using printf(1) syntax. +# NOTE: THis is just like the f_yesno function except "No" is default. +# +f_noyes() +{ + local msg + msg=$( printf "$@" ) + + # + # Use f_dialog_noyes from dialog.subr if possible, otherwise fall + # back to dialog(1) (without options, making it obvious when using + # un-aided system dialog). + # + if f_have f_dialog_noyes; then + f_dialog_noyes "$msg" + else + dialog --defaultno --yesno "$msg" 0 0 + fi +} + # f_show_help $file # # Display a language help-file. Automatically takes $LANG and $LC_ALL into Modified: head/usr.sbin/bsdconfig/startup/rcdelete ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcdelete Mon Jan 14 01:09:23 2013 (r245401) +++ head/usr.sbin/bsdconfig/startup/rcdelete Mon Jan 14 01:15:25 2013 (r245402) @@ -210,9 +210,7 @@ dialog_menu_delete() [ $# -ge 1 ] || return $FAILURE if [ $# -eq 1 ]; then - msg=$( printf "$msg_are_you_sure_you_want_to_delete" \ - "$delete_vars" ) - f_dialog_noyes "$msg" + f_noyes "$msg_are_you_sure_you_want_to_delete" "$delete_vars" return $? fi From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 05:40:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DFFBC418; Mon, 14 Jan 2013 05:40:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AE6A8279; Mon, 14 Jan 2013 05:40:22 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0E5eMZ3049064; Mon, 14 Jan 2013 05:40:22 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0E5eMw1049063; Mon, 14 Jan 2013 05:40:22 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301140540.r0E5eMw1049063@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 14 Jan 2013 05:40:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245405 - 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.14 Precedence: list List-Id: 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, 14 Jan 2013 05:40:22 -0000 Author: kib Date: Mon Jan 14 05:40:21 2013 New Revision: 245405 URL: http://svnweb.freebsd.org/changeset/base/245405 Log: Rename vfs_hash_index() to vfs_hash_bucket(). Reviewed by: peter Tested by: peter, pho Sponsored by: The FreeBSD Foundation MFC after: 5 days Modified: head/sys/kern/vfs_hash.c Modified: head/sys/kern/vfs_hash.c ============================================================================== --- head/sys/kern/vfs_hash.c Mon Jan 14 04:31:54 2013 (r245404) +++ head/sys/kern/vfs_hash.c Mon Jan 14 05:40:21 2013 (r245405) @@ -55,10 +55,10 @@ vfs_hashinit(void *dummy __unused) SYSINIT(vfs_hash, SI_SUB_VFS, SI_ORDER_SECOND, vfs_hashinit, NULL); static struct vfs_hash_head * -vfs_hash_index(const struct mount *mp, u_int hash) +vfs_hash_bucket(const struct mount *mp, u_int hash) { - return(&vfs_hash_tbl[(hash + mp->mnt_hashseed) & vfs_hash_mask]); + return (&vfs_hash_tbl[(hash + mp->mnt_hashseed) & vfs_hash_mask]); } int @@ -69,7 +69,7 @@ vfs_hash_get(const struct mount *mp, u_i while (1) { mtx_lock(&vfs_hash_mtx); - LIST_FOREACH(vp, vfs_hash_index(mp, hash), v_hashlist) { + LIST_FOREACH(vp, vfs_hash_bucket(mp, hash), v_hashlist) { if (vp->v_hash != hash) continue; if (vp->v_mount != mp) @@ -113,7 +113,7 @@ vfs_hash_insert(struct vnode *vp, u_int while (1) { mtx_lock(&vfs_hash_mtx); LIST_FOREACH(vp2, - vfs_hash_index(vp->v_mount, hash), v_hashlist) { + vfs_hash_bucket(vp->v_mount, hash), v_hashlist) { if (vp2->v_hash != hash) continue; if (vp2->v_mount != vp->v_mount) @@ -138,7 +138,7 @@ vfs_hash_insert(struct vnode *vp, u_int } vp->v_hash = hash; - LIST_INSERT_HEAD(vfs_hash_index(vp->v_mount, hash), vp, v_hashlist); + LIST_INSERT_HEAD(vfs_hash_bucket(vp->v_mount, hash), vp, v_hashlist); mtx_unlock(&vfs_hash_mtx); return (0); } @@ -149,7 +149,7 @@ vfs_hash_rehash(struct vnode *vp, u_int mtx_lock(&vfs_hash_mtx); LIST_REMOVE(vp, v_hashlist); - LIST_INSERT_HEAD(vfs_hash_index(vp->v_mount, hash), vp, v_hashlist); + LIST_INSERT_HEAD(vfs_hash_bucket(vp->v_mount, hash), vp, v_hashlist); vp->v_hash = hash; mtx_unlock(&vfs_hash_mtx); } From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 05:41:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D099E5A6; Mon, 14 Jan 2013 05:41:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B09AF288; Mon, 14 Jan 2013 05:41:41 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0E5ffXt050677; Mon, 14 Jan 2013 05:41:41 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0E5ffTP050675; Mon, 14 Jan 2013 05:41:41 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301140541.r0E5ffTP050675@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 14 Jan 2013 05:41:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245406 - 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.14 Precedence: list List-Id: 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, 14 Jan 2013 05:41:41 -0000 Author: kib Date: Mon Jan 14 05:41:40 2013 New Revision: 245406 URL: http://svnweb.freebsd.org/changeset/base/245406 Log: Add exported vfs_hash_index() function, which calculates the canonical pre-masked hash for the given vnode. The function assumes that vp->v_hash is initialized by the filesystem vnode instantiation function. At the moment, it is only done if filesystem uses vfs_hash_insert(). Reviewed by: peter Tested by: peter, pho (previous version) Sponsored by: The FreeBSD Foundation MFC after: 5 days Modified: head/sys/kern/vfs_hash.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_hash.c ============================================================================== --- head/sys/kern/vfs_hash.c Mon Jan 14 05:40:21 2013 (r245405) +++ head/sys/kern/vfs_hash.c Mon Jan 14 05:41:40 2013 (r245406) @@ -54,6 +54,13 @@ vfs_hashinit(void *dummy __unused) /* Must be SI_ORDER_SECOND so desiredvnodes is available */ SYSINIT(vfs_hash, SI_SUB_VFS, SI_ORDER_SECOND, vfs_hashinit, NULL); +u_int +vfs_hash_index(struct vnode *vp) +{ + + return (vp->v_hash + vp->v_mount->mnt_hashseed); +} + static struct vfs_hash_head * vfs_hash_bucket(const struct mount *mp, u_int hash) { Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Mon Jan 14 05:40:21 2013 (r245405) +++ head/sys/sys/vnode.h Mon Jan 14 05:41:40 2013 (r245406) @@ -812,6 +812,7 @@ int fifo_printinfo(struct vnode *); typedef int vfs_hash_cmp_t(struct vnode *vp, void *arg); int vfs_hash_get(const struct mount *mp, u_int hash, int flags, struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg); +u_int vfs_hash_index(struct vnode *vp); int vfs_hash_insert(struct vnode *vp, u_int hash, int flags, struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg); void vfs_hash_rehash(struct vnode *vp, u_int hash); void vfs_hash_remove(struct vnode *vp); From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 05:42:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C5F6771D; Mon, 14 Jan 2013 05:42:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9B6C2293; Mon, 14 Jan 2013 05:42:54 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0E5gsWg050871; Mon, 14 Jan 2013 05:42:54 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0E5gsK0050870; Mon, 14 Jan 2013 05:42:54 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301140542.r0E5gsK0050870@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 14 Jan 2013 05:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245407 - 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.14 Precedence: list List-Id: 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, 14 Jan 2013 05:42:54 -0000 Author: kib Date: Mon Jan 14 05:42:54 2013 New Revision: 245407 URL: http://svnweb.freebsd.org/changeset/base/245407 Log: diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 7c243b6..0bdaf36 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -279,6 +279,7 @@ SYSCTL_INT(_debug, OID_AUTO, vnlru_nowhere, CTLFLAG_RW, #define VSHOULDFREE(vp) (!((vp)->v_iflag & VI_FREE) && !(vp)->v_holdcnt) #define VSHOULDBUSY(vp) (((vp)->v_iflag & VI_FREE) && (vp)->v_holdcnt) +static int vnsz2log; /* * Initialize the vnode management data structures. @@ -293,6 +294,7 @@ SYSCTL_INT(_debug, OID_AUTO, vnlru_nowhere, CTLFLAG_RW, static void vntblinit(void *dummy __unused) { + u_int i; int physvnodes, virtvnodes; /* @@ -332,6 +334,9 @@ vntblinit(void *dummy __unused) syncer_maxdelay = syncer_mask + 1; mtx_init(&sync_mtx, "Syncer mtx", NULL, MTX_DEF); cv_init(&sync_wakeup, "syncer"); + for (i = 1; i <= sizeof(struct vnode); i <<= 1) + vnsz2log++; + vnsz2log--; } SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_FIRST, vntblinit, NULL); @@ -1067,6 +1072,14 @@ alloc: } rangelock_init(&vp->v_rl); + /* + * For the filesystems which do not use vfs_hash_insert(), + * still initialize v_hash to have vfs_hash_index() useful. + * E.g., nullfs uses vfs_hash_index() on the lower vnode for + * its own hashing. + */ + vp->v_hash = (uintptr_t)vp >> vnsz2log; + *vpp = vp; return (0); } Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon Jan 14 05:41:40 2013 (r245406) +++ head/sys/kern/vfs_subr.c Mon Jan 14 05:42:54 2013 (r245407) @@ -279,6 +279,7 @@ SYSCTL_INT(_debug, OID_AUTO, vnlru_nowhe #define VSHOULDFREE(vp) (!((vp)->v_iflag & VI_FREE) && !(vp)->v_holdcnt) #define VSHOULDBUSY(vp) (((vp)->v_iflag & VI_FREE) && (vp)->v_holdcnt) +static int vnsz2log; /* * Initialize the vnode management data structures. @@ -293,6 +294,7 @@ SYSCTL_INT(_debug, OID_AUTO, vnlru_nowhe static void vntblinit(void *dummy __unused) { + u_int i; int physvnodes, virtvnodes; /* @@ -332,6 +334,9 @@ vntblinit(void *dummy __unused) syncer_maxdelay = syncer_mask + 1; mtx_init(&sync_mtx, "Syncer mtx", NULL, MTX_DEF); cv_init(&sync_wakeup, "syncer"); + for (i = 1; i <= sizeof(struct vnode); i <<= 1) + vnsz2log++; + vnsz2log--; } SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_FIRST, vntblinit, NULL); @@ -1067,6 +1072,14 @@ alloc: } rangelock_init(&vp->v_rl); + /* + * For the filesystems which do not use vfs_hash_insert(), + * still initialize v_hash to have vfs_hash_index() useful. + * E.g., nullfs uses vfs_hash_index() on the lower vnode for + * its own hashing. + */ + vp->v_hash = (uintptr_t)vp >> vnsz2log; + *vpp = vp; return (0); } From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 05:44:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4A6E58B1; Mon, 14 Jan 2013 05:44:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 24BF22AA; Mon, 14 Jan 2013 05:44:48 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0E5imom051171; Mon, 14 Jan 2013 05:44:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0E5imKI051170; Mon, 14 Jan 2013 05:44:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301140544.r0E5imKI051170@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 14 Jan 2013 05:44:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245408 - head/sys/fs/nullfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 05:44:48 -0000 Author: kib Date: Mon Jan 14 05:44:47 2013 New Revision: 245408 URL: http://svnweb.freebsd.org/changeset/base/245408 Log: The current default size of the nullfs hash table used to lookup the existing nullfs vnode by the lower vnode is only 16 slots. Since the default mode for the nullfs is to cache the vnodes, hash has extremely huge chains. Size the nullfs hashtbl based on the current value of desiredvnodes. Use vfs_hash_index() to calculate the hash bucket for a given vnode. Pointy hat to: kib Diagnosed and reviewed by: peter Tested by: peter, pho (previous version) Sponsored by: The FreeBSD Foundation MFC after: 5 days Modified: head/sys/fs/nullfs/null_subr.c Modified: head/sys/fs/nullfs/null_subr.c ============================================================================== --- head/sys/fs/nullfs/null_subr.c Mon Jan 14 05:42:54 2013 (r245407) +++ head/sys/fs/nullfs/null_subr.c Mon Jan 14 05:44:47 2013 (r245408) @@ -46,9 +46,6 @@ #include -#define LOG2_SIZEVNODE 8 /* log2(sizeof struct vnode) */ -#define NNULLNODECACHE 16 - /* * Null layer cache: * Each cache entry holds a reference to the lower vnode @@ -57,12 +54,11 @@ * alias is removed the lower vnode is vrele'd. */ -#define NULL_NHASH(vp) \ - (&null_node_hashtbl[(((uintptr_t)vp)>>LOG2_SIZEVNODE) & null_node_hash]) +#define NULL_NHASH(vp) (&null_node_hashtbl[vfs_hash_index(vp) & null_hash_mask]) static LIST_HEAD(null_node_hashhead, null_node) *null_node_hashtbl; -static u_long null_node_hash; -struct mtx null_hashmtx; +static struct mtx null_hashmtx; +static u_long null_hash_mask; static MALLOC_DEFINE(M_NULLFSHASH, "nullfs_hash", "NULLFS hash table"); MALLOC_DEFINE(M_NULLFSNODE, "nullfs_node", "NULLFS vnode private part"); @@ -77,8 +73,8 @@ nullfs_init(vfsp) struct vfsconf *vfsp; { - NULLFSDEBUG("nullfs_init\n"); /* printed during system boot */ - null_node_hashtbl = hashinit(NNULLNODECACHE, M_NULLFSHASH, &null_node_hash); + null_node_hashtbl = hashinit(desiredvnodes, M_NULLFSHASH, + &null_hash_mask); mtx_init(&null_hashmtx, "nullhs", NULL, MTX_DEF); return (0); } @@ -89,7 +85,7 @@ nullfs_uninit(vfsp) { mtx_destroy(&null_hashmtx); - hashdestroy(null_node_hashtbl, M_NULLFSHASH, null_node_hash); + hashdestroy(null_node_hashtbl, M_NULLFSHASH, null_hash_mask); return (0); } From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 05:45:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1F16FA32; Mon, 14 Jan 2013 05:45:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0FFBE2BA; Mon, 14 Jan 2013 05:45:34 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0E5jXTg051325; Mon, 14 Jan 2013 05:45:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0E5jXC3051324; Mon, 14 Jan 2013 05:45:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301140545.r0E5jXC3051324@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 14 Jan 2013 05:45:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245409 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 05:45:34 -0000 Author: kib Date: Mon Jan 14 05:45:33 2013 New Revision: 245409 URL: http://svnweb.freebsd.org/changeset/base/245409 Log: For zfs vnodes, use the standard inode number based hash algorithm. Reviewed and tested by: peter Sponsored by: The FreeBSD Foundation MFC after: 5 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon Jan 14 05:44:47 2013 (r245408) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon Jan 14 05:45:33 2013 (r245409) @@ -2025,6 +2025,8 @@ zfs_vget(vfs_t *vfsp, ino_t ino, int fla err = zfs_vnode_lock(*vpp, flags); if (err != 0) *vpp = NULL; + else + (*vpp)->v_hash = ino; return (err); } From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 05:46:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 15FB3BB9; Mon, 14 Jan 2013 05:46:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 03F4D2D0; Mon, 14 Jan 2013 05:46:50 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0E5kngV051538; Mon, 14 Jan 2013 05:46:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0E5kn6G051536; Mon, 14 Jan 2013 05:46:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301140546.r0E5kn6G051536@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 14 Jan 2013 05:46:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245410 - 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.14 Precedence: list List-Id: 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, 14 Jan 2013 05:46:50 -0000 Author: kib Date: Mon Jan 14 05:46:49 2013 New Revision: 245410 URL: http://svnweb.freebsd.org/changeset/base/245410 Log: Rearrange the struct bufobj and struct vnode layouts to reduce padding. On the amd64 kernel with INVARIANTS turned off, size of the struct vnode is reduced from 496 to 472 bytes, saving 24 bytes of memory and KVA per vnode. Noted and reviewed by: peter Tested by: pho Sponsored by: The FreeBSD Foundation Modified: head/sys/sys/bufobj.h head/sys/sys/vnode.h Modified: head/sys/sys/bufobj.h ============================================================================== --- head/sys/sys/bufobj.h Mon Jan 14 05:45:33 2013 (r245409) +++ head/sys/sys/bufobj.h Mon Jan 14 05:46:49 2013 (r245410) @@ -89,12 +89,7 @@ struct buf_ops { struct bufobj { struct mtx bo_mtx; /* Mutex which protects "i" things */ - struct bufv bo_clean; /* i Clean buffers */ - struct bufv bo_dirty; /* i Dirty buffers */ - long bo_numoutput; /* i Writes in progress */ - u_int bo_flag; /* i Flags */ struct buf_ops *bo_ops; /* - Buffer operations */ - int bo_bsize; /* - Block size for i/o */ struct vm_object *bo_object; /* v Place to store VM object */ LIST_ENTRY(bufobj) bo_synclist; /* S dirty vnode list */ void *bo_private; /* private pointer */ @@ -103,6 +98,11 @@ struct bufobj { * XXX: only to keep the syncer working * XXX: for now. */ + struct bufv bo_clean; /* i Clean buffers */ + struct bufv bo_dirty; /* i Dirty buffers */ + long bo_numoutput; /* i Writes in progress */ + u_int bo_flag; /* i Flags */ + int bo_bsize; /* - Block size for i/o */ }; /* Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Mon Jan 14 05:45:33 2013 (r245409) +++ head/sys/sys/vnode.h Mon Jan 14 05:46:49 2013 (r245410) @@ -99,7 +99,6 @@ struct vnode { * Fields which define the identity of the vnode. These fields are * owned by the filesystem (XXX: and vgone() ?) */ - enum vtype v_type; /* u vnode type */ const char *v_tag; /* u type of underlying data */ struct vop_vector *v_op; /* u vnode operations vector */ void *v_data; /* u private data for fs */ @@ -122,10 +121,10 @@ struct vnode { } v_un; /* - * vfs_hash: (mount + inode) -> vnode hash. + * vfs_hash: (mount + inode) -> vnode hash. The hash value + * itself is grouped with other int fields, to avoid padding. */ LIST_ENTRY(vnode) v_hashlist; - u_int v_hash; /* * VFS_namecache stuff @@ -135,24 +134,11 @@ struct vnode { struct namecache *v_cache_dd; /* c Cache entry for .. vnode */ /* - * clustering stuff - */ - daddr_t v_cstart; /* v start block of cluster */ - daddr_t v_lasta; /* v last allocation */ - daddr_t v_lastw; /* v last write */ - int v_clen; /* v length of cur. cluster */ - - /* * Locking */ struct lock v_lock; /* u (if fs don't have one) */ struct mtx v_interlock; /* lock for "i" things */ struct lock *v_vnlock; /* u pointer to vnode lock */ - int v_holdcnt; /* i prevents recycling. */ - int v_usecount; /* i ref count of users */ - u_int v_iflag; /* i vnode flags (see below) */ - u_int v_vflag; /* v vnode flags */ - int v_writecount; /* v ref count of writers */ /* * The machinery of being a vnode @@ -167,6 +153,22 @@ struct vnode { struct label *v_label; /* MAC label for vnode */ struct lockf *v_lockf; /* Byte-level advisory lock list */ struct rangelock v_rl; /* Byte-range lock */ + + /* + * clustering stuff + */ + daddr_t v_cstart; /* v start block of cluster */ + daddr_t v_lasta; /* v last allocation */ + daddr_t v_lastw; /* v last write */ + int v_clen; /* v length of cur. cluster */ + + int v_holdcnt; /* i prevents recycling. */ + int v_usecount; /* i ref count of users */ + u_int v_iflag; /* i vnode flags (see below) */ + u_int v_vflag; /* v vnode flags */ + int v_writecount; /* v ref count of writers */ + u_int v_hash; + enum vtype v_type; /* u vnode type */ }; #endif /* defined(_KERNEL) || defined(_KVM_VNODE) */ From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 05:46:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 06668BBA; Mon, 14 Jan 2013 05:46:54 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from onyx.glenbarber.us (onyx.glenbarber.us [IPv6:2607:fc50:1000:c200::face]) by mx1.freebsd.org (Postfix) with ESMTP id C825B2D2; Mon, 14 Jan 2013 05:46:53 +0000 (UTC) Received: from glenbarber.us (kaos.glenbarber.us [71.224.221.174]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: gjb) by onyx.glenbarber.us (Postfix) with ESMTPSA id 1DA5023F763; Mon, 14 Jan 2013 00:46:52 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.7.1 onyx.glenbarber.us 1DA5023F763 Authentication-Results: onyx.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none (insecure policy) Date: Mon, 14 Jan 2013 00:46:50 -0500 From: Glen Barber To: Konstantin Belousov Subject: Re: svn commit: r245407 - head/sys/kern Message-ID: <20130114054650.GA1359@glenbarber.us> References: <201301140542.r0E5gsK0050870@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="CxIGHgfcyU0Ip7+W" Content-Disposition: inline In-Reply-To: <201301140542.r0E5gsK0050870@svn.freebsd.org> X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 05:46:54 -0000 --CxIGHgfcyU0Ip7+W Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 14, 2013 at 05:42:54AM +0000, Konstantin Belousov wrote: > Author: kib > Date: Mon Jan 14 05:42:54 2013 > New Revision: 245407 > URL: http://svnweb.freebsd.org/changeset/base/245407 >=20 > Log: > diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c > index 7c243b6..0bdaf36 100644 > --- a/sys/kern/vfs_subr.c > +++ b/sys/kern/vfs_subr.c > @@ -279,6 +279,7 @@ SYSCTL_INT(_debug, OID_AUTO, vnlru_nowhere, CTLFLAG= _RW, > #define VSHOULDFREE(vp) (!((vp)->v_iflag & VI_FREE) && !(vp)->v_holdcn= t) > #define VSHOULDBUSY(vp) (((vp)->v_iflag & VI_FREE) && (vp)->v_holdcnt) > =20 > +static int vnsz2log; Is this accidental log? Glen --CxIGHgfcyU0Ip7+W Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBCAAGBQJQ85vKAAoJEFJPDDeguUajIvYH/ilTHF0RcTANjJfk5VECeO93 bNWXPFKtF8QveJluwYNDqCe127FQtVFdSSv7PhNp8De5ZljFS0gACxG35Zfj2cuS 0Q7Fj3jDquAiJdAxiGWUG1WYPQRHblAYeRO00H9i1R2ksyUcksqkY7kobmBWypeM rRKbf3m9ZoKgHM4g9LA0mZSHbjFDBDP/XdHkM74MXJUy3KEIQnlwDKHoElASRUDw 1vVfQL4kl/RujErY22w+9Oj5wJRDmUCDKTsbhbCTptoTT/P/iS6J6flxsQON9hW1 trDcq2b6WxzPRM/kEi1lb201FGah6RmA16J0y7E9SNih1iIxsguH55sikQNdne4= =xYap -----END PGP SIGNATURE----- --CxIGHgfcyU0Ip7+W-- From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 05:52:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 48863EBF; Mon, 14 Jan 2013 05:52:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3B4272FA; Mon, 14 Jan 2013 05:52:24 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0E5qOIY053850; Mon, 14 Jan 2013 05:52:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0E5qOKn053849; Mon, 14 Jan 2013 05:52:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301140552.r0E5qOKn053849@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 14 Jan 2013 05:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245411 - 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.14 Precedence: list List-Id: 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, 14 Jan 2013 05:52:24 -0000 Author: kib Date: Mon Jan 14 05:52:23 2013 New Revision: 245411 URL: http://svnweb.freebsd.org/changeset/base/245411 Log: Add a trivial comment to record the proper commit log for r245407: Set the v_hash for a new vnode in the getnewvnode() to the value calculated based on the vnode structure address. Filesystems using vfs_hash_insert() override the v_hash using the standard formula of (inode_number + mnt_hashseed). For other filesystems, the initialization allows the vfs_hash_index() to provide useful hash too. Suggested, reviewed and tested by: peter Sponsored by: The FreeBSD Foundation MFC after: 5 days Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon Jan 14 05:46:49 2013 (r245410) +++ head/sys/kern/vfs_subr.c Mon Jan 14 05:52:23 2013 (r245411) @@ -279,6 +279,7 @@ SYSCTL_INT(_debug, OID_AUTO, vnlru_nowhe #define VSHOULDFREE(vp) (!((vp)->v_iflag & VI_FREE) && !(vp)->v_holdcnt) #define VSHOULDBUSY(vp) (((vp)->v_iflag & VI_FREE) && (vp)->v_holdcnt) +/* Shift count for (uintptr_t)vp to initialize vp->v_hash. */ static int vnsz2log; /* From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 05:57:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 85C27112; Mon, 14 Jan 2013 05:57:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id F2E40330; Mon, 14 Jan 2013 05:57:48 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r0E5vi95078587; Mon, 14 Jan 2013 07:57:44 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.4 kib.kiev.ua r0E5vi95078587 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r0E5vibF078586; Mon, 14 Jan 2013 07:57:44 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 14 Jan 2013 07:57:44 +0200 From: Konstantin Belousov To: Glen Barber Subject: Re: svn commit: r245407 - head/sys/kern Message-ID: <20130114055744.GG2561@kib.kiev.ua> References: <201301140542.r0E5gsK0050870@svn.freebsd.org> <20130114054650.GA1359@glenbarber.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="dGMqxDINbOsorC0c" Content-Disposition: inline In-Reply-To: <20130114054650.GA1359@glenbarber.us> User-Agent: Mutt/1.5.21 (2010-09-15) 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 version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 05:57:49 -0000 --dGMqxDINbOsorC0c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 14, 2013 at 12:46:50AM -0500, Glen Barber wrote: > On Mon, Jan 14, 2013 at 05:42:54AM +0000, Konstantin Belousov wrote: > > Author: kib > > Date: Mon Jan 14 05:42:54 2013 > > New Revision: 245407 > > URL: http://svnweb.freebsd.org/changeset/base/245407 > >=20 > > Log: > > diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c > > index 7c243b6..0bdaf36 100644 > > --- a/sys/kern/vfs_subr.c > > +++ b/sys/kern/vfs_subr.c > > @@ -279,6 +279,7 @@ SYSCTL_INT(_debug, OID_AUTO, vnlru_nowhere, CTLFL= AG_RW, > > #define VSHOULDFREE(vp) (!((vp)->v_iflag & VI_FREE) && !(vp)->v_hold= cnt) > > #define VSHOULDBUSY(vp) (((vp)->v_iflag & VI_FREE) && (vp)->v_holdcn= t) > > =20 > > +static int vnsz2log; >=20 > Is this accidental log? Yes, I mistakenly used patch file name instead of the log file name for ci = -F. Proper commit message recorded in r245411. --dGMqxDINbOsorC0c Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQ855XAAoJEJDCuSvBvK1BxaIP/1nMY/bFIx1L8thEiMZZ0fz4 uuoP2xnMvnrnnhK49jUplVjKO+1EIX3iClMw9YS2fRHUNMr3+043qSHBUDIqsNS8 Gk3hrzuwk82A53uwFJ0P7ZCsNEx47kwsfnsIzbqaxRUSkxi0RWhFqlsHK0f/4QG3 55VB8ztMcDlxgjbBy0MEPp5eAcO9Yebn0ewJ0myyZHy3zKSjC7Oi48H/PXJC7Vdv cqYkolfqlYQirras8DQmJnKWyb11tDeRdcBGfzFun4PFrFLUo8hm6ecLkqHcGE3M BXMZVz7URz+LnBe6ApMTLfYDIZrw4bp1Dlw5eM7n8y2B2PiVXaxdHRmgm18dWXJL KRZYlxleV2kBgHQiZrc+/1i2W5ybektDSr1RVm2v1eAFiS73815WsnvtU+yD263D 3sio6aw4dDrJ0b7/JVu7hRy7qOxy68t5bgh2AW5qBSbbRZTihtZ123jay3svbsnr KKb0nceTF3g1LdEc2Azb4Yq8tDXgeBHNkvTrF4Px38AgoOJrN22ia3GvawQQgMQ+ W7xQMetNruQpffA9+RHyLEHsYfg270I7/ap2RpAf4aPAf/cUO3bb2TDoPWsLNHFp Wv9HZM9nNQQihLJ/raLdnUFIKoJ/i0dQDnPCnH/yhxu0EAkzg02ZntKGfBGy/20Z 9CWbXLQg/Oyqh4cAbFcx =ktXG -----END PGP SIGNATURE----- --dGMqxDINbOsorC0c-- From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 05:59:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B9A1F293; Mon, 14 Jan 2013 05:59:14 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from onyx.glenbarber.us (onyx.glenbarber.us [IPv6:2607:fc50:1000:c200::face]) by mx1.freebsd.org (Postfix) with ESMTP id 7F55133F; Mon, 14 Jan 2013 05:59:14 +0000 (UTC) Received: from glenbarber.us (kaos.glenbarber.us [71.224.221.174]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: gjb) by onyx.glenbarber.us (Postfix) with ESMTPSA id 28F1723F763; Mon, 14 Jan 2013 00:59:13 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.7.1 onyx.glenbarber.us 28F1723F763 Authentication-Results: onyx.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none (insecure policy) Date: Mon, 14 Jan 2013 00:59:11 -0500 From: Glen Barber To: Konstantin Belousov Subject: Re: svn commit: r245407 - head/sys/kern Message-ID: <20130114055911.GB1359@glenbarber.us> References: <201301140542.r0E5gsK0050870@svn.freebsd.org> <20130114054650.GA1359@glenbarber.us> <20130114055744.GG2561@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="HO3Ykb1C9doWAHv0" Content-Disposition: inline In-Reply-To: <20130114055744.GG2561@kib.kiev.ua> X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 05:59:14 -0000 --HO3Ykb1C9doWAHv0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 14, 2013 at 07:57:44AM +0200, Konstantin Belousov wrote: > On Mon, Jan 14, 2013 at 12:46:50AM -0500, Glen Barber wrote: > > On Mon, Jan 14, 2013 at 05:42:54AM +0000, Konstantin Belousov wrote: > > > Author: kib > > > Date: Mon Jan 14 05:42:54 2013 > > > New Revision: 245407 > > > URL: http://svnweb.freebsd.org/changeset/base/245407 > > >=20 > > > Log: > > > diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c > > > index 7c243b6..0bdaf36 100644 > > > --- a/sys/kern/vfs_subr.c > > > +++ b/sys/kern/vfs_subr.c > > > @@ -279,6 +279,7 @@ SYSCTL_INT(_debug, OID_AUTO, vnlru_nowhere, CTL= FLAG_RW, > > > #define VSHOULDFREE(vp) (!((vp)->v_iflag & VI_FREE) && !(vp)->v_ho= ldcnt) > > > #define VSHOULDBUSY(vp) (((vp)->v_iflag & VI_FREE) && (vp)->v_hold= cnt) > > > =20 > > > +static int vnsz2log; > >=20 > > Is this accidental log? >=20 > Yes, I mistakenly used patch file name instead of the log file name for c= i -F. > Proper commit message recorded in r245411. Ah. Thanks. Glen --HO3Ykb1C9doWAHv0 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBCAAGBQJQ856vAAoJEFJPDDeguUajcHYIAIjE34so9NHjFuNBbeWSL0uZ SsM2ABerT+R1BOgtu6/RqBF5TgVaaBGYcxs5kABzneGEwakNXB3s1tvpx4WZ90D1 FOgxyeGDDMvdzoF3lLLy8/LvJzib6ndd8Uh8mzmxcgTaaPwRaHpjtw+oU/yeWtXL ApZH+dYkoDmJKDHLHLZydP2pp6fUCK4PAQUsyyK3zMTPkXeljS+nHd5ffkWFdgiW yWyJLnNq6xfKnh1YAy50yzi5+MEZg/tcS0HdzAr++Whhz24y9dgZl3BlBSi8hJpE AOegpa1tegjewvuyCCSTHB9EZlE/seET+wSeaNEwFcPyAQEuZNLUBUjaRjpzvwc= =JG1G -----END PGP SIGNATURE----- --HO3Ykb1C9doWAHv0-- From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 07:17:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8BE8DE95; Mon, 14 Jan 2013 07:17:39 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7EF4D7C1; Mon, 14 Jan 2013 07:17:39 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0E7HdHZ078632; Mon, 14 Jan 2013 07:17:39 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0E7HdEs078630; Mon, 14 Jan 2013 07:17:39 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201301140717.r0E7HdEs078630@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 14 Jan 2013 07:17:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245412 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 07:17:39 -0000 Author: bapt Date: Mon Jan 14 07:17:38 2013 New Revision: 245412 URL: http://svnweb.freebsd.org/changeset/base/245412 Log: Directly uses calloc(3) instread of malloc(3) + memset(3) Reported by: Jeremy Chadwick MFC after: 3 days Modified: head/usr.sbin/pkg/dns_utils.c Modified: head/usr.sbin/pkg/dns_utils.c ============================================================================== --- head/usr.sbin/pkg/dns_utils.c Mon Jan 14 05:52:23 2013 (r245411) +++ head/usr.sbin/pkg/dns_utils.c Mon Jan 14 07:17:38 2013 (r245412) @@ -66,10 +66,9 @@ dns_getsrvinfo(const char *zone) p += len + NS_QFIXEDSZ; } - res = malloc(sizeof(struct dns_srvinfo) * ancount); + res = calloc(ancount, sizeof(struct dns_srvinfo)); if (res == NULL) return (NULL); - memset(res, 0, sizeof(struct dns_srvinfo) * ancount); n = 0; while (ancount > 0 && p < end) { From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 08:39:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id ED02FECE; Mon, 14 Jan 2013 08:39:48 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DE4EFCD1; Mon, 14 Jan 2013 08:39:48 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0E8dmJG002759; Mon, 14 Jan 2013 08:39:48 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0E8dmpt002758; Mon, 14 Jan 2013 08:39:48 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201301140839.r0E8dmpt002758@svn.freebsd.org> From: Andrew Turner Date: Mon, 14 Jan 2013 08:39:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245413 - head/contrib/gcc/config/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 08:39:49 -0000 Author: andrew Date: Mon Jan 14 08:39:48 2013 New Revision: 245413 URL: http://svnweb.freebsd.org/changeset/base/245413 Log: Switch the default CPU to an arm9. This removes compiler support for the unsupported 26-bit addressing mode. This change is required for moving to the ARM EABI. Modified: head/contrib/gcc/config/arm/freebsd.h Modified: head/contrib/gcc/config/arm/freebsd.h ============================================================================== --- head/contrib/gcc/config/arm/freebsd.h Mon Jan 14 07:17:38 2013 (r245412) +++ head/contrib/gcc/config/arm/freebsd.h Mon Jan 14 08:39:48 2013 (r245413) @@ -97,7 +97,7 @@ #define TARGET_VERSION fprintf (stderr, " (FreeBSD/armv6 ELF)"); #else #undef SUBTARGET_CPU_DEFAULT -#define SUBTARGET_CPU_DEFAULT TARGET_CPU_strongarm +#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9 #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (FreeBSD/StrongARM ELF)"); #endif From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 09:11:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F23007A6; Mon, 14 Jan 2013 09:11:18 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CD12CE30; Mon, 14 Jan 2013 09:11:18 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0E9BIdr013862; Mon, 14 Jan 2013 09:11:18 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0E9BIeC013861; Mon, 14 Jan 2013 09:11:18 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201301140911.r0E9BIeC013861@svn.freebsd.org> From: Andrew Turner Date: Mon, 14 Jan 2013 09:11:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245414 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 09:11:19 -0000 Author: andrew Date: Mon Jan 14 09:11:18 2013 New Revision: 245414 URL: http://svnweb.freebsd.org/changeset/base/245414 Log: Update sigcode to use both the current ABI and FreeBSD's version of the ARM EABI syscall calling convention. The current ABI encodes the syscall number in the instruction. This causes issues with the thumb mode as it only has 8 bits to encode this value and we have too many system calls and by using a register will simplify the code to get the syscall number in the kernel. With the ARM EABI we reuse the Linux calling convention by storing the value in r7. Because of this we use both methods to encode the syscall number in this function. Modified: head/sys/arm/arm/locore.S Modified: head/sys/arm/arm/locore.S ============================================================================== --- head/sys/arm/arm/locore.S Mon Jan 14 08:39:48 2013 (r245413) +++ head/sys/arm/arm/locore.S Mon Jan 14 09:11:18 2013 (r245414) @@ -484,12 +484,29 @@ ENTRY_NP(abort) ENTRY_NP(sigcode) mov r0, sp + + /* + * Call the sigreturn system call. + * + * We have to load r7 manually rather than using + * "ldr r7, =SYS_sigreturn" to ensure the value of szsigcode is + * correct. Using the alternative places esigcode at the address + * of the data rather than the address one past the data. + */ + + ldr r7, [pc, #12] /* Load SYS_sigreturn */ swi SYS_sigreturn /* Well if that failed we better exit quick ! */ + ldr r7, [pc, #8] /* Load SYS_exit */ swi SYS_exit - b . - 8 + + /* Branch back to retry SYS_sigreturn */ + b . - 16 + + .word SYS_sigreturn + .word SYS_exit .align 0 .global _C_LABEL(esigcode) From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 11:03:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3FCDFB9; Mon, 14 Jan 2013 11:03:14 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2037036B; Mon, 14 Jan 2013 11:03:14 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0EB3D4c046989; Mon, 14 Jan 2013 11:03:13 GMT (envelope-from jlh@svn.freebsd.org) Received: (from jlh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0EB3DBN046987; Mon, 14 Jan 2013 11:03:13 GMT (envelope-from jlh@svn.freebsd.org) Message-Id: <201301141103.r0EB3DBN046987@svn.freebsd.org> From: Jeremie Le Hen Date: Mon, 14 Jan 2013 11:03:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245418 - head/usr.bin/stdbuf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 11:03:14 -0000 Author: jlh Date: Mon Jan 14 11:03:13 2013 New Revision: 245418 URL: http://svnweb.freebsd.org/changeset/base/245418 Log: Allow commands without any additional arguments, as stated in the manpage. While here, exit early when there is nothing to do. PR: 168415 Submitted by: Zhihao Yuan (initial version) MFC after: 1 week Approved by: kib (mentor) Modified: head/usr.bin/stdbuf/stdbuf.c Modified: head/usr.bin/stdbuf/stdbuf.c ============================================================================== --- head/usr.bin/stdbuf/stdbuf.c Mon Jan 14 11:00:06 2013 (r245417) +++ head/usr.bin/stdbuf/stdbuf.c Mon Jan 14 11:03:13 2013 (r245418) @@ -72,8 +72,8 @@ main(int argc, char *argv[]) } argc -= optind; argv += optind; - if (argc < 2) - usage(0); + if (argc == 0) + exit(0); if (ibuf != NULL && setenv("_STDBUF_I", ibuf, 1) == -1) warn("Failed to set environment variable: %s=%s", From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 11:06:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 19C644D8; Mon, 14 Jan 2013 11:06:51 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0CBB3651; Mon, 14 Jan 2013 11:06:51 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0EB6ovu047701; Mon, 14 Jan 2013 11:06:50 GMT (envelope-from jlh@svn.freebsd.org) Received: (from jlh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0EB6oFa047700; Mon, 14 Jan 2013 11:06:50 GMT (envelope-from jlh@svn.freebsd.org) Message-Id: <201301141106.r0EB6oFa047700@svn.freebsd.org> From: Jeremie Le Hen Date: Mon, 14 Jan 2013 11:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245419 - head/usr.bin/stdbuf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 11:06:51 -0000 Author: jlh Date: Mon Jan 14 11:06:50 2013 New Revision: 245419 URL: http://svnweb.freebsd.org/changeset/base/245419 Log: Remove stray tabs. Submitted by: kib Approved by: kib (mentor) MFC after: 1 week Modified: head/usr.bin/stdbuf/stdbuf.c Modified: head/usr.bin/stdbuf/stdbuf.c ============================================================================== --- head/usr.bin/stdbuf/stdbuf.c Mon Jan 14 11:03:13 2013 (r245418) +++ head/usr.bin/stdbuf/stdbuf.c Mon Jan 14 11:06:50 2013 (r245419) @@ -39,7 +39,7 @@ extern char *__progname; static void usage(int s) { - + fprintf(stderr, "Usage: %s [-e 0|L|] [-i 0|L|] [-o 0|L|] " " [args ...]\n", __progname); exit(s); @@ -94,7 +94,7 @@ main(int argc, char *argv[]) if (i < 0 || putenv(preload1) == -1) warn("Failed to set environment variable: LD_PRELOAD"); - + preload0 = getenv("LD_32_PRELOAD"); if (preload0 == NULL) i = asprintf(&preload1, "LD_32_PRELOAD=" LIBSTDBUF32); From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 12:12:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1AA3E6F6; Mon, 14 Jan 2013 12:12:57 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0DB25E8B; Mon, 14 Jan 2013 12:12:57 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0ECCudL068804; Mon, 14 Jan 2013 12:12:56 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0ECCujt068802; Mon, 14 Jan 2013 12:12:56 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201301141212.r0ECCujt068802@svn.freebsd.org> From: Andrey Zonov Date: Mon, 14 Jan 2013 12:12:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245421 - 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.14 Precedence: list List-Id: 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, 14 Jan 2013 12:12:57 -0000 Author: zont Date: Mon Jan 14 12:12:56 2013 New Revision: 245421 URL: http://svnweb.freebsd.org/changeset/base/245421 Log: - Get rid of unused function vmspace_wired_count(). Reviewed by: alc Approved by: kib (mentor) MFC after: 1 week Modified: head/sys/vm/vm_map.c head/sys/vm/vm_map.h Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Mon Jan 14 11:13:31 2013 (r245420) +++ head/sys/vm/vm_map.c Mon Jan 14 12:12:56 2013 (r245421) @@ -726,12 +726,6 @@ vmspace_resident_count(struct vmspace *v return pmap_resident_count(vmspace_pmap(vmspace)); } -long -vmspace_wired_count(struct vmspace *vmspace) -{ - return pmap_wired_count(vmspace_pmap(vmspace)); -} - /* * vm_map_create: * Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Mon Jan 14 11:13:31 2013 (r245420) +++ head/sys/vm/vm_map.h Mon Jan 14 12:12:56 2013 (r245421) @@ -298,7 +298,6 @@ void vm_map_wait_busy(vm_map_t map); _vm_map_lock_downgrade(map, LOCK_FILE, LOCK_LINE) long vmspace_resident_count(struct vmspace *vmspace); -long vmspace_wired_count(struct vmspace *vmspace); #endif /* _KERNEL */ From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 12:20:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5A812907; Mon, 14 Jan 2013 12:20:56 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4B653ED0; Mon, 14 Jan 2013 12:20:56 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0ECKuqd071484; Mon, 14 Jan 2013 12:20:56 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0ECKtY4071480; Mon, 14 Jan 2013 12:20:55 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201301141220.r0ECKtY4071480@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 14 Jan 2013 12:20:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245422 - in head: bin/sh tools/regression/bin/sh/expansion X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 12:20:56 -0000 Author: jilles Date: Mon Jan 14 12:20:55 2013 New Revision: 245422 URL: http://svnweb.freebsd.org/changeset/base/245422 Log: sh: Pass $? to command substitution containing compound/multiple commands. Example: false; echo $(echo $?; :) Added: head/tools/regression/bin/sh/expansion/cmdsubst17.0 (contents, props changed) Modified: head/bin/sh/eval.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Mon Jan 14 12:12:56 2013 (r245421) +++ head/bin/sh/eval.c Mon Jan 14 12:20:55 2013 (r245422) @@ -624,8 +624,8 @@ evalbackcmd(union node *n, struct backcm exitstatus = 0; goto out; } + exitstatus = oexitstatus; if (is_valid_fast_cmdsubst(n)) { - exitstatus = oexitstatus; savelocalvars = localvars; localvars = NULL; forcelocal++; @@ -649,7 +649,6 @@ evalbackcmd(union node *n, struct backcm poplocalvars(); localvars = savelocalvars; } else { - exitstatus = 0; if (pipe(pip) < 0) error("Pipe call failed: %s", strerror(errno)); jp = makejob(n, 1); Added: head/tools/regression/bin/sh/expansion/cmdsubst17.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/cmdsubst17.0 Mon Jan 14 12:20:55 2013 (r245422) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +f() { return 3; } +f +[ `echo $?; :` = 3 ] From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 13:06:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E8D79147; Mon, 14 Jan 2013 13:06:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B74B67C1; Mon, 14 Jan 2013 13:06:35 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0ED6ZsZ084619; Mon, 14 Jan 2013 13:06:35 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0ED6ZCB084618; Mon, 14 Jan 2013 13:06:35 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301141306.r0ED6ZCB084618@svn.freebsd.org> From: Alexander Motin Date: Mon, 14 Jan 2013 13:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245423 - head/sys/geom/raid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 13:06:36 -0000 Author: mav Date: Mon Jan 14 13:06:35 2013 New Revision: 245423 URL: http://svnweb.freebsd.org/changeset/base/245423 Log: Print some more metadata fields. Modified: head/sys/geom/raid/md_intel.c Modified: head/sys/geom/raid/md_intel.c ============================================================================== --- head/sys/geom/raid/md_intel.c Mon Jan 14 12:20:55 2013 (r245422) +++ head/sys/geom/raid/md_intel.c Mon Jan 14 13:06:35 2013 (r245423) @@ -179,7 +179,7 @@ struct intel_raid_conf { uint8_t error_log_pos; uint8_t dummy_2[1]; uint32_t cache_size; - uint32_t orig_family_num; + uint32_t orig_config_id; uint32_t pwr_cycle_count; uint32_t bbm_log_size; uint32_t filler_0[35]; @@ -385,14 +385,17 @@ g_raid_md_intel_print(struct intel_raid_ printf("attributes 0x%08x\n", meta->attributes); printf("total_disks %u\n", meta->total_disks); printf("total_volumes %u\n", meta->total_volumes); - printf("orig_family_num 0x%08x\n", meta->orig_family_num); + printf("error_log_pos %u\n", meta->error_log_pos); + printf("cache_size %u\n", meta->cache_size); + printf("orig_config_id 0x%08x\n", meta->orig_config_id); + printf("pwr_cycle_count %u\n", meta->pwr_cycle_count); printf("bbm_log_size %u\n", meta->bbm_log_size); - printf("DISK# serial disk_sectors disk_sectors_hi disk_id flags\n"); + printf("DISK# serial disk_sectors disk_sectors_hi disk_id flags owner\n"); for (i = 0; i < meta->total_disks; i++ ) { - printf(" %d <%.16s> %u %u 0x%08x 0x%08x\n", i, + printf(" %d <%.16s> %u %u 0x%08x 0x%08x %08x\n", i, meta->disk[i].serial, meta->disk[i].sectors, - meta->disk[i].sectors_hi, - meta->disk[i].id, meta->disk[i].flags); + meta->disk[i].sectors_hi, meta->disk[i].id, + meta->disk[i].flags, meta->disk[i].owner_cfg_num); } for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); @@ -414,6 +417,9 @@ g_raid_md_intel_print(struct intel_raid_ printf(" migr_state %u\n", mvol->migr_state); printf(" migr_type %u\n", mvol->migr_type); printf(" dirty %u\n", mvol->dirty); + printf(" fs_state %u\n", mvol->fs_state); + printf(" verify_errors %u\n", mvol->verify_errors); + printf(" bad_blocks %u\n", mvol->bad_blocks); for (j = 0; j < (mvol->migr_state ? 2 : 1); j++) { printf(" *** Map %d ***\n", j); From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 15:00:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 763FF927 for ; Mon, 14 Jan 2013 15:00:54 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id C0F04E01 for ; Mon, 14 Jan 2013 15:00:53 +0000 (UTC) Received: (qmail 61599 invoked from network); 14 Jan 2013 16:23:47 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 14 Jan 2013 16:23:47 -0000 Message-ID: <50F41DA3.8060300@freebsd.org> Date: Mon, 14 Jan 2013 16:00:51 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Alan Cox Subject: Re: svn commit: r243631 - in head/sys: kern sys References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50C1BC90.90106@freebsd.org> <50C25A27.4060007@bluezbox.com> <50C26331.6030504@freebsd.org> <50C26AE9.4020600@bluezbox.com> <50C3A3D3.9000804@freebsd.org> <50C3AF72.4010902@rice.edu> <330405A1-312A-45A5-BB86-4969478D8BBD@bluezbox.com> <50D03E83.8060908@rice.edu> <50DD081E.8000409@bluezbox.com> <50EB1841.5030006@bluezbox.com> <50F28806.10505@rice.edu> In-Reply-To: <50F28806.10505@rice.edu> Content-Type: multipart/mixed; boundary="------------060703050804030003000002" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Oleksandr Tymoshenko X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 15:00:54 -0000 This is a multi-part message in MIME format. --------------060703050804030003000002 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit On 13.01.2013 11:10, Alan Cox wrote: > On 01/07/2013 12:47, Oleksandr Tymoshenko wrote: >> On 12/27/2012 6:46 PM, Oleksandr Tymoshenko wrote: >>> On 12/18/2012 1:59 AM, Alan Cox wrote: >>>> On 12/17/2012 23:40, Oleksandr Tymoshenko wrote: >>>>> On 2012-12-08, at 1:21 PM, Alan Cox wrote: >>>> That makes sense. However, "virtual_avail" isn't the start of the >>>> kernel address space. The kernel map always starts at >>>> VM_MIN_KERNEL_ADDRESS. (See kmem_init().) "virtual_avail" represents >>>> the next unallocated virtual address in the kernel address space at an >>>> early point in initialization. "virtual_avail" and "virtual_end" >>>> aren't >>>> used after that, or outside the VM system. Please use >>>> vm_map_min(kernel_map) and vm_map_max(kernel_map) instead. >>> >>> I checked: kernel_map is not available (NULL) at this point. So we >>> can't use it to >>> determine real KVA size. Closest thing we can get is >>> virtual_avail/virtual_end pair. >>> >>> Andre, could you approve attached patch for commit or suggest better >>> solution? >> >> Any update on this one? Can I proceed with commit? >> > > Yes, I've now spent a little bit of time looking at this, and I don't > see why these calculations and tunable_mbinit() need to be performed > before the kernel map is initialized. > > Let me summarize what I found: > > 1. The function tunable_mbinit() now has a dependency on the global > variable maxmbufmem. tunable_mbinit() is executed under > SI_SUB_TUNABLES. tunable_mbinit() defines the global variable > nmbclusters. The statements made in the comment at the head of > tunable_mbinit() all appear to be false: > > /* > * tunable_mbinit() has to be run before init_maxsockets() thus > * the SYSINIT order below is SI_ORDER_MIDDLE while init_maxsockets() > * runs at SI_ORDER_ANY. > * > * NB: This has to be done before VM init. > */ > > I don't see anything in init_maxsockets() that depends on > tunable_mbinit(). Moreover, the statement about "VM init" is only > correct if you regard the initialization of the kernel's malloc as "VM > init". This seems to be historic cruft. The dependency on maxsockets was removed recently with the autotuning improvements. A patch moving the maxmbufmem calculation into tunable_mbinit() and changing it to SI_SUB_KMEM which comes after the VM initialization is attached. > 2. The function kmeminit() in kern/kern_malloc.c has a dependency on the > global variable nmbclusters. kmeminit() is executed under SI_SUB_KMEM, > which comes after the initialization of the virtual memory system, > including the kernel map. The use of nmbclusters in kmeminit seems to be bogus. I think it comes from the times when the mbuf allocator was directly layered on top of the VM, that is before UMA. kmeminit() should not use nmbclusters. The computations done in kmeminit() do not make a whole lot of sense to me. But I'm no expert in that area. > 3. The function vm_ksubmap_init() has a dependency on the global > variable maxpipekva. vm_ksubmap_init() is executed under SI_SUB_CPU, > which comes after SI_SUB_KMEM. > > Am I missing anything? > > I'm attaching a patch that defers the calculation of maxpipekva until we > actually need it in vm_ksubmap_init(). Any comments on this patch are > welcome. Looks good to me. Perhaps the whole calculation and setup of the pipe_map could be moved to kern/sys_pipe.c:pipeinit() to have it all together. -- Andre --------------060703050804030003000002 Content-Type: text/plain; charset=windows-1252; name="maxmbufmem.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="maxmbufmem.diff" Index: sys/mbuf.h =================================================================== --- sys/mbuf.h (revision 245423) +++ sys/mbuf.h (working copy) @@ -384,7 +384,6 @@ * * The rest of it is defined in kern/kern_mbuf.c */ -extern quad_t maxmbufmem; extern uma_zone_t zone_mbuf; extern uma_zone_t zone_clust; extern uma_zone_t zone_pack; Index: kern/kern_mbuf.c =================================================================== --- kern/kern_mbuf.c (revision 245423) +++ kern/kern_mbuf.c (working copy) @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -104,16 +105,25 @@ struct mbstat mbstat; /* - * tunable_mbinit() has to be run before init_maxsockets() thus - * the SYSINIT order below is SI_ORDER_MIDDLE while init_maxsockets() - * runs at SI_ORDER_ANY. - * - * NB: This has to be done before VM init. + * tunable_mbinit() has to be run before any mbuf allocations are done. */ static void tunable_mbinit(void *dummy) { + quad_t realmem, maxmbufmem; + /* + * The default limit for all mbuf related memory is 1/2 of all + * available kernel memory (physical or kmem). + * At most it can be 3/4 of available kernel memory. + */ + realmem = qmin((quad_t)physmem * PAGE_SIZE, + vm_map_max(kernel_map) - vm_map_min(kernel_map)); + maxmbufmem = realmem / 2; + TUNABLE_QUAD_FETCH("kern.maxmbufmem", &maxmbufmem); + if (maxmbufmem > realmem / 4 * 3) + maxmbufmem = realmem / 4 * 3; + TUNABLE_INT_FETCH("kern.ipc.nmbclusters", &nmbclusters); if (nmbclusters == 0) nmbclusters = maxmbufmem / MCLBYTES / 4; @@ -139,7 +149,7 @@ nmbufs = lmax(maxmbufmem / MSIZE / 5, nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16); } -SYSINIT(tunable_mbinit, SI_SUB_TUNABLES, SI_ORDER_MIDDLE, tunable_mbinit, NULL); +SYSINIT(tunable_mbinit, SI_SUB_KMEM, SI_ORDER_MIDDLE, tunable_mbinit, NULL); static int sysctl_nmbclusters(SYSCTL_HANDLER_ARGS) @@ -279,16 +289,14 @@ static void mb_zfini_pack(void *, int); static void mb_reclaim(void *); -static void mbuf_init(void *); static void *mbuf_jumbo_alloc(uma_zone_t, int, uint8_t *, int); -/* Ensure that MSIZE must be a power of 2. */ +/* Ensure that MSIZE is a power of 2. */ CTASSERT((((MSIZE - 1) ^ MSIZE) + 1) >> 1 == MSIZE); /* * Initialize FreeBSD Network buffer allocation. */ -SYSINIT(mbuf, SI_SUB_MBUF, SI_ORDER_FIRST, mbuf_init, NULL); static void mbuf_init(void *dummy) { @@ -396,6 +404,7 @@ mbstat.sf_iocnt = 0; mbstat.sf_allocwait = mbstat.sf_allocfail = 0; } +SYSINIT(mbuf, SI_SUB_MBUF, SI_ORDER_FIRST, mbuf_init, NULL); /* * UMA backend page allocator for the jumbo frame zones. Index: kern/subr_param.c =================================================================== --- kern/subr_param.c (revision 245423) +++ kern/subr_param.c (working copy) @@ -93,7 +93,6 @@ int nbuf; int ngroups_max; /* max # groups per process */ int nswbuf; -quad_t maxmbufmem; /* max mbuf memory */ pid_t pid_max = PID_MAX; long maxswzone; /* max swmeta KVA storage */ long maxbcache; /* max buffer cache KVA storage */ @@ -272,7 +271,6 @@ void init_param2(long physpages) { - quad_t realmem; /* Base parameters */ maxusers = MAXUSERS; @@ -329,18 +327,6 @@ TUNABLE_INT_FETCH("kern.ncallout", &ncallout); /* - * The default limit for all mbuf related memory is 1/2 of all - * available kernel memory (physical or kmem). - * At most it can be 3/4 of available kernel memory. - */ - realmem = qmin((quad_t)physpages * PAGE_SIZE, - VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS); - maxmbufmem = realmem / 2; - TUNABLE_QUAD_FETCH("kern.maxmbufmem", &maxmbufmem); - if (maxmbufmem > (realmem / 4) * 3) - maxmbufmem = (realmem / 4) * 3; - - /* * The default for maxpipekva is min(1/64 of the kernel address space, * max(1/64 of main memory, 512KB)). See sys_pipe.c for more details. */ --------------060703050804030003000002-- From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 15:05:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D1743AE8; Mon, 14 Jan 2013 15:05:23 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A6A19E38; Mon, 14 Jan 2013 15:05:23 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0EF5N69021258; Mon, 14 Jan 2013 15:05:23 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0EF5N18021253; Mon, 14 Jan 2013 15:05:23 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201301141505.r0EF5N18021253@svn.freebsd.org> From: Sean Bruno Date: Mon, 14 Jan 2013 15:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245424 - head/sys/boot/i386/libi386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 15:05:23 -0000 Author: sbruno Date: Mon Jan 14 15:05:22 2013 New Revision: 245424 URL: http://svnweb.freebsd.org/changeset/base/245424 Log: Quiesce some clang warnings while we're here doing stuff. Submitted by: Hiren Panchasara Obtained from: Yahoo! Inc Modified: head/sys/boot/i386/libi386/bootinfo64.c head/sys/boot/i386/libi386/devicename.c head/sys/boot/i386/libi386/pxe.c Modified: head/sys/boot/i386/libi386/bootinfo64.c ============================================================================== --- head/sys/boot/i386/libi386/bootinfo64.c Mon Jan 14 13:06:35 2013 (r245423) +++ head/sys/boot/i386/libi386/bootinfo64.c Mon Jan 14 15:05:22 2013 (r245424) @@ -134,7 +134,8 @@ bi_checkcpu(void) { char *cpu_vendor; int vendor[3]; - int eflags, regs[4]; + int eflags; + unsigned int regs[4]; /* Check for presence of "cpuid". */ eflags = read_eflags(); Modified: head/sys/boot/i386/libi386/devicename.c ============================================================================== --- head/sys/boot/i386/libi386/devicename.c Mon Jan 14 13:06:35 2013 (r245423) +++ head/sys/boot/i386/libi386/devicename.c Mon Jan 14 15:05:22 2013 (r245424) @@ -128,7 +128,7 @@ i386_parsedev(struct i386_devdesc **dev, goto fail; } } else { - cp = np; + cp = (char *)np; } if (*cp && (*cp != ':')) { err = EINVAL; Modified: head/sys/boot/i386/libi386/pxe.c ============================================================================== --- head/sys/boot/i386/libi386/pxe.c Mon Jan 14 13:06:35 2013 (r245423) +++ head/sys/boot/i386/libi386/pxe.c Mon Jan 14 15:05:22 2013 (r245424) @@ -88,6 +88,12 @@ static int pxe_netif_get(struct iodesc * static int pxe_netif_put(struct iodesc *desc, void *pkt, size_t len); static void pxe_netif_end(struct netif *nif); +#ifdef OLD_NFSV2 +int nfs_getrootfh(struct iodesc*, char*, u_char*); +#else +int nfs_getrootfh(struct iodesc*, char*, uint32_t*, u_char*); +#endif + extern struct netif_stats pxe_st[]; extern u_int16_t __bangpxeseg; extern u_int16_t __bangpxeoff; From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 15:09:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C95A7CD1 for ; Mon, 14 Jan 2013 15:09:02 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 145FDE73 for ; Mon, 14 Jan 2013 15:09:01 +0000 (UTC) Received: (qmail 61629 invoked from network); 14 Jan 2013 16:31:55 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 14 Jan 2013 16:31:55 -0000 Message-ID: <50F41F8C.5030900@freebsd.org> Date: Mon, 14 Jan 2013 16:09:00 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Alfred Perlstein Subject: Re: svn commit: r243631 - in head/sys: kern sys References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50C1BC90.90106@freebsd.org> <50C25A27.4060007@bluezbox.com> <50C26331.6030504@freebsd.org> <50C26AE9.4020600@bluezbox.com> <50C3A3D3.9000804@freebsd.org> <50C3AF72.4010902@rice.edu> <330405A1-312A-45A5-BB86-4969478D8BBD@bluezbox.com> <50D03E83.8060908@rice.edu> <50DD081E.8000409@bluezbox.com> <50EB1841.5030006@bluezbox.com> <50EB22D2.6090103@rice.edu> <50EB415F.8020405@freebsd.org> <50F04FE5.7010406@rice.edu> <50F1BD69.4060104@mu.org> <50F2F79C.7040109@mu.org> In-Reply-To: <50F2F79C.7040109@mu.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , src-committers@freebsd.org, Alan Cox , "Jayachandran C." , svn-src-all@freebsd.org, Oleksandr Tymoshenko , freebsd-arch@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 15:09:02 -0000 On 13.01.2013 19:06, Alfred Perlstein wrote: > On 1/12/13 10:32 PM, Adrian Chadd wrote: >> On 12 January 2013 11:45, Alfred Perlstein wrote: >> >>> I'm not sure if regressing to the waterfall method of development is a good >>> idea at this point. >>> >>> I see a light at the end of the tunnel and we to continue to just handle >>> these minor corner cases as we progress. >>> >>> If we move to a model where a minor bug is grounds to completely remove >>> helpful code then nothing will ever get done. >>> >> Allocating 512MB worth of callwheels on a 16GB MIPS machine is a >> little silly, don't you think? >> >> That suggests to me that the extent of which maxfiles/maxusers/etc >> percolates the codebase wasn't totally understood by those who wish to >> change it. >> >> I'd rather see some more investigative work into outlining things that >> need fixing and start fixing those, rather than "just change stuff and >> fix whatever issues creep up." >> >> I kinda hope we all understand what we're working on in the kernel a >> little better than that. > > Cool! I'm glad people are now aware of the callwheel allocation being insane with large maxusers. > > I saw this about a month ago (if not longer), but since there were half a dozen people calling me an > imbecile who hadn't really yet read the code I didn't want to inflame them more by fixing that with > "a hack". (actually a simple fix). > > A simple fix is to clamp callwheel size to the previous result of a maxusers of 384 and call it a day. > > However the simplicity of that approach would probably inflame too many feelings so I am unsure as > how to proceed. > > Any ideas? I noticed the callwheel dependency as well and asked mav@ about it in a short email exchange. He said it has only little use and goes away with the calloutng import. While that is outstanding we need to clamp it to a sane value. However I don't know what a sane value would be and why its size is directly derived from maxproc and maxfiles. If there can be one callout per process and open file descriptor in the system, then it probably has to be so big. If it can deal with 'collisions' in the wheel it can be much smaller. -- Andre From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 15:14:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8FCD3F75; Mon, 14 Jan 2013 15:14:32 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by mx1.freebsd.org (Postfix) with ESMTP id 4A816EBB; Mon, 14 Jan 2013 15:14:32 +0000 (UTC) Received: by mail-pa0-f45.google.com with SMTP id bg2so2267831pad.4 for ; Mon, 14 Jan 2013 07:14:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:x-mailer:from:subject:date :to; bh=QVTJtgiPvpr4DyN8mmHj3qWNe0wC2ZY4qlU6qoVknbY=; b=R7Fajh1L7Yd+4zxvqK+Tt9WNILM0szNN7oRQWRe1zQX4sLVEAaQltkMNSgOiXpcmQn ZZUBDiTuw9le1MjfvAoih4R7apppH53R3F53UkkPVQjt1QkiT/R0BXVz2OlV1mcg/bz1 vqGZZ06IdwbO4CS0emhlqULOjFOAuK9Kj85IiKq1DXoIDwJ5LZZFt4zSGgSPdLOCqhOG D9K6w/G0KAmYqGmqTVyjUrEeQWWgp5PMV7RPKU3aZHFGak1Asp9JX542Nw7O2VmnevE5 jdp39STHdZ9avkQR11jPsGGskpJZrF7uiPbKsBcVJZf+gjuppIyh6aogrrk/Ldiwzyq+ jTkg== X-Received: by 10.68.241.65 with SMTP id wg1mr259388004pbc.141.1358176466092; Mon, 14 Jan 2013 07:14:26 -0800 (PST) Received: from [10.175.95.150] (mobile-166-137-218-105.mycingular.net. [166.137.218.105]) by mx.google.com with ESMTPS id im4sm8360021pbc.13.2013.01.14.07.14.23 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Jan 2013 07:14:25 -0800 (PST) References: <201301141505.r0EF5N18021253@svn.freebsd.org> Mime-Version: 1.0 (1.0) In-Reply-To: <201301141505.r0EF5N18021253@svn.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <45AA9DA0-E3F9-4AE7-A7E4-B9504B916038@gmail.com> X-Mailer: iPhone Mail (10A523) From: Garrett Cooper Subject: Re: svn commit: r245424 - head/sys/boot/i386/libi386 Date: Mon, 14 Jan 2013 07:14:19 -0800 To: Sean Bruno Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 15:14:32 -0000 Thanks for taking care of these. I have a pr open to handle more issues, but= this took care of a chunk of them. Thanks, -Garrett Sent from my iPhone On Jan 14, 2013, at 7:05 AM, Sean Bruno wrote: > Author: sbruno > Date: Mon Jan 14 15:05:22 2013 > New Revision: 245424 > URL: http://svnweb.freebsd.org/changeset/base/245424 >=20 > Log: > Quiesce some clang warnings while we're here doing stuff. >=20 > Submitted by: Hiren Panchasara > Obtained from: Yahoo! Inc >=20 > Modified: > head/sys/boot/i386/libi386/bootinfo64.c > head/sys/boot/i386/libi386/devicename.c > head/sys/boot/i386/libi386/pxe.c >=20 > Modified: head/sys/boot/i386/libi386/bootinfo64.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/sys/boot/i386/libi386/bootinfo64.c Mon Jan 14 13:06:35 2013 = (r245423) > +++ head/sys/boot/i386/libi386/bootinfo64.c Mon Jan 14 15:05:22 2013 = (r245424) > @@ -134,7 +134,8 @@ bi_checkcpu(void) > { > char *cpu_vendor; > int vendor[3]; > - int eflags, regs[4]; > + int eflags; > + unsigned int regs[4]; >=20 > /* Check for presence of "cpuid". */ > eflags =3D read_eflags(); >=20 > Modified: head/sys/boot/i386/libi386/devicename.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/sys/boot/i386/libi386/devicename.c Mon Jan 14 13:06:35 2013 = (r245423) > +++ head/sys/boot/i386/libi386/devicename.c Mon Jan 14 15:05:22 2013 = (r245424) > @@ -128,7 +128,7 @@ i386_parsedev(struct i386_devdesc **dev, > goto fail; > } > } else { > - cp =3D np; > + cp =3D (char *)np; > } > if (*cp && (*cp !=3D ':')) { > err =3D EINVAL; >=20 > Modified: head/sys/boot/i386/libi386/pxe.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/sys/boot/i386/libi386/pxe.c Mon Jan 14 13:06:35 2013 (r2454= 23) > +++ head/sys/boot/i386/libi386/pxe.c Mon Jan 14 15:05:22 2013 (r2454= 24) > @@ -88,6 +88,12 @@ static int pxe_netif_get(struct iodesc * > static int pxe_netif_put(struct iodesc *desc, void *pkt, size_t len); > static void pxe_netif_end(struct netif *nif); >=20 > +#ifdef OLD_NFSV2 > +int nfs_getrootfh(struct iodesc*, char*, u_char*); > +#else > +int nfs_getrootfh(struct iodesc*, char*, uint32_t*, u_char*); > +#endif > + > extern struct netif_stats pxe_st[]; > extern u_int16_t __bangpxeseg; > extern u_int16_t __bangpxeoff; > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://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 Jan 14 16:16:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D8DF95E6; Mon, 14 Jan 2013 16:16:13 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id B1E43254; Mon, 14 Jan 2013 16:16:13 +0000 (UTC) Received: from Alfreds-MacBook-Pro-9.local (unknown [64.25.27.130]) by elvis.mu.org (Postfix) with ESMTPSA id 0FA2A1A3C24; Mon, 14 Jan 2013 08:16:11 -0800 (PST) Message-ID: <50F42F4B.303@mu.org> Date: Mon, 14 Jan 2013 11:16:11 -0500 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r243631 - in head/sys: kern sys References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50C1BC90.90106@freebsd.org> <50C25A27.4060007@bluezbox.com> <50C26331.6030504@freebsd.org> <50C26AE9.4020600@bluezbox.com> <50C3A3D3.9000804@freebsd.org> <50C3AF72.4010902@rice.edu> <330405A1-312A-45A5-BB86-4969478D8BBD@bluezbox.com> <50D03E83.8060908@rice.edu> <50DD081E.8000409@bluezbox.com> <50EB1841.5030006@bluezbox.com> <50EB22D2.6090103@rice.edu> <50EB415F.8020405@freebsd.org> <50F04FE5.7010406@rice.edu> <50F1BD69.4060104@mu.org> <50F2F79C.7040109@mu.org> <50F41F8C.5030900@freebsd.org> In-Reply-To: <50F41F8C.5030900@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , src-committers@freebsd.org, Alan Cox , "Jayachandran C." , svn-src-all@freebsd.org, Oleksandr Tymoshenko , freebsd-arch@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 16:16:13 -0000 On 1/14/13 10:09 AM, Andre Oppermann wrote: > On 13.01.2013 19:06, Alfred Perlstein wrote: >> On 1/12/13 10:32 PM, Adrian Chadd wrote: >>> On 12 January 2013 11:45, Alfred Perlstein wrote: >>> >>>> I'm not sure if regressing to the waterfall method of development >>>> is a good >>>> idea at this point. >>>> >>>> I see a light at the end of the tunnel and we to continue to just >>>> handle >>>> these minor corner cases as we progress. >>>> >>>> If we move to a model where a minor bug is grounds to completely >>>> remove >>>> helpful code then nothing will ever get done. >>>> >>> Allocating 512MB worth of callwheels on a 16GB MIPS machine is a >>> little silly, don't you think? >>> >>> That suggests to me that the extent of which maxfiles/maxusers/etc >>> percolates the codebase wasn't totally understood by those who wish to >>> change it. >>> >>> I'd rather see some more investigative work into outlining things that >>> need fixing and start fixing those, rather than "just change stuff and >>> fix whatever issues creep up." >>> >>> I kinda hope we all understand what we're working on in the kernel a >>> little better than that. >> >> Cool! I'm glad people are now aware of the callwheel allocation >> being insane with large maxusers. >> >> I saw this about a month ago (if not longer), but since there were >> half a dozen people calling me an >> imbecile who hadn't really yet read the code I didn't want to inflame >> them more by fixing that with >> "a hack". (actually a simple fix). >> >> A simple fix is to clamp callwheel size to the previous result of a >> maxusers of 384 and call it a day. >> >> However the simplicity of that approach would probably inflame too >> many feelings so I am unsure as >> how to proceed. >> >> Any ideas? > > I noticed the callwheel dependency as well and asked mav@ about it > in a short email exchange. He said it has only little use and goes > away with the calloutng import. While that is outstanding we need > to clamp it to a sane value. > > However I don't know what a sane value would be and why its size is > directly derived from maxproc and maxfiles. If there can be one > callout per process and open file descriptor in the system, then > it probably has to be so big. If it can deal with 'collisions' > in the wheel it can be much smaller. > If it really goes away with calloutng, then we should probably leave it be in -current. As far as clipping it when/if we push maxusers fixes in -stable (which we must do) then my impression (although maybe wrong) is that the callwheels (cc_callwheel) are just arrays of hash buckets based on what tick will be fired next MOD callwheelmask. This means that if cc_callwheel is way too small, then we will wind up with collisions, however if it's enormous then we wind up with a window that is so large it can accommodate something like hundreds of ticks into the future. Example: > Loaded symbols for /boot/kernel/profile.ko > #0 sched_switch (td=0xffffffff81373e40, newtd=0xfffffe001aab5960, > flags=) at ../../../kern/sched_ule.c:1954 > 1954 cpuid = PCPU_GET(cpuid); > (kgdb) p callwheelsize > $1 = 2097152 > Current language: auto; currently minimal > (kgdb) # .(16:06:31)(root@dan) > /usr/home/alfred # sysctl -a | grep hz > kern.clockrate: { hz = 1000, tick = 1000, profhz = 8128, stathz = 127 } > kern.dcons.poll_hz: 25 > kern.hz: 1000 > debug.psm.hz: 20 > .(16:06:37)(root@dan) > /usr/home/alfred # 2097152 > .(16:06:40)(root@dan) > /usr/home/alfred # bc > 2097152 / 1000 > 2097 > ^D# .(16:06:56)(root@dan) > /usr/home/alfred # sysctl kern.maxusers > kern.maxusers: 3406 So basically on this box there are enough callwheel slots for something like 2097 seconds, or 34 minutes into the future. I would assume that a machine that was capped at 384 maxusers would wind up with something that could handle callouts up to ~3 minutes in the future without wraparound and collisions. As far as the ncallout, that is for timeout(9) support. At a glance I'm not aware of any users of timeout(9) that are not "per device" so there's unlikely to be a need for a timeout(9) supporting pre-allocated timeout per prorcess/file, more likely something like N-devices*4, which is fine at something way lower than the max allocated at 384 maxusers from before all the changes we have made. I could be wrong.. but I still believe that it would be quite the system that would need more than callout=get_callout_from_maxusers(min(maxusers, 384)); Functions calling this function: timeout Functions calling this function: timeout File Function Line 0 si.c si_start 1439 pp->lstart_ch = timeout(si_lstart, (caddr_t)pp, time); 1 sio.c siobusycheck 1269 timeout(siobusycheck, com, hz / 100); 2 sio.c siopoll 1744 timeout(siobusycheck, com, hz / 100); 3 sio.c siosettimeout 2203 sio_timeout_handle = timeout(comwakeup, (void *)NULL, 4 sio.c comwakeup 2220 sio_timeout_handle = timeout(comwakeup, (void *)NULL, sio_timeout); 5 syscons.c scrn_timer 1834 timeout(scrn_timer, sc, hz / 10); 6 syscons.c scrn_timer 1884 timeout(scrn_timer, sc, hz / 10); 7 syscons.c scrn_timer 1902 timeout(scrn_timer, sc, hz / 25); 8 syscons.c blink_screen 3847 timeout(blink_screen, scp, hz / 10); 9 trm.c trm_ExecuteSRB 478 ccb->ccb_h.timeout_ch = timeout(trmtimeout, (caddr_t)srb, (ccb->ccb_h.timeout * hz) / 1000); a tws_cam.c tws_execute_scsi 782 ccb_h->timeout_ch = timeout(tws_timeout, req, (ccb_h->timeout * hz)/1000); b tws_cam.c tws_send_scsi_cmd 820 req->thandle = timeout(tws_timeout, req, (TWS_IO_TIMEOUT * hz)); c tws_cam.c tws_set_param 867 req->thandle = timeout(tws_timeout, req, (TWS_IOCTL_TIMEOUT * hz)); d tws_services.c tws_print_stats 398 timeout(tws_print_stats, sc, 300*hz); e if_wl.c wlstart 1022 sc->watchdog_ch = timeout(wlwatchdog, sc, 10); f spic.c spictimeout 429 sc->sc_timeout_ch = timeout(spictimeout, sc, spic_pollrate); g spic.c spictimeout 442 sc->sc_timeout_ch = timeout(spictimeout, sc, spic_pollrate); h spic.c spicopen 459 timeout(spictimeout, sc, spic_pollrate); i kern_cons.c sysbeep 624 timeout(sysbeepstop, (void *)NULL, period); j kern_fail.c fail_point_sleep 133 timeout(fp->fp_sleep_fn, fp->fp_sleep_arg, timo); k aarp.c aarptimer 128 aarptimer_ch = timeout(aarptimer, NULL, AARPT_AGE * hz); l aarp.c aarptnew 580 aarptimer_ch = timeout(aarptimer, (caddr_t)0, hz); m ng_btsocket_l2cap.c ng_btsocket_l2cap_timeout 2663 pcb->timo = timeout(ng_btsocket_l2cap_process_timeout, pcb, n ng_btsocket_rfcomm.c ng_btsocket_rfcomm_timeou 3449 pcb->timo = timeout(ng_btsocket_rfcomm_process_timeout, pcb, o ng_fec.c ng_fec_init 642 priv->fec_ch = timeout(ng_fec_tick, priv, hz); p ng_fec.c ng_fec_tick 717 priv->fec_ch = timeout(ng_fec_tick, priv, hz); q key.c key_timehandler 4551 (void )timeout((void *)key_timehandler, (void *)0, hz); r key.c key_init 7776 timeout((void *)key_timehandler, (void *)0, hz); s ncp_subr.c ncp_init 107 ncp_timer_handle = timeout(ncp_timer, NULL, NCP_TIMER_TICK); t fdc.c fd_turnon 1186 timeout(fd_motor_on, fd, hz); u fdc.c fdstate 1786 fd->toffhandle = timeout(fd_turnoff, fd, 4 * hz); v fdc.c fdstate 1877 timeout(fd_pseudointr, fdc, hz / 16); w fdc.c fdstate 2092 fd->tohandle = timeout(fd_iotimeout, fdc, hz); x fdc.c fdstate 2101 fd->tohandle = timeout(fd_iotimeout, fdc, hz); y fdc.c fdstate 2218 timeout(fd_pseudointr, fdc, hz / 8); * Lines 71-106 of 115, 10 more - press the space bar to display more * Functions calling this function: timeout File Function Line 0 olpt.c lptopen 421 timeout (lptout, (caddr_t)sc, 1 olpt.c lptout 440 timeout (lptout, (caddr_t)sc, sc->sc_backoff); 2 pckbd.c pckbd_timeout 260 timeout(pckbd_timeout, arg, hz/10); 3 sio.c sioattach 2012 timeout(siobusycheck, com, hz / 100); 4 sio.c sioattach 2696 timeout(siobusycheck, com, hz / 100); 5 sio.c sioattach 3330 sio_timeout_handle = timeout(comwakeup, (void *)NULL, 6 sio.c sioattach 3347 sio_timeout_handle = timeout(comwakeup, (void *)NULL, sio_timeout); 7 sio.c sioattach 3933 timeout(pc98_check_msr, (caddr_t)dev, 8 sio.c sioattach 3951 timeout(pc98_check_msr, (caddr_t)dev, 9 ncr.c ncr_timeout 5171 timeout (ncr_timeout, (caddr_t) np, step ? step : 1); * Press the space bar to display the first lines again * -Alfred From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 16:38:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 27378212; Mon, 14 Jan 2013 16:38:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 199F5380; Mon, 14 Jan 2013 16:38:44 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0EGchiS048739; Mon, 14 Jan 2013 16:38:43 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0EGchik048738; Mon, 14 Jan 2013 16:38:43 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301141638.r0EGchik048738@svn.freebsd.org> From: Alexander Motin Date: Mon, 14 Jan 2013 16:38:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245425 - head/sys/geom/raid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 16:38:44 -0000 Author: mav Date: Mon Jan 14 16:38:43 2013 New Revision: 245425 URL: http://svnweb.freebsd.org/changeset/base/245425 Log: Small cosmetic tuning of the IRRT status constants. Modified: head/sys/geom/raid/md_intel.c Modified: head/sys/geom/raid/md_intel.c ============================================================================== --- head/sys/geom/raid/md_intel.c Mon Jan 14 15:05:22 2013 (r245424) +++ head/sys/geom/raid/md_intel.c Mon Jan 14 16:38:43 2013 (r245425) @@ -98,8 +98,9 @@ struct intel_raid_vol { uint8_t cng_master_disk; uint16_t cache_policy; uint8_t cng_state; -#define INTEL_SNGST_NEEDS_UPDATE 1 -#define INTEL_SNGST_MASTER_MISSING 2 +#define INTEL_CNGST_UPDATED 0 +#define INTEL_CNGST_NEEDS_UPDATE 1 +#define INTEL_CNGST_MASTER_MISSING 2 uint8_t cng_sub_state; uint32_t filler_0[10]; @@ -2366,9 +2367,11 @@ g_raid_md_write_intel(struct g_raid_md_o mvol->cng_master_disk = pv->pv_cng_master_disk; if (vol->v_subdisks[pv->pv_cng_master_disk].sd_state == G_RAID_SUBDISK_S_NONE) - mvol->cng_state = INTEL_SNGST_MASTER_MISSING; + mvol->cng_state = INTEL_CNGST_MASTER_MISSING; else if (vol->v_state != G_RAID_VOLUME_S_OPTIMAL) - mvol->cng_state = INTEL_SNGST_NEEDS_UPDATE; + mvol->cng_state = INTEL_CNGST_NEEDS_UPDATE; + else + mvol->cng_state = INTEL_CNGST_UPDATED; } /* Check for any recovery in progress. */ From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 16:40:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 74330513; Mon, 14 Jan 2013 16:40:51 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 578B43CF; Mon, 14 Jan 2013 16:40:51 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0EGepwl050630; Mon, 14 Jan 2013 16:40:51 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0EGepLc050623; Mon, 14 Jan 2013 16:40:51 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201301141640.r0EGepLc050623@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 14 Jan 2013 16:40:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245426 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 16:40:51 -0000 Author: jilles Date: Mon Jan 14 16:40:50 2013 New Revision: 245426 URL: http://svnweb.freebsd.org/changeset/base/245426 Log: sh: Simplify cd-hash interaction. Instead of rechecking relative paths for all hashed utilities after a cd, track if any utility in cmdtable depends on a relative path in PATH. If there is such a utility, cd clears the entire table. As a result, the '*' in hash no longer happens. Modified: head/bin/sh/exec.c head/bin/sh/sh.1 Modified: head/bin/sh/exec.c ============================================================================== --- head/bin/sh/exec.c Mon Jan 14 16:38:43 2013 (r245425) +++ head/bin/sh/exec.c Mon Jan 14 16:40:50 2013 (r245426) @@ -86,12 +86,12 @@ struct tblentry { union param param; /* definition of builtin function */ int special; /* flag for special builtin commands */ signed char cmdtype; /* index identifying command */ - char rehash; /* if set, cd done since entry created */ char cmdname[]; /* name of command */ }; static struct tblentry *cmdtable[CMDTABLESIZE]; +static int cmdtable_cd = 0; /* cmdtable contains cd-dependent entries */ int exerrno = 0; /* Last exec error */ @@ -305,8 +305,6 @@ printentry(struct tblentry *cmdp, int ve error("internal error: cmdtype %d", cmdp->cmdtype); #endif } - if (cmdp->rehash) - out1c('*'); out1c('\n'); } @@ -323,12 +321,12 @@ find_command(const char *name, struct cm { struct tblentry *cmdp, loc_cmd; int idx; - int prev; char *fullname; struct stat statb; int e; int i; int spec; + int cd; /* If name contains a slash, don't use the hash table */ if (strchr(name, '/') != NULL) { @@ -337,8 +335,10 @@ find_command(const char *name, struct cm return; } + cd = 0; + /* If name is in the table, and not invalidated by cd, we're done */ - if ((cmdp = cmdlookup(name, 0)) != NULL && cmdp->rehash == 0) { + if ((cmdp = cmdlookup(name, 0)) != NULL) { if (cmdp->cmdtype == CMDFUNCTION && act & DO_NOFUNC) cmdp = NULL; else @@ -359,13 +359,6 @@ find_command(const char *name, struct cm } /* We have to search path. */ - prev = -1; /* where to start */ - if (cmdp) { /* doing a rehash */ - if (cmdp->cmdtype == CMDBUILTIN) - prev = -1; - else - prev = cmdp->param.index; - } e = ENOENT; idx = -1; @@ -380,13 +373,8 @@ loop: goto loop; /* ignore unimplemented options */ } } - /* if rehash, don't redo absolute path names */ - if (fullname[0] == '/' && idx <= prev) { - if (idx < prev) - goto loop; - TRACE(("searchexec \"%s\": no change\n", name)); - goto success; - } + if (fullname[0] != '/') + cd = 1; if (stat(fullname, &statb) < 0) { if (errno != ENOENT && errno != ENOTDIR) e = errno; @@ -426,9 +414,6 @@ loop: goto success; } - /* We failed. If there was an entry for this command, delete it */ - if (cmdp && cmdp->cmdtype != CMDFUNCTION) - delete_cmd_entry(); if (act & DO_ERR) { if (e == ENOENT || e == ENOTDIR) outfmt(out2, "%s: not found\n", name); @@ -440,7 +425,8 @@ loop: return; success: - cmdp->rehash = 0; + if (cd) + cmdtable_cd = 1; entry->cmdtype = cmdp->cmdtype; entry->u = cmdp->param; entry->special = cmdp->special; @@ -469,22 +455,15 @@ find_builtin(const char *name, int *spec /* - * Called when a cd is done. Marks all commands so the next time they - * are executed they will be rehashed. + * Called when a cd is done. If any entry in cmdtable depends on the current + * directory, simply clear cmdtable completely. */ void hashcd(void) { - struct tblentry **pp; - struct tblentry *cmdp; - - for (pp = cmdtable ; pp < &cmdtable[CMDTABLESIZE] ; pp++) { - for (cmdp = *pp ; cmdp ; cmdp = cmdp->next) { - if (cmdp->cmdtype == CMDNORMAL) - cmdp->rehash = 1; - } - } + if (cmdtable_cd) + clearcmdentry(); } @@ -526,6 +505,7 @@ clearcmdentry(void) } } } + cmdtable_cd = 0; INTON; } @@ -566,7 +546,6 @@ cmdlookup(const char *name, int add) + strlen(name) + 1); cmdp->next = NULL; cmdp->cmdtype = CMDUNKNOWN; - cmdp->rehash = 0; strcpy(cmdp->cmdname, name); INTON; } Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Mon Jan 14 16:38:43 2013 (r245425) +++ head/bin/sh/sh.1 Mon Jan 14 16:40:50 2013 (r245426) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd July 15, 2012 +.Dd January 14, 2013 .Dt SH 1 .Os .Sh NAME @@ -2219,10 +2219,6 @@ The shell maintains a hash table which r With no arguments whatsoever, the .Ic hash command prints out the contents of this table. -Entries which have not been looked at since the last -.Ic cd -command are marked with an asterisk; -it is possible for these entries to be invalid. .Pp With arguments, the .Ic hash From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 15:51:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1CD24B3F; Mon, 14 Jan 2013 15:51:40 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bk0-f43.google.com (mail-bk0-f43.google.com [209.85.214.43]) by mx1.freebsd.org (Postfix) with ESMTP id 8B50D112; Mon, 14 Jan 2013 15:51:38 +0000 (UTC) Received: by mail-bk0-f43.google.com with SMTP id jf20so2095752bkc.30 for ; Mon, 14 Jan 2013 07:51:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=8dWv/Q4R3Sd3oz0GATFy77UA0UR87LtTzChQ6qO+U9c=; b=yrxy1X5hRA3NKHii/S4oUGd8mq13rpSA5Xvp3iZhkx9254Sufov+dzvqaUQyJGlqXA i4JZfAQLlywYI9vPAZnvbUUpHzbMmTsNsHYFPCI7KNfSpf9ke0waBv8r8FWjUETwYy1Q /r+UWMYUlwnYjlA2zdiSp/xGWPLRjunev11I3tE+H6EG3Ef4IzVlJOUAtyIRQ+Gp2seo nNOA1k391n+L4n9RnS+KlfpiumEHqmxELRe4SRRgzexkeWwU4b0WetW0WqBh6Rynd4Dc d4Kbks4+K0PuXHhVjcMetazuQMYd0vPP2CpLWZgLagb0LQZeoNzbI5qT8MOVxVyc/XNd 5f8A== X-Received: by 10.204.147.143 with SMTP id l15mr40422061bkv.28.1358178691948; Mon, 14 Jan 2013 07:51:31 -0800 (PST) Received: from mavbook.mavhome.dp.ua (mavhome.mavhome.dp.ua. [213.227.240.37]) by mx.google.com with ESMTPS id m20sm10183415bkw.4.2013.01.14.07.51.29 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Jan 2013 07:51:31 -0800 (PST) Sender: Alexander Motin Message-ID: <50F4297F.8050708@FreeBSD.org> Date: Mon, 14 Jan 2013 17:51:27 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r243631 - in head/sys: kern sys References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50C1BC90.90106@freebsd.org> <50C25A27.4060007@bluezbox.com> <50C26331.6030504@freebsd.org> <50C26AE9.4020600@bluezbox.com> <50C3A3D3.9000804@freebsd.org> <50C3AF72.4010902@rice.edu> <330405A1-312A-45A5-BB86-4969478D8BBD@bluezbox.com> <50D03E83.8060908@rice.edu> <50DD081E.8000409@bluezbox.com> <50EB1841.5030006@bluezbox.com> <50EB22D2.6090103@rice.edu> <50EB415F.8020405@freebsd.org> <50F04FE5.7010406@rice.edu> <50F1BD69.4060104@mu.org> <50F2F79C.7040109@mu.org> <50F41F8C.5030900@freebsd.org> In-Reply-To: <50F41F8C.5030900@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Mon, 14 Jan 2013 16:41:42 +0000 Cc: Adrian Chadd , src-committers@freebsd.org, Alan Cox , "Jayachandran C." , svn-src-all@freebsd.org, Alfred Perlstein , Oleksandr Tymoshenko , freebsd-arch@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 15:51:40 -0000 On 14.01.2013 17:09, Andre Oppermann wrote: > On 13.01.2013 19:06, Alfred Perlstein wrote: >> On 1/12/13 10:32 PM, Adrian Chadd wrote: >>> On 12 January 2013 11:45, Alfred Perlstein wrote: >>> >>>> I'm not sure if regressing to the waterfall method of development is >>>> a good >>>> idea at this point. >>>> >>>> I see a light at the end of the tunnel and we to continue to just >>>> handle >>>> these minor corner cases as we progress. >>>> >>>> If we move to a model where a minor bug is grounds to completely remove >>>> helpful code then nothing will ever get done. >>>> >>> Allocating 512MB worth of callwheels on a 16GB MIPS machine is a >>> little silly, don't you think? >>> >>> That suggests to me that the extent of which maxfiles/maxusers/etc >>> percolates the codebase wasn't totally understood by those who wish to >>> change it. >>> >>> I'd rather see some more investigative work into outlining things that >>> need fixing and start fixing those, rather than "just change stuff and >>> fix whatever issues creep up." >>> >>> I kinda hope we all understand what we're working on in the kernel a >>> little better than that. >> >> Cool! I'm glad people are now aware of the callwheel allocation >> being insane with large maxusers. >> >> I saw this about a month ago (if not longer), but since there were >> half a dozen people calling me an >> imbecile who hadn't really yet read the code I didn't want to inflame >> them more by fixing that with >> "a hack". (actually a simple fix). >> >> A simple fix is to clamp callwheel size to the previous result of a >> maxusers of 384 and call it a day. >> >> However the simplicity of that approach would probably inflame too >> many feelings so I am unsure as >> how to proceed. >> >> Any ideas? > > I noticed the callwheel dependency as well and asked mav@ about it > in a short email exchange. He said it has only little use and goes > away with the calloutng import. While that is outstanding we need > to clamp it to a sane value. > > However I don't know what a sane value would be and why its size is > directly derived from maxproc and maxfiles. If there can be one > callout per process and open file descriptor in the system, then > it probably has to be so big. If it can deal with 'collisions' > in the wheel it can be much smaller. As I've actually written, there are two different things: ncallout -- number of preallocated callout structures for purposes of timeout() calls. That is a legacy API that is probably not very much used now, so that value don't need to be too big. But that allocation is static and if it will ever be exhausted system will panic. That is why it was set quite high. The right way now would be to analyze where that API is still used and estimate the really required number. callwheelsize -- number of slots in the callwheel. That is purely optimizational value. If set too low, it will just increase number of hash collisions without effects other then some slowdown. Optimal value here does depend on number of callouts in system, but not only. Since array index there is not really a hash, it is practically useless to set array size it higher then median callout interval divided by hz (or by 1ms in calloutng). The problem is to estimate that median value, that completely depends on workload. Each one ncallout cost 32-52 bytes, while one callwheelsize only 8-16 and could probably be reduced to 4-8 by replacing TAILQ with LIST. So that is ncallout and respective timeout() API what should be managed in first order. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 17:41:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C1761244; Mon, 14 Jan 2013 17:41:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B31A18B4; Mon, 14 Jan 2013 17:41:05 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0EHf5O0068742; Mon, 14 Jan 2013 17:41:05 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0EHf5dl068738; Mon, 14 Jan 2013 17:41:05 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201301141741.r0EHf5dl068738@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 14 Jan 2013 17:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245427 - in 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.14 Precedence: list List-Id: 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, 14 Jan 2013 17:41:05 -0000 Author: hselasky Date: Mon Jan 14 17:41:04 2013 New Revision: 245427 URL: http://svnweb.freebsd.org/changeset/base/245427 Log: Add new u3g device quirk. Submitted by: Lowell Gilbert MFC after: 1 week Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Mon Jan 14 16:40:50 2013 (r245426) +++ head/sys/dev/usb/serial/u3g.c Mon Jan 14 17:41:04 2013 (r245427) @@ -356,6 +356,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(NOVATEL, V740, 0), U3G_DEV(NOVATEL, X950D, 0), U3G_DEV(NOVATEL, XU870, 0), + U3G_DEV(MOTOROLA2, MB886, U3GINIT_SCSIEJECT), U3G_DEV(OPTION, E6500, 0), U3G_DEV(OPTION, E6501, 0), U3G_DEV(OPTION, E6601, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Mon Jan 14 16:40:50 2013 (r245426) +++ head/sys/dev/usb/usbdevs Mon Jan 14 17:41:04 2013 (r245427) @@ -2939,6 +2939,7 @@ product MOTOROLA2 A41XV32X 0x2a22 A41x/V product MOTOROLA2 E398 0x4810 E398 Mobile Phone product MOTOROLA2 USBLAN 0x600c USBLAN product MOTOROLA2 USBLAN2 0x6027 USBLAN +product MOTOROLA2 MB886 0x710f MB886 Mobile Phone (Atria HD) product MOTOROLA4 RT2770 0x9031 RT2770 product MOTOROLA4 RT3070 0x9032 RT3070 From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 18:01:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 50A38D94; Mon, 14 Jan 2013 18:01:20 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 387A59BD; Mon, 14 Jan 2013 18:01:20 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0EI1KLu074854; Mon, 14 Jan 2013 18:01:20 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0EI1Kvp074853; Mon, 14 Jan 2013 18:01:20 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201301141801.r0EI1Kvp074853@svn.freebsd.org> From: Dimitry Andric Date: Mon, 14 Jan 2013 18:01:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245428 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 18:01:20 -0000 Author: dim Date: Mon Jan 14 18:01:19 2013 New Revision: 245428 URL: http://svnweb.freebsd.org/changeset/base/245428 Log: Add CLOCK_PROCESS_CPUTIME_ID to , to synchronize the CLOCK_* values with those in . Otherwise, if a program includes before , the CLOCK_PROCESS_CPUTIME_ID macro never gets defined. Reviewed by: davidxu X-MFC-With: 239347 Modified: head/include/time.h Modified: head/include/time.h ============================================================================== --- head/include/time.h Mon Jan 14 17:41:04 2013 (r245427) +++ head/include/time.h Mon Jan 14 18:01:19 2013 (r245428) @@ -112,6 +112,7 @@ typedef __pid_t pid_t; #define CLOCK_MONOTONIC_FAST 12 /* FreeBSD-specific. */ #define CLOCK_SECOND 13 /* FreeBSD-specific. */ #define CLOCK_THREAD_CPUTIME_ID 14 +#define CLOCK_PROCESS_CPUTIME_ID 15 #endif /* !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 200112 */ #if !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 200112 From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 16:05:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B68AB10A for ; Mon, 14 Jan 2013 16:05:45 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 1F5891AC for ; Mon, 14 Jan 2013 16:05:44 +0000 (UTC) Received: (qmail 61937 invoked from network); 14 Jan 2013 17:28:38 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 14 Jan 2013 17:28:38 -0000 Message-ID: <50F42CD7.6020400@freebsd.org> Date: Mon, 14 Jan 2013 17:05:43 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Alexander Motin Subject: Re: svn commit: r243631 - in head/sys: kern sys References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50C1BC90.90106@freebsd.org> <50C25A27.4060007@bluezbox.com> <50C26331.6030504@freebsd.org> <50C26AE9.4020600@bluezbox.com> <50C3A3D3.9000804@freebsd.org> <50C3AF72.4010902@rice.edu> <330405A1-312A-45A5-BB86-4969478D8BBD@bluezbox.com> <50D03E83.8060908@rice.edu> <50DD081E.8000409@bluezbox.com> <50EB1841.5030006@bluezbox.com> <50EB22D2.6090103@rice.edu> <50EB415F.8020405@freebsd.org> <50F04FE5.7010406@rice.edu> <50F1BD69.4060104@mu.org> <50F2F79C.7040109@mu.org> <50F41F8C.5030900@freebsd.org> <50F4297F.8050708@FreeBSD.org> In-Reply-To: <50F4297F.8050708@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Mon, 14 Jan 2013 18:18:03 +0000 Cc: Adrian Chadd , src-committers@freebsd.org, Alan Cox , "Jayachandran C." , svn-src-all@freebsd.org, Alfred Perlstein , Oleksandr Tymoshenko , freebsd-arch@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 16:05:45 -0000 On 14.01.2013 16:51, Alexander Motin wrote: > On 14.01.2013 17:09, Andre Oppermann wrote: >> On 13.01.2013 19:06, Alfred Perlstein wrote: >>> On 1/12/13 10:32 PM, Adrian Chadd wrote: >>>> On 12 January 2013 11:45, Alfred Perlstein wrote: >>>> >>>>> I'm not sure if regressing to the waterfall method of development is >>>>> a good >>>>> idea at this point. >>>>> >>>>> I see a light at the end of the tunnel and we to continue to just >>>>> handle >>>>> these minor corner cases as we progress. >>>>> >>>>> If we move to a model where a minor bug is grounds to completely remove >>>>> helpful code then nothing will ever get done. >>>>> >>>> Allocating 512MB worth of callwheels on a 16GB MIPS machine is a >>>> little silly, don't you think? >>>> >>>> That suggests to me that the extent of which maxfiles/maxusers/etc >>>> percolates the codebase wasn't totally understood by those who wish to >>>> change it. >>>> >>>> I'd rather see some more investigative work into outlining things that >>>> need fixing and start fixing those, rather than "just change stuff and >>>> fix whatever issues creep up." >>>> >>>> I kinda hope we all understand what we're working on in the kernel a >>>> little better than that. >>> >>> Cool! I'm glad people are now aware of the callwheel allocation >>> being insane with large maxusers. >>> >>> I saw this about a month ago (if not longer), but since there were >>> half a dozen people calling me an >>> imbecile who hadn't really yet read the code I didn't want to inflame >>> them more by fixing that with >>> "a hack". (actually a simple fix). >>> >>> A simple fix is to clamp callwheel size to the previous result of a >>> maxusers of 384 and call it a day. >>> >>> However the simplicity of that approach would probably inflame too >>> many feelings so I am unsure as >>> how to proceed. >>> >>> Any ideas? >> >> I noticed the callwheel dependency as well and asked mav@ about it >> in a short email exchange. He said it has only little use and goes >> away with the calloutng import. While that is outstanding we need >> to clamp it to a sane value. >> >> However I don't know what a sane value would be and why its size is >> directly derived from maxproc and maxfiles. If there can be one >> callout per process and open file descriptor in the system, then >> it probably has to be so big. If it can deal with 'collisions' >> in the wheel it can be much smaller. > > As I've actually written, there are two different things: > ncallout -- number of preallocated callout structures for purposes of > timeout() calls. That is a legacy API that is probably not very much > used now, so that value don't need to be too big. But that allocation is > static and if it will ever be exhausted system will panic. That is why > it was set quite high. The right way now would be to analyze where that > API is still used and estimate the really required number. Can timeout() be emulated on top of another API so we can do away with it? > callwheelsize -- number of slots in the callwheel. That is purely > optimizational value. If set too low, it will just increase number of > hash collisions without effects other then some slowdown. Optimal value > here does depend on number of callouts in system, but not only. Since > array index there is not really a hash, it is practically useless to set > array size it higher then median callout interval divided by hz (or by > 1ms in calloutng). The problem is to estimate that median value, that > completely depends on workload. OK. So for example a large number of TCP connection would use up a large number of slots in the callwheel. I'll try to come up with a reasonable sane scaling value. > Each one ncallout cost 32-52 bytes, while one callwheelsize only 8-16 > and could probably be reduced to 4-8 by replacing TAILQ with LIST. So > that is ncallout and respective timeout() API what should be managed in > first order. I'll give it a try. -- Andre From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 16:17:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 54EA78AC; Mon, 14 Jan 2013 16:17:56 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 2C37627D; Mon, 14 Jan 2013 16:17:55 +0000 (UTC) Received: from Alfreds-MacBook-Pro-9.local (unknown [64.25.27.130]) by elvis.mu.org (Postfix) with ESMTPSA id F18111A3C1D; Mon, 14 Jan 2013 08:17:53 -0800 (PST) Message-ID: <50F42FB1.6020401@mu.org> Date: Mon, 14 Jan 2013 11:17:53 -0500 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r243631 - in head/sys: kern sys References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50C1BC90.90106@freebsd.org> <50C25A27.4060007@bluezbox.com> <50C26331.6030504@freebsd.org> <50C26AE9.4020600@bluezbox.com> <50C3A3D3.9000804@freebsd.org> <50C3AF72.4010902@rice.edu> <330405A1-312A-45A5-BB86-4969478D8BBD@bluezbox.com> <50D03E83.8060908@rice.edu> <50DD081E.8000409@bluezbox.com> <50EB1841.5030006@bluezbox.com> <50EB22D2.6090103@rice.edu> <50EB415F.8020405@freebsd.org> <50F04FE5.7010406@rice.edu> <50F1BD69.4060104@mu.org> <50F2F79C.7040109@mu.org> <50F41F8C.5030900@freebsd.org> <50F4297F.8050708@FreeBSD.org> <50F42CD7.6020400@freebsd.org> In-Reply-To: <50F42CD7.6020400@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Mon, 14 Jan 2013 18:18:03 +0000 Cc: Adrian Chadd , src-committers@freebsd.org, Alan Cox , "Jayachandran C." , Alexander Motin , Oleksandr Tymoshenko , freebsd-arch@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 16:17:56 -0000 On 1/14/13 11:05 AM, Andre Oppermann wrote: > > Can timeout() be emulated on top of another API so we can do away with > it? yes, this is what callout(9) is for. there are a few consumers left (see the email I just sent out). those consumers would just have to allocate their own callout handle/struct and pass that to callout instead of using timeout(9). -Alfred From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 16:23:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3779ECAE; Mon, 14 Jan 2013 16:23:12 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bk0-f41.google.com (mail-bk0-f41.google.com [209.85.214.41]) by mx1.freebsd.org (Postfix) with ESMTP id AB42D2D9; Mon, 14 Jan 2013 16:23:10 +0000 (UTC) Received: by mail-bk0-f41.google.com with SMTP id jg9so2111134bkc.0 for ; Mon, 14 Jan 2013 08:23:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=MJwK5QiJyaS9fWNMo/yaZFKa7uX/AO53ObUmDIIqHjw=; b=o5YdDbyo1DzArLT9o9PtYVdpCS+nZf8T4NlsRxoj1HKLt/dStMr0R9eiFJHplK0Uh4 a3rYEGMfBqYsagPGJaEizOAWvm36w86dVWXoXeUkbT1v5mvFOsBH3mL03ohvv9qwojyG NmquN4JKxoPuMNjy1c+fkX3pKzDGOC7iKv1vqviTtWSwZ9pl5xEum3SaD+ljKO8RtNkg uufj1s+94QEAKrKf9UTajaMuDGsXXvWRDdfjIE5Pk57GtCTSnnDlpI76xA/mfBYhbeet U/djTpAIBEsm48M+ymkL03gaYaZggwM8KpxEu0m0B10pqWNrHwfy97e9na5ukQEAF8ep UjrQ== X-Received: by 10.204.3.206 with SMTP id 14mr39244118bko.120.1358180583687; Mon, 14 Jan 2013 08:23:03 -0800 (PST) Received: from mavbook.mavhome.dp.ua (mavhome.mavhome.dp.ua. [213.227.240.37]) by mx.google.com with ESMTPS id e22sm10318424bke.14.2013.01.14.08.23.01 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Jan 2013 08:23:02 -0800 (PST) Sender: Alexander Motin Message-ID: <50F430E3.70501@FreeBSD.org> Date: Mon, 14 Jan 2013 18:22:59 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r243631 - in head/sys: kern sys References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50C1BC90.90106@freebsd.org> <50C25A27.4060007@bluezbox.com> <50C26331.6030504@freebsd.org> <50C26AE9.4020600@bluezbox.com> <50C3A3D3.9000804@freebsd.org> <50C3AF72.4010902@rice.edu> <330405A1-312A-45A5-BB86-4969478D8BBD@bluezbox.com> <50D03E83.8060908@rice.edu> <50DD081E.8000409@bluezbox.com> <50EB1841.5030006@bluezbox.com> <50EB22D2.6090103@rice.edu> <50EB415F.8020405@freebsd.org> <50F04FE5.7010406@rice.edu> <50F1BD69.4060104@mu.org> <50F2F79C.7040109@mu.org> <50F41F8C.5030900@freebsd.org> <50F4297F.8050708@FreeBSD.org> <50F42CD7.6020400@freebsd.org> In-Reply-To: <50F42CD7.6020400@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Mon, 14 Jan 2013 18:18:03 +0000 Cc: Adrian Chadd , src-committers@freebsd.org, Alan Cox , "Jayachandran C." , svn-src-all@freebsd.org, Alfred Perlstein , Oleksandr Tymoshenko , freebsd-arch@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 16:23:12 -0000 On 14.01.2013 18:05, Andre Oppermann wrote: > On 14.01.2013 16:51, Alexander Motin wrote: >> As I've actually written, there are two different things: >> ncallout -- number of preallocated callout structures for purposes of >> timeout() calls. That is a legacy API that is probably not very much >> used now, so that value don't need to be too big. But that allocation is >> static and if it will ever be exhausted system will panic. That is why >> it was set quite high. The right way now would be to analyze where that >> API is still used and estimate the really required number. > > Can timeout() be emulated on top of another API so we can do away with it? It is already emulated on top of callout_init()/callout_reset(). The problem is that callout_init()/callout_reset() assume storage memory to be allocated by consumer, while timeout() assumes it to be allocated by subsystem. The only way to solve it is to rewrite remaining timeout() consumers to use callout_init()/callout_reset() API directly. >> callwheelsize -- number of slots in the callwheel. That is purely >> optimizational value. If set too low, it will just increase number of >> hash collisions without effects other then some slowdown. Optimal value >> here does depend on number of callouts in system, but not only. Since >> array index there is not really a hash, it is practically useless to set >> array size it higher then median callout interval divided by hz (or by >> 1ms in calloutng). The problem is to estimate that median value, that >> completely depends on workload. > > OK. So for example a large number of TCP connection would use up a > large number of slots in the callwheel. I'll try to come up with a > reasonable sane scaling value. Yes, it _may_ use, but that also depends on time intervals. If most of these TCP timeouts will be few seconds long for ACK timeout, there will be no any performance difference between having callwheelsize of 100*hz and 10000*hz. Same time, if periods are measured in hours, like for keep-alives, increasing callwheelsize may be effective. >> Each one ncallout cost 32-52 bytes, while one callwheelsize only 8-16 >> and could probably be reduced to 4-8 by replacing TAILQ with LIST. So >> that is ncallout and respective timeout() API what should be managed in >> first order. > > I'll give it a try. Thanks. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 18:03:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9BB56F55; Mon, 14 Jan 2013 18:03:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 749829DC; Mon, 14 Jan 2013 18:03:20 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E88E7B948; Mon, 14 Jan 2013 13:03:19 -0500 (EST) From: John Baldwin To: Alexander Motin Subject: Re: svn commit: r243631 - in head/sys: kern sys Date: Mon, 14 Jan 2013 12:55:46 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50F41F8C.5030900@freebsd.org> <50F4297F.8050708@FreeBSD.org> In-Reply-To: <50F4297F.8050708@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201301141255.46994.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 14 Jan 2013 13:03:20 -0500 (EST) X-Mailman-Approved-At: Mon, 14 Jan 2013 18:36:10 +0000 Cc: Adrian Chadd , src-committers@freebsd.org, Andre Oppermann , Alan Cox , "Jayachandran C." , svn-src-all@freebsd.org, Alfred Perlstein , Oleksandr Tymoshenko , freebsd-arch@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 18:03:20 -0000 On Monday, January 14, 2013 10:51:27 am Alexander Motin wrote: > As I've actually written, there are two different things: > ncallout -- number of preallocated callout structures for purposes of > timeout() calls. That is a legacy API that is probably not very much > used now, so that value don't need to be too big. But that allocation is > static and if it will ever be exhausted system will panic. That is why > it was set quite high. The right way now would be to analyze where that > API is still used and estimate the really required number. FYI, I have slowly been working through the tree fixing users of timeout() to use callout_*() instead. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 18:39:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 29C26AAF for ; Mon, 14 Jan 2013 18:39:23 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com [209.85.217.174]) by mx1.freebsd.org (Postfix) with ESMTP id 9E1A8C3F for ; Mon, 14 Jan 2013 18:39:22 +0000 (UTC) Received: by mail-lb0-f174.google.com with SMTP id gi11so3190404lbb.33 for ; Mon, 14 Jan 2013 10:39:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=aUhMdx9q31QqxzIdNj7k76DlNk119t2OtFoHzuCcOCA=; b=PCWqvvnIFX5MCvSyUGkA+yyPG/CWmm2RabAsnZx1F0vJJU3GkILTA/pt93tgehuyVb fo9TMlnZoEqdLODDLrBMpCueBPJIL5NLdMapdp4FLen3YRaXLvVl2kMeiAAdpV12iIVh 4gTZXslpNmgR/W21eM29D6PD3AlveLrURVGS0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=aUhMdx9q31QqxzIdNj7k76DlNk119t2OtFoHzuCcOCA=; b=GWqvMxzWvy+Oruv2Z7Z9mTQb7AIauX4Mbg6fbaPBqjSkS1lNHd3l3/GDt0U7VXJeBq MwmmxdRIQk13Iltk6quvFapl9nFsQoLREO6zMR+tT6Lnfc7qHfq42ec/K1YkzeByaYwU IkSeSd8Ljd6oZ8wHHwBw/u3liOFA3itAupXaKCo5kEq5sgjETPEBCevGx8+DnLEje/sE EYgqXVHtPvMt2PdVPbn+hkFKA+mMeQS7f5ga5JWpxQL31USCbSPFI2/TXpTkbRdT1YPz KLDSkMa+5whItpdBUc2yesaIiDJS/kltC3N8PuFehgG+VLxEVlosdaxpmZ3yOiG4DMxw kBcg== Received: by 10.112.82.136 with SMTP id i8mr707403lby.74.1358188761301; Mon, 14 Jan 2013 10:39:21 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.151.36 with HTTP; Mon, 14 Jan 2013 10:38:51 -0800 (PST) In-Reply-To: <201301141640.r0EGepLc050623@svn.freebsd.org> References: <201301141640.r0EGepLc050623@svn.freebsd.org> From: Eitan Adler Date: Mon, 14 Jan 2013 13:38:51 -0500 X-Google-Sender-Auth: J9gKXsoxHyd8VB2dsjRnnKL5M7k Message-ID: Subject: Re: svn commit: r245426 - head/bin/sh To: Jilles Tjoelker Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQmr+Yw1tQucusNC518V/o5LVU1j8nYPbTLLrNkCI5SsSq5wNoBn8SWz9JA2H77ViKfPPhbC Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 18:39:23 -0000 On 14 January 2013 11:40, Jilles Tjoelker wrote: > Author: jilles > Date: Mon Jan 14 16:40:50 2013 > New Revision: 245426 > URL: http://svnweb.freebsd.org/changeset/base/245426 > > Log: > sh: Simplify cd-hash interaction. > > Instead of rechecking relative paths for all hashed utilities after a cd, > track if any utility in cmdtable depends on a relative path in PATH. > If there is such a utility, cd clears the entire table. Why not clear just these entries instead of the entire table? -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 19:33:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7E74D3CE; Mon, 14 Jan 2013 19:33:12 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 666DD2B4; Mon, 14 Jan 2013 19:33:12 +0000 (UTC) Received: from Alfreds-MacBook-Pro-9.local (unknown [64.25.27.130]) by elvis.mu.org (Postfix) with ESMTPSA id 26D281A3CE7; Mon, 14 Jan 2013 11:33:10 -0800 (PST) Message-ID: <50F45D74.7000309@mu.org> Date: Mon, 14 Jan 2013 14:33:08 -0500 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r243631 - in head/sys: kern sys References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50F41F8C.5030900@freebsd.org> <50F4297F.8050708@FreeBSD.org> <201301141255.46994.jhb@freebsd.org> In-Reply-To: <201301141255.46994.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Mon, 14 Jan 2013 19:42:28 +0000 Cc: Adrian Chadd , src-committers@freebsd.org, Andre Oppermann , Alan Cox , "Jayachandran C." , Alexander Motin , Oleksandr Tymoshenko , freebsd-arch@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 19:33:12 -0000 On 1/14/13 12:55 PM, John Baldwin wrote: > On Monday, January 14, 2013 10:51:27 am Alexander Motin wrote: >> As I've actually written, there are two different things: >> ncallout -- number of preallocated callout structures for purposes of >> timeout() calls. That is a legacy API that is probably not very much >> used now, so that value don't need to be too big. But that allocation is >> static and if it will ever be exhausted system will panic. That is why >> it was set quite high. The right way now would be to analyze where that >> API is still used and estimate the really required number. > FYI, I have slowly been working through the tree fixing users of timeout() > to use callout_*() instead. > We would surely be in a bad place had you not taken so much time to fix nearly all those instances. It is very much appreciated. -Alfred From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 20:31:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B3278BDE; Mon, 14 Jan 2013 20:31:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8B4B98CB; Mon, 14 Jan 2013 20:31:46 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0EKVk0P020046; Mon, 14 Jan 2013 20:31:46 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0EKVkhq020045; Mon, 14 Jan 2013 20:31:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301142031.r0EKVkhq020045@svn.freebsd.org> From: Alexander Motin Date: Mon, 14 Jan 2013 20:31:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245433 - head/sys/geom/raid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 20:31:46 -0000 Author: mav Date: Mon Jan 14 20:31:45 2013 New Revision: 245433 URL: http://svnweb.freebsd.org/changeset/base/245433 Log: Keep value of orig_config_id metadata field. Windows driver writes there previous value of config_id when it is changed in some cases. I guess it may be used do avoid some split-brain conditions. Modified: head/sys/geom/raid/md_intel.c Modified: head/sys/geom/raid/md_intel.c ============================================================================== --- head/sys/geom/raid/md_intel.c Mon Jan 14 20:26:50 2013 (r245432) +++ head/sys/geom/raid/md_intel.c Mon Jan 14 20:31:45 2013 (r245433) @@ -216,6 +216,7 @@ struct g_raid_md_intel_pervolume { struct g_raid_md_intel_object { struct g_raid_md_object mdio_base; uint32_t mdio_config_id; + uint32_t mdio_orig_config_id; uint32_t mdio_generation; struct intel_raid_conf *mdio_meta; struct callout mdio_start_co; /* STARTING state timer. */ @@ -717,7 +718,7 @@ intel_meta_write_spare(struct g_consumer memcpy(&meta->version[0], INTEL_VERSION_1000, sizeof(INTEL_VERSION_1000) - 1); meta->config_size = INTEL_MAX_MD_SIZE(1); - meta->config_id = arc4random(); + meta->config_id = meta->orig_config_id = arc4random(); meta->generation = 1; meta->total_disks = 1; meta->disk[0] = *d; @@ -1318,7 +1319,7 @@ g_raid_md_create_intel(struct g_raid_md_ char name[16]; mdi = (struct g_raid_md_intel_object *)md; - mdi->mdio_config_id = arc4random(); + mdi->mdio_config_id = mdi->mdio_orig_config_id = arc4random(); mdi->mdio_generation = 0; snprintf(name, sizeof(name), "Intel-%08x", mdi->mdio_config_id); sc = g_raid_create_node(mp, name, md); @@ -1463,6 +1464,7 @@ search: } else { /* Not found matching node -- create one. */ result = G_RAID_MD_TASTE_NEW; mdi->mdio_config_id = meta->config_id; + mdi->mdio_orig_config_id = meta->orig_config_id; snprintf(name, sizeof(name), "Intel-%08x", meta->config_id); sc = g_raid_create_node(mp, name, md); md->mdo_softc = sc; @@ -2292,6 +2294,7 @@ g_raid_md_write_intel(struct g_raid_md_o memcpy(&meta->intel_id[0], INTEL_MAGIC, sizeof(INTEL_MAGIC) - 1); meta->config_size = INTEL_MAX_MD_SIZE(numdisks); meta->config_id = mdi->mdio_config_id; + meta->orig_config_id = mdi->mdio_orig_config_id; meta->generation = mdi->mdio_generation; meta->attributes = INTEL_ATTR_CHECKSUM; meta->total_disks = numdisks; From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 20:36:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3F00ADA6; Mon, 14 Jan 2013 20:36:24 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 21CD78F8; Mon, 14 Jan 2013 20:36:24 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0EKaO2g020698; Mon, 14 Jan 2013 20:36:24 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0EKaNB5020689; Mon, 14 Jan 2013 20:36:23 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201301142036.r0EKaNB5020689@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 14 Jan 2013 20:36:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245434 - in head/sys: dev/cxgbe dev/cxgbe/common dev/cxgbe/tom modules/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.14 Precedence: list List-Id: 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, 14 Jan 2013 20:36:24 -0000 Author: np Date: Mon Jan 14 20:36:22 2013 New Revision: 245434 URL: http://svnweb.freebsd.org/changeset/base/245434 Log: cxgbe(4): Updates to the hardware L2 table management code. - Add full support for IPv6 addresses. - Read the size of the L2 table during attach. Do not assume that PCIe physical function 4 of the card has all of the table to itself. - Use FNV instead of Jenkins to hash L3 addresses and drop the private copy of jhash.h from the driver. MFC after: 1 week Deleted: head/sys/dev/cxgbe/common/jhash.h Modified: head/sys/dev/cxgbe/offload.h head/sys/dev/cxgbe/t4_l2t.c head/sys/dev/cxgbe/t4_l2t.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/tom/t4_tom_l2t.c head/sys/modules/cxgbe/tom/Makefile Modified: head/sys/dev/cxgbe/offload.h ============================================================================== --- head/sys/dev/cxgbe/offload.h Mon Jan 14 20:31:45 2013 (r245433) +++ head/sys/dev/cxgbe/offload.h Mon Jan 14 20:36:22 2013 (r245434) @@ -104,8 +104,8 @@ struct tid_info { }; struct t4_range { - unsigned int start; - unsigned int size; + u_int start; + u_int size; }; struct t4_virt_res { /* virtualized HW resources */ @@ -117,6 +117,7 @@ struct t4_virt_res { struct t4_range qp; struct t4_range cq; struct t4_range ocq; + struct t4_range l2t; }; #ifdef TCP_OFFLOAD Modified: head/sys/dev/cxgbe/t4_l2t.c ============================================================================== --- head/sys/dev/cxgbe/t4_l2t.c Mon Jan 14 20:31:45 2013 (r245433) +++ head/sys/dev/cxgbe/t4_l2t.c Mon Jan 14 20:36:22 2013 (r245434) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include "common/common.h" -#include "common/jhash.h" #include "common/t4_msg.h" #include "t4_l2t.h" @@ -78,7 +77,7 @@ t4_alloc_l2e(struct l2t_data *d) return (NULL); /* there's definitely a free entry */ - for (e = d->rover, end = &d->l2tab[L2T_SIZE]; e != end; ++e) + for (e = d->rover, end = &d->l2tab[d->l2t_size]; e != end; ++e) if (atomic_load_acq_int(&e->refcnt) == 0) goto found; @@ -115,6 +114,7 @@ t4_write_l2e(struct adapter *sc, struct { struct wrqe *wr; struct cpl_l2t_write_req *req; + int idx = e->idx + sc->vres.l2t.start; mtx_assert(&e->lock, MA_OWNED); @@ -124,10 +124,10 @@ t4_write_l2e(struct adapter *sc, struct req = wrtod(wr); INIT_TP_WR(req, 0); - OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_L2T_WRITE_REQ, e->idx | + OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_L2T_WRITE_REQ, idx | V_SYNC_WR(sync) | V_TID_QID(sc->sge.fwq.abs_id))); req->params = htons(V_L2T_W_PORT(e->lport) | V_L2T_W_NOREPLY(!sync)); - req->l2t_idx = htons(e->idx); + req->l2t_idx = htons(idx); req->vlan = htons(e->vlan); memcpy(req->dst_mac, e->dmac, sizeof(req->dst_mac)); @@ -183,18 +183,24 @@ t4_l2t_set_switching(struct adapter *sc, int t4_init_l2t(struct adapter *sc, int flags) { - int i; + int i, l2t_size; struct l2t_data *d; - d = malloc(sizeof(*d), M_CXGBE, M_ZERO | flags); + l2t_size = sc->vres.l2t.size; + if (l2t_size < 2) /* At least 1 bucket for IP and 1 for IPv6 */ + return (EINVAL); + + d = malloc(sizeof(*d) + l2t_size * sizeof (struct l2t_entry), M_CXGBE, + M_ZERO | flags); if (!d) return (ENOMEM); + d->l2t_size = l2t_size; d->rover = d->l2tab; - atomic_store_rel_int(&d->nfree, L2T_SIZE); + atomic_store_rel_int(&d->nfree, l2t_size); rw_init(&d->lock, "L2T"); - for (i = 0; i < L2T_SIZE; i++) { + for (i = 0; i < l2t_size; i++) { struct l2t_entry *e = &d->l2tab[i]; e->idx = i; @@ -215,7 +221,7 @@ t4_free_l2t(struct l2t_data *d) { int i; - for (i = 0; i < L2T_SIZE; i++) + for (i = 0; i < d->l2t_size; i++) mtx_destroy(&d->l2tab[i].lock); rw_destroy(&d->lock); free(d, M_CXGBE); @@ -229,11 +235,11 @@ do_l2t_write_rpl(struct sge_iq *iq, cons { const struct cpl_l2t_write_rpl *rpl = (const void *)(rss + 1); unsigned int tid = GET_TID(rpl); - unsigned int idx = tid & (L2T_SIZE - 1); + unsigned int idx = tid % L2T_SIZE; if (__predict_false(rpl->status != CPL_ERR_NONE)) { log(LOG_ERR, - "Unexpected L2T_WRITE_RPL status %u for entry %u\n", + "Unexpected L2T_WRITE_RPL (%u) for entry at hw_idx %u\n", rpl->status, idx); return (EINVAL); } @@ -269,7 +275,7 @@ sysctl_l2t(SYSCTL_HANDLER_ARGS) struct l2t_entry *e; struct sbuf *sb; int rc, i, header = 0; - char ip[60]; + char ip[INET6_ADDRSTRLEN]; if (l2t == NULL) return (ENXIO); @@ -283,7 +289,7 @@ sysctl_l2t(SYSCTL_HANDLER_ARGS) return (ENOMEM); e = &l2t->l2tab[0]; - for (i = 0; i < L2T_SIZE; i++, e++) { + for (i = 0; i < l2t->l2t_size; i++, e++) { mtx_lock(&e->lock); if (e->state == L2T_STATE_UNUSED) goto skip; @@ -295,11 +301,15 @@ sysctl_l2t(SYSCTL_HANDLER_ARGS) } if (e->state == L2T_STATE_SWITCHING) ip[0] = 0; - else - snprintf(ip, sizeof(ip), "%s", - inet_ntoa(*(struct in_addr *)&e->addr)); + else { + inet_ntop(e->ipv6 ? AF_INET6 : AF_INET, &e->addr[0], + &ip[0], sizeof(ip)); + } - /* XXX: e->ifp may not be around */ + /* + * XXX: e->ifp may not be around. + * XXX: IPv6 addresses may not align properly in the output. + */ sbuf_printf(sb, "\n%4u %-15s %02x:%02x:%02x:%02x:%02x:%02x %4d" " %u %2u %c %5u %s", e->idx, ip, e->dmac[0], e->dmac[1], e->dmac[2], Modified: head/sys/dev/cxgbe/t4_l2t.h ============================================================================== --- head/sys/dev/cxgbe/t4_l2t.h Mon Jan 14 20:31:45 2013 (r245433) +++ head/sys/dev/cxgbe/t4_l2t.h Mon Jan 14 20:36:22 2013 (r245434) @@ -60,7 +60,7 @@ enum { struct l2t_entry { uint16_t state; /* entry state */ uint16_t idx; /* entry index */ - uint32_t addr; /* next hop IP address */ + uint32_t addr[4]; /* next hop IP or IPv6 address */ struct ifnet *ifp; /* outgoing interface */ uint16_t smt_idx; /* SMT index */ uint16_t vlan; /* VLAN TCI (id: 0-11, prio: 13-15) */ @@ -70,15 +70,17 @@ struct l2t_entry { struct mtx lock; volatile int refcnt; /* entry reference count */ uint16_t hash; /* hash bucket the entry is on */ + uint8_t ipv6; /* entry is for an IPv6 address */ uint8_t lport; /* associated offload logical port */ uint8_t dmac[ETHER_ADDR_LEN]; /* next hop's MAC address */ }; struct l2t_data { struct rwlock lock; + u_int l2t_size; volatile int nfree; /* number of free entries */ struct l2t_entry *rover;/* starting point for next allocation */ - struct l2t_entry l2tab[L2T_SIZE]; + struct l2t_entry l2tab[]; }; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Jan 14 20:31:45 2013 (r245433) +++ head/sys/dev/cxgbe/t4_main.c Mon Jan 14 20:36:22 2013 (r245434) @@ -1866,7 +1866,9 @@ get_params__post_init(struct adapter *sc param[1] = FW_PARAM_PFVF(EQ_START); param[2] = FW_PARAM_PFVF(FILTER_START); param[3] = FW_PARAM_PFVF(FILTER_END); - rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 4, param, val); + param[4] = FW_PARAM_PFVF(L2T_START); + param[5] = FW_PARAM_PFVF(L2T_END); + rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 6, param, val); if (rc != 0) { device_printf(sc->dev, "failed to query parameters (post_init): %d.\n", rc); @@ -1877,6 +1879,11 @@ get_params__post_init(struct adapter *sc sc->sge.eq_start = val[1]; sc->tids.ftid_base = val[2]; sc->tids.nftids = val[3] - val[2] + 1; + sc->vres.l2t.start = val[4]; + sc->vres.l2t.size = val[5] - val[4] + 1; + KASSERT(sc->vres.l2t.size <= L2T_SIZE, + ("%s: L2 table size (%u) larger than expected (%u)", + __func__, sc->vres.l2t.size, L2T_SIZE)); /* get capabilites */ bzero(&caps, sizeof(caps)); Modified: head/sys/dev/cxgbe/tom/t4_tom_l2t.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom_l2t.c Mon Jan 14 20:31:45 2013 (r245433) +++ head/sys/dev/cxgbe/tom/t4_tom_l2t.c Mon Jan 14 20:36:22 2013 (r245434) @@ -27,6 +27,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" +#include "opt_inet6.h" #ifdef TCP_OFFLOAD #include @@ -34,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -48,28 +50,89 @@ __FBSDID("$FreeBSD$"); #include #include "common/common.h" -#include "common/jhash.h" #include "common/t4_msg.h" #include "tom/t4_tom_l2t.h" #include "tom/t4_tom.h" #define VLAN_NONE 0xfff -#define SA(x) ((struct sockaddr *)(x)) -#define SIN(x) ((struct sockaddr_in *)(x)) -#define SINADDR(x) (SIN(x)->sin_addr.s_addr) - static inline void l2t_hold(struct l2t_data *d, struct l2t_entry *e) { + if (atomic_fetchadd_int(&e->refcnt, 1) == 0) /* 0 -> 1 transition */ atomic_subtract_int(&d->nfree, 1); } -static inline unsigned int -arp_hash(const uint32_t key, int ifindex) +static inline u_int +l2_hash(struct l2t_data *d, const struct sockaddr *sa, int ifindex) +{ + u_int hash, half = d->l2t_size / 2, start = 0; + const void *key; + size_t len; + + KASSERT(sa->sa_family == AF_INET || sa->sa_family == AF_INET6, + ("%s: sa %p has unexpected sa_family %d", __func__, sa, + sa->sa_family)); + + if (sa->sa_family == AF_INET) { + const struct sockaddr_in *sin = (const void *)sa; + + key = &sin->sin_addr; + len = sizeof(sin->sin_addr); + } else { + const struct sockaddr_in6 *sin6 = (const void *)sa; + + key = &sin6->sin6_addr; + len = sizeof(sin6->sin6_addr); + start = half; + } + + hash = fnv_32_buf(key, len, FNV1_32_INIT); + hash = fnv_32_buf(&ifindex, sizeof(ifindex), hash); + hash %= half; + + return (hash + start); +} + +static inline int +l2_cmp(const struct sockaddr *sa, struct l2t_entry *e) +{ + + KASSERT(sa->sa_family == AF_INET || sa->sa_family == AF_INET6, + ("%s: sa %p has unexpected sa_family %d", __func__, sa, + sa->sa_family)); + + if (sa->sa_family == AF_INET) { + const struct sockaddr_in *sin = (const void *)sa; + + return (e->addr[0] != sin->sin_addr.s_addr); + } else { + const struct sockaddr_in6 *sin6 = (const void *)sa; + + return (memcmp(&e->addr[0], &sin6->sin6_addr, sizeof(e->addr))); + } +} + +static inline void +l2_store(const struct sockaddr *sa, struct l2t_entry *e) { - return jhash_2words(key, ifindex, 0) & (L2T_SIZE - 1); + + KASSERT(sa->sa_family == AF_INET || sa->sa_family == AF_INET6, + ("%s: sa %p has unexpected sa_family %d", __func__, sa, + sa->sa_family)); + + if (sa->sa_family == AF_INET) { + const struct sockaddr_in *sin = (const void *)sa; + + e->addr[0] = sin->sin_addr.s_addr; + e->ipv6 = 0; + } else { + const struct sockaddr_in6 *sin6 = (const void *)sa; + + memcpy(&e->addr[0], &sin6->sin6_addr, sizeof(e->addr)); + e->ipv6 = 1; + } } /* @@ -100,7 +163,7 @@ send_pending(struct adapter *sc, struct static void resolution_failed_for_wr(struct wrqe *wr) { - log(LOG_ERR, "%s: leaked work request %p, wr_len %d", __func__, wr, + log(LOG_ERR, "%s: leaked work request %p, wr_len %d\n", __func__, wr, wr->wr_len); /* free(wr, M_CXGBE); */ @@ -175,15 +238,25 @@ resolve_entry(struct adapter *sc, struct struct tom_data *td = sc->tom_softc; struct toedev *tod = &td->tod; struct sockaddr_in sin = {0}; + struct sockaddr_in6 sin6 = {0}; + struct sockaddr *sa; uint8_t dmac[ETHER_ADDR_LEN]; uint16_t vtag = VLAN_NONE; int rc; - sin.sin_family = AF_INET; - sin.sin_len = sizeof(struct sockaddr_in); - SINADDR(&sin) = e->addr; + if (e->ipv6 == 0) { + sin.sin_family = AF_INET; + sin.sin_len = sizeof(struct sockaddr_in); + sin.sin_addr.s_addr = e->addr[0]; + sa = (void *)&sin; + } else { + sin6.sin6_family = AF_INET6; + sin6.sin6_len = sizeof(struct sockaddr_in6); + memcpy(&sin6.sin6_addr, &e->addr[0], sizeof(e->addr)); + sa = (void *)&sin6; + } - rc = toe_l2_resolve(tod, e->ifp, SA(&sin), dmac, &vtag); + rc = toe_l2_resolve(tod, e->ifp, sa, dmac, &vtag); if (rc == EWOULDBLOCK) return (rc); @@ -263,7 +336,7 @@ do_l2t_write_rpl2(struct sge_iq *iq, con struct adapter *sc = iq->adapter; const struct cpl_l2t_write_rpl *rpl = (const void *)(rss + 1); unsigned int tid = GET_TID(rpl); - unsigned int idx = tid & (L2T_SIZE - 1); + unsigned int idx = tid % L2T_SIZE; int rc; rc = do_l2t_write_rpl(iq, rss, m); @@ -271,7 +344,7 @@ do_l2t_write_rpl2(struct sge_iq *iq, con return (rc); if (tid & F_SYNC_WR) { - struct l2t_entry *e = &sc->l2t->l2tab[idx]; + struct l2t_entry *e = &sc->l2t->l2tab[idx - sc->vres.l2t.start]; mtx_lock(&e->lock); if (e->state != L2T_STATE_SWITCHING) { @@ -310,21 +383,22 @@ t4_l2t_get(struct port_info *pi, struct { struct l2t_entry *e; struct l2t_data *d = pi->adapter->l2t; - uint32_t addr = SINADDR(sa); - int hash = arp_hash(addr, ifp->if_index); - unsigned int smt_idx = pi->port_id; + u_int hash, smt_idx = pi->port_id; - if (sa->sa_family != AF_INET) - return (NULL); /* XXX: no IPv6 support right now */ + KASSERT(sa->sa_family == AF_INET || sa->sa_family == AF_INET6, + ("%s: sa %p has unexpected sa_family %d", __func__, sa, + sa->sa_family)); #ifndef VLAN_TAG if (ifp->if_type == IFT_L2VLAN) return (NULL); #endif + hash = l2_hash(d, sa, ifp->if_index); rw_wlock(&d->lock); for (e = d->l2tab[hash].first; e; e = e->next) { - if (e->addr == addr && e->ifp == ifp && e->smt_idx == smt_idx) { + if (l2_cmp(sa, e) == 0 && e->ifp == ifp && + e->smt_idx == smt_idx) { l2t_hold(d, e); goto done; } @@ -338,7 +412,7 @@ t4_l2t_get(struct port_info *pi, struct d->l2tab[hash].first = e; e->state = L2T_STATE_RESOLVING; - e->addr = addr; + l2_store(sa, e); e->ifp = ifp; e->smt_idx = smt_idx; e->hash = hash; @@ -368,14 +442,14 @@ t4_l2_update(struct toedev *tod, struct struct adapter *sc = tod->tod_softc; struct l2t_entry *e; struct l2t_data *d = sc->l2t; - uint32_t addr = SINADDR(sa); - int hash = arp_hash(addr, ifp->if_index); + u_int hash; KASSERT(d != NULL, ("%s: no L2 table", __func__)); + hash = l2_hash(d, sa, ifp->if_index); rw_rlock(&d->lock); for (e = d->l2tab[hash].first; e; e = e->next) { - if (e->addr == addr && e->ifp == ifp) { + if (l2_cmp(sa, e) == 0 && e->ifp == ifp) { mtx_lock(&e->lock); if (atomic_load_acq_int(&e->refcnt)) goto found; Modified: head/sys/modules/cxgbe/tom/Makefile ============================================================================== --- head/sys/modules/cxgbe/tom/Makefile Mon Jan 14 20:31:45 2013 (r245433) +++ head/sys/modules/cxgbe/tom/Makefile Mon Jan 14 20:36:22 2013 (r245434) @@ -10,15 +10,20 @@ CXGBE = ${.CURDIR}/../../../dev/cxgbe KMOD = t4_tom SRCS = t4_tom.c t4_connect.c t4_listen.c t4_cpl_io.c t4_tom_l2t.c t4_ddp.c SRCS+= device_if.h bus_if.h pci_if.h -SRCS+= opt_inet.h +SRCS+= opt_inet.h opt_inet6.h CFLAGS+= -I${CXGBE} .if !defined(KERNBUILDDIR) .if ${MK_INET_SUPPORT} != "no" opt_inet.h: - echo "#define INET 1" > ${.TARGET} - echo "#define TCP_OFFLOAD 1" >> ${.TARGET} + @echo "#define INET 1" > ${.TARGET} + @echo "#define TCP_OFFLOAD 1" >> ${.TARGET} +.endif + +.if ${MK_INET6_SUPPORT} != "no" +opt_inet6.h: + @echo "#define INET6 1" > ${.TARGET} .endif .endif From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 20:38:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A1DC4F36; Mon, 14 Jan 2013 20:38:33 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 93742916; Mon, 14 Jan 2013 20:38:33 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0EKcXvr021016; Mon, 14 Jan 2013 20:38:33 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0EKcXIQ021013; Mon, 14 Jan 2013 20:38:33 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301142038.r0EKcXIQ021013@svn.freebsd.org> From: Brooks Davis Date: Mon, 14 Jan 2013 20:38:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245435 - in head: share/man/man5 tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 20:38:33 -0000 Author: brooks Date: Mon Jan 14 20:38:32 2013 New Revision: 245435 URL: http://svnweb.freebsd.org/changeset/base/245435 Log: Remember the . in .\" in the WITH_NMTREE file and regenerate the output. Reported by: joeld Modified: head/share/man/man5/src.conf.5 head/tools/build/options/WITH_NMTREE Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Mon Jan 14 20:36:22 2013 (r245434) +++ head/share/man/man5/src.conf.5 Mon Jan 14 20:38:32 2013 (r245435) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 236279 2012-05-30 02:37:20Z gjb .\" $FreeBSD$ -.Dd January 9, 2013 +.Dd January 14, 2013 .Dt SRC.CONF 5 .Os .Sh NAME @@ -805,7 +805,7 @@ Set to not build NLS catalogs. Set to not build NLS catalog support for .Xr csh 1 . .It Va WITH_NMTREE -\" $FreeBSD$ +.\" from FreeBSD: head/tools/build/options/WITH_NMTREE 245241 2013-01-09 21:07:08Z brooks Set to install .Xr nmtree 8 as Modified: head/tools/build/options/WITH_NMTREE ============================================================================== --- head/tools/build/options/WITH_NMTREE Mon Jan 14 20:36:22 2013 (r245434) +++ head/tools/build/options/WITH_NMTREE Mon Jan 14 20:38:32 2013 (r245435) @@ -1,4 +1,4 @@ -\" $FreeBSD$ +.\" $FreeBSD$ Set to install .Xr nmtree 8 as From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 21:03:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2F436A74; Mon, 14 Jan 2013 21:03:38 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 121B4A3C; Mon, 14 Jan 2013 21:03:38 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0EL3cCU029380; Mon, 14 Jan 2013 21:03:38 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0EL3ZhZ029362; Mon, 14 Jan 2013 21:03:35 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201301142103.r0EL3ZhZ029362@svn.freebsd.org> From: Devin Teske Date: Mon, 14 Jan 2013 21:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245437 - in head/usr.sbin/bsdconfig: console password password/share share startup startup/share usermgmt usermgmt/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 21:03:38 -0000 Author: dteske Date: Mon Jan 14 21:03:34 2013 New Revision: 245437 URL: http://svnweb.freebsd.org/changeset/base/245437 Log: Don't use f_show_msg() unless printf(1) syntax is required (this reduces the number of unnecessary forks). Modified: head/usr.sbin/bsdconfig/console/ttys head/usr.sbin/bsdconfig/password/password head/usr.sbin/bsdconfig/password/share/password.subr head/usr.sbin/bsdconfig/share/mustberoot.subr head/usr.sbin/bsdconfig/share/variable.subr head/usr.sbin/bsdconfig/startup/misc head/usr.sbin/bsdconfig/startup/rcdelete head/usr.sbin/bsdconfig/startup/rcvar head/usr.sbin/bsdconfig/startup/share/rcconf.subr head/usr.sbin/bsdconfig/startup/share/rcedit.subr head/usr.sbin/bsdconfig/usermgmt/groupinput head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr head/usr.sbin/bsdconfig/usermgmt/userinput Modified: head/usr.sbin/bsdconfig/console/ttys ============================================================================== --- head/usr.sbin/bsdconfig/console/ttys Mon Jan 14 20:49:37 2013 (r245436) +++ head/usr.sbin/bsdconfig/console/ttys Mon Jan 14 21:03:34 2013 (r245437) @@ -192,7 +192,7 @@ while :; do err=$( ttys_set_type "$consterm" 2>&1 ) [ "$err" ] || break - f_show_msg "%s" "$err" + f_dialog_msgbox "$err" done exit $SUCCESS Modified: head/usr.sbin/bsdconfig/password/password ============================================================================== --- head/usr.sbin/bsdconfig/password/password Mon Jan 14 20:49:37 2013 (r245436) +++ head/usr.sbin/bsdconfig/password/password Mon Jan 14 21:03:34 2013 (r245437) @@ -72,7 +72,7 @@ f_mustberoot_init if f_dialog_input_password; then err=$( echo "$pw_password" | pw usermod $USER_ROOT -h 0 2>&1 ) || f_die $? "%s" "$err" - f_show_msg "$msg_password_changed" + f_dialog_msgbox "$msg_password_changed" fi return $SUCCESS Modified: head/usr.sbin/bsdconfig/password/share/password.subr ============================================================================== --- head/usr.sbin/bsdconfig/password/share/password.subr Mon Jan 14 20:49:37 2013 (r245436) +++ head/usr.sbin/bsdconfig/password/share/password.subr Mon Jan 14 21:03:34 2013 (r245437) @@ -108,13 +108,13 @@ f_dialog_input_password() # Check for NULL entry if ! [ "$_password1" -o "$_password2" ]; then - f_show_msg "$msg_password_is_empty" + f_dialog_msgbox "$msg_password_is_empty" continue fi # Check for password mismatch if [ "$_password1" != "$_password2" ]; then - f_show_msg "$msg_passwords_do_not_match" + f_dialog_msgbox "$msg_passwords_do_not_match" continue fi Modified: head/usr.sbin/bsdconfig/share/mustberoot.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/mustberoot.subr Mon Jan 14 20:49:37 2013 (r245436) +++ head/usr.sbin/bsdconfig/share/mustberoot.subr Mon Jan 14 21:03:34 2013 (r245437) @@ -128,7 +128,7 @@ f_become_root_via_sudo() 1) # Always try sudo(8) when run as $user local err if ! err=$( touch "$checkpath" 2>&1 ); then - f_show_msg "%s" "$err" + f_dialog_msgbox "$err" else f_show_msg "$msg_created_path" "$checkpath" fi Modified: head/usr.sbin/bsdconfig/share/variable.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/variable.subr Mon Jan 14 20:49:37 2013 (r245436) +++ head/usr.sbin/bsdconfig/share/variable.subr Mon Jan 14 21:03:34 2013 (r245437) @@ -118,7 +118,7 @@ f_variable_set_defaults() # # Dump a list of registered/advertised variables and their respective values to # $VARIABLE_DUMPFILE. Returns success unless the file couldn't be written. If -# an error occurs, it is displayed using f_show_msg() (from common.subr). +# an error occurs, it is displayed using f_dialog_msgbox() (from dialog.subr). # f_dump_variables() { @@ -131,7 +131,7 @@ f_dump_variables() printf "%s='%s'\n" "$var" "$value" done > "$VARIABLE_DUMPFILE" ) 2>&1 ); then - f_show_msg "%s" "$err" + f_dialog_msgbox "$err" return $FAILURE fi } Modified: head/usr.sbin/bsdconfig/startup/misc ============================================================================== --- head/usr.sbin/bsdconfig/startup/misc Mon Jan 14 20:49:37 2013 (r245436) +++ head/usr.sbin/bsdconfig/startup/misc Mon Jan 14 21:03:34 2013 (r245437) @@ -307,14 +307,14 @@ while :; do ?" [X] "*) err=$( f_sysrc_set apm_enable NO 2>&1 ) ;; ?" [ ] "*) err=$( f_sysrc_set apm_enable YES 2>&1 ) ;; esac - [ $? -eq $SUCCESS ] || f_show_msg "%s\n" "$err" ;; + [ $? -eq $SUCCESS ] || f_dialog_msgbox "$err\n" ;; ?" ["?"] $msg_startup_dirs") dialog_input_value \ "$msg_startup_dirs_desc" \ "$( f_sysrc_get local_startup )" if [ $? -eq $SUCCESS ]; then err=$( f_sysrc_set local_startup "$value" ) || - f_show_msg "%s\n" "$err" + f_dialog_msgbox "$err\n" fi ;; ?" ["?"] $msg_named") @@ -322,14 +322,14 @@ while :; do ?" [X] "*) err=$( f_sysrc_set named_enable NO 2>&1 ) ;; ?" [ ] "*) err=$( f_sysrc_set named_enable YES 2>&1 ) ;; esac - [ $? -eq $SUCCESS ] || f_show_msg "%s\n" "$err" ;; + [ $? -eq $SUCCESS ] || f_dialog_msgbox "$err\n" ;; ?" ["?"] $msg_named_flags") dialog_input_value \ "$msg_named_flags_desc" \ "$( f_sysrc_get named_flags )" if [ $? -eq $SUCCESS ]; then err=$( f_sysrc_set named_flags "$value" ) || - f_show_msg "%s\n" "$err" + f_dialog_msgbox "$err\n" fi ;; ?" ["?"] $msg_nis_client") @@ -339,14 +339,14 @@ while :; do err=$( f_sysrc_set nis_client_enable YES 2>&1 ) \ && err=$( f_sysrc_set rpcbind_enable YES 2>&1 ) ;; esac - [ $? -eq $SUCCESS ] || f_show_msg "%s\n" "$err" ;; + [ $? -eq $SUCCESS ] || f_dialog_msgbox "$err\n" ;; ?" ["?"] $msg_nis_domainname") dialog_input_value \ "$msg_nis_domainname_desc" \ "$( f_sysrc_get nisdomainname )" if [ $? -eq $SUCCESS ]; then err=$( f_sysrc_set nisdomainname "$value" ) || - f_show_msg "%s\n" "$err" + f_dialog_msgbox "$err\n" fi ;; ?" ["?"] $msg_nis_server") @@ -356,31 +356,31 @@ while :; do err=$( f_sysrc_set nis_server_enable YES 2>&1 ) \ && err=$( f_sysrc_set rpcbind_enable YES 2>&1 ) ;; esac - [ $? -eq $SUCCESS ] || f_show_msg "%s\n" "$err" ;; + [ $? -eq $SUCCESS ] || f_dialog_msgbox "$err\n" ;; ?" ["?"] $msg_accounting") case "$mtag" in ?" [X] "*) err=$( f_sysrc_set accounting_enable NO 2>&1 ) ;; ?" [ ] "*) err=$( f_sysrc_set accounting_enable YES 2>&1 ) ;; esac - [ $? -eq $SUCCESS ] || f_show_msg "%s\n" "$err" ;; + [ $? -eq $SUCCESS ] || f_dialog_msgbox "$err\n" ;; ?" ["?"] $msg_lpd") case "$mtag" in ?" [X] "*) err=$( f_sysrc_set lpd_enable NO 2>&1 ) ;; ?" [ ] "*) err=$( f_sysrc_set lpd_enable YES 2>&1 ) ;; esac - [ $? -eq $SUCCESS ] || f_show_msg "%s\n" "$err" ;; + [ $? -eq $SUCCESS ] || f_dialog_msgbox "$err\n" ;; ?" ["?"] $msg_sco") case "$mtag" in ?" [X] "*) err=$( f_sysrc_set ibcs2_enable NO 2>&1 ) ;; ?" [ ] "*) err=$( f_sysrc_set ibcs2_enable YES 2>&1 ) ;; esac - [ $? -eq $SUCCESS ] || f_show_msg "%s\n" "$err" ;; + [ $? -eq $SUCCESS ] || f_dialog_msgbox "$err\n" ;; ?" ["?"] $msg_svr4") case "$mtag" in ?" [X] "*) err=$( f_sysrc_set svr4_enable NO 2>&1 ) ;; ?" [ ] "*) err=$( f_sysrc_set svr4_enable YES 2>&1 ) ;; esac - [ $? -eq $SUCCESS ] || f_show_msg "%s\n" "$err" ;; + [ $? -eq $SUCCESS ] || f_dialog_msgbox "$err\n" ;; esac done Modified: head/usr.sbin/bsdconfig/startup/rcdelete ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcdelete Mon Jan 14 20:49:37 2013 (r245436) +++ head/usr.sbin/bsdconfig/startup/rcdelete Mon Jan 14 21:03:34 2013 (r245437) @@ -318,7 +318,7 @@ while :; do for var in $delete_vars; do err=$( f_sysrc_delete $var 2>&1 ) if [ $? -ne $SUCCESS ]; then - f_show_msg "%s\n" "$err" + f_dialog_msgbox "$err\n" break fi done Modified: head/usr.sbin/bsdconfig/startup/rcvar ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcvar Mon Jan 14 20:49:37 2013 (r245436) +++ head/usr.sbin/bsdconfig/startup/rcvar Mon Jan 14 21:03:34 2013 (r245437) @@ -194,7 +194,7 @@ while :; do esac err=$( f_sysrc_set "$rcvar" "$value" 2>&1 ) || - f_show_msg "$err" + f_dialog_msgbox "$err" esac done Modified: head/usr.sbin/bsdconfig/startup/share/rcconf.subr ============================================================================== --- head/usr.sbin/bsdconfig/startup/share/rcconf.subr Mon Jan 14 20:49:37 2013 (r245436) +++ head/usr.sbin/bsdconfig/startup/share/rcconf.subr Mon Jan 14 21:03:34 2013 (r245437) @@ -432,14 +432,14 @@ f_dialog_input_rcvar() # Check for invalid entry (1of2) if ! echo "$_input" | grep -q "^[[:alpha:]_]"; then - f_show_msg "$msg_rcvar_must_start_with" + f_dialog_msgbox "$msg_rcvar_must_start_with" continue fi # Check for invalid entry (2of2) if ! echo "$_input" | grep -q "^[[:alpha:]_][[:alnum:]_]*$" then - f_show_msg "$msg_rcvar_contains_invalid_chars" + f_dialog_msgbox "$msg_rcvar_contains_invalid_chars" continue fi Modified: head/usr.sbin/bsdconfig/startup/share/rcedit.subr ============================================================================== --- head/usr.sbin/bsdconfig/startup/share/rcedit.subr Mon Jan 14 20:49:37 2013 (r245436) +++ head/usr.sbin/bsdconfig/startup/share/rcedit.subr Mon Jan 14 21:03:34 2013 (r245437) @@ -78,8 +78,7 @@ f_dialog_rcedit() f_dprintf "%s: [%s]->[%s]" "$var" "$cur_val" "$_input" - err=$( f_sysrc_set "$var" "$_input" 2>&1 ) || - f_show_msg "$err" + err=$( f_sysrc_set "$var" "$_input" 2>&1 ) || f_dialog_msgbox "$err" } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/usermgmt/groupinput ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/groupinput Mon Jan 14 20:49:37 2013 (r245436) +++ head/usr.sbin/bsdconfig/usermgmt/groupinput Mon Jan 14 21:03:34 2013 (r245437) @@ -63,10 +63,10 @@ save_changes() err=$( pw groupdel "$group_name" 2>&1 ) retval=$? if [ $retval -ne $SUCCESS ]; then - f_show_msg "%s %s\n" "$msg_error" "$err" + f_dialog_msgbox "$msg_error $err\n" return $retval fi - f_show_msg "$msg_group_deleted" + f_dialog_msgbox "$msg_group_deleted" ;; Add) local cmd="pw groupadd -n '$group_name'" @@ -82,10 +82,10 @@ save_changes() err=$( eval $cmd 2>&1 ) retval=$? if [ $retval -ne $SUCCESS ]; then - f_show_msg "%s %s\n" "$msg_error" "$err" + f_dialog_msgbox "$msg_error $err\n" return $retval fi - f_show_msg "$msg_group_added" + f_dialog_msgbox "$msg_group_added" ;; Edit/View) local cmd="pw groupmod -n '$group_name'" @@ -101,10 +101,10 @@ save_changes() err=$( eval $cmd 2>&1 ) retval=$? if [ $retval -ne $SUCCESS ]; then - f_show_msg "%s %s\n" "$msg_error" "$err" + f_dialog_msgbox "$msg_error $err\n" return $retval fi - f_show_msg "$msg_group_updated" + f_dialog_msgbox "$msg_group_updated" ;; esac Modified: head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr Mon Jan 14 20:49:37 2013 (r245436) +++ head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr Mon Jan 14 21:03:34 2013 (r245437) @@ -134,13 +134,13 @@ f_dialog_input_group_name() # Check for NULL entry if [ ! "$_input" ]; then - f_show_msg "$msg_group_is_empty" + f_dialog_msgbox "$msg_group_is_empty" continue fi # Check for invalid entry if ! echo "$_input" | grep -q "^[[:alpha:]]"; then - f_show_msg "$msg_group_must_start_with_letter" + f_dialog_msgbox "$msg_group_must_start_with_letter" continue fi @@ -229,7 +229,7 @@ f_dialog_input_group_password() # Check for password mismatch if [ "$_password1" != "$_password2" ]; then - f_show_msg "$msg_group_passwords_do_not_match" + f_dialog_msgbox "$msg_group_passwords_do_not_match" continue fi Modified: head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Mon Jan 14 20:49:37 2013 (r245436) +++ head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Mon Jan 14 21:03:34 2013 (r245437) @@ -239,13 +239,13 @@ f_dialog_input_name() # Check for NULL entry if [ ! "$_input" ]; then - f_show_msg "$msg_login_is_empty" + f_dialog_msgbox "$msg_login_is_empty" continue fi # Check for invalid entry if ! echo "$_input" | grep -q "^[[:alpha:]]"; then - f_show_msg "$msg_login_must_start_with_letter" + f_dialog_msgbox "$msg_login_must_start_with_letter" continue fi @@ -334,7 +334,7 @@ f_dialog_input_password() # Check for password mismatch if [ "$_password1" != "$_password2" ]; then - f_show_msg "$msg_passwords_do_not_match" + f_dialog_msgbox "$msg_passwords_do_not_match" continue fi @@ -589,7 +589,7 @@ f_dialog_input_change() # Taint-check the user's input if ! f_isinteger "$ret_days"; then - f_show_msg "$msg_invalid_number_of_days" + f_dialog_msgbox "$msg_invalid_number_of_days" continue fi @@ -616,7 +616,8 @@ f_dialog_input_change() # Taint-check the user's input if ! f_isinteger "${_input:-0}"; then - f_show_msg "$msg_invalid_number_of_seconds" + f_dialog_msgbox \ + "$msg_invalid_number_of_seconds" continue fi @@ -773,7 +774,7 @@ f_dialog_input_expire() # Taint-check the user's input if ! f_isinteger "$ret_days"; then - f_show_msg "$msg_invalid_number_of_days" + f_dialog_msgbox "$msg_invalid_number_of_days" continue fi @@ -800,7 +801,8 @@ f_dialog_input_expire() # Taint-check the user's input if ! f_isinteger "${_input:-0}"; then - f_show_msg "$msg_invalid_number_of_seconds" + f_dialog_msgbox \ + "$msg_invalid_number_of_seconds" continue fi Modified: head/usr.sbin/bsdconfig/usermgmt/userinput ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/userinput Mon Jan 14 20:49:37 2013 (r245436) +++ head/usr.sbin/bsdconfig/usermgmt/userinput Mon Jan 14 21:03:34 2013 (r245437) @@ -81,22 +81,22 @@ save_changes() err=$( pw userdel -u "$pw_uid" 2>&1 ) retval=$? if [ $retval -ne $SUCCESS ]; then - f_show_msg "%s %s\n" "$msg_error" "$err" + f_dialog_msgbox "$msg_error $err\n" return $retval fi - f_show_msg "$msg_login_deleted" + f_dialog_msgbox "$msg_login_deleted" if [ "$pw_group_delete" = "$msg_yes" ] && f_quietly pw groupshow -g "$pw_gid" then err=$( pw groupdel -g "$pw_gid" 2>&1 ) || - f_show_msg "%s %s\n" "$msg_warning" "$err" + f_dialog_msgbox "$msg_warning $err\n" fi if [ "$pw_home_delete" = "$msg_yes" ]; then f_dialog_info "$msg_deleting_home_directory" err=$( rm -Rf "$pw_home_dir" 2>&1 ) || - f_show_msg "%s %s\n" "$msg_warning" "$err" + f_dialog_msgbox "$msg_warning $err\n" fi ;; Add) @@ -119,26 +119,26 @@ save_changes() err=$( eval $cmd 2>&1 ) retval=$? if [ $retval -ne $SUCCESS ]; then - f_show_msg "%s %s\n" "$msg_error" "$err" + f_dialog_msgbox "$msg_error $err\n" return $retval fi - f_show_msg "$msg_login_added" + f_dialog_msgbox "$msg_login_added" if [ "$pw_home_create" = "$msg_yes" ]; then err=$( mkdir -p "$pw_home_dir" 2>&1 ) if [ $? -ne $SUCCESS ]; then - f_show_msg "%s %s\n" "$msg_warning" "$err" + f_dialog_msgbox "$msg_warning $err\n" elif [ -e "$pw_home_dir" ]; then err=$( chown -R "$pw_uid:$pw_gid" \ "$pw_home_dir" 2>&1 ) - [ $? -eq $SUCCESS ] || f_show_msg \ - "%s %s\n" "$msg_warning" "$err" + [ $? -eq $SUCCESS ] || + f_dialog_msgbox "$msg_warning $err\n" fi fi if [ "$pw_dotfiles_create" = "$msg_yes" ]; then err=$( copy_dotfiles 2>&1 ) || - f_show_msg "%s %s\n" "$msg_warning" "$err" + f_dialog_msgbox "$msg_warning $err\n" fi user="$pw_name" @@ -165,26 +165,26 @@ save_changes() err=$( eval $cmd 2>&1 ) retval=$? if [ $retval -ne $SUCCESS ]; then - f_show_msg "%s %s\n" "$msg_error" "$err" + f_dialog_msgbox "$msg_error $err\n" return $retval fi - f_show_msg "$msg_login_updated" + f_dialog_msgbox "$msg_login_updated" if [ "$pw_home_create" = "$msg_yes" ]; then err=$( mkdir -p "$pw_home_dir" ) if [ $? -ne $SUCCESS ]; then - f_show_msg "%s %s\n" "$msg_warning" "$err" + f_dialog_msgbox "$msg_warning $err\n" elif [ -e "$pw_home_dir" ]; then err=$( chown -R "$pw_uid:$pw_gid" \ "$pw_home_dir" 2>&1 ) - [ $? -eq $SUCCESS ] || f_show_msg \ - "%s %s\n" "$msg_warning" "$err" + [ $? -eq $SUCCESS ] || + f_dialog_msgbox "$msg_warning $err\n" fi fi if [ "$pw_dotfiles_create" = "$msg_yes" ]; then err=$( copy_dotfiles 2>&1 ) || - f_show_msg "%s %s\n" "$msg_warning" "$err" + f_dialog_msgbox "$msg_warning $err\n" fi ;; esac From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 22:43:34 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F1BE9588; Mon, 14 Jan 2013 22:43:33 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) by mx1.freebsd.org (Postfix) with ESMTP id D557CA8; Mon, 14 Jan 2013 22:43:33 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.5/8.14.5) with ESMTP id r0EMhRLI072352; Mon, 14 Jan 2013 14:43:27 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.5/8.14.5/Submit) id r0EMhRWa072351; Mon, 14 Jan 2013 14:43:27 -0800 (PST) (envelope-from sgk) Date: Mon, 14 Jan 2013 14:43:27 -0800 From: Steve Kargl To: Dag-Erling =?iso-8859-1?B?U23DuHJncmF2?= Subject: Re: svn commit: r245269 - head/share/mk Message-ID: <20130114224326.GA72312@troutmask.apl.washington.edu> References: <201301102244.r0AMiJ1k059594@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201301102244.r0AMiJ1k059594@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 22:43:34 -0000 On Thu, Jan 10, 2013 at 10:44:19PM +0000, Dag-Erling Smørgrav wrote: > Author: des > Date: Thu Jan 10 22:44:19 2013 > New Revision: 245269 > URL: http://svnweb.freebsd.org/changeset/base/245269 > > Log: > Remove all support for legacy NOFOO and NO_FOO build options. > This commit caused ===> kerberos5/doc (buildincludes) ===> kerberos5/lib (buildincludes) ===> kerberos5/lib/libasn1 (buildincludes) compile_et /usr/src/kerberos5/lib/libasn1/../../../crypto/heimdal/lib/asn1/asn1_err.et compile_et: No such file or directory *** [asn1_err.h] Error code 1 Stop in /usr/src/kerberos5/lib/libasn1. *** [buildincludes] Error code 1 Stop in /usr/src/kerberos5/lib. *** [buildincludes] Error code 1 because I had forgotten that several years ago I added NO_KERBEROS to my /etc/make.conf. After wasting a day trying to figure out how and who broke world, including reading the top of src/UPDATING, I recalled this commit and checked my /etc/make.conf. Setting WITHOUT_KERBEROS="YES" in /etc/make.conf allowed buildworld to complete. I suggest adding a blurb to src/UPDATING to help others with memory loss issues. Index: UPDATING =================================================================== --- UPDATING (revision 245426) +++ UPDATING (working copy) @@ -26,6 +26,13 @@ disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) + +20130110: + Revision 245269 removed the legacy support for NOFOO and NO_FOO + build options. Individuals should review their /etc/make.conf + and /etc/src.conf for (long forgotten) NOFOO and NO_FOO, and + changes these to WITHOUT_FOO. + 20121223: After switching to Clang as the default compiler some users of ZFS on i386 systems started to experience stack overflow kernel panics. -- Steve From owner-svn-src-head@FreeBSD.ORG Mon Jan 14 22:57:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EABF2E33; Mon, 14 Jan 2013 22:57:03 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id B1C81175; Mon, 14 Jan 2013 22:57:03 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 00FDD3592EF; Mon, 14 Jan 2013 23:57:01 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id E0A762848C; Mon, 14 Jan 2013 23:57:00 +0100 (CET) Date: Mon, 14 Jan 2013 23:57:00 +0100 From: Jilles Tjoelker To: Eitan Adler Subject: Re: svn commit: r245426 - head/bin/sh Message-ID: <20130114225700.GA93645@stack.nl> References: <201301141640.r0EGepLc050623@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Jan 2013 22:57:04 -0000 On Mon, Jan 14, 2013 at 01:38:51PM -0500, Eitan Adler wrote: > On 14 January 2013 11:40, Jilles Tjoelker wrote: > > Author: jilles > > Date: Mon Jan 14 16:40:50 2013 > > New Revision: 245426 > > URL: http://svnweb.freebsd.org/changeset/base/245426 > > Log: > > sh: Simplify cd-hash interaction. > > Instead of rechecking relative paths for all hashed utilities after a cd, > > track if any utility in cmdtable depends on a relative path in PATH. > > If there is such a utility, cd clears the entire table. > Why not clear just these entries instead of the entire table? Clearing too much might affect performance but not correctness. The utilities will be looked up again if necessary. Because it is uncommon nowadays to include a relative pathname in PATH, I handle this case in a very simple manner. -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 00:12:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0005CF3C; Tue, 15 Jan 2013 00:12:34 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E62B76FF; Tue, 15 Jan 2013 00:12:34 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0F0CYrH087248; Tue, 15 Jan 2013 00:12:34 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0F0CYU5087246; Tue, 15 Jan 2013 00:12:34 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301150012.r0F0CYU5087246@svn.freebsd.org> From: Brooks Davis Date: Tue, 15 Jan 2013 00:12:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245440 - in head: . etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 00:12:35 -0000 Author: brooks Date: Tue Jan 15 00:12:34 2013 New Revision: 245440 URL: http://svnweb.freebsd.org/changeset/base/245440 Log: Add an option DB_FROM_SRC to use src/etc's user/group databases when installing. This allows things like running installworld for 10-CURRENT on a 9.0-RELEASE system without adding extra users and groups to the passwd and group files. To prevent potentially risky uid/gid mismatches on systems with non-standard local values, require that DESTDIR be set if DB_FROM_SRC is set. Sponsored by: DARPA, AFRL Reviewed by: peter Modified: head/Makefile.inc1 head/etc/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Jan 14 22:00:43 2013 (r245439) +++ head/Makefile.inc1 Tue Jan 15 00:12:34 2013 (r245440) @@ -13,6 +13,8 @@ # -DNO_PORTSUPDATE do not update ports in ${MAKE} update # -DNO_DOCUPDATE do not update doc in ${MAKE} update # -DNO_WWWUPDATE do not update www in ${MAKE} update +# -DDB_FROM_SRC use the user/group databases in src/etc instead of +# the system database when installing. # -DNO_CTF do not run the DTrace CTF conversion tools on built objects # LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list # LOCAL_LIB_DIRS="list of dirs" to add additional dirs to libraries target @@ -340,12 +342,13 @@ LIB32WMAKEFLAGS+= \ LIB32WMAKE= ${LIB32WMAKEENV} ${MAKE} ${LIB32WMAKEFLAGS} \ -DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_INFO -DWITHOUT_HTML -LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*:N_LDSCRIPTROOT=*} -DNO_INCS +LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*:N_LDSCRIPTROOT=*} -DNO_INCS \ + ${IMAKE_INSTALL} .endif -# install stage IMAKEENV= ${CROSSENV:N_LDSCRIPTROOT=*} -IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 +IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 \ + ${IMAKE_INSTALL} ${IMAKE_MTREE} .if empty(.MAKEFLAGS:M-n) IMAKEENV+= PATH=${STRICTTMPPATH}:${INSTALLTMP} \ LD_LIBRARY_PATH=${INSTALLTMP} \ @@ -354,6 +357,10 @@ IMAKE+= __MAKE_SHELL=${INSTALLTMP}/sh .else IMAKEENV+= PATH=${TMPPATH}:${INSTALLTMP} .endif +.if defined(DB_FROM_SRC) +IMAKE_INSTALL= INSTALL="install -N ${.CURDIR}/etc" +IMAKE_MTREE= MTREE_CMD="nmtree -N ${.CURDIR}/etc" +.endif # kernel stage KMAKEENV= ${WMAKEENV} @@ -595,9 +602,11 @@ kernel-toolchain: ${TOOLCHAIN_TGTS:N_inc installcheck: # -# Require DESTDIR to be set if installing for a different architecture. +# Require DESTDIR to be set if installing for a different architecture or +# using the user/group database in the source tree. # -.if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${TARGET} != ${MACHINE} +.if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${TARGET} != ${MACHINE} || \ + defined(DB_FROM_SRC) .if !make(distributeworld) installcheck: installcheck_DESTDIR installcheck_DESTDIR: @@ -608,6 +617,7 @@ installcheck_DESTDIR: .endif .endif +.if !defined(DB_FROM_SRC) # # Check for missing UIDs/GIDs. # @@ -635,6 +645,7 @@ installcheck_UGID: false; \ fi .endfor +.endif # # Required install tools to be saved in a scratch dir for safety. @@ -692,6 +703,7 @@ distributeworld installworld: installche done); \ cp $$libs $$progs ${INSTALLTMP} cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale + rm -f ${METALOG} .if make(distributeworld) .for dist in ${EXTRA_DISTRIBUTIONS} -mkdir ${DESTDIR}/${DISTDIR}/${dist} @@ -753,7 +765,8 @@ redistribute: .endif distrib-dirs distribution: - cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} ${.TARGET} + cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \ + ${IMAKE_INSTALL} ${.TARGET} # # buildkernel and installkernel @@ -1059,6 +1072,11 @@ _lex= usr.bin/lex _yacc= usr.bin/yacc .endif +.if defined(DB_FROM_SRC) && ${BOOTSTRAPPING} < 1000026 +_nmtree= lib/libnetbsd \ + usr.sbin/nmtree +.endif + .if ${BOOTSTRAPPING} >= 900040 && ${BOOTSTRAPPING} < 900041 _awk= usr.bin/awk .endif @@ -1120,7 +1138,8 @@ bootstrap-tools: ${_lex} \ usr.bin/xinstall \ ${_gensnmptree} \ - usr.sbin/config + usr.sbin/config \ + ${_nmtree} ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ cd ${.CURDIR}/${_tool}; \ ${MAKE} DIRPRFX=${_tool}/ obj; \ Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Mon Jan 14 22:00:43 2013 (r245439) +++ head/etc/Makefile Tue Jan 15 00:12:34 2013 (r245440) @@ -291,25 +291,27 @@ distribution: ${DESTDIR}/etc/nsswitch.conf .endif +MTREE_CMD?= mtree + distrib-dirs: - mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/ - mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var - mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr - mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.include.dist \ + ${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/ + ${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var + ${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr + ${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.include.dist \ -p ${DESTDIR}/usr/include .if ${MK_BIND_LIBS} != "no" - mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.include.dist \ + ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.include.dist \ -p ${DESTDIR}/usr/include .endif .if ${MK_BIND_MTREE} != "no" - mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.chroot.dist \ + ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.chroot.dist \ -p ${DESTDIR}/var/named .endif .if ${MK_GROFF} != "no" - mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.groff.dist -p ${DESTDIR}/usr + ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.groff.dist -p ${DESTDIR}/usr .endif .if ${MK_SENDMAIL} != "no" - mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.sendmail.dist -p ${DESTDIR}/ + ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.sendmail.dist -p ${DESTDIR}/ .endif cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys cd ${DESTDIR}/usr/share/man/en.ISO8859-1; ln -sf ../man* . From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 00:24:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 231C46A8; Tue, 15 Jan 2013 00:24:02 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 072C67A6; Tue, 15 Jan 2013 00:24:02 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0F0O1gj090431; Tue, 15 Jan 2013 00:24:01 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0F0O1xK090429; Tue, 15 Jan 2013 00:24:01 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201301150024.r0F0O1xK090429@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 15 Jan 2013 00:24:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245441 - 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.14 Precedence: list List-Id: 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, 15 Jan 2013 00:24:02 -0000 Author: np Date: Tue Jan 15 00:24:01 2013 New Revision: 245441 URL: http://svnweb.freebsd.org/changeset/base/245441 Log: cxgbe/tom: Miscellaneous updates for TOE+IPv6 support (more to follow). - Teach find_best_mtu_idx() to deal with IPv6 endpoints. - Install correct protosw in offloaded TCP/IPv6 sockets when DDP is enabled. - Move set_tcp_ddp_ulp_mode to t4_tom.c so that t4_tom.h can be included without having to drag in t4_msg.h too. This was bothering the iWARP driver for some reason. MFC after: 1 week Modified: head/sys/dev/cxgbe/tom/t4_tom.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Tue Jan 15 00:12:34 2013 (r245440) +++ head/sys/dev/cxgbe/tom/t4_tom.c Tue Jan 15 00:24:01 2013 (r245441) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" +#include "opt_inet6.h" #include #include @@ -43,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #define TCPSTATES #include @@ -58,6 +60,9 @@ __FBSDID("$FreeBSD$"); static struct protosw ddp_protosw; static struct pr_usrreqs ddp_usrreqs; +static struct protosw ddp6_protosw; +static struct pr_usrreqs ddp6_usrreqs; + /* Module ops */ static int t4_tom_mod_load(void); static int t4_tom_mod_unload(void); @@ -170,8 +175,12 @@ 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) - so->so_proto = &ddp_protosw; + if (toep->ulp_mode == ULP_MODE_TCPDDP) { + if (inp->inp_vflag & INP_IPV6) + so->so_proto = &ddp6_protosw; + else + so->so_proto = &ddp_protosw; + } SOCKBUF_UNLOCK(sb); /* Update TCP PCB */ @@ -394,7 +403,7 @@ int find_best_mtu_idx(struct adapter *sc, struct in_conninfo *inc, int pmss) { unsigned short *mtus = &sc->params.mtus[0]; - int i = 0, mss; + int i, mss, n; KASSERT(inc != NULL || pmss > 0, ("%s: at least one of inc/pmss must be specified", __func__)); @@ -403,8 +412,13 @@ find_best_mtu_idx(struct adapter *sc, st if (pmss > 0 && mss > pmss) mss = pmss; - while (i < NMTUS - 1 && mtus[i + 1] <= mss + 40) - ++i; + if (inc->inc_flags & INC_ISIPV6) + n = sizeof(struct ip6_hdr) + sizeof(struct tcphdr); + else + n = sizeof(struct ip) + sizeof(struct tcphdr); + + for (i = 0; i < NMTUS - 1 && mtus[i + 1] <= mss + n; i++) + continue; return (i); } @@ -513,6 +527,15 @@ select_ntuple(struct port_info *pi, stru return (htobe32(ntuple)); } +void +set_tcpddp_ulp_mode(struct toepcb *toep) +{ + + toep->ulp_mode = ULP_MODE_TCPDDP; + toep->ddp_flags = DDP_OK; + toep->ddp_score = DDP_LOW_SCORE; +} + static int alloc_tid_tabs(struct tid_info *t) { @@ -698,17 +721,24 @@ static int t4_tom_mod_load(void) { int rc; - struct protosw *tcp_protosw; + struct protosw *tcp_protosw, *tcp6_protosw; 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_soreceive = t4_soreceive_ddp; ddp_protosw.pr_usrreqs = &ddp_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_soreceive = t4_soreceive_ddp; + ddp6_protosw.pr_usrreqs = &ddp6_usrreqs; + rc = t4_register_uld(&tom_uld_info); if (rc != 0) t4_tom_mod_unload(); Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Tue Jan 15 00:12:34 2013 (r245440) +++ head/sys/dev/cxgbe/tom/t4_tom.h Tue Jan 15 00:24:01 2013 (r245441) @@ -140,15 +140,6 @@ struct flowc_tx_params { #define DDP_LOW_SCORE 1 #define DDP_HIGH_SCORE 3 -static inline void -set_tcpddp_ulp_mode(struct toepcb *toep) -{ - - toep->ulp_mode = ULP_MODE_TCPDDP; - toep->ddp_flags = DDP_OK; - toep->ddp_score = DDP_LOW_SCORE; -} - /* * Compressed state for embryonic connections for a listener. Barely fits in * 64B, try not to grow it further. @@ -234,6 +225,7 @@ int select_rcv_wscale(void); uint64_t calc_opt0(struct socket *, struct port_info *, struct l2t_entry *, int, int, int, int); uint32_t select_ntuple(struct port_info *, struct l2t_entry *, uint32_t); +void set_tcpddp_ulp_mode(struct toepcb *); /* t4_connect.c */ void t4_init_connect_cpl_handlers(struct adapter *); From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 01:13:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 04F09330; Tue, 15 Jan 2013 01:13:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DDAF497F; Tue, 15 Jan 2013 01:13:55 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0F1DtQP005920; Tue, 15 Jan 2013 01:13:55 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0F1DtXa005919; Tue, 15 Jan 2013 01:13:55 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301150113.r0F1DtXa005919@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jan 2013 01:13:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245443 - head/sys/geom/mirror X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 01:13:56 -0000 Author: mav Date: Tue Jan 15 01:13:55 2013 New Revision: 245443 URL: http://svnweb.freebsd.org/changeset/base/245443 Log: Alike to r242314 for GRAID make GMIRROR more aggressive in marking volumes as clean on shutdown and move that action from shutdown_pre_sync stage to shutdown_post_sync to avoid extra flapping. ZFS tends to not close devices on shutdown, that doesn't allow GEOM RAID to shutdown gracefully. To handle that, mark volume as clean just when shutdown time comes and there are no active writes. PR: kern/113957 MFC after: 2 weeks Modified: head/sys/geom/mirror/g_mirror.c Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Tue Jan 15 00:39:15 2013 (r245442) +++ head/sys/geom/mirror/g_mirror.c Tue Jan 15 01:13:55 2013 (r245443) @@ -81,7 +81,8 @@ SYSCTL_UINT(_kern_geom_mirror, OID_AUTO, G_MIRROR_DEBUG(4, "%s: Woken up %p.", __func__, (ident)); \ } while (0) -static eventhandler_tag g_mirror_pre_sync = NULL; +static eventhandler_tag g_mirror_post_sync = NULL; +static int g_mirror_shutdown = 0; static int g_mirror_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp); @@ -815,7 +816,7 @@ g_mirror_idle(struct g_mirror_softc *sc, return (0); if (acw > 0 || (acw == -1 && sc->sc_provider->acw > 0)) { timeout = g_mirror_idletime - (time_uptime - sc->sc_last_write); - if (timeout > 0) + if (!g_mirror_shutdown && timeout > 0) return (timeout); } sc->sc_idle = 1; @@ -2821,7 +2822,7 @@ g_mirror_access(struct g_provider *pp, i error = ENXIO; goto end; } - if (dcw == 0 && !sc->sc_idle) + if (dcw == 0) g_mirror_idle(sc, dcw); if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROYING) != 0) { if (acr > 0 || acw > 0 || ace > 0) { @@ -3232,7 +3233,7 @@ g_mirror_dumpconf(struct sbuf *sb, const } static void -g_mirror_shutdown_pre_sync(void *arg, int howto) +g_mirror_shutdown_post_sync(void *arg, int howto) { struct g_class *mp; struct g_geom *gp, *gp2; @@ -3242,6 +3243,7 @@ g_mirror_shutdown_pre_sync(void *arg, in mp = arg; DROP_GIANT(); g_topology_lock(); + g_mirror_shutdown = 1; LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) { if ((sc = gp->softc) == NULL) continue; @@ -3250,6 +3252,7 @@ g_mirror_shutdown_pre_sync(void *arg, in continue; g_topology_unlock(); sx_xlock(&sc->sc_lock); + g_mirror_idle(sc, -1); g_cancel_event(sc); error = g_mirror_destroy(sc, G_MIRROR_DESTROY_DELAYED); if (error != 0) @@ -3264,9 +3267,9 @@ static void g_mirror_init(struct g_class *mp) { - g_mirror_pre_sync = EVENTHANDLER_REGISTER(shutdown_pre_sync, - g_mirror_shutdown_pre_sync, mp, SHUTDOWN_PRI_FIRST); - if (g_mirror_pre_sync == NULL) + g_mirror_post_sync = EVENTHANDLER_REGISTER(shutdown_post_sync, + g_mirror_shutdown_post_sync, mp, SHUTDOWN_PRI_FIRST); + if (g_mirror_post_sync == NULL) G_MIRROR_DEBUG(0, "Warning! Cannot register shutdown event."); } @@ -3274,8 +3277,8 @@ static void g_mirror_fini(struct g_class *mp) { - if (g_mirror_pre_sync != NULL) - EVENTHANDLER_DEREGISTER(shutdown_pre_sync, g_mirror_pre_sync); + if (g_mirror_post_sync != NULL) + EVENTHANDLER_DEREGISTER(shutdown_post_sync, g_mirror_post_sync); } DECLARE_GEOM_CLASS(g_mirror_class, g_mirror); From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 01:27:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7C63B67E; Tue, 15 Jan 2013 01:27:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5FB259EE; Tue, 15 Jan 2013 01:27:05 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0F1R5fR009271; Tue, 15 Jan 2013 01:27:05 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0F1R5hF009270; Tue, 15 Jan 2013 01:27:05 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301150127.r0F1R5hF009270@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jan 2013 01:27:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245444 - head/sys/geom/raid3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 01:27:05 -0000 Author: mav Date: Tue Jan 15 01:27:04 2013 New Revision: 245444 URL: http://svnweb.freebsd.org/changeset/base/245444 Log: Alike to r242314 for GRAID make GRAID3 more aggressive in marking volumes as clean on shutdown and move that action from shutdown_pre_sync stage to shutdown_post_sync to avoid extra flapping. ZFS tends to not close devices on shutdown, that doesn't allow GEOM RAID to shutdown gracefully. To handle that, mark volume as clean just when shutdown time comes and there are no active writes. MFC after: 2 weeks Modified: head/sys/geom/raid3/g_raid3.c Modified: head/sys/geom/raid3/g_raid3.c ============================================================================== --- head/sys/geom/raid3/g_raid3.c Tue Jan 15 01:13:55 2013 (r245443) +++ head/sys/geom/raid3/g_raid3.c Tue Jan 15 01:27:04 2013 (r245444) @@ -104,7 +104,8 @@ SYSCTL_UINT(_kern_geom_raid3_stat, OID_A G_RAID3_DEBUG(4, "%s: Woken up %p.", __func__, (ident)); \ } while (0) -static eventhandler_tag g_raid3_pre_sync = NULL; +static eventhandler_tag g_raid3_post_sync = NULL; +static int g_raid3_shutdown = 0; static int g_raid3_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp); @@ -876,7 +877,7 @@ g_raid3_idle(struct g_raid3_softc *sc, i return (0); if (acw > 0 || (acw == -1 && sc->sc_provider->acw > 0)) { timeout = g_raid3_idletime - (time_uptime - sc->sc_last_write); - if (timeout > 0) + if (!g_raid3_shutdown && timeout > 0) return (timeout); } sc->sc_idle = 1; @@ -3098,7 +3099,7 @@ g_raid3_access(struct g_provider *pp, in error = ENXIO; goto end; } - if (dcw == 0 && !sc->sc_idle) + if (dcw == 0) g_raid3_idle(sc, dcw); if ((sc->sc_flags & G_RAID3_DEVICE_FLAG_DESTROYING) != 0) { if (acr > 0 || acw > 0 || ace > 0) { @@ -3544,7 +3545,7 @@ g_raid3_dumpconf(struct sbuf *sb, const } static void -g_raid3_shutdown_pre_sync(void *arg, int howto) +g_raid3_shutdown_post_sync(void *arg, int howto) { struct g_class *mp; struct g_geom *gp, *gp2; @@ -3554,6 +3555,7 @@ g_raid3_shutdown_pre_sync(void *arg, int mp = arg; DROP_GIANT(); g_topology_lock(); + g_raid3_shutdown = 1; LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) { if ((sc = gp->softc) == NULL) continue; @@ -3562,6 +3564,7 @@ g_raid3_shutdown_pre_sync(void *arg, int continue; g_topology_unlock(); sx_xlock(&sc->sc_lock); + g_raid3_idle(sc, -1); g_cancel_event(sc); error = g_raid3_destroy(sc, G_RAID3_DESTROY_DELAYED); if (error != 0) @@ -3576,9 +3579,9 @@ static void g_raid3_init(struct g_class *mp) { - g_raid3_pre_sync = EVENTHANDLER_REGISTER(shutdown_pre_sync, - g_raid3_shutdown_pre_sync, mp, SHUTDOWN_PRI_FIRST); - if (g_raid3_pre_sync == NULL) + g_raid3_post_sync = EVENTHANDLER_REGISTER(shutdown_post_sync, + g_raid3_shutdown_post_sync, mp, SHUTDOWN_PRI_FIRST); + if (g_raid3_post_sync == NULL) G_RAID3_DEBUG(0, "Warning! Cannot register shutdown event."); } @@ -3586,8 +3589,8 @@ static void g_raid3_fini(struct g_class *mp) { - if (g_raid3_pre_sync != NULL) - EVENTHANDLER_DEREGISTER(shutdown_pre_sync, g_raid3_pre_sync); + if (g_raid3_post_sync != NULL) + EVENTHANDLER_DEREGISTER(shutdown_post_sync, g_raid3_post_sync); } DECLARE_GEOM_CLASS(g_raid3_class, g_raid3); From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 02:18:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 62E15FA8; Tue, 15 Jan 2013 02:18:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3E8DABE6; Tue, 15 Jan 2013 02:18:05 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0F2I5dK024942; Tue, 15 Jan 2013 02:18:05 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0F2I5Sb024940; Tue, 15 Jan 2013 02:18:05 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301150218.r0F2I5Sb024940@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jan 2013 02:18:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245446 - head/sys/dev/ata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 02:18:05 -0000 Author: mav Date: Tue Jan 15 02:18:04 2013 New Revision: 245446 URL: http://svnweb.freebsd.org/changeset/base/245446 Log: In case somebody still use it, fix legacy ataraid(4) to work on combined PATA+AHCI controllers, such as JMicron JMB363. PR: kern/159271 MFC after: 1 week Modified: head/sys/dev/ata/ata-raid.c Modified: head/sys/dev/ata/ata-raid.c ============================================================================== --- head/sys/dev/ata/ata-raid.c Tue Jan 15 01:33:19 2013 (r245445) +++ head/sys/dev/ata/ata-raid.c Tue Jan 15 02:18:04 2013 (r245446) @@ -1351,10 +1351,11 @@ static int ata_raid_read_metadata(device_t subdisk) { devclass_t pci_devclass = devclass_find("pci"); + devclass_t atapci_devclass = devclass_find("atapci"); devclass_t devclass=device_get_devclass(GRANDPARENT(GRANDPARENT(subdisk))); /* prioritize vendor native metadata layout if possible */ - if (devclass == pci_devclass) { + if (devclass == pci_devclass || devclass == atapci_devclass) { switch (pci_get_vendor(GRANDPARENT(device_get_parent(subdisk)))) { case ATA_HIGHPOINT_ID: if (ata_raid_hptv3_read_meta(subdisk, ata_raid_arrays)) From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 03:03:41 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DD0B4EEF; Tue, 15 Jan 2013 03:03:41 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail35.syd.optusnet.com.au (mail35.syd.optusnet.com.au [211.29.133.51]) by mx1.freebsd.org (Postfix) with ESMTP id 7566EF05; Tue, 15 Jan 2013 03:03:40 +0000 (UTC) Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail35.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r0F33PuS002157 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 15 Jan 2013 14:03:27 +1100 Date: Tue, 15 Jan 2013 14:03:25 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin Subject: Re: svn commit: r243631 - in head/sys: kern sys In-Reply-To: <201301141255.46994.jhb@freebsd.org> Message-ID: <20130115125138.P1099@besplex.bde.org> References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50F41F8C.5030900@freebsd.org> <50F4297F.8050708@FreeBSD.org> <201301141255.46994.jhb@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.0 cv=MscKcBme c=1 sm=1 a=PcN1GEuqyV8A:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=Y5AXMyR2jB0A:10 a=hIoxf_-hmCfl0XhHhqEA:9 a=CjuIK1q_8ugA:10 a=Lytp-BlQWYeEZU7Z:21 a=AhQzpKN3FgPaxGeD:21 a=TEtd8y5WR3g2ypngnwZWYw==:117 X-Mailman-Approved-At: Tue, 15 Jan 2013 03:14:20 +0000 Cc: Adrian Chadd , src-committers@FreeBSD.org, Andre Oppermann , Alan Cox , "Jayachandran C." , Alexander Motin , Alfred Perlstein , Oleksandr Tymoshenko , freebsd-arch@FreeBSD.org, svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 03:03:42 -0000 On Mon, 14 Jan 2013, John Baldwin wrote: > On Monday, January 14, 2013 10:51:27 am Alexander Motin wrote: >> As I've actually written, there are two different things: >> ncallout -- number of preallocated callout structures for purposes of >> timeout() calls. That is a legacy API that is probably not very much >> used now, so that value don't need to be too big. But that allocation is >> static and if it will ever be exhausted system will panic. That is why >> it was set quite high. The right way now would be to analyze where that >> API is still used and estimate the really required number. > > FYI, I have slowly been working through the tree fixing users of timeout() > to use callout_*() instead. But timeout() is a better API, starting with its name, for the simple cases that it handles. It is easier to use since the storage allocation for it is handled automatically. Since it returns a handle, the automatic storage allocation for it doesn't need to be static. (The allocation is not quite static, since ncallout is variable, but I will describe it as static.) The static allocation is just a minor optimization for efficiency and simplicity (the callout API gives further minor optimizations by allocating even more statically in callers, so that no linked list management is needed and there is better locality). It can be replaced by a malloc() on every call to timeout(), or maybe a buffer pool. The static allocation is equivalent to a buffer pool that is never expanded and has no fallback to malloc() when it is too small. Since there is no fallback, the pool has to be very large (but not 512MB) to prevent panics. Since use of timeout() has rotted, there aren't many callers of it left, so if there was a fallback then a very small buffer pool of size say 16 entries would suffice. Larger systems and newer ones that start using the better timeout() API might need as many as 256 entries. However, buffer pools are what you use when the system's malloc() is too slow to use. Since malloc(9) or at least uma_zalloc(9) is not all that slow, it is probably efficient enough to just use it, at least while timeout() is just a compatibility wrapper. There are already some minor efficiencies from using the wrapper. By using the system's malloc() and not using a buffer pool, timeout() becomes even simpler than before: delete ncallout and all associated code, and replace the linked list by malloc()'s internal management: % struct callout_handle % timeout(ftn, arg, to_ticks) % timeout_t *ftn; % void *arg; % int to_ticks; % { % struct callout_cpu *cc; % struct callout *new; % struct callout_handle handle; % % cc = CC_CPU(timeout_cpu); % CC_LOCK(cc); All the locking becomes unnecessary too. The locking might be just as slow as dynamic allocation, especially if the lock is contended. % /* Fill in the next free callout structure. */ % new = SLIST_FIRST(&cc->cc_callfree); This would have to be malloc()ed. There seems to be a problem with waiting being impossible in some contexts, so malloc() might fail, but this function can't fail. So a large buffer pool might be needed after all to handle cases where malloc() fails :-(. Also, it must be checked that there are no caller's of timeout() before malloc() is initialized, or else the current early initialization of the buffer pool is still needed for these early callers. % if (new == NULL) % /* XXX Attempt to malloc first */ % panic("timeout table full"); This code always knew that it shouldn't panic. % SLIST_REMOVE_HEAD(&cc->cc_callfree, c_links.sle); % callout_reset(new, to_ticks, ftn, arg); % handle.callout = new; % CC_UNLOCK(cc); % % return (handle); % } Bruce From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 05:33:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B93DD257; Tue, 15 Jan 2013 05:33:41 +0000 (UTC) (envelope-from dbn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 884A6A44; Tue, 15 Jan 2013 05:33:41 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0F5XfmJ090576; Tue, 15 Jan 2013 05:33:41 GMT (envelope-from dbn@svn.freebsd.org) Received: (from dbn@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0F5XfeV090574; Tue, 15 Jan 2013 05:33:41 GMT (envelope-from dbn@svn.freebsd.org) Message-Id: <201301150533.r0F5XfeV090574@svn.freebsd.org> From: David Naylor Date: Tue, 15 Jan 2013 05:33:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245447 - in head: share/misc usr.bin/calendar/calendars X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 05:33:41 -0000 Author: dbn (ports committer) Date: Tue Jan 15 05:33:40 2013 New Revision: 245447 URL: http://svnweb.freebsd.org/changeset/base/245447 Log: Add myself as a port committer (with eadler@ and bdrewery@ as mentors). While in the repository, add myself to calendar.freebsd. Approved by: eadler/bdrewery (mentor) Modified: head/share/misc/committers-ports.dot head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Tue Jan 15 02:18:04 2013 (r245446) +++ head/share/misc/committers-ports.dot Tue Jan 15 05:33:40 2013 (r245447) @@ -77,6 +77,7 @@ culot [label="Frederic Culot\nculot@Free daichi [label="Daichi Goto\ndaichi@FreeBSD.org\n2002/10/17"] danfe [label="Alexey Dokuchaev\ndanfe@FreeBSD.org\n2004/08/20"] db [label="Diane Bruce\ndb@FreeBSD.org\n2007/01/18"] +dbn [label="David Naylor\ndbn@FreeBSD.org\n2013/01/14"] decke [label="Bernhard Froehlich\ndecke@FreeBSD.org\n2010/03/21"] delphij [label="Xin Li\ndelphij@FreeBSD.org\n2006/05/01"] demon [label="Dmitry Sivachenko\ndemon@FreeBSD.org\n2000/11/13"] @@ -233,6 +234,8 @@ asami -> obrien avilla -> jhale avilla -> rakuco +bdrewery -> dbn + bapt -> bdrewery bapt -> eadler bapt -> jlaffaye @@ -274,6 +277,7 @@ delphij -> rafan demon -> mat eadler -> ak +eadler -> dbn eadler -> bdrewery eadler -> gjb eadler -> tj Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Tue Jan 15 02:18:04 2013 (r245446) +++ head/usr.bin/calendar/calendars/calendar.freebsd Tue Jan 15 05:33:40 2013 (r245447) @@ -165,6 +165,7 @@ 05/22 Clive Tong-I Lin born in Changhua, Taiwan, Republic of China, 1978 05/22 Michael Bushkov born in Rostov-on-Don, Russian Federation, 1985 05/22 Rui Paulo born in Evora, Portugal, 1986 +05/22 David Naylor born in Johannesburg, South Africa, 1988 05/23 Munechika Sumikawa born in Osaka, Osaka, Japan, 1972 05/24 Duncan McLennan Barclay born in London, Middlesex, United Kingdom, 1970 05/24 Oliver Lehmann born in Karlsburg, Germany, 1981 From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 07:07:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DA464D17; Tue, 15 Jan 2013 07:07:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B352D81; Tue, 15 Jan 2013 07:07:30 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0F77UUK020589; Tue, 15 Jan 2013 07:07:30 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0F77UxB020587; Tue, 15 Jan 2013 07:07:30 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201301150707.r0F77UxB020587@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 15 Jan 2013 07:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245448 - 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.14 Precedence: list List-Id: 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, 15 Jan 2013 07:07:30 -0000 Author: np Date: Tue Jan 15 07:07:29 2013 New Revision: 245448 URL: http://svnweb.freebsd.org/changeset/base/245448 Log: cxgbe/tom: Basic CLIP table management. This is the Compressed Local IPv6 table on the chip. To save space, the chip uses an index into this table instead of a full IPv6 address in some of its hardware data structures. For now the driver fills this table with all the local IPv6 addresses that it sees at the time the table is initialized. I'll improve this later so that the table is updated whenever new IPv6 addresses are configured or existing ones deleted. MFC after: 1 week Modified: head/sys/dev/cxgbe/tom/t4_tom.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Tue Jan 15 05:33:40 2013 (r245447) +++ head/sys/dev/cxgbe/tom/t4_tom.c Tue Jan 15 07:07:29 2013 (r245448) @@ -41,11 +41,14 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include #include +#include #define TCPSTATES #include #include @@ -82,6 +85,11 @@ static void queue_tid_release(struct ada static void release_offload_resources(struct toepcb *); static int alloc_tid_tabs(struct tid_info *); static void free_tid_tabs(struct tid_info *); +static int add_lip(struct adapter *, struct in6_addr *); +static int delete_lip(struct adapter *, struct in6_addr *); +static struct clip_entry *search_lip(struct tom_data *, struct in6_addr *); +static void init_clip_table(struct adapter *, struct tom_data *); +static void destroy_clip_table(struct adapter *, struct tom_data *); static void free_tom_data(struct adapter *, struct tom_data *); struct toepcb * @@ -246,8 +254,8 @@ release_offload_resources(struct toepcb KASSERT(!(toep->flags & TPF_ATTACHED), ("%s: %p is still attached.", __func__, toep)); - CTR4(KTR_CXGBE, "%s: toep %p (tid %d, l2te %p)", - __func__, toep, tid, toep->l2te); + CTR5(KTR_CXGBE, "%s: toep %p (tid %d, l2te %p, ce %p)", + __func__, toep, tid, toep->l2te, toep->ce); if (toep->ulp_mode == ULP_MODE_TCPDDP) release_ddp_resources(toep); @@ -260,6 +268,9 @@ release_offload_resources(struct toepcb release_tid(sc, tid, toep->ctrlq); } + if (toep->ce) + release_lip(td, toep->ce); + mtx_lock(&td->toep_list_lock); TAILQ_REMOVE(&td->toep_list, toep, link); mtx_unlock(&td->toep_list_lock); @@ -588,9 +599,157 @@ free_tid_tabs(struct tid_info *t) mtx_destroy(&t->stid_lock); } +static int +add_lip(struct adapter *sc, struct in6_addr *lip) +{ + struct fw_clip_cmd c; + + ASSERT_SYNCHRONIZED_OP(sc); + /* mtx_assert(&td->clip_table_lock, MA_OWNED); */ + + memset(&c, 0, sizeof(c)); + c.op_to_write = htonl(V_FW_CMD_OP(FW_CLIP_CMD) | F_FW_CMD_REQUEST | + F_FW_CMD_WRITE); + c.alloc_to_len16 = htonl(F_FW_CLIP_CMD_ALLOC | FW_LEN16(c)); + c.ip_hi = *(uint64_t *)&lip->s6_addr[0]; + c.ip_lo = *(uint64_t *)&lip->s6_addr[8]; + + return (t4_wr_mbox_ns(sc, sc->mbox, &c, sizeof(c), &c)); +} + +static int +delete_lip(struct adapter *sc, struct in6_addr *lip) +{ + struct fw_clip_cmd c; + + ASSERT_SYNCHRONIZED_OP(sc); + /* mtx_assert(&td->clip_table_lock, MA_OWNED); */ + + memset(&c, 0, sizeof(c)); + c.op_to_write = htonl(V_FW_CMD_OP(FW_CLIP_CMD) | F_FW_CMD_REQUEST | + F_FW_CMD_READ); + c.alloc_to_len16 = htonl(F_FW_CLIP_CMD_FREE | FW_LEN16(c)); + c.ip_hi = *(uint64_t *)&lip->s6_addr[0]; + c.ip_lo = *(uint64_t *)&lip->s6_addr[8]; + + return (t4_wr_mbox_ns(sc, sc->mbox, &c, sizeof(c), &c)); +} + +static struct clip_entry * +search_lip(struct tom_data *td, struct in6_addr *lip) +{ + struct clip_entry *ce; + + mtx_assert(&td->clip_table_lock, MA_OWNED); + + TAILQ_FOREACH(ce, &td->clip_table, link) { + if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) + return (ce); + } + + return (NULL); +} + +struct clip_entry * +hold_lip(struct tom_data *td, struct in6_addr *lip) +{ + struct clip_entry *ce; + + mtx_lock(&td->clip_table_lock); + ce = search_lip(td, lip); + if (ce != NULL) + ce->refcount++; + mtx_unlock(&td->clip_table_lock); + + return (ce); +} + +void +release_lip(struct tom_data *td, struct clip_entry *ce) +{ + + mtx_lock(&td->clip_table_lock); + KASSERT(search_lip(td, &ce->lip) == ce, + ("%s: CLIP entry %p p not in CLIP table.", __func__, ce)); + KASSERT(ce->refcount > 0, + ("%s: CLIP entry %p has refcount 0", __func__, ce)); + --ce->refcount; + mtx_unlock(&td->clip_table_lock); +} + +static void +init_clip_table(struct adapter *sc, struct tom_data *td) +{ + struct in6_ifaddr *ia; + struct in6_addr *lip, tlip; + struct clip_entry *ce; + + ASSERT_SYNCHRONIZED_OP(sc); + + mtx_init(&td->clip_table_lock, "CLIP table lock", NULL, MTX_DEF); + TAILQ_INIT(&td->clip_table); + + IN6_IFADDR_RLOCK(); + TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) { + lip = &ia->ia_addr.sin6_addr; + + KASSERT(!IN6_IS_ADDR_MULTICAST(lip), + ("%s: mcast address in in6_ifaddr list", __func__)); + + if (IN6_IS_ADDR_LOOPBACK(lip)) + continue; + if (IN6_IS_SCOPE_EMBED(lip)) { + /* Remove the embedded scope */ + tlip = *lip; + lip = &tlip; + in6_clearscope(lip); + } + /* + * XXX: how to weed out the link local address for the loopback + * interface? It's fe80::1 usually (always?). + */ + + mtx_lock(&td->clip_table_lock); + if (search_lip(td, lip) == NULL) { + ce = malloc(sizeof(*ce), M_CXGBE, M_NOWAIT); + memcpy(&ce->lip, lip, sizeof(ce->lip)); + ce->refcount = 0; + if (add_lip(sc, lip) == 0) + TAILQ_INSERT_TAIL(&td->clip_table, ce, link); + else + free(ce, M_CXGBE); + } + mtx_unlock(&td->clip_table_lock); + } + IN6_IFADDR_RUNLOCK(); +} + +static void +destroy_clip_table(struct adapter *sc, struct tom_data *td) +{ + struct clip_entry *ce, *ce_temp; + + if (mtx_initialized(&td->clip_table_lock)) { + mtx_lock(&td->clip_table_lock); + TAILQ_FOREACH_SAFE(ce, &td->clip_table, link, ce_temp) { + KASSERT(ce->refcount == 0, + ("%s: CLIP entry %p still in use (%d)", __func__, + ce, ce->refcount)); + TAILQ_REMOVE(&td->clip_table, ce, link); + delete_lip(sc, &ce->lip); + free(ce, M_CXGBE); + } + mtx_unlock(&td->clip_table_lock); + mtx_destroy(&td->clip_table_lock); + } +} + static void free_tom_data(struct adapter *sc, struct tom_data *td) { + + ASSERT_SYNCHRONIZED_OP(sc); + KASSERT(TAILQ_EMPTY(&td->toep_list), ("%s: TOE PCB list is not empty.", __func__)); KASSERT(td->lctx_count == 0, @@ -599,6 +758,7 @@ free_tom_data(struct adapter *sc, struct t4_uninit_l2t_cpl_handlers(sc); t4_uninit_cpl_io_handlers(sc); t4_uninit_ddp(sc, td); + destroy_clip_table(sc, td); if (td->listen_mask != 0) hashdestroy(td->listen_hash, M_CXGBE, td->listen_mask); @@ -644,8 +804,12 @@ t4_tom_activate(struct adapter *sc) if (rc != 0) goto done; + /* DDP page pods and CPL handlers */ t4_init_ddp(sc, td); + /* CLIP table for IPv6 offload */ + init_clip_table(sc, td); + /* CPL handlers */ t4_init_connect_cpl_handlers(sc); t4_init_l2t_cpl_handlers(sc); Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Tue Jan 15 05:33:40 2013 (r245447) +++ head/sys/dev/cxgbe/tom/t4_tom.h Tue Jan 15 07:07:29 2013 (r245448) @@ -109,6 +109,7 @@ struct toepcb { struct sge_ofld_rxq *ofld_rxq; struct sge_wrq *ctrlq; struct l2t_entry *l2te; /* L2 table entry used by this connection */ + struct clip_entry *ce; /* CLIP table entry used by this tid */ int tid; /* Connection identifier */ unsigned int tx_credits;/* tx WR credits (in 16 byte units) remaining */ unsigned int sb_cc; /* last noted value of so_rcv->sb_cc */ @@ -175,6 +176,12 @@ struct listen_ctx { TAILQ_HEAD(ppod_head, ppod_region); +struct clip_entry { + TAILQ_ENTRY(clip_entry) link; + struct in6_addr lip; /* local IPv6 address */ + u_int refcount; +}; + struct tom_data { struct toedev tod; @@ -192,6 +199,9 @@ struct tom_data { int nppods_free; /* # of available ppods */ int nppods_free_head; /* # of available ppods at the begining */ struct ppod_head ppods; + + struct mtx clip_table_lock; + TAILQ_HEAD(, clip_entry) clip_table; }; static inline struct tom_data * @@ -226,6 +236,8 @@ uint64_t calc_opt0(struct socket *, stru int, int, int, int); uint32_t select_ntuple(struct port_info *, struct l2t_entry *, uint32_t); void set_tcpddp_ulp_mode(struct toepcb *); +struct clip_entry *hold_lip(struct tom_data *, struct in6_addr *); +void release_lip(struct tom_data *, struct clip_entry *); /* t4_connect.c */ void t4_init_connect_cpl_handlers(struct adapter *); From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 08:26:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 85B84E80; Tue, 15 Jan 2013 08:26:18 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5DCF136B; Tue, 15 Jan 2013 08:26:18 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0F8QIpm044612; Tue, 15 Jan 2013 08:26:18 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0F8QGJr044600; Tue, 15 Jan 2013 08:26:16 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201301150826.r0F8QGJr044600@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Tue, 15 Jan 2013 08:26:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245450 - in head/sys: arm/allwinner arm/conf boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 08:26:18 -0000 Author: ganbold (doc committer) Date: Tue Jan 15 08:26:16 2013 New Revision: 245450 URL: http://svnweb.freebsd.org/changeset/base/245450 Log: Initial support for Allwinner A10 SoC (Cubieboard) Add simple console driver Add interrupt handling and timer codes Add kernel config file Add dts file Approved by: gonzo Added: head/sys/arm/allwinner/ head/sys/arm/allwinner/a10_machdep.c (contents, props changed) head/sys/arm/allwinner/aintc.c (contents, props changed) head/sys/arm/allwinner/bus_space.c (contents, props changed) head/sys/arm/allwinner/common.c (contents, props changed) head/sys/arm/allwinner/console.c (contents, props changed) head/sys/arm/allwinner/files.a10 (contents, props changed) head/sys/arm/allwinner/std.a10 (contents, props changed) head/sys/arm/allwinner/timer.c (contents, props changed) head/sys/arm/conf/CUBIEBOARD (contents, props changed) head/sys/boot/fdt/dts/cubieboard.dts (contents, props changed) Added: head/sys/arm/allwinner/a10_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/a10_machdep.c Tue Jan 15 08:26:16 2013 (r245450) @@ -0,0 +1,122 @@ +/*- + * Copyright (c) 2012 Ganbold Tsagaankhuu. + * All rights reserved. + * + * This code is derived from software written for Brini by Mark Brinicombe + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 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. + * + * from: FreeBSD: //depot/projects/arm/src/sys/arm/ti/ti_machdep.c + */ + +#include "opt_ddb.h" +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#define _ARM32_BUS_DMA_PRIVATE +#include +#include +#include + +#include +#include + +#include +#include /* For trapframe_t, used in */ +#include +#include + +#include + +/* Start of address space used for bootstrap map */ +#define DEVMAP_BOOTSTRAP_MAP_START 0xE0000000 + +void (*a10_cpu_reset)(void); + +vm_offset_t +initarm_lastaddr(void) +{ + + a10_cpu_reset = NULL; + return (DEVMAP_BOOTSTRAP_MAP_START - ARM_NOCACHE_KVA_SIZE); +} + +void +initarm_gpio_init(void) +{ +} + +void +initarm_late_init(void) +{ +} + +#define FDT_DEVMAP_MAX (1 + 2 + 1 + 1) +static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { + { 0, 0, 0, 0, 0, } +}; + +/* + * Construct pmap_devmap[] with DT-derived config data. + */ +int +platform_devmap_init(void) +{ + int i = 0; + + fdt_devmap[i].pd_va = 0xE1C00000; + fdt_devmap[i].pd_pa = 0x01C00000; + fdt_devmap[i].pd_size = 0x00400000; /* 4 MB */ + fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE; + fdt_devmap[i].pd_cache = PTE_DEVICE; + + i++; + + pmap_devmap_bootstrap_table = &fdt_devmap[0]; + + return (0); +} + +struct arm32_dma_range * +bus_dma_get_range(void) +{ + return (NULL); +} + +int +bus_dma_get_range_nb(void) +{ + return (0); +} + +void +cpu_reset() +{ + if (a10_cpu_reset) + (*a10_cpu_reset)(); + else + printf("no cpu_reset implementation\n"); + printf("Reset failed!\n"); + while (1); +} Added: head/sys/arm/allwinner/aintc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/aintc.c Tue Jan 15 08:26:16 2013 (r245450) @@ -0,0 +1,211 @@ +/*- + * Copyright (c) 2012 Ganbold Tsagaankhuu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +/** + * Interrupt controller registers + * + */ +#define SW_INT_VECTOR_REG 0x00 +#define SW_INT_BASE_ADR_REG 0x04 +#define SW_INT_PROTECTION_REG 0x08 +#define SW_INT_NMI_CTRL_REG 0x0c + +#define SW_INT_IRQ_PENDING_REG0 0x10 +#define SW_INT_IRQ_PENDING_REG1 0x14 +#define SW_INT_IRQ_PENDING_REG2 0x18 + +#define SW_INT_FIQ_PENDING_REG0 0x20 +#define SW_INT_FIQ_PENDING_REG1 0x24 +#define SW_INT_FIQ_PENDING_REG2 0x28 + +#define SW_INT_SELECT_REG0 0x30 +#define SW_INT_SELECT_REG1 0x34 +#define SW_INT_SELECT_REG2 0x38 + +#define SW_INT_ENABLE_REG0 0x40 +#define SW_INT_ENABLE_REG1 0x44 +#define SW_INT_ENABLE_REG2 0x48 + +#define SW_INT_MASK_REG0 0x50 +#define SW_INT_MASK_REG1 0x54 +#define SW_INT_MASK_REG2 0x58 + +#define SW_INT_IRQNO_ENMI 0 + +#define SW_INT_IRQ_PENDING_REG(_b) (0x10 + ((_b) * 4)) +#define SW_INT_FIQ_PENDING_REG(_b) (0x20 + ((_b) * 4)) +#define SW_INT_SELECT_REG(_b) (0x30 + ((_b) * 4)) +#define SW_INT_ENABLE_REG(_b) (0x40 + ((_b) * 4)) +#define SW_INT_MASK_REG(_b) (0x50 + ((_b) * 4)) + +struct a10_aintc_softc { + device_t sc_dev; + struct resource * aintc_res; + bus_space_tag_t aintc_bst; + bus_space_handle_t aintc_bsh; + uint8_t ver; +}; + +static struct a10_aintc_softc *a10_aintc_sc = NULL; + +#define aintc_read_4(reg) \ + bus_space_read_4(a10_aintc_sc->aintc_bst, a10_aintc_sc->aintc_bsh, reg) +#define aintc_write_4(reg, val) \ + bus_space_write_4(a10_aintc_sc->aintc_bst, a10_aintc_sc->aintc_bsh, reg, val) + +static int +a10_aintc_probe(device_t dev) +{ + if (!ofw_bus_is_compatible(dev, "a10,aintc")) + return (ENXIO); + device_set_desc(dev, "A10 AINTC Interrupt Controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +a10_aintc_attach(device_t dev) +{ + struct a10_aintc_softc *sc = device_get_softc(dev); + int rid = 0; + int i; + + sc->sc_dev = dev; + + if (a10_aintc_sc) + return (ENXIO); + + sc->aintc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (!sc->aintc_res) { + device_printf(dev, "could not allocate resource\n"); + return (ENXIO); + } + + sc->aintc_bst = rman_get_bustag(sc->aintc_res); + sc->aintc_bsh = rman_get_bushandle(sc->aintc_res); + + a10_aintc_sc = sc; + + /* Disable & clear all interrupts */ + for (i = 0; i < 3; i++) { + aintc_write_4(SW_INT_ENABLE_REG(i), 0); + aintc_write_4(SW_INT_MASK_REG(i), 0xffffffff); + } + /* enable protection mode*/ + aintc_write_4(SW_INT_PROTECTION_REG, 0x01); + + /* config the external interrupt source type*/ + aintc_write_4(SW_INT_NMI_CTRL_REG, 0x00); + + return (0); +} + +static device_method_t a10_aintc_methods[] = { + DEVMETHOD(device_probe, a10_aintc_probe), + DEVMETHOD(device_attach, a10_aintc_attach), + { 0, 0 } +}; + +static driver_t a10_aintc_driver = { + "aintc", + a10_aintc_methods, + sizeof(struct a10_aintc_softc), +}; + +static devclass_t a10_aintc_devclass; + +DRIVER_MODULE(aintc, simplebus, a10_aintc_driver, a10_aintc_devclass, 0, 0); + +int +arm_get_next_irq(int last_irq) +{ + uint32_t value; + int i, b; + + for (i = 0; i < 3; i++) { + value = aintc_read_4(SW_INT_IRQ_PENDING_REG(i)); + for (b = 0; b < 32; b++) + if (value & (1 << b)) { + return (i * 32 + b); + } + } + + return (-1); +} + +void +arm_mask_irq(uintptr_t nb) +{ + uint32_t bit, block, value; + + bit = (nb % 32); + block = (nb / 32); + + value = aintc_read_4(SW_INT_ENABLE_REG(block)); + value &= ~(1 << bit); + aintc_write_4(SW_INT_ENABLE_REG(block), value); + + value = aintc_read_4(SW_INT_MASK_REG(block)); + value |= (1 << bit); + aintc_write_4(SW_INT_MASK_REG(block), value); +} + +void +arm_unmask_irq(uintptr_t nb) +{ + uint32_t bit, block, value; + + bit = (nb % 32); + block = (nb / 32); + + value = aintc_read_4(SW_INT_ENABLE_REG(block)); + value |= (1 << bit); + aintc_write_4(SW_INT_ENABLE_REG(block), value); + + value = aintc_read_4(SW_INT_MASK_REG(block)); + value &= ~(1 << bit); + aintc_write_4(SW_INT_MASK_REG(block), value); + + if(nb == SW_INT_IRQNO_ENMI) /* must clear pending bit when enabled */ + aintc_write_4(SW_INT_IRQ_PENDING_REG(0), (1 << SW_INT_IRQNO_ENMI)); +} Added: head/sys/arm/allwinner/bus_space.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/bus_space.c Tue Jan 15 08:26:16 2013 (r245450) @@ -0,0 +1,113 @@ +/*- + * Copyright (C) 2012 Ganbold Tsagaankhuu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of MARVELL nor the names of contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY 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 AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include + +/* Prototypes for all the bus_space structure functions */ +bs_protos(generic); +bs_protos(generic_armv4); + +struct bus_space _base_tag = { + /* cookie */ + .bs_cookie = (void *) 0, + + /* mapping/unmapping */ + .bs_map = generic_bs_map, + .bs_unmap = generic_bs_unmap, + .bs_subregion = generic_bs_subregion, + + /* allocation/deallocation */ + .bs_alloc = generic_bs_alloc, + .bs_free = generic_bs_free, + + /* barrier */ + .bs_barrier = generic_bs_barrier, + + /* read (single) */ + .bs_r_1 = generic_bs_r_1, + .bs_r_2 = generic_armv4_bs_r_2, + .bs_r_4 = generic_bs_r_4, + .bs_r_8 = NULL, + + /* read multiple */ + .bs_rm_1 = generic_bs_rm_1, + .bs_rm_2 = generic_armv4_bs_rm_2, + .bs_rm_4 = generic_bs_rm_4, + .bs_rm_8 = NULL, + + /* read region */ + .bs_rr_1 = generic_bs_rr_1, + .bs_rr_2 = generic_armv4_bs_rr_2, + .bs_rr_4 = generic_bs_rr_4, + .bs_rr_8 = NULL, + + /* write (single) */ + .bs_w_1 = generic_bs_w_1, + .bs_w_2 = generic_armv4_bs_w_2, + .bs_w_4 = generic_bs_w_4, + .bs_w_8 = NULL, + + /* write multiple */ + .bs_wm_1 = generic_bs_wm_1, + .bs_wm_2 = generic_armv4_bs_wm_2, + .bs_wm_4 = generic_bs_wm_4, + .bs_wm_8 = NULL, + + /* write region */ + .bs_wr_1 = generic_bs_wr_1, + .bs_wr_2 = generic_armv4_bs_wr_2, + .bs_wr_4 = generic_bs_wr_4, + .bs_wr_8 = NULL, + + /* set multiple */ + /* XXX not implemented */ + + /* set region */ + .bs_sr_1 = NULL, + .bs_sr_2 = generic_armv4_bs_sr_2, + .bs_sr_4 = generic_bs_sr_4, + .bs_sr_8 = NULL, + + /* copy */ + .bs_c_1 = NULL, + .bs_c_2 = generic_armv4_bs_c_2, + .bs_c_4 = NULL, + .bs_c_8 = NULL, +}; + +bus_space_tag_t fdtbus_bs_tag = &_base_tag; Added: head/sys/arm/allwinner/common.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/common.c Tue Jan 15 08:26:16 2013 (r245450) @@ -0,0 +1,65 @@ +/*- + * Copyright (c) 2012 Ganbold Tsagaankhuu + * All rights reserved. + * + * Developed by Ganbold Tsagaankhuu + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +struct fdt_fixup_entry fdt_fixup_table[] = { + { NULL, NULL } +}; + +static int +fdt_aintc_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, + int *pol) +{ + if (!fdt_is_compatible(node, "a10,aintc")) + return (ENXIO); + + *interrupt = fdt32_to_cpu(intr[0]); + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + + return (0); +} + +fdt_pic_decode_t fdt_pic_table[] = { + &fdt_aintc_decode_ic, + NULL +}; Added: head/sys/arm/allwinner/console.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/console.c Tue Jan 15 08:26:16 2013 (r245450) @@ -0,0 +1,146 @@ +/*- + * Copyright (c) 2012 Ganbold Tsagaankhuu + * 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. + */ + +/* Simple UART console driver for Allwinner A10 */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#ifndef A10_UART_BASE +#define A10_UART_BASE 0xe1c28000 /* UART0 */ +#endif + +int reg_shift = 2; + +#define UART_DLL 0 /* Out: Divisor Latch Low */ +#define UART_DLM 1 /* Out: Divisor Latch High */ +#define UART_FCR 2 /* Out: FIFO Control Register */ +#define UART_LCR 3 /* Out: Line Control Register */ +#define UART_MCR 4 /* Out: Modem Control Register */ +#define UART_LSR 5 /* In: Line Status Register */ +#define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */ +#define UART_LSR_DR 0x01 /* Receiver data ready */ +#define UART_MSR 6 /* In: Modem Status Register */ +#define UART_SCR 7 /* I/O: Scratch Register */ + + +/* + * uart related funcs + */ +static u_int32_t +uart_getreg(u_int32_t *bas) +{ + return *((volatile u_int32_t *)(bas)) & 0xff; +} + +static void +uart_setreg(u_int32_t *bas, u_int32_t val) +{ + *((volatile u_int32_t *)(bas)) = (u_int32_t)val; +} + +static int +ub_getc(void) +{ + while ((uart_getreg((u_int32_t *)(A10_UART_BASE + + (UART_LSR << reg_shift))) & UART_LSR_DR) == 0); + __asm __volatile("nop"); + + return (uart_getreg((u_int32_t *)A10_UART_BASE) & 0xff); +} + +static void +ub_putc(unsigned char c) +{ + if (c == '\n') + ub_putc('\r'); + + while ((uart_getreg((u_int32_t *)(A10_UART_BASE + + (UART_LSR << reg_shift))) & UART_LSR_THRE) == 0) + __asm __volatile("nop"); + + uart_setreg((u_int32_t *)A10_UART_BASE, c); +} + +static cn_probe_t uart_cnprobe; +static cn_init_t uart_cninit; +static cn_term_t uart_cnterm; +static cn_getc_t uart_cngetc; +static cn_putc_t uart_cnputc; +static cn_grab_t uart_cngrab; +static cn_ungrab_t uart_cnungrab; + +static void +uart_cngrab(struct consdev *cp) +{ +} + +static void +uart_cnungrab(struct consdev *cp) +{ +} + + +static void +uart_cnprobe(struct consdev *cp) +{ + sprintf(cp->cn_name, "uart"); + cp->cn_pri = CN_NORMAL; +} + +static void +uart_cninit(struct consdev *cp) +{ + uart_setreg((u_int32_t *)(A10_UART_BASE + + (UART_FCR << reg_shift)), 0x06); +} + +void +uart_cnputc(struct consdev *cp, int c) +{ + ub_putc(c); +} + +int +uart_cngetc(struct consdev * cp) +{ + return ub_getc(); +} + +static void +uart_cnterm(struct consdev * cp) +{ +} + +CONSOLE_DRIVER(uart); + Added: head/sys/arm/allwinner/files.a10 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/files.a10 Tue Jan 15 08:26:16 2013 (r245450) @@ -0,0 +1,17 @@ +# $FreeBSD$ +kern/kern_clocksource.c standard + +arm/arm/bus_space_asm_generic.S standard +arm/arm/bus_space_generic.c standard +arm/arm/cpufunc_asm_armv5.S standard +arm/arm/cpufunc_asm_arm10.S standard +arm/arm/cpufunc_asm_arm11.S standard +arm/arm/cpufunc_asm_armv7.S standard +arm/arm/irq_dispatch.S standard + +arm/allwinner/timer.c standard +arm/allwinner/aintc.c standard +arm/allwinner/bus_space.c standard +arm/allwinner/common.c standard +arm/allwinner/console.c standard +arm/allwinner/a10_machdep.c standard Added: head/sys/arm/allwinner/std.a10 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/std.a10 Tue Jan 15 08:26:16 2013 (r245450) @@ -0,0 +1,21 @@ +# Allwinner A10 common options +#$FreeBSD$ + +cpu CPU_CORTEXA +machine arm armv6 +makeoption ARM_LITTLE_ENDIAN + +# Physical memory starts at 0x40200000. We assume images are loaded at +# 0x40200000, e.g. from u-boot with 'fatload mmc 0 0x40200000 kernel' +# +# +options PHYSADDR=0x40000000 + +makeoptions KERNPHYSADDR=0x40200000 +options KERNPHYSADDR=0x40200000 +makeoptions KERNVIRTADDR=0xc0200000 +options KERNVIRTADDR=0xc0200000 + +options STARTUP_PAGETABLE_ADDR=0x48000000 + +files "../allwinner/files.a10" Added: head/sys/arm/allwinner/timer.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/timer.c Tue Jan 15 08:26:16 2013 (r245450) @@ -0,0 +1,341 @@ +/*- + * Copyright (c) 2012 Ganbold Tsagaankhuu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include + +/** + * Timer registers addr + * + */ +#define SW_TIMER_IRQ_EN_REG 0x00 +#define SW_TIMER_IRQ_STA_REG 0x04 +#define SW_TIMER0_CTRL_REG 0x10 +#define SW_TIMER0_INT_VALUE_REG 0x14 +#define SW_TIMER0_CUR_VALUE_REG 0x18 + +#define SYS_TIMER_SCAL 16 /* timer clock source pre-divsion */ +#define SYS_TIMER_CLKSRC 24000000 /* timer clock source */ +#define TMR_INTER_VAL SYS_TIMER_CLKSRC/(SYS_TIMER_SCAL * 1000) + +#define CLOCK_TICK_RATE TMR_INTER_VAL +#define INITIAL_TIMECOUNTER (0xffffffff) + +struct a10_timer_softc { + device_t sc_dev; + struct resource *res[2]; + bus_space_tag_t sc_bst; + bus_space_handle_t sc_bsh; + void *sc_ih; /* interrupt handler */ + uint32_t sc_period; + uint32_t clkfreq; + struct eventtimer et; +}; + +int a10_timer_get_timerfreq(struct a10_timer_softc *); + +#define timer_read_4(sc, reg) \ + bus_space_read_4(sc->sc_bst, sc->sc_bsh, reg) +#define timer_write_4(sc, reg, val) \ + bus_space_write_4(sc->sc_bst, sc->sc_bsh, reg, val) + +static u_int a10_timer_get_timecount(struct timecounter *); +static int a10_timer_timer_start(struct eventtimer *, + struct bintime *, struct bintime *); +static int a10_timer_timer_stop(struct eventtimer *); + +static int a10_timer_initialized = 0; +static int a10_timer_intr(void *); +static int a10_timer_probe(device_t); +static int a10_timer_attach(device_t); + +static struct timecounter a10_timer_timecounter = { + .tc_name = "a10_timer timer0", + .tc_get_timecount = a10_timer_get_timecount, + .tc_counter_mask = ~0u, + .tc_frequency = 0, + .tc_quality = 1000, +}; + +struct a10_timer_softc *a10_timer_sc = NULL; + +static struct resource_spec a10_timer_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static int +a10_timer_probe(device_t dev) +{ + + if (!ofw_bus_is_compatible(dev, "a10,timers")) + return (ENXIO); + + device_set_desc(dev, "Allwinner A10 timer"); + return (BUS_PROBE_DEFAULT); +} + +static int +a10_timer_attach(device_t dev) +{ + struct a10_timer_softc *sc; + int err; + uint32_t val; + uint32_t freq; + + sc = device_get_softc(dev); + + if (bus_alloc_resources(dev, a10_timer_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + sc->sc_dev = dev; + sc->sc_bst = rman_get_bustag(sc->res[0]); + sc->sc_bsh = rman_get_bushandle(sc->res[0]); + + /* set interval */ + timer_write_4(sc, SW_TIMER0_INT_VALUE_REG, TMR_INTER_VAL); + + /* set clock source to HOSC, 16 pre-division */ + val = timer_read_4(sc, SW_TIMER0_CTRL_REG); + val &= ~(0x07<<4); + val &= ~(0x03<<2); + val |= (4<<4) | (1<<2); + timer_write_4(sc, SW_TIMER0_CTRL_REG, val); + + /* set mode to auto reload */ + val = timer_read_4(sc, SW_TIMER0_CTRL_REG); + val |= (1<<1); + timer_write_4(sc, SW_TIMER0_CTRL_REG, val); + + /* Enable timer0 */ + val = timer_read_4(sc, SW_TIMER_IRQ_EN_REG); + val |= (1<<0); + timer_write_4(sc, SW_TIMER_IRQ_EN_REG, val); + + /* Setup and enable the timer interrupt */ + err = bus_setup_intr(dev, sc->res[1], INTR_TYPE_CLK, a10_timer_intr, + NULL, sc, &sc->sc_ih); + if (err != 0) { + bus_release_resources(dev, a10_timer_spec, sc->res); + device_printf(dev, "Unable to setup the clock irq handler, " + "err = %d\n", err); + return (ENXIO); + } + freq = SYS_TIMER_CLKSRC; + + /* Set desired frequency in event timer and timecounter */ + sc->et.et_frequency = (uint64_t)freq; + sc->clkfreq = (uint64_t)freq; + sc->et.et_name = "a10_timer Eventtimer"; + sc->et.et_flags = ET_FLAGS_ONESHOT | ET_FLAGS_PERIODIC; + sc->et.et_quality = 1000; + sc->et.et_min_period.sec = 0; + sc->et.et_min_period.frac = + ((0x00000002LLU << 32) / sc->et.et_frequency) << 32; + sc->et.et_max_period.sec = 0xfffffff0U / sc->et.et_frequency; + sc->et.et_max_period.frac = + ((0xfffffffeLLU << 32) / sc->et.et_frequency) << 32; + sc->et.et_start = a10_timer_timer_start; + sc->et.et_stop = a10_timer_timer_stop; + sc->et.et_priv = sc; + et_register(&sc->et); + + if (device_get_unit(dev) == 0) + a10_timer_sc = sc; + + a10_timer_timecounter.tc_frequency = (uint64_t)freq; + tc_init(&a10_timer_timecounter); + + printf("clock: hz=%d stathz = %d\n", hz, stathz); + + device_printf(sc->sc_dev, "timer clock frequency %d\n", sc->clkfreq); + + a10_timer_initialized = 1; + + return (0); +} + +static int +a10_timer_timer_start(struct eventtimer *et, struct bintime *first, + struct bintime *period) +{ + struct a10_timer_softc *sc; + uint32_t clo, count; + + sc = (struct a10_timer_softc *)et->et_priv; + + if (first != NULL) { + count = (sc->et.et_frequency * (first->frac >> 32)) >> 32; + if (first->sec != 0) + count += sc->et.et_frequency * first->sec; + + /* clear */ + timer_write_4(sc, SW_TIMER0_CUR_VALUE_REG, 0); + clo = timer_read_4(sc, SW_TIMER0_CUR_VALUE_REG); + clo += count; + timer_write_4(sc, SW_TIMER0_CUR_VALUE_REG, clo); + + return (0); + } + + return (EINVAL); +} + +static int +a10_timer_timer_stop(struct eventtimer *et) +{ + struct a10_timer_softc *sc; + uint32_t val; + + sc = (struct a10_timer_softc *)et->et_priv; + + /* clear */ + timer_write_4(sc, SW_TIMER0_CUR_VALUE_REG, 0); + + /* disable */ + val = timer_read_4(sc, SW_TIMER0_CTRL_REG); + val &= ~(1<<0); /* Disable timer0 */ + timer_write_4(sc, SW_TIMER0_CTRL_REG, val); + + sc->sc_period = 0; + + return (0); +} + +int +a10_timer_get_timerfreq(struct a10_timer_softc *sc) +{ + + return (sc->clkfreq); +} + +void +cpu_initclocks(void) +{ + cpu_initclocks_bsp(); +} + +static int +a10_timer_intr(void *arg) +{ + struct a10_timer_softc *sc; + + sc = (struct a10_timer_softc *)arg; + + if (sc->et.et_active) + sc->et.et_event_cb(&sc->et, sc->et.et_arg); + + /* pending */ + timer_write_4(sc, SW_TIMER_IRQ_STA_REG, 0x1); + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 09:23:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BEDCCC08; Tue, 15 Jan 2013 09:23:18 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bk0-f41.google.com (mail-bk0-f41.google.com [209.85.214.41]) by mx1.freebsd.org (Postfix) with ESMTP id D575C7A5; Tue, 15 Jan 2013 09:23:17 +0000 (UTC) Received: by mail-bk0-f41.google.com with SMTP id jg9so2452560bkc.14 for ; Tue, 15 Jan 2013 01:23:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=8N2y76YqpoNIGJKCHtvpXFB4rfg8aLoI9mqiz3zmkhA=; b=F93cWBOXLLSZJ9Tmhh6Pq7gkrv6SPTScXlW+6WU9ZkrEs0suirjRMRzE1J63yV94JV bPNjJG2Xl6faS7TyFjszS9WHVl9NmVNbULIA7hoAZNtmWoAZQqe0EdgD3D/fnb9Cs7+I cACtr3wfRHI7z9tCIRcXsLBpJLsIJuqtDft7sTGhZm+4+6KRXXmy7DeHHSHNerKPmA2r vZDK0bBdQZJiuRA/ON6aWp6vW6b+a235M1gJRogG8x8C4PM5bKwtYHTdAoRVWqEZnajX +mOUJ0i8aQwJ0nuESXb2m9bW/NQexr+AVepQdvzYULe5nHghe6RuSGRmtKJ+55cR02hQ jMbQ== X-Received: by 10.204.129.214 with SMTP id p22mr39910255bks.47.1358241796627; Tue, 15 Jan 2013 01:23:16 -0800 (PST) Received: from mavbook.mavhome.dp.ua (mavhome.mavhome.dp.ua. [213.227.240.37]) by mx.google.com with ESMTPS id l17sm11990658bkw.12.2013.01.15.01.23.14 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Jan 2013 01:23:15 -0800 (PST) Sender: Alexander Motin Message-ID: <50F52000.30009@FreeBSD.org> Date: Tue, 15 Jan 2013 11:23:12 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Ganbold Tsagaankhuu Subject: Re: svn commit: r245450 - in head/sys: arm/allwinner arm/conf boot/fdt/dts References: <201301150826.r0F8QGJr044600@svn.freebsd.org> In-Reply-To: <201301150826.r0F8QGJr044600@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 09:23:18 -0000 On 15.01.2013 10:26, Ganbold Tsagaankhuu wrote: > Author: ganbold (doc committer) > Date: Tue Jan 15 08:26:16 2013 > New Revision: 245450 > URL: http://svnweb.freebsd.org/changeset/base/245450 > > Log: > Initial support for Allwinner A10 SoC (Cubieboard) > Add simple console driver > Add interrupt handling and timer codes > Add kernel config file > Add dts file > Approved by: gonzo > + /* Set desired frequency in event timer and timecounter */ > + sc->et.et_frequency = (uint64_t)freq; > + sc->clkfreq = (uint64_t)freq; > + sc->et.et_name = "a10_timer Eventtimer"; > + sc->et.et_flags = ET_FLAGS_ONESHOT | ET_FLAGS_PERIODIC; > + sc->et.et_quality = 1000; > + sc->et.et_min_period.sec = 0; > + sc->et.et_min_period.frac = > + ((0x00000002LLU << 32) / sc->et.et_frequency) << 32; > + sc->et.et_max_period.sec = 0xfffffff0U / sc->et.et_frequency; > + sc->et.et_max_period.frac = > + ((0xfffffffeLLU << 32) / sc->et.et_frequency) << 32; > + sc->et.et_start = a10_timer_timer_start; > + sc->et.et_stop = a10_timer_timer_stop; > + sc->et.et_priv = sc; > + et_register(&sc->et); > +static int > +a10_timer_timer_start(struct eventtimer *et, struct bintime *first, > + struct bintime *period) > +{ > + struct a10_timer_softc *sc; > + uint32_t clo, count; > + > + sc = (struct a10_timer_softc *)et->et_priv; > + > + if (first != NULL) { > + count = (sc->et.et_frequency * (first->frac >> 32)) >> 32; > + if (first->sec != 0) > + count += sc->et.et_frequency * first->sec; > + > + /* clear */ > + timer_write_4(sc, SW_TIMER0_CUR_VALUE_REG, 0); > + clo = timer_read_4(sc, SW_TIMER0_CUR_VALUE_REG); > + clo += count; > + timer_write_4(sc, SW_TIMER0_CUR_VALUE_REG, clo); > + > + return (0); > + } > + > + return (EINVAL); > +} It seems like you've announced periodic mode support above, but haven't implemented it here. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 09:31:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5D92EEAE; Tue, 15 Jan 2013 09:31:15 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 40C747FD; Tue, 15 Jan 2013 09:31:15 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0F9VFN9065165; Tue, 15 Jan 2013 09:31:15 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0F9VEBA065160; Tue, 15 Jan 2013 09:31:14 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201301150931.r0F9VEBA065160@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Tue, 15 Jan 2013 09:31:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245453 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 09:31:15 -0000 Author: ganbold (doc committer) Date: Tue Jan 15 09:31:13 2013 New Revision: 245453 URL: http://svnweb.freebsd.org/changeset/base/245453 Log: Fix license to follow standard license template Reviewed by: joel Modified: head/sys/arm/allwinner/a10_machdep.c head/sys/arm/allwinner/bus_space.c head/sys/arm/allwinner/common.c head/sys/arm/allwinner/console.c head/sys/arm/allwinner/timer.c Modified: head/sys/arm/allwinner/a10_machdep.c ============================================================================== --- head/sys/arm/allwinner/a10_machdep.c Tue Jan 15 09:17:07 2013 (r245452) +++ head/sys/arm/allwinner/a10_machdep.c Tue Jan 15 09:31:13 2013 (r245453) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Ganbold Tsagaankhuu. + * Copyright (c) 2012 Ganbold Tsagaankhuu * All rights reserved. * * This code is derived from software written for Brini by Mark Brinicombe Modified: head/sys/arm/allwinner/bus_space.c ============================================================================== --- head/sys/arm/allwinner/bus_space.c Tue Jan 15 09:17:07 2013 (r245452) +++ head/sys/arm/allwinner/bus_space.c Tue Jan 15 09:31:13 2013 (r245453) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012 Ganbold Tsagaankhuu + * Copyright (c) 2012 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,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. - * 3. Neither the name of MARVELL nor the names of contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY AUTHOR 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 AUTHOR 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) Modified: head/sys/arm/allwinner/common.c ============================================================================== --- head/sys/arm/allwinner/common.c Tue Jan 15 09:17:07 2013 (r245452) +++ head/sys/arm/allwinner/common.c Tue Jan 15 09:31:13 2013 (r245453) @@ -1,9 +1,7 @@ /*- - * Copyright (c) 2012 Ganbold Tsagaankhuu + * Copyright (c) 2012 Ganbold Tsagaankhuu * All rights reserved. * - * Developed by Ganbold Tsagaankhuu - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: Modified: head/sys/arm/allwinner/console.c ============================================================================== --- head/sys/arm/allwinner/console.c Tue Jan 15 09:17:07 2013 (r245452) +++ head/sys/arm/allwinner/console.c Tue Jan 15 09:31:13 2013 (r245453) @@ -5,11 +5,11 @@ * 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. + * 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 Modified: head/sys/arm/allwinner/timer.c ============================================================================== --- head/sys/arm/allwinner/timer.c Tue Jan 15 09:17:07 2013 (r245452) +++ head/sys/arm/allwinner/timer.c Tue Jan 15 09:31:13 2013 (r245453) @@ -5,11 +5,11 @@ * 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. + * 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 From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 09:39:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1FD1C303; Tue, 15 Jan 2013 09:39:13 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0374E872; Tue, 15 Jan 2013 09:39:13 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0F9dCs8066341; Tue, 15 Jan 2013 09:39:12 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0F9dCYn066336; Tue, 15 Jan 2013 09:39:12 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201301150939.r0F9dCYn066336@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Tue, 15 Jan 2013 09:39:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245454 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 09:39:13 -0000 Author: ganbold (doc committer) Date: Tue Jan 15 09:39:11 2013 New Revision: 245454 URL: http://svnweb.freebsd.org/changeset/base/245454 Log: Fix formatting of license according to share/examples/etc/bsd-style-copyright Reviewed by: joel Modified: head/sys/arm/allwinner/a10_machdep.c head/sys/arm/allwinner/bus_space.c head/sys/arm/allwinner/common.c head/sys/arm/allwinner/console.c head/sys/arm/allwinner/timer.c Modified: head/sys/arm/allwinner/a10_machdep.c ============================================================================== --- head/sys/arm/allwinner/a10_machdep.c Tue Jan 15 09:31:13 2013 (r245453) +++ head/sys/arm/allwinner/a10_machdep.c Tue Jan 15 09:39:11 2013 (r245454) @@ -16,7 +16,7 @@ * 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 + * 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) Modified: head/sys/arm/allwinner/bus_space.c ============================================================================== --- head/sys/arm/allwinner/bus_space.c Tue Jan 15 09:31:13 2013 (r245453) +++ head/sys/arm/allwinner/bus_space.c Tue Jan 15 09:39:11 2013 (r245454) @@ -14,7 +14,7 @@ * 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 + * 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) Modified: head/sys/arm/allwinner/common.c ============================================================================== --- head/sys/arm/allwinner/common.c Tue Jan 15 09:31:13 2013 (r245453) +++ head/sys/arm/allwinner/common.c Tue Jan 15 09:39:11 2013 (r245454) @@ -14,7 +14,7 @@ * 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 + * 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) Modified: head/sys/arm/allwinner/console.c ============================================================================== --- head/sys/arm/allwinner/console.c Tue Jan 15 09:31:13 2013 (r245453) +++ head/sys/arm/allwinner/console.c Tue Jan 15 09:39:11 2013 (r245454) @@ -14,7 +14,7 @@ * 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 + * 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) Modified: head/sys/arm/allwinner/timer.c ============================================================================== --- head/sys/arm/allwinner/timer.c Tue Jan 15 09:31:13 2013 (r245453) +++ head/sys/arm/allwinner/timer.c Tue Jan 15 09:39:11 2013 (r245454) @@ -14,7 +14,7 @@ * 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 + * 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) From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 09:56:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 37ED25C5; Tue, 15 Jan 2013 09:56:21 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1ECDB901; Tue, 15 Jan 2013 09:56:21 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0F9uL2I071786; Tue, 15 Jan 2013 09:56:21 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0F9uKTD071785; Tue, 15 Jan 2013 09:56:20 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201301150956.r0F9uKTD071785@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Tue, 15 Jan 2013 09:56:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245455 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 09:56:21 -0000 Author: ganbold (doc committer) Date: Tue Jan 15 09:56:20 2013 New Revision: 245455 URL: http://svnweb.freebsd.org/changeset/base/245455 Log: Add mistakenly removed third clause to license Reviewed by: joel Modified: head/sys/arm/allwinner/bus_space.c Modified: head/sys/arm/allwinner/bus_space.c ============================================================================== --- head/sys/arm/allwinner/bus_space.c Tue Jan 15 09:39:11 2013 (r245454) +++ head/sys/arm/allwinner/bus_space.c Tue Jan 15 09:56:20 2013 (r245455) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Ganbold Tsagaankhuu + * Copyright (C) 2012 FreeBSD Foundation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,11 +10,14 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. + * 3. Neither the name of MARVELL nor the names of contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * THIS SOFTWARE IS PROVIDED BY 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 + * ARE DISCLAIMED. IN NO EVENT SHALL 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) From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 10:06:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 410BEA43; Tue, 15 Jan 2013 10:06:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2E32A97D; Tue, 15 Jan 2013 10:06:36 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0FA6aQZ075111; Tue, 15 Jan 2013 10:06:36 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0FA6ZnV075107; Tue, 15 Jan 2013 10:06:35 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301151006.r0FA6ZnV075107@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jan 2013 10:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245456 - in head: sbin/geom/class/raid3 sys/geom/raid3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 10:06:36 -0000 Author: mav Date: Tue Jan 15 10:06:35 2013 New Revision: 245456 URL: http://svnweb.freebsd.org/changeset/base/245456 Log: Allow to insert new component to geom_raid3 without specifying number. PR: kern/160562 MFC after: 2 weeks Modified: head/sbin/geom/class/raid3/geom_raid3.c head/sbin/geom/class/raid3/graid3.8 head/sys/geom/raid3/g_raid3_ctl.c Modified: head/sbin/geom/class/raid3/geom_raid3.c ============================================================================== --- head/sbin/geom/class/raid3/geom_raid3.c Tue Jan 15 09:56:20 2013 (r245455) +++ head/sbin/geom/class/raid3/geom_raid3.c Tue Jan 15 10:06:35 2013 (r245456) @@ -76,7 +76,7 @@ struct g_command class_commands[] = { { "insert", G_FLAG_VERBOSE, NULL, { { 'h', "hardcode", NULL, G_TYPE_BOOL }, - { 'n', "number", NULL, G_TYPE_NUMBER }, + { 'n', "number", G_VAL_OPTIONAL, G_TYPE_NUMBER }, G_OPT_SENTINEL }, "[-hv] <-n number> name prov" Modified: head/sbin/geom/class/raid3/graid3.8 ============================================================================== --- head/sbin/geom/class/raid3/graid3.8 Tue Jan 15 09:56:20 2013 (r245455) +++ head/sbin/geom/class/raid3/graid3.8 Tue Jan 15 10:06:35 2013 (r245456) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 5, 2010 +.Dd January 15, 2012 .Dt GRAID3 8 .Os .Sh NAME @@ -53,7 +53,7 @@ .Nm .Cm insert .Op Fl hv -.Fl n Ar number +.Op Fl n Ar number .Ar name .Ar prov .Nm @@ -171,6 +171,8 @@ Add the given component to the existing removed previously with the .Cm remove command or if one component is missing and will not be connected again. +If no number is given, new component will be added instead of first missed +component. .Pp Additional options include: .Bl -tag -width ".Fl h" Modified: head/sys/geom/raid3/g_raid3_ctl.c ============================================================================== --- head/sys/geom/raid3/g_raid3_ctl.c Tue Jan 15 09:56:20 2013 (r245455) +++ head/sys/geom/raid3/g_raid3_ctl.c Tue Jan 15 10:06:35 2013 (r245456) @@ -404,7 +404,7 @@ g_raid3_ctl_insert(struct gctl_req *req, u_char *sector; off_t compsize; intmax_t *no; - int *hardcode, *nargs, error; + int *hardcode, *nargs, error, autono; nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); if (nargs == NULL) { @@ -425,11 +425,10 @@ g_raid3_ctl_insert(struct gctl_req *req, gctl_error(req, "No 'arg%u' argument.", 1); return; } - no = gctl_get_paraml(req, "number", sizeof(*no)); - if (no == NULL) { - gctl_error(req, "No '%s' argument.", "no"); - return; - } + if (gctl_get_param(req, "number", NULL) != NULL) + no = gctl_get_paraml(req, "number", sizeof(*no)); + else + no = NULL; if (strncmp(name, "/dev/", 5) == 0) name += 5; g_topology_lock(); @@ -465,16 +464,30 @@ g_raid3_ctl_insert(struct gctl_req *req, gctl_error(req, "No such device: %s.", name); goto end; } - if (*no >= sc->sc_ndisks) { - sx_xunlock(&sc->sc_lock); - gctl_error(req, "Invalid component number."); - goto end; - } - disk = &sc->sc_disks[*no]; - if (disk->d_state != G_RAID3_DISK_STATE_NODISK) { - sx_xunlock(&sc->sc_lock); - gctl_error(req, "Component %jd is already connected.", *no); - goto end; + if (no != NULL) { + if (*no < 0 || *no >= sc->sc_ndisks) { + sx_xunlock(&sc->sc_lock); + gctl_error(req, "Invalid component number."); + goto end; + } + disk = &sc->sc_disks[*no]; + if (disk->d_state != G_RAID3_DISK_STATE_NODISK) { + sx_xunlock(&sc->sc_lock); + gctl_error(req, "Component %jd is already connected.", + *no); + goto end; + } + } else { + disk = NULL; + for (autono = 0; autono < sc->sc_ndisks && disk == NULL; autono++) + if (sc->sc_disks[autono].d_state == + G_RAID3_DISK_STATE_NODISK) + disk = &sc->sc_disks[autono]; + if (disk == NULL) { + sx_xunlock(&sc->sc_lock); + gctl_error(req, "No disconnected components."); + goto end; + } } if (((sc->sc_sectorsize / (sc->sc_ndisks - 1)) % pp->sectorsize) != 0) { sx_xunlock(&sc->sc_lock); From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 10:42:57 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id ECE653E0; Tue, 15 Jan 2013 10:42:57 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id 3E3D0B41; Tue, 15 Jan 2013 10:42:56 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id r0FAgnPM089544; Tue, 15 Jan 2013 14:42:49 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id r0FAgmto089543; Tue, 15 Jan 2013 14:42:48 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 15 Jan 2013 14:42:48 +0400 From: Gleb Smirnoff To: Bruce Evans Subject: Re: svn commit: r245222 - head/sys/sys Message-ID: <20130115104248.GI79056@FreeBSD.org> References: <201301090909.r09999kV013794@svn.freebsd.org> <20130109091217.GL66284@FreeBSD.org> <20130110081336.L967@besplex.bde.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="LQksG6bCIzRHxTLp" Content-Disposition: inline In-Reply-To: <20130110081336.L967@besplex.bde.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Hans Petter Selasky X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 10:42:58 -0000 --LQksG6bCIzRHxTLp Content-Type: text/plain; charset=koi8-r Content-Disposition: inline On Thu, Jan 10, 2013 at 09:31:28AM +1100, Bruce Evans wrote: B> > On Wed, Jan 09, 2013 at 09:09:09AM +0000, Hans Petter Selasky wrote: B> > H> Log: B> > H> Fix compile warning when using GCC: B> > H> Comparison between signed and unsigned. B> B> o Add 3 style bugs: B> 2 sets of excessive parentheses B> 1 line longer than 80 columns Bruce, can you please look at attached patch, that fixes problems you describe? It - fixes mentioned style bugs in param.h - adds int casts to MHLEN and MLEN - removes extra casts from (void *) to (struct mbuf *) - removes extra declarations of inlined functions - uninlines and moves m_get2() and m_getjcl() to uipc_mbuf.c - size argument of m_get2() swicthed back to int -- Totus tuus, Glebius. --LQksG6bCIzRHxTLp Content-Type: text/x-diff; charset=koi8-r Content-Disposition: attachment; filename="mbuf.diff" Index: sys/param.h =================================================================== --- sys/param.h (revision 245450) +++ sys/param.h (working copy) @@ -156,8 +156,8 @@ * MCLBYTES must be no larger than PAGE_SIZE. */ #ifndef MSIZE -#define MSIZE 256 /* size of an mbuf */ -#endif /* MSIZE */ +#define MSIZE 256 /* size of an mbuf */ +#endif #ifndef MCLSHIFT #define MCLSHIFT 11 /* convert bytes to mbuf clusters */ Index: sys/mbuf.h =================================================================== --- sys/mbuf.h (revision 245450) +++ sys/mbuf.h (working copy) @@ -52,11 +52,14 @@ * stored. Additionally, it is possible to allocate a separate buffer * externally and attach it to the mbuf in a way similar to that of mbuf * clusters. + * + * MLEN is data length in a normal mbuf. + * MHLEN is data length in an mbuf with pktheader. + * MINCLSIZE is a smallest amount of data that should be put into cluster. */ -#define MLEN (MSIZE - sizeof(struct m_hdr)) /* normal data len */ -#define MHLEN (MLEN - sizeof(struct pkthdr)) /* data len w/pkthdr */ -#define MINCLSIZE (MHLEN + 1) /* smallest amount to put in cluster */ -#define M_MAXCOMPRESS (MHLEN / 2) /* max amount to copy for compression */ +#define MLEN ((int)(MSIZE - sizeof(struct m_hdr))) +#define MHLEN ((int)(MLEN - sizeof(struct pkthdr))) +#define MINCLSIZE (MHLEN + 1) #ifdef _KERNEL /*- @@ -393,23 +396,10 @@ extern uma_zone_t zone_jumbo16; extern uma_zone_t zone_ext_refcnt; -static __inline struct mbuf *m_getcl(int how, short type, int flags); -static __inline struct mbuf *m_get(int how, short type); -static __inline struct mbuf *m_get2(int how, short type, int flags, - u_int size); -static __inline struct mbuf *m_gethdr(int how, short type); -static __inline struct mbuf *m_getjcl(int how, short type, int flags, - int size); -static __inline struct mbuf *m_getclr(int how, short type); /* XXX */ -static __inline int m_init(struct mbuf *m, uma_zone_t zone, - int size, int how, short type, int flags); -static __inline struct mbuf *m_free(struct mbuf *m); -static __inline void m_clget(struct mbuf *m, int how); -static __inline void *m_cljget(struct mbuf *m, int how, int size); -static __inline void m_chtype(struct mbuf *m, short new_type); -void mb_free_ext(struct mbuf *); -static __inline struct mbuf *m_last(struct mbuf *m); -int m_pkthdr_init(struct mbuf *m, int how); +struct mbuf *m_get2(int how, short type, int flags, int size); +struct mbuf *m_getjcl(int how, short type, int flags, int size); +void mb_free_ext(struct mbuf *); +int m_pkthdr_init(struct mbuf *m, int how); static __inline int m_gettype(int size) @@ -502,7 +492,7 @@ args.flags = 0; args.type = type; - return ((struct mbuf *)(uma_zalloc_arg(zone_mbuf, &args, how))); + return (uma_zalloc_arg(zone_mbuf, &args, how)); } /* @@ -529,7 +519,7 @@ args.flags = M_PKTHDR; args.type = type; - return ((struct mbuf *)(uma_zalloc_arg(zone_mbuf, &args, how))); + return (uma_zalloc_arg(zone_mbuf, &args, how)); } static __inline struct mbuf * @@ -539,87 +529,9 @@ args.flags = flags; args.type = type; - return ((struct mbuf *)(uma_zalloc_arg(zone_pack, &args, how))); + return (uma_zalloc_arg(zone_pack, &args, how)); } -/* - * m_get2() allocates minimum mbuf that would fit "size" argument. - * - * XXX: This is rather large, should be real function maybe. - */ -static __inline struct mbuf * -m_get2(int how, short type, int flags, u_int size) -{ - struct mb_args args; - struct mbuf *m, *n; - uma_zone_t zone; - - args.flags = flags; - args.type = type; - - if (size <= MHLEN || (size <= MLEN && (flags & M_PKTHDR) == 0)) - return ((struct mbuf *)(uma_zalloc_arg(zone_mbuf, &args, how))); - if (size <= MCLBYTES) - return ((struct mbuf *)(uma_zalloc_arg(zone_pack, &args, how))); - - if (size > MJUM16BYTES) - return (NULL); - - m = uma_zalloc_arg(zone_mbuf, &args, how); - if (m == NULL) - return (NULL); - -#if MJUMPAGESIZE != MCLBYTES - if (size <= MJUMPAGESIZE) - zone = zone_jumbop; - else -#endif - if (size <= MJUM9BYTES) - zone = zone_jumbo9; - else - zone = zone_jumbo16; - - n = uma_zalloc_arg(zone, m, how); - if (n == NULL) { - uma_zfree(zone_mbuf, m); - return (NULL); - } - - return (m); -} - -/* - * m_getjcl() returns an mbuf with a cluster of the specified size attached. - * For size it takes MCLBYTES, MJUMPAGESIZE, MJUM9BYTES, MJUM16BYTES. - * - * XXX: This is rather large, should be real function maybe. - */ -static __inline struct mbuf * -m_getjcl(int how, short type, int flags, int size) -{ - struct mb_args args; - struct mbuf *m, *n; - uma_zone_t zone; - - if (size == MCLBYTES) - return m_getcl(how, type, flags); - - args.flags = flags; - args.type = type; - - m = uma_zalloc_arg(zone_mbuf, &args, how); - if (m == NULL) - return (NULL); - - zone = m_getzone(size); - n = uma_zalloc_arg(zone, m, how); - if (n == NULL) { - uma_zfree(zone_mbuf, m); - return (NULL); - } - return (m); -} - static __inline void m_free_fast(struct mbuf *m) { Index: kern/uipc_mbuf.c =================================================================== --- kern/uipc_mbuf.c (revision 245450) +++ kern/uipc_mbuf.c (working copy) @@ -85,6 +85,79 @@ #endif /* + * m_get2() allocates minimum mbuf that would fit "size" argument. + */ +struct mbuf * +m_get2(int how, short type, int flags, int size) +{ + struct mb_args args; + struct mbuf *m, *n; + uma_zone_t zone; + + args.flags = flags; + args.type = type; + + if (size <= MHLEN || (size <= MLEN && (flags & M_PKTHDR) == 0)) + return (uma_zalloc_arg(zone_mbuf, &args, how)); + if (size <= MCLBYTES) + return (uma_zalloc_arg(zone_pack, &args, how)); + if (size > MJUM16BYTES) + return (NULL); + + m = uma_zalloc_arg(zone_mbuf, &args, how); + if (m == NULL) + return (NULL); + +#if MJUMPAGESIZE != MCLBYTES + if (size <= MJUMPAGESIZE) + zone = zone_jumbop; + else +#endif + if (size <= MJUM9BYTES) + zone = zone_jumbo9; + else + zone = zone_jumbo16; + + n = uma_zalloc_arg(zone, m, how); + if (n == NULL) { + uma_zfree(zone_mbuf, m); + return (NULL); + } + + return (m); +} + +/* + * m_getjcl() returns an mbuf with a cluster of the specified size attached. + * For size it takes MCLBYTES, MJUMPAGESIZE, MJUM9BYTES, MJUM16BYTES. + */ +struct mbuf * +m_getjcl(int how, short type, int flags, int size) +{ + struct mb_args args; + struct mbuf *m, *n; + uma_zone_t zone; + + if (size == MCLBYTES) + return m_getcl(how, type, flags); + + args.flags = flags; + args.type = type; + + m = uma_zalloc_arg(zone_mbuf, &args, how); + if (m == NULL) + return (NULL); + + zone = m_getzone(size); + n = uma_zalloc_arg(zone, m, how); + if (n == NULL) { + uma_zfree(zone_mbuf, m); + return (NULL); + } + return (m); +} + +/* * Allocate a given length worth of mbufs and/or clusters (whatever fits * best) and return a pointer to the top of the allocated chain. If an * existing mbuf chain is provided, then we will append the new chain --LQksG6bCIzRHxTLp-- From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 12:13:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D7AF9FC1; Tue, 15 Jan 2013 12:13:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 45891220; Tue, 15 Jan 2013 12:13:46 +0000 (UTC) Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r0FCDaBe025423 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 15 Jan 2013 23:13:38 +1100 Date: Tue, 15 Jan 2013 23:13:36 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Gleb Smirnoff Subject: Re: svn commit: r245222 - head/sys/sys In-Reply-To: <20130115104248.GI79056@FreeBSD.org> Message-ID: <20130115220100.G977@besplex.bde.org> References: <201301090909.r09999kV013794@svn.freebsd.org> <20130109091217.GL66284@FreeBSD.org> <20130110081336.L967@besplex.bde.org> <20130115104248.GI79056@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.0 cv=Zty1sKHG c=1 sm=1 a=5ctC8jQGzeMA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=FSHVhTTuonsA:10 a=XPZFlgyBuagG_ouHMVoA:9 a=CjuIK1q_8ugA:10 a=BXU8iOwLmnkijF0M:21 a=gnC4dsayiF7WZ4Gn:21 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hans Petter Selasky X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 12:13:48 -0000 On Tue, 15 Jan 2013, Gleb Smirnoff wrote: > On Thu, Jan 10, 2013 at 09:31:28AM +1100, Bruce Evans wrote: > B> > On Wed, Jan 09, 2013 at 09:09:09AM +0000, Hans Petter Selasky wrote: > B> > H> Log: > B> > H> Fix compile warning when using GCC: > B> > H> Comparison between signed and unsigned. > B> > B> o Add 3 style bugs: > B> 2 sets of excessive parentheses > B> 1 line longer than 80 columns > > Bruce, > > can you please look at attached patch, that fixes problems you > describe? It > > - fixes mentioned style bugs in param.h > - adds int casts to MHLEN and MLEN > - removes extra casts from (void *) to (struct mbuf *) > - removes extra declarations of inlined functions > - uninlines and moves m_get2() and m_getjcl() to uipc_mbuf.c > - size argument of m_get2() swicthed back to int Looks mostly good. % ... % Index: sys/mbuf.h % =================================================================== % --- sys/mbuf.h (revision 245450) % +++ sys/mbuf.h (working copy) % @@ -52,11 +52,14 @@ % * stored. Additionally, it is possible to allocate a separate buffer % * externally and attach it to the mbuf in a way similar to that of mbuf % * clusters. % + * % + * MLEN is data length in a normal mbuf. % + * MHLEN is data length in an mbuf with pktheader. % + * MINCLSIZE is a smallest amount of data that should be put into cluster. % */ The comment needs indent protection if you want to preserve the line structure of the new comments. I don't see any better way to format these lines as bullet points. A separate paragraph for each would be too verbose. % -#define MLEN (MSIZE - sizeof(struct m_hdr)) /* normal data len */ % -#define MHLEN (MLEN - sizeof(struct pkthdr)) /* data len w/pkthdr */ % -#define MINCLSIZE (MHLEN + 1) /* smallest amount to put in cluster */ % -#define M_MAXCOMPRESS (MHLEN / 2) /* max amount to copy for compression */ % +#define MLEN ((int)(MSIZE - sizeof(struct m_hdr))) % +#define MHLEN ((int)(MLEN - sizeof(struct pkthdr))) % +#define MINCLSIZE (MHLEN + 1) These never needed to be sorted non-alphabetically. I hope this doesn't cause any problems. MHLEN, etc., are used just a few times outside of mbuf.h where we can't control this, mostly in specialized code. One interesting use in non-specialized code is in tcp_output(): if (len <= MHLEN - hdrlen - max_linkhdr) { Here len has type long, MHLEN has type size_t (before this change) and type int (after this change), hdrlen has type unsigned (misspelled as that instead of u_int), and max_linkhdr has type int. So the type combinations are nonsense, and there is a good chance of getting different compiler warnings about this before and after the change. Having just one unsigned type in the mix tends to promote everything to unsigned, except on 64-bit systems with one u_int but no size_t, the long has highest rank so everything gets promoted to long. % ... % @@ -393,23 +396,10 @@ % extern uma_zone_t zone_jumbo16; % extern uma_zone_t zone_ext_refcnt; % % -static __inline struct mbuf *m_getcl(int how, short type, int flags); % ... % -static __inline void *m_cljget(struct mbuf *m, int how, int size); % -static __inline void m_chtype(struct mbuf *m, short new_type); % -void mb_free_ext(struct mbuf *); % -static __inline struct mbuf *m_last(struct mbuf *m); % -int m_pkthdr_init(struct mbuf *m, int how); % +struct mbuf *m_get2(int how, short type, int flags, int size); % +struct mbuf *m_getjcl(int how, short type, int flags, int size); % +void mb_free_ext(struct mbuf *); This one is still missing a parameter name, unlike all (?) the others. % +int m_pkthdr_init(struct mbuf *m, int how); The 2 new non-inline prototypes should be moved to the general section for non-inline prototypes. The 2 old ones must remain early since they are used in the inlines. After moving the 2 new ones, also remove their parameter names to match the (worse) nearby style. This leaves only 1 nearby other for mb_free_ext() to be mismatched with. The general prototype section has a fairly uniform style, with the only obvious bugs being: - m_copyup() has parameter names - m_sanity() is misindented by 1 space - m_unshare() has 1 parameter name but 2 parameters. There is another section for non-inline prototypes for packet tag routines. This has the same style as the general section, except it is unsorted at the end. It is placed _before_ the packet tag inlines instead of after them. This has the technical advantage that you don't have to split up the non-inline prototypes. There is another section for non-inline prototypes and other things for MBUF_PROFILING. This has about 3 style bugs per line. Bruce From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 13:56:20 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9EC073DB; Tue, 15 Jan 2013 13:56:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id C8E2C99C; Tue, 15 Jan 2013 13:56:18 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id r0FDuHxA090730; Tue, 15 Jan 2013 17:56:17 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id r0FDuH0c090729; Tue, 15 Jan 2013 17:56:17 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 15 Jan 2013 17:56:17 +0400 From: Gleb Smirnoff To: Bruce Evans Subject: Re: svn commit: r245222 - head/sys/sys Message-ID: <20130115135617.GJ79056@FreeBSD.org> References: <201301090909.r09999kV013794@svn.freebsd.org> <20130109091217.GL66284@FreeBSD.org> <20130110081336.L967@besplex.bde.org> <20130115104248.GI79056@FreeBSD.org> <20130115220100.G977@besplex.bde.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="BwCQnh7xodEAoBMC" Content-Disposition: inline In-Reply-To: <20130115220100.G977@besplex.bde.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Hans Petter Selasky X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 13:56:20 -0000 --BwCQnh7xodEAoBMC Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Bruce, On Tue, Jan 15, 2013 at 11:13:36PM +1100, Bruce Evans wrote: B> > can you please look at attached patch, that fixes problems you B> > describe? It B> > B> > - fixes mentioned style bugs in param.h B> > - adds int casts to MHLEN and MLEN B> > - removes extra casts from (void *) to (struct mbuf *) B> > - removes extra declarations of inlined functions B> > - uninlines and moves m_get2() and m_getjcl() to uipc_mbuf.c B> > - size argument of m_get2() swicthed back to int B> B> Looks mostly good. B> B> % ... B> % Index: sys/mbuf.h B> % =================================================================== B> % --- sys/mbuf.h (revision 245450) B> % +++ sys/mbuf.h (working copy) B> % @@ -52,11 +52,14 @@ B> % * stored. Additionally, it is possible to allocate a separate buffer B> % * externally and attach it to the mbuf in a way similar to that of mbuf B> % * clusters. B> % + * B> % + * MLEN is data length in a normal mbuf. B> % + * MHLEN is data length in an mbuf with pktheader. B> % + * MINCLSIZE is a smallest amount of data that should be put into cluster. B> % */ B> B> The comment needs indent protection if you want to preserve the line B> structure of the new comments. I don't see any better way to format these B> lines as bullet points. A separate paragraph for each would be too verbose. B> B> % -#define MLEN (MSIZE - sizeof(struct m_hdr)) /* normal data len */ B> % -#define MHLEN (MLEN - sizeof(struct pkthdr)) /* data len w/pkthdr */ B> % -#define MINCLSIZE (MHLEN + 1) /* smallest amount to put in cluster */ B> % -#define M_MAXCOMPRESS (MHLEN / 2) /* max amount to copy for compression */ B> % +#define MLEN ((int)(MSIZE - sizeof(struct m_hdr))) B> % +#define MHLEN ((int)(MLEN - sizeof(struct pkthdr))) B> % +#define MINCLSIZE (MHLEN + 1) B> B> These never needed to be sorted non-alphabetically. Sorting alphabetically moves MLEN to the bottom, but the above macros are defined via MLEN. IMO, it is more easy to read when we move from most simple macro to ones that are derived from it, not in alphabetical order. B> I hope this doesn't cause any problems. MHLEN, etc., are used just a few B> times outside of mbuf.h where we can't control this, mostly in specialized B> code. One interesting use in non-specialized code is in tcp_output(): B> B> if (len <= MHLEN - hdrlen - max_linkhdr) { B> B> Here len has type long, MHLEN has type size_t (before this change) and type B> int (after this change), hdrlen has type unsigned (misspelled as that instead B> of u_int), and max_linkhdr has type int. So the type combinations are B> nonsense, and there is a good chance of getting different compiler warnings B> about this before and after the change. Having just one unsigned type in B> the mix tends to promote everything to unsigned, except on 64-bit systems B> with one u_int but no size_t, the long has highest rank so everything B> gets promoted to long. I think here we can do: - unsigned ipoptlen, optlen, hdrlen; + int ipoptlen, optlen, hdrlen; These three take their values from: - ip6_optlen() - m_len (from mbuf header) - tcp_addoptions() ... , which all are ints. - sizeof(), which can be casted. I left the ipsec_optlen unsigned. Its type originates from ipsec_hdrsiz_internal(), which returns result of sizeof(). Patch attached. This leads to (len <= MHLEN - hdrlen - max_linkhdr) comparing long and (int - int - int). This also fixes many other places in tcp_output, where values od ipoptlen, optlen, hdrlen are assigned to int variables or supplied as int arguments. B> % ... B> % @@ -393,23 +396,10 @@ B> % extern uma_zone_t zone_jumbo16; B> % extern uma_zone_t zone_ext_refcnt; B> % B> % -static __inline struct mbuf *m_getcl(int how, short type, int flags); B> % ... B> % -static __inline void *m_cljget(struct mbuf *m, int how, int size); B> % -static __inline void m_chtype(struct mbuf *m, short new_type); B> % -void mb_free_ext(struct mbuf *); B> % -static __inline struct mbuf *m_last(struct mbuf *m); B> % -int m_pkthdr_init(struct mbuf *m, int how); B> % +struct mbuf *m_get2(int how, short type, int flags, int size); B> % +struct mbuf *m_getjcl(int how, short type, int flags, int size); B> % +void mb_free_ext(struct mbuf *); B> B> This one is still missing a parameter name, unlike all (?) the others. B> B> % +int m_pkthdr_init(struct mbuf *m, int how); B> B> The 2 new non-inline prototypes should be moved to the general section B> for non-inline prototypes. The 2 old ones must remain early since B> they are used in the inlines. B> B> After moving the 2 new ones, also remove their parameter names to match B> the (worse) nearby style. This leaves only 1 nearby other for mb_free_ext() B> to be mismatched with. B> B> The general prototype section has a fairly uniform style, with the only B> obvious bugs being: B> - m_copyup() has parameter names B> - m_sanity() is misindented by 1 space B> - m_unshare() has 1 parameter name but 2 parameters. Applied, patch attached. -- Totus tuus, Glebius. --BwCQnh7xodEAoBMC Content-Type: text/x-diff; charset=koi8-r Content-Disposition: attachment; filename="tcp_output.diff" Index: netinet/tcp_output.c =================================================================== --- netinet/tcp_output.c (revision 245450) +++ netinet/tcp_output.c (working copy) @@ -173,7 +173,7 @@ struct ipovly *ipov = NULL; struct tcphdr *th; u_char opt[TCP_MAXOLEN]; - unsigned ipoptlen, optlen, hdrlen; + int ipoptlen, optlen, hdrlen; #ifdef IPSEC unsigned ipsec_optlen = 0; #endif @@ -684,10 +684,10 @@ optlen = 0; #ifdef INET6 if (isipv6) - hdrlen = sizeof (struct ip6_hdr) + sizeof (struct tcphdr); + hdrlen = (int)(sizeof(struct ip6_hdr) + sizeof(struct tcphdr)); else #endif - hdrlen = sizeof (struct tcpiphdr); + hdrlen = (int)sizeof(struct tcpiphdr); /* * Compute options for segment. --BwCQnh7xodEAoBMC Content-Type: text/x-diff; charset=koi8-r Content-Disposition: attachment; filename="mbuf.diff" Index: netinet/tcp_output.c =================================================================== --- netinet/tcp_output.c (revision 245450) +++ netinet/tcp_output.c (working copy) @@ -173,7 +173,7 @@ struct ipovly *ipov = NULL; struct tcphdr *th; u_char opt[TCP_MAXOLEN]; - unsigned ipoptlen, optlen, hdrlen; + int ipoptlen, optlen, hdrlen; #ifdef IPSEC unsigned ipsec_optlen = 0; #endif @@ -684,10 +684,10 @@ optlen = 0; #ifdef INET6 if (isipv6) - hdrlen = sizeof (struct ip6_hdr) + sizeof (struct tcphdr); + hdrlen = (int)(sizeof(struct ip6_hdr) + sizeof(struct tcphdr)); else #endif - hdrlen = sizeof (struct tcpiphdr); + hdrlen = (int)sizeof(struct tcpiphdr); /* * Compute options for segment. Index: sys/param.h =================================================================== --- sys/param.h (revision 245450) +++ sys/param.h (working copy) @@ -156,8 +156,8 @@ * MCLBYTES must be no larger than PAGE_SIZE. */ #ifndef MSIZE -#define MSIZE 256 /* size of an mbuf */ -#endif /* MSIZE */ +#define MSIZE 256 /* size of an mbuf */ +#endif #ifndef MCLSHIFT #define MCLSHIFT 11 /* convert bytes to mbuf clusters */ Index: sys/mbuf.h =================================================================== --- sys/mbuf.h (revision 245450) +++ sys/mbuf.h (working copy) @@ -52,11 +52,14 @@ * stored. Additionally, it is possible to allocate a separate buffer * externally and attach it to the mbuf in a way similar to that of mbuf * clusters. + * + * MLEN is data length in a normal mbuf. + * MHLEN is data length in an mbuf with pktheader. + * MINCLSIZE is a smallest amount of data that should be put into cluster. */ -#define MLEN (MSIZE - sizeof(struct m_hdr)) /* normal data len */ -#define MHLEN (MLEN - sizeof(struct pkthdr)) /* data len w/pkthdr */ -#define MINCLSIZE (MHLEN + 1) /* smallest amount to put in cluster */ -#define M_MAXCOMPRESS (MHLEN / 2) /* max amount to copy for compression */ +#define MLEN ((int)(MSIZE - sizeof(struct m_hdr))) +#define MHLEN ((int)(MLEN - sizeof(struct pkthdr))) +#define MINCLSIZE (MHLEN + 1) #ifdef _KERNEL /*- @@ -393,23 +396,8 @@ extern uma_zone_t zone_jumbo16; extern uma_zone_t zone_ext_refcnt; -static __inline struct mbuf *m_getcl(int how, short type, int flags); -static __inline struct mbuf *m_get(int how, short type); -static __inline struct mbuf *m_get2(int how, short type, int flags, - u_int size); -static __inline struct mbuf *m_gethdr(int how, short type); -static __inline struct mbuf *m_getjcl(int how, short type, int flags, - int size); -static __inline struct mbuf *m_getclr(int how, short type); /* XXX */ -static __inline int m_init(struct mbuf *m, uma_zone_t zone, - int size, int how, short type, int flags); -static __inline struct mbuf *m_free(struct mbuf *m); -static __inline void m_clget(struct mbuf *m, int how); -static __inline void *m_cljget(struct mbuf *m, int how, int size); -static __inline void m_chtype(struct mbuf *m, short new_type); -void mb_free_ext(struct mbuf *); -static __inline struct mbuf *m_last(struct mbuf *m); -int m_pkthdr_init(struct mbuf *m, int how); +void mb_free_ext(struct mbuf *); +int m_pkthdr_init(struct mbuf *, int); static __inline int m_gettype(int size) @@ -502,7 +490,7 @@ args.flags = 0; args.type = type; - return ((struct mbuf *)(uma_zalloc_arg(zone_mbuf, &args, how))); + return (uma_zalloc_arg(zone_mbuf, &args, how)); } /* @@ -529,7 +517,7 @@ args.flags = M_PKTHDR; args.type = type; - return ((struct mbuf *)(uma_zalloc_arg(zone_mbuf, &args, how))); + return (uma_zalloc_arg(zone_mbuf, &args, how)); } static __inline struct mbuf * @@ -539,87 +527,9 @@ args.flags = flags; args.type = type; - return ((struct mbuf *)(uma_zalloc_arg(zone_pack, &args, how))); + return (uma_zalloc_arg(zone_pack, &args, how)); } -/* - * m_get2() allocates minimum mbuf that would fit "size" argument. - * - * XXX: This is rather large, should be real function maybe. - */ -static __inline struct mbuf * -m_get2(int how, short type, int flags, u_int size) -{ - struct mb_args args; - struct mbuf *m, *n; - uma_zone_t zone; - - args.flags = flags; - args.type = type; - - if (size <= MHLEN || (size <= MLEN && (flags & M_PKTHDR) == 0)) - return ((struct mbuf *)(uma_zalloc_arg(zone_mbuf, &args, how))); - if (size <= MCLBYTES) - return ((struct mbuf *)(uma_zalloc_arg(zone_pack, &args, how))); - - if (size > MJUM16BYTES) - return (NULL); - - m = uma_zalloc_arg(zone_mbuf, &args, how); - if (m == NULL) - return (NULL); - -#if MJUMPAGESIZE != MCLBYTES - if (size <= MJUMPAGESIZE) - zone = zone_jumbop; - else -#endif - if (size <= MJUM9BYTES) - zone = zone_jumbo9; - else - zone = zone_jumbo16; - - n = uma_zalloc_arg(zone, m, how); - if (n == NULL) { - uma_zfree(zone_mbuf, m); - return (NULL); - } - - return (m); -} - -/* - * m_getjcl() returns an mbuf with a cluster of the specified size attached. - * For size it takes MCLBYTES, MJUMPAGESIZE, MJUM9BYTES, MJUM16BYTES. - * - * XXX: This is rather large, should be real function maybe. - */ -static __inline struct mbuf * -m_getjcl(int how, short type, int flags, int size) -{ - struct mb_args args; - struct mbuf *m, *n; - uma_zone_t zone; - - if (size == MCLBYTES) - return m_getcl(how, type, flags); - - args.flags = flags; - args.type = type; - - m = uma_zalloc_arg(zone_mbuf, &args, how); - if (m == NULL) - return (NULL); - - zone = m_getzone(size); - n = uma_zalloc_arg(zone, m, how); - if (n == NULL) { - uma_zfree(zone_mbuf, m); - return (NULL); - } - return (m); -} - static __inline void m_free_fast(struct mbuf *m) { @@ -881,7 +791,7 @@ int, int, int, int); struct mbuf *m_copypacket(struct mbuf *, int); void m_copy_pkthdr(struct mbuf *, struct mbuf *); -struct mbuf *m_copyup(struct mbuf *n, int len, int dstoff); +struct mbuf *m_copyup(struct mbuf *, int, int); struct mbuf *m_defrag(struct mbuf *, int); void m_demote(struct mbuf *, int); struct mbuf *m_devget(char *, int, int, struct ifnet *, @@ -891,6 +801,8 @@ u_int m_fixhdr(struct mbuf *); struct mbuf *m_fragment(struct mbuf *, int, int); void m_freem(struct mbuf *); +struct mbuf *m_get2(int, short, int, int); +struct mbuf *m_getjcl(int, short, int, int); struct mbuf *m_getm2(struct mbuf *, int, int, short, int); struct mbuf *m_getptr(struct mbuf *, int, int *); u_int m_length(struct mbuf *, struct mbuf **); @@ -900,10 +812,10 @@ void m_print(const struct mbuf *, int); struct mbuf *m_pulldown(struct mbuf *, int, int, int *); struct mbuf *m_pullup(struct mbuf *, int); -int m_sanity(struct mbuf *, int); +int m_sanity(struct mbuf *, int); struct mbuf *m_split(struct mbuf *, int, int); struct mbuf *m_uiotombuf(struct uio *, int, int, int, int); -struct mbuf *m_unshare(struct mbuf *, int how); +struct mbuf *m_unshare(struct mbuf *, int); /*- * Network packets may have annotations attached by affixing a list of Index: kern/uipc_mbuf.c =================================================================== --- kern/uipc_mbuf.c (revision 245450) +++ kern/uipc_mbuf.c (working copy) @@ -85,6 +85,79 @@ #endif /* + * m_get2() allocates minimum mbuf that would fit "size" argument. + */ +struct mbuf * +m_get2(int how, short type, int flags, int size) +{ + struct mb_args args; + struct mbuf *m, *n; + uma_zone_t zone; + + args.flags = flags; + args.type = type; + + if (size <= MHLEN || (size <= MLEN && (flags & M_PKTHDR) == 0)) + return (uma_zalloc_arg(zone_mbuf, &args, how)); + if (size <= MCLBYTES) + return (uma_zalloc_arg(zone_pack, &args, how)); + if (size > MJUM16BYTES) + return (NULL); + + m = uma_zalloc_arg(zone_mbuf, &args, how); + if (m == NULL) + return (NULL); + +#if MJUMPAGESIZE != MCLBYTES + if (size <= MJUMPAGESIZE) + zone = zone_jumbop; + else +#endif + if (size <= MJUM9BYTES) + zone = zone_jumbo9; + else + zone = zone_jumbo16; + + n = uma_zalloc_arg(zone, m, how); + if (n == NULL) { + uma_zfree(zone_mbuf, m); + return (NULL); + } + + return (m); +} + +/* + * m_getjcl() returns an mbuf with a cluster of the specified size attached. + * For size it takes MCLBYTES, MJUMPAGESIZE, MJUM9BYTES, MJUM16BYTES. + */ +struct mbuf * +m_getjcl(int how, short type, int flags, int size) +{ + struct mb_args args; + struct mbuf *m, *n; + uma_zone_t zone; + + if (size == MCLBYTES) + return m_getcl(how, type, flags); + + args.flags = flags; + args.type = type; + + m = uma_zalloc_arg(zone_mbuf, &args, how); + if (m == NULL) + return (NULL); + + zone = m_getzone(size); + n = uma_zalloc_arg(zone, m, how); + if (n == NULL) { + uma_zfree(zone_mbuf, m); + return (NULL); + } + return (m); +} + +/* * Allocate a given length worth of mbufs and/or clusters (whatever fits * best) and return a pointer to the top of the allocated chain. If an * existing mbuf chain is provided, then we will append the new chain --BwCQnh7xodEAoBMC-- From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 14:06:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AF2D9811; Tue, 15 Jan 2013 14:06:00 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 898FAA0C; Tue, 15 Jan 2013 14:06:00 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0FE60eH049747; Tue, 15 Jan 2013 14:06:00 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0FE60cS049746; Tue, 15 Jan 2013 14:06:00 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201301151406.r0FE60cS049746@svn.freebsd.org> From: Andrey Zonov Date: Tue, 15 Jan 2013 14:06:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245457 - 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.14 Precedence: list List-Id: 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, 15 Jan 2013 14:06:00 -0000 Author: zont Date: Tue Jan 15 14:05:59 2013 New Revision: 245457 URL: http://svnweb.freebsd.org/changeset/base/245457 Log: - Detect when we are in KVM. Silence on: emulation Approved by: kib (mentor) MFC after: 1 week Modified: head/sys/kern/subr_param.c Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Tue Jan 15 10:06:35 2013 (r245456) +++ head/sys/kern/subr_param.c Tue Jan 15 14:05:59 2013 (r245457) @@ -161,6 +161,7 @@ static const char *const vm_bnames[] = { "Bochs", /* Bochs */ "Xen", /* Xen */ "BHYVE", /* bhyve */ + "Seabios", /* KVM */ NULL }; @@ -169,6 +170,7 @@ static const char *const vm_pnames[] = { "Virtual Machine", /* Microsoft VirtualPC */ "VirtualBox", /* Sun xVM VirtualBox */ "Parallels Virtual Platform", /* Parallels VM */ + "KVM", /* KVM */ NULL }; From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 14:09:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DA2BEAA0; Tue, 15 Jan 2013 14:09:08 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C3567A3B; Tue, 15 Jan 2013 14:09:08 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0FE983j050316; Tue, 15 Jan 2013 14:09:08 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0FE98HB050315; Tue, 15 Jan 2013 14:09:08 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201301151409.r0FE98HB050315@svn.freebsd.org> From: Andrey Zonov Date: Tue, 15 Jan 2013 14:09:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245458 - 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.14 Precedence: list List-Id: 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, 15 Jan 2013 14:09:08 -0000 Author: zont Date: Tue Jan 15 14:09:08 2013 New Revision: 245458 URL: http://svnweb.freebsd.org/changeset/base/245458 Log: - Use standard RETURN VALUES section. Approved by: kib (mentor) MFC after: 1 week Modified: head/lib/libc/sys/chroot.2 Modified: head/lib/libc/sys/chroot.2 ============================================================================== --- head/lib/libc/sys/chroot.2 Tue Jan 15 14:05:59 2013 (r245457) +++ head/lib/libc/sys/chroot.2 Tue Jan 15 14:09:08 2013 (r245458) @@ -92,12 +92,8 @@ system call. Any other value for .Ql kern.chroot_allow_open_directories will bypass the check for open directories -.Pp -Upon successful completion, a value of 0 is returned. -Otherwise, -a value of -1 is returned and -.Va errno -is set to indicate an error. +.Sh RETURN VALUES +.Rv -std .Sh ERRORS The .Fn chroot From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 14:35:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B525273; Tue, 15 Jan 2013 14:35:36 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 98C79CDA; Tue, 15 Jan 2013 14:35:36 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0FEZati058782; Tue, 15 Jan 2013 14:35:36 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0FEZa0F058779; Tue, 15 Jan 2013 14:35:36 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201301151435.r0FEZa0F058779@svn.freebsd.org> From: Sean Bruno Date: Tue, 15 Jan 2013 14:35:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245459 - head/sys/dev/ciss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 14:35:36 -0000 Author: sbruno Date: Tue Jan 15 14:35:35 2013 New Revision: 245459 URL: http://svnweb.freebsd.org/changeset/base/245459 Log: Satisfy the intent of kern/151564: [ciss] ciss(4) should increase CISS_MAX_LOGICAL to 107 Submitter wanted to increase the number of logical disks supported by ciss(4) by simply raising the CISS_MAX_LOGICAL value even higher. Instead, consult the documentation for the raid controller (OPENCISS) and poke the controller bits to ask it for how many logical/physical disks it can handle. Revert svn R242089 that raised CISS_MAX_LOGICAL to 64 for all controllers. For older controllers that don't support this mechanism, fallback to the old value of 16 logical disks. Tested on P420, P410, P400 and 6i model ciss(4) controllers. This should will be MFC'd back to stable/9 stable/8 and stable/7 after the MFC period. PR: kern/151564 Reviewed by: scottl@freebsd.org MFC after: 2 weeks Modified: head/sys/dev/ciss/ciss.c head/sys/dev/ciss/cissreg.h head/sys/dev/ciss/cissvar.h Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Tue Jan 15 14:09:08 2013 (r245458) +++ head/sys/dev/ciss/ciss.c Tue Jan 15 14:35:35 2013 (r245459) @@ -1203,13 +1203,21 @@ ciss_identify_adapter(struct ciss_softc /* XXX only really required for old 5300 adapters? */ sc->ciss_flags |= CISS_FLAG_BMIC_ABORT; + /* + * Earlier controller specs do not contain these config + * entries, so assume that a 0 means its old and assign + * these values to the defaults that were established + * when this driver was developed for them + */ + if (sc->ciss_cfg->max_logical_supported == 0) + sc->ciss_cfg->max_logical_supported = CISS_MAX_LOGICAL; + if (sc->ciss_cfg->max_physical_supported == 0) + sc->ciss_cfg->max_physical_supported = CISS_MAX_PHYSICAL; /* print information */ if (bootverbose) { -#if 0 /* XXX proxy volumes??? */ ciss_printf(sc, " %d logical drive%s configured\n", sc->ciss_id->configured_logical_drives, (sc->ciss_id->configured_logical_drives == 1) ? "" : "s"); -#endif ciss_printf(sc, " firmware %4.4s\n", sc->ciss_id->running_firmware_revision); ciss_printf(sc, " %d SCSI channels\n", sc->ciss_id->scsi_bus_count); @@ -1232,6 +1240,9 @@ ciss_identify_adapter(struct ciss_softc "\20\1ultra2\2ultra3\10fibre1\11fibre2\n"); ciss_printf(sc, " server name '%.16s'\n", sc->ciss_cfg->server_name); ciss_printf(sc, " heartbeat 0x%x\n", sc->ciss_cfg->heartbeat); + ciss_printf(sc, " max logical logical volumes: %d\n", sc->ciss_cfg->max_logical_supported); + ciss_printf(sc, " max physical disks supported: %d\n", sc->ciss_cfg->max_physical_supported); + ciss_printf(sc, " max physical disks per logical volume: %d\n", sc->ciss_cfg->max_physical_per_logical); } out: @@ -1319,7 +1330,7 @@ ciss_report_luns(struct ciss_softc *sc, break; case CISS_CMD_STATUS_DATA_OVERRUN: ciss_printf(sc, "WARNING: more units than driver limit (%d)\n", - CISS_MAX_LOGICAL); + sc->ciss_cfg->max_logical_supported); break; default: ciss_printf(sc, "error detecting logical drive configuration (%s)\n", @@ -1353,7 +1364,7 @@ ciss_init_logical(struct ciss_softc *sc) debug_called(1); cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_LOGICAL_LUNS, - CISS_MAX_LOGICAL); + sc->ciss_cfg->max_logical_supported); if (cll == NULL) { error = ENXIO; goto out; @@ -1361,9 +1372,9 @@ ciss_init_logical(struct ciss_softc *sc) /* sanity-check reply */ ndrives = (ntohl(cll->list_size) / sizeof(union ciss_device_address)); - if ((ndrives < 0) || (ndrives > CISS_MAX_LOGICAL)) { + if ((ndrives < 0) || (ndrives > sc->ciss_cfg->max_logical_supported)) { ciss_printf(sc, "adapter claims to report absurd number of logical drives (%d > %d)\n", - ndrives, CISS_MAX_LOGICAL); + ndrives, sc->ciss_cfg->max_logical_supported); error = ENXIO; goto out; } @@ -1386,19 +1397,20 @@ ciss_init_logical(struct ciss_softc *sc) for (i = 0; i <= sc->ciss_max_logical_bus; i++) { sc->ciss_logical[i] = - malloc(CISS_MAX_LOGICAL * sizeof(struct ciss_ldrive), + malloc(sc->ciss_cfg->max_logical_supported * + sizeof(struct ciss_ldrive), CISS_MALLOC_CLASS, M_NOWAIT | M_ZERO); if (sc->ciss_logical[i] == NULL) { error = ENXIO; goto out; } - for (j = 0; j < CISS_MAX_LOGICAL; j++) + for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) sc->ciss_logical[i][j].cl_status = CISS_LD_NONEXISTENT; } - for (i = 0; i < CISS_MAX_LOGICAL; i++) { + for (i = 0; i < sc->ciss_cfg->max_logical_supported; i++) { if (i < ndrives) { struct ciss_ldrive *ld; int bus, target; @@ -1440,7 +1452,7 @@ ciss_init_physical(struct ciss_softc *sc target = 0; cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_PHYSICAL_LUNS, - CISS_MAX_PHYSICAL); + sc->ciss_cfg->max_physical_supported); if (cll == NULL) { error = ENXIO; goto out; @@ -1983,7 +1995,7 @@ ciss_free(struct ciss_softc *sc) bus_dma_tag_destroy(sc->ciss_parent_dmat); if (sc->ciss_logical) { for (i = 0; i <= sc->ciss_max_logical_bus; i++) { - for (j = 0; j < CISS_MAX_LOGICAL; j++) { + for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) { if (sc->ciss_logical[i][j].cl_ldrive) free(sc->ciss_logical[i][j].cl_ldrive, CISS_MALLOC_CLASS); if (sc->ciss_logical[i][j].cl_lstatus) @@ -2966,9 +2978,9 @@ ciss_cam_action(struct cam_sim *sim, uni cpi->hba_inquiry = PI_TAG_ABLE; /* XXX is this correct? */ cpi->target_sprt = 0; cpi->hba_misc = 0; - cpi->max_target = CISS_MAX_LOGICAL; + cpi->max_target = sc->ciss_cfg->max_logical_supported; cpi->max_lun = 0; /* 'logical drive' channel only */ - cpi->initiator_id = CISS_MAX_LOGICAL; + cpi->initiator_id = sc->ciss_cfg->max_logical_supported; strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strncpy(cpi->hba_vid, "msmith@freebsd.org", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); @@ -3879,7 +3891,7 @@ ciss_notify_rescan_logical(struct ciss_s * drive address. */ cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_LOGICAL_LUNS, - CISS_MAX_LOGICAL); + sc->ciss_cfg->max_logical_supported); if (cll == NULL) return; @@ -3890,7 +3902,7 @@ ciss_notify_rescan_logical(struct ciss_s * firmware. */ for (i = 0; i < sc->ciss_max_logical_bus; i++) { - for (j = 0; j < CISS_MAX_LOGICAL; j++) { + for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) { ld = &sc->ciss_logical[i][j]; if (ld->cl_update == 0) @@ -4059,7 +4071,7 @@ ciss_notify_hotplug(struct ciss_softc *s * Rescan the physical lun list for new items */ cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_PHYSICAL_LUNS, - CISS_MAX_PHYSICAL); + sc->ciss_cfg->max_physical_supported); if (cll == NULL) { ciss_printf(sc, "Warning, cannot get physical lun list\n"); break; @@ -4307,7 +4319,7 @@ ciss_print_adapter(struct ciss_softc *sc "\20\1notify_ok\2control_open\3aborting\4running\21fake_synch\22bmic_abort\n"); for (i = 0; i < sc->ciss_max_logical_bus; i++) { - for (j = 0; j < CISS_MAX_LOGICAL; j++) { + for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) { ciss_printf(sc, "LOGICAL DRIVE %d: ", i); ciss_print_ldrive(sc, &sc->ciss_logical[i][j]); } Modified: head/sys/dev/ciss/cissreg.h ============================================================================== --- head/sys/dev/ciss/cissreg.h Tue Jan 15 14:09:08 2013 (r245458) +++ head/sys/dev/ciss/cissreg.h Tue Jan 15 14:35:35 2013 (r245459) @@ -425,6 +425,15 @@ struct ciss_config_table #define CISS_DRIVER_DAUGHTER_ATTACHED (1<<8) #define CISS_DRIVER_SCSI_PREFETCH (1<<9) u_int32_t max_sg_length; /* 31 in older firmware */ +/* + * these fields appear in OpenCISS Spec 1.06 + * http://cciss.sourceforge.net/#docs + */ + u_int32_t max_logical_supported; + u_int32_t max_physical_supported; + u_int32_t max_physical_per_logical; + u_int32_t max_perfomant_mode_cmds; + u_int32_t max_block_fetch_count; } __packed; /* Modified: head/sys/dev/ciss/cissvar.h ============================================================================== --- head/sys/dev/ciss/cissvar.h Tue Jan 15 14:09:08 2013 (r245458) +++ head/sys/dev/ciss/cissvar.h Tue Jan 15 14:35:35 2013 (r245459) @@ -45,8 +45,11 @@ typedef STAILQ_HEAD(, ciss_request) cr_q /* * Maximum number of logical drives we support. + * If the controller does not indicate a maximum + * value. This is a compatibiliy value to support + * older ciss controllers (e.g. model 6i) */ -#define CISS_MAX_LOGICAL 63 +#define CISS_MAX_LOGICAL 16 /* * Maximum number of physical devices we support. From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 16:33:38 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3648AD82; Tue, 15 Jan 2013 16:33:38 +0000 (UTC) (envelope-from wkoszek@freebsd.czest.pl) Received: from freebsd.czest.pl (freebsd.czest.pl [212.87.224.105]) by mx1.freebsd.org (Postfix) with ESMTP id B726C639; Tue, 15 Jan 2013 16:33:37 +0000 (UTC) Received-SPF: pass (freebsd.czest.pl: domain of wkoszek@freebsd.czest.pl designates 212.87.224.105 as permitted sender) receiver=freebsd.czest.pl; client-ip=212.87.224.105; helo=freebsd.czest.pl; envelope-from=wkoszek@freebsd.czest.pl; x-software=spfmilter 0.97 http://www.acme.com/software/spfmilter/ with libspf-unknown; Received: from freebsd.czest.pl (freebsd.czest.pl [212.87.224.105]) by freebsd.czest.pl (8.14.5/8.14.5) with ESMTP id r0FGLGba050848; Tue, 15 Jan 2013 16:21:16 GMT (envelope-from wkoszek@freebsd.czest.pl) Received: (from wkoszek@localhost) by freebsd.czest.pl (8.14.5/8.14.5/Submit) id r0FGLG3W050847; Tue, 15 Jan 2013 16:21:16 GMT (envelope-from wkoszek) Date: Tue, 15 Jan 2013 16:21:16 +0000 From: "Wojciech A. Koszek" To: Ganbold Tsagaankhuu Subject: Re: svn commit: r245450 - in head/sys: arm/allwinner arm/conf boot/fdt/dts Message-ID: <20130115162116.GI20538@FreeBSD.org> References: <201301150826.r0F8QGJr044600@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline In-Reply-To: <201301150826.r0F8QGJr044600@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on freebsd.czest.pl X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (freebsd.czest.pl [212.87.224.105]); Tue, 15 Jan 2013 16:21:18 +0000 (UTC) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 16:33:38 -0000 On Tue, Jan 15, 2013 at 08:26:16AM +0000, Ganbold Tsagaankhuu wrote: > Author: ganbold (doc committer) > Date: Tue Jan 15 08:26:16 2013 > New Revision: 245450 > URL: http://svnweb.freebsd.org/changeset/base/245450 > > Log: > Initial support for Allwinner A10 SoC (Cubieboard) > Add simple console driver > Add interrupt handling and timer codes > Add kernel config file > Add dts file > Approved by: gonzo Ganbold, Thanks for this commit. Comments below. > > Added: head/sys/arm/allwinner/a10_machdep.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/arm/allwinner/a10_machdep.c Tue Jan 15 08:26:16 2013 (r245450) > @@ -0,0 +1,122 @@ > +/*- > + * Copyright (c) 2012 Ganbold Tsagaankhuu. Dot '.' after name isn't necessary. I'd really appreciate having PDF filename of the documentation from which the code was derived in the comments, e.g.: "This file is derived from X.PDF, ver1.0, date 2012/Y/Z" > + * > + * from: FreeBSD: //depot/projects/arm/src/sys/arm/ti/ti_machdep.c > + */ > + [..] > +int > +platform_devmap_init(void) > +{ > + int i = 0; > + > + fdt_devmap[i].pd_va = 0xE1C00000; > + fdt_devmap[i].pd_pa = 0x01C00000; > + fdt_devmap[i].pd_size = 0x00400000; /* 4 MB */ Do you think you could comment on what these mean (or pages in the PDF where can I find them) next to these variables? > > Added: head/sys/arm/allwinner/console.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/arm/allwinner/console.c Tue Jan 15 08:26:16 2013 (r245450) > @@ -0,0 +1,146 @@ [..] > +#ifndef A10_UART_BASE > +#define A10_UART_BASE 0xe1c28000 /* UART0 */ > +#endif > + > +int reg_shift = 2; Could you make it static and move it below defines? > +#define UART_DLL 0 /* Out: Divisor Latch Low */ > +#define UART_DLM 1 /* Out: Divisor Latch High */ > +#define UART_FCR 2 /* Out: FIFO Control Register */ > +#define UART_LCR 3 /* Out: Line Control Register */ > +#define UART_MCR 4 /* Out: Modem Control Register */ > +#define UART_LSR 5 /* In: Line Status Register */ > +#define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */ > +#define UART_LSR_DR 0x01 /* Receiver data ready */ > +#define UART_MSR 6 /* In: Modem Status Register */ > +#define UART_SCR 7 /* I/O: Scratch Register */ > + > + > +/* > + * uart related funcs > + */ > +static u_int32_t > +uart_getreg(u_int32_t *bas) > +{ > + return *((volatile u_int32_t *)(bas)) & 0xff; > +} > + > +static void > +uart_setreg(u_int32_t *bas, u_int32_t val) > +{ > + *((volatile u_int32_t *)(bas)) = (u_int32_t)val; > +} > + > +static int > +ub_getc(void) > +{ > + while ((uart_getreg((u_int32_t *)(A10_UART_BASE + > + (UART_LSR << reg_shift))) & UART_LSR_DR) == 0); > + __asm __volatile("nop"); > + > + return (uart_getreg((u_int32_t *)A10_UART_BASE) & 0xff); > +} > + > +static void > +ub_putc(unsigned char c) > +{ > + if (c == '\n') > + ub_putc('\r'); > + > + while ((uart_getreg((u_int32_t *)(A10_UART_BASE + > + (UART_LSR << reg_shift))) & UART_LSR_THRE) == 0) > + __asm __volatile("nop"); > + > + uart_setreg((u_int32_t *)A10_UART_BASE, c); > +} Why aren't bus_* methods used here for accessing memory? > +# > +# > +options PHYSADDR=0x40000000 > + > +makeoptions KERNPHYSADDR=0x40200000 Two tabs? > +options KERNPHYSADDR=0x40200000 > +makeoptions KERNVIRTADDR=0xc0200000 > +options KERNVIRTADDR=0xc0200000 > + > +options STARTUP_PAGETABLE_ADDR=0x48000000 > + > +files "../allwinner/files.a10" > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** -- Wojciech A. Koszek wkoszek@FreeBSD.czest.pl http://FreeBSD.czest.pl/~wkoszek/ From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 17:08:45 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2509A1D5; Tue, 15 Jan 2013 17:08:45 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id D3B0085A; Tue, 15 Jan 2013 17:08:44 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id C2CD4885C; Tue, 15 Jan 2013 18:08:36 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on smtp.des.no X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.2 Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id BFD7F885B; Tue, 15 Jan 2013 18:08:36 +0100 (CET) Received: by ds4.des.no (Postfix, from userid 1001) id 8DB319BE8; Tue, 15 Jan 2013 18:08:36 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Steve Kargl Subject: Re: svn commit: r245269 - head/share/mk References: <201301102244.r0AMiJ1k059594@svn.freebsd.org> <20130114224326.GA72312@troutmask.apl.washington.edu> Date: Tue, 15 Jan 2013 18:08:36 +0100 In-Reply-To: <20130114224326.GA72312@troutmask.apl.washington.edu> (Steve Kargl's message of "Mon, 14 Jan 2013 14:43:27 -0800") Message-ID: <86mwwaml0r.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 17:08:45 -0000 Steve Kargl writes: > I suggest adding a blurb to src/UPDATING to help others with memory > loss issues. Thanks, can you commit that patch? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 17:17:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8CE0945D; Tue, 15 Jan 2013 17:17:55 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7F6688C1; Tue, 15 Jan 2013 17:17:55 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0FHHtoP009656; Tue, 15 Jan 2013 17:17:55 GMT (envelope-from rene@svn.freebsd.org) Received: (from rene@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0FHHtgj009655; Tue, 15 Jan 2013 17:17:55 GMT (envelope-from rene@svn.freebsd.org) Message-Id: <201301151717.r0FHHtgj009655@svn.freebsd.org> From: Rene Ladan Date: Tue, 15 Jan 2013 17:17:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245463 - 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.14 Precedence: list List-Id: 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, 15 Jan 2013 17:17:55 -0000 Author: rene (doc,ports committer) Date: Tue Jan 15 17:17:54 2013 New Revision: 245463 URL: http://svnweb.freebsd.org/changeset/base/245463 Log: Add gjb as my co-mentor now that I have a full doc/www bit. Approved by: remko (mentor) Modified: head/share/misc/committers-doc.dot Modified: head/share/misc/committers-doc.dot ============================================================================== --- head/share/misc/committers-doc.dot Tue Jan 15 16:46:51 2013 (r245462) +++ head/share/misc/committers-doc.dot Tue Jan 15 17:17:54 2013 (r245463) @@ -116,6 +116,7 @@ gabor -> issyl0 gabor -> ebrandi gjb -> wblock +gjb -> rene hrs -> ryusuke From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 17:50:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7AE7ACFE; Tue, 15 Jan 2013 17:50:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5D95DB27; Tue, 15 Jan 2013 17:50:08 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0FHo89A019667; Tue, 15 Jan 2013 17:50:08 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0FHo88B019659; Tue, 15 Jan 2013 17:50:08 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301151750.r0FHo88B019659@svn.freebsd.org> From: Adrian Chadd Date: Tue, 15 Jan 2013 17:50:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245464 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 17:50:08 -0000 Author: adrian Date: Tue Jan 15 17:50:07 2013 New Revision: 245464 URL: http://svnweb.freebsd.org/changeset/base/245464 Log: Remove the use of the ifnet send queue and if_start() in the power save queue code. Instead, use if_transmit() directly - and handle the cases where frame transmission fails. I don't necessarily like this and I think at this point the M_ENCAP check, node freeing upon fail and the actual if_transmit() call should be done in methods in ieee80211_freebsd.c, but I digress slightly.. This removes one of the last few uses of if_start() and the ifnet if_snd queue. The last major offender is ieee80211_output.c, where ieee80211_start() implements if_start() and uses the ifnet queue directly. (There's a couple of gotchas here, where the if_start pointer is compared to ieee80211_start(), but that's a later problem.) Modified: head/sys/net80211/ieee80211_power.c Modified: head/sys/net80211/ieee80211_power.c ============================================================================== --- head/sys/net80211/ieee80211_power.c Tue Jan 15 17:17:54 2013 (r245463) +++ head/sys/net80211/ieee80211_power.c Tue Jan 15 17:50:07 2013 (r245464) @@ -416,6 +416,8 @@ pwrsave_flushq(struct ieee80211_node *ni struct ieee80211vap *vap = ni->ni_vap; struct ieee80211_psq_head *qhead; struct ifnet *parent, *ifp; + struct mbuf *parent_q = NULL, *ifp_q = NULL; + struct mbuf *m; IEEE80211_NOTE(vap, IEEE80211_MSG_POWER, ni, "flush ps queue, %u packets queued", psq->psq_len); @@ -427,8 +429,7 @@ pwrsave_flushq(struct ieee80211_node *ni parent = vap->iv_ic->ic_ifp; /* XXX need different driver interface */ /* XXX bypasses q max and OACTIVE */ - IF_PREPEND_LIST(&parent->if_snd, qhead->head, qhead->tail, - qhead->len); + parent_q = qhead->head; qhead->head = qhead->tail = NULL; qhead->len = 0; } else @@ -439,8 +440,7 @@ pwrsave_flushq(struct ieee80211_node *ni ifp = vap->iv_ifp; /* XXX need different driver interface */ /* XXX bypasses q max and OACTIVE */ - IF_PREPEND_LIST(&ifp->if_snd, qhead->head, qhead->tail, - qhead->len); + ifp_q = qhead->head; qhead->head = qhead->tail = NULL; qhead->len = 0; } else @@ -450,10 +450,34 @@ pwrsave_flushq(struct ieee80211_node *ni /* NB: do this outside the psq lock */ /* XXX packets might get reordered if parent is OACTIVE */ - if (parent != NULL) - if_start(parent); - if (ifp != NULL) - if_start(ifp); + /* parent frames, should be encapsulated */ + if (parent != NULL) { + while (parent_q != NULL) { + m = parent_q; + parent_q = m->m_nextpkt; + /* must be encapsulated */ + KASSERT((m->m_flags & M_ENCAP), + ("%s: parentq with non-M_ENCAP frame!\n", + __func__)); + /* + * For encaped frames, we need to free the node + * reference upon failure. + */ + if (parent->if_transmit(parent, m) != 0) + ieee80211_free_node(ni); + } + } + + /* VAP frames, aren't encapsulated */ + if (ifp != NULL) { + while (ifp_q != NULL) { + m = ifp_q; + ifp_q = m->m_nextpkt; + KASSERT((!(m->m_flags & M_ENCAP)), + ("%s: vapq with M_ENCAP frame!\n", __func__)); + (void) ifp->if_transmit(ifp, m); + } + } } /* From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 17:59:44 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6C049FDA; Tue, 15 Jan 2013 17:59:44 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) by mx1.freebsd.org (Postfix) with ESMTP id 40D31BF6; Tue, 15 Jan 2013 17:59:44 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.5/8.14.5) with ESMTP id r0FHxfjB077061; Tue, 15 Jan 2013 09:59:41 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.5/8.14.5/Submit) id r0FHxfg0077060; Tue, 15 Jan 2013 09:59:41 -0800 (PST) (envelope-from sgk) Date: Tue, 15 Jan 2013 09:59:41 -0800 From: Steve Kargl To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Subject: Re: svn commit: r245269 - head/share/mk Message-ID: <20130115175941.GA77018@troutmask.apl.washington.edu> References: <201301102244.r0AMiJ1k059594@svn.freebsd.org> <20130114224326.GA72312@troutmask.apl.washington.edu> <86mwwaml0r.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <86mwwaml0r.fsf@ds4.des.no> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 17:59:44 -0000 On Tue, Jan 15, 2013 at 06:08:36PM +0100, Dag-Erling Smørgrav wrote: > Steve Kargl writes: > > I suggest adding a blurb to src/UPDATING to help others with memory > > loss issues. > > Thanks, can you commit that patch? > Yes. But, I found that your commit only indirectly caused the problem. The system that showed the problem with NO_KERBEROS in /etc/make.conf never had kerberos installed, so your change actually caused my buildworld to try to build kerberos. It appears that usr.bin/compile_et is needed to bootstrap kerberos. compile_et is not installed as a bootstrap-tool, so it must be picking up a previously installed compile_et. At the moment, I'm stumped as how to compile_et. -- Steve From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 18:01:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 520611E6; Tue, 15 Jan 2013 18:01:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 351BEC06; Tue, 15 Jan 2013 18:01:25 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0FI1OlF023475; Tue, 15 Jan 2013 18:01:24 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0FI1NYQ023469; Tue, 15 Jan 2013 18:01:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301151801.r0FI1NYQ023469@svn.freebsd.org> From: Adrian Chadd Date: Tue, 15 Jan 2013 18:01:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245465 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 18:01:25 -0000 Author: adrian Date: Tue Jan 15 18:01:23 2013 New Revision: 245465 URL: http://svnweb.freebsd.org/changeset/base/245465 Log: Implement frame (data) transmission using if_transmit(), rather than if_start(). This removes the overlapping data path TX from occuring, which solves quite a number of the potential TX queue races in ath(4). It doesn't fix the net80211 layer TX queue races and it doesn't fix the raw TX path yet, but it's an important step towards this. This hasn't dropped the TX performance in my testing; primarily because now the TX path can quickly queue frames and continue along processing. This involves a few rather deep changes: * Use the ath_buf as a queue placeholder for now, as we need to be able to support queuing a list of mbufs (ie, when transmitting fragments) and m_nextpkt can't be used here (because it's what is joining the fragments together) * if_transmit() now simply allocates the ath_buf and queues it to a driver TX staging queue. * TX is now moved into a taskqueue function. * The TX taskqueue function now dequeues and transmits frames. * Fragments are handled correctly here - as the current API passes the fragment list as one mbuf list (joined with m_nextpkt) through to the driver if_transmit(). * For the couple of places where ath_start() may be called (mostly from net80211 when starting the VAP up again), just reimplement it using the new enqueue and taskqueue methods. What I don't like (about this work and the TX code in general): * I'm using the same lock for the staging TX queue management and the actual TX. This isn't required; I'm just being slack. * I haven't yet moved TX to a separate taskqueue (but the taskqueue is created); it's easy enough to do this later if necessary. I just need to make sure it's a higher priority queue, so TX has the same behaviour as it used to (where it would preempt existing RX..) * I need to re-review the TX path a little more and make sure that ieee80211_node_*() functions aren't called within the TX lock. When queueing, I should just push failed frames into a queue and when I'm wrapping up the TX code, unlock the TX lock and call ieee80211_node_free() on each. * It would be nice if I could hold the TX lock for the entire TX and TX completion, rather than this release/re-acquire behaviour. But that requires that I shuffle around the TX completion code to handle actual ath_buf free and net80211 callback/free outside of the TX lock. That's one of my next projects. * the ic_raw_xmit() path doesn't use this yet - so it still has sequencing problems with parallel, overlapping calls to the data path. I'll fix this later. Tested: * Hostap - AR9280, AR9220 * STA - AR5212, AR9280, AR5416 Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Jan 15 17:50:07 2013 (r245464) +++ head/sys/dev/ath/if_ath.c Tue Jan 15 18:01:23 2013 (r245465) @@ -152,7 +152,6 @@ static void ath_init(void *); static void ath_stop_locked(struct ifnet *); static void ath_stop(struct ifnet *); static int ath_reset_vap(struct ieee80211vap *, u_long); -static void ath_start_queue(struct ifnet *ifp); static int ath_media_change(struct ifnet *); static void ath_watchdog(void *); static int ath_ioctl(struct ifnet *, u_long, caddr_t); @@ -213,6 +212,14 @@ static void ath_dfs_tasklet(void *, int) static void ath_node_powersave(struct ieee80211_node *, int); static int ath_node_set_tim(struct ieee80211_node *, int); +static int ath_transmit(struct ifnet *ifp, struct mbuf *m); +static void ath_qflush(struct ifnet *ifp); + +static void ath_txq_qinit(struct ifnet *ifp); +static void ath_txq_qflush(struct ifnet *ifp); +static int ath_txq_qadd(struct ifnet *ifp, struct mbuf *m0); +static void ath_txq_qrun(struct ifnet *ifp); + #ifdef IEEE80211_SUPPORT_TDMA #include #endif @@ -429,12 +436,20 @@ ath_attach(u_int16_t devid, struct ath_s taskqueue_start_threads(&sc->sc_tq, 1, PI_NET, "%s taskq", ifp->if_xname); + sc->sc_tx_tq = taskqueue_create("ath_tx_taskq", M_NOWAIT, + taskqueue_thread_enqueue, &sc->sc_tx_tq); + taskqueue_start_threads(&sc->sc_tx_tq, 1, PI_NET, + "%s TX taskq", ifp->if_xname); + TASK_INIT(&sc->sc_rxtask, 0, sc->sc_rx.recv_tasklet, sc); TASK_INIT(&sc->sc_bmisstask, 0, ath_bmiss_proc, sc); TASK_INIT(&sc->sc_bstucktask,0, ath_bstuck_proc, sc); TASK_INIT(&sc->sc_resettask,0, ath_reset_proc, sc); - TASK_INIT(&sc->sc_txqtask,0, ath_txq_sched_tasklet, sc); - TASK_INIT(&sc->sc_fataltask,0, ath_fatal_proc, sc); + TASK_INIT(&sc->sc_txqtask, 0, ath_txq_sched_tasklet, sc); + TASK_INIT(&sc->sc_fataltask, 0, ath_fatal_proc, sc); + + /* XXX make this a higher priority taskqueue? */ + TASK_INIT(&sc->sc_txpkttask, 0, ath_start_task, sc); /* * Allocate hardware transmit queues: one queue for @@ -554,13 +569,18 @@ ath_attach(u_int16_t devid, struct ath_s ifp->if_softc = sc; ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; - ifp->if_start = ath_start_queue; + /* XXX net80211 uses if_start to re-start ifnet processing */ + ifp->if_start = ath_start; + ifp->if_transmit = ath_transmit; + ifp->if_qflush = ath_qflush; ifp->if_ioctl = ath_ioctl; ifp->if_init = ath_init; IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); + ath_txq_qinit(ifp); + ic->ic_ifp = ifp; /* XXX not right but it's not used anywhere important */ ic->ic_phytype = IEEE80211_T_OFDM; @@ -966,16 +986,16 @@ ath_detach(struct ath_softc *sc) ath_stop(ifp); ieee80211_ifdetach(ifp->if_l2com); taskqueue_free(sc->sc_tq); + taskqueue_free(sc->sc_tx_tq); #ifdef ATH_TX99_DIAG if (sc->sc_tx99 != NULL) sc->sc_tx99->detach(sc->sc_tx99); #endif ath_rate_detach(sc->sc_rc); - #ifdef ATH_DEBUG_ALQ if_ath_alq_tidyup(&sc->sc_alq); #endif - + ath_txq_qflush(ifp); ath_spectral_detach(sc); ath_dfs_detach(sc); ath_desc_free(sc); @@ -2454,6 +2474,14 @@ ath_buf_clone(struct ath_softc *sc, cons tbf->bf_flags = bf->bf_flags & ~ATH_BUF_BUSY; tbf->bf_status = bf->bf_status; tbf->bf_m = bf->bf_m; + /* + * XXX Copy the node reference, the caller is responsible + * for deleting the node reference before it frees its + * buffer. + * + * XXX It's done like this so we don't call the net80211 + * code whilst having active TX queue locks held. + */ tbf->bf_node = bf->bf_node; /* will be setup by the chain/setup function */ tbf->bf_lastds = NULL; @@ -2498,13 +2526,70 @@ ath_getbuf(struct ath_softc *sc, ath_buf } static void -ath_start_queue(struct ifnet *ifp) +ath_qflush(struct ifnet *ifp) { - struct ath_softc *sc = ifp->if_softc; - ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start_queue: start"); + /* XXX complete/suspend TX */ + ath_txq_qflush(ifp); + + /* Unsuspend TX? */ +} + +/* + * Transmit a frame from net80211. + */ +static int +ath_transmit(struct ifnet *ifp, struct mbuf *m) +{ + struct ieee80211_node *ni; + struct ath_softc *sc = (struct ath_softc *) ifp->if_softc; + + ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; + + if (ath_txq_qadd(ifp, m) < 0) { + /* + * If queuing fails, the if_transmit() API makes the + * callee responsible for freeing the mbuf (rather than + * the caller, who just assumes the mbuf has been dealt + * with somehow). + * + * BUT, net80211 will free node references if if_transmit() + * fails _on encapsulated buffers_. Since drivers + * only get fully encapsulated frames from net80211 (via + * raw or otherwise APIs), we must be absolutely careful + * to not free the node ref or things will get loopy + * down the track. + * + * For tx fragments, the TX code must free whatever + * new references it created, but NOT the original + * TX node ref that was passed in. + */ + ath_freetx(m); + return (ENOBUFS); + } + + /* + * Unconditionally kick the taskqueue. + * + * Now, there's a subtle race condition possible here if we + * went down the path of only kicking the taskqueue if it + * wasn't running. If we're not absolutely, positively + * careful, we could have a small race window between + * finishing the taskqueue and clearing the TX flag, which + * would be interpreted in _this_ context as "we don't need + * to kick the TX taskqueue, as said taskqueue is already + * running." + * + * It's a problem in some of the 1GE/10GE NIC drivers. + * So until a _correct_ method for implementing this is + * drafted up and written, which avoids (potentially) + * large amounts of locking contention per-frame, let's + * just do the inefficient "kick taskqueue each time" + * method. + */ ath_tx_kick(sc); - ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start_queue: finished"); + + return (0); } void @@ -2531,9 +2616,7 @@ ath_start_task(void *arg, int npending) sc->sc_txstart_cnt++; ATH_PCU_UNLOCK(sc); - ATH_TX_LOCK(sc); - ath_start(sc->sc_ifp); - ATH_TX_UNLOCK(sc); + ath_txq_qrun(ifp); ATH_PCU_LOCK(sc); sc->sc_txstart_cnt--; @@ -2541,91 +2624,298 @@ ath_start_task(void *arg, int npending) ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start_task: finished"); } -void -ath_start(struct ifnet *ifp) +/* + * Pending TX buffer chain management routines. + */ + + +/* + * Initialise the TX queue! + */ +static void +ath_txq_qinit(struct ifnet *ifp) +{ + struct ath_softc *sc = ifp->if_softc; + + TAILQ_INIT(&sc->sc_txbuf_list); +} + +/* + * Add this mbuf to the TX buffer chain. + * + * This allocates an ath_buf, links the mbuf into it, and + * appends it to the end of the TX buffer chain. + * It doesn't fill out the ath_buf in any way besides + * that. + * + * Since the mbuf may be a list of mbufs representing + * 802.11 fragments, handle allocating ath_bufs for each + * of the mbuf fragments. + * + * If we queued it, 0 is returned. Else, < 0 is returned. + * + * If <0 is returned, the sender is responsible for + * freeing the mbuf if appropriate. + */ +static int +ath_txq_qadd(struct ifnet *ifp, struct mbuf *m0) { struct ath_softc *sc = ifp->if_softc; - struct ieee80211_node *ni; struct ath_buf *bf; - struct mbuf *m, *next; ath_bufhead frags; - int npkts = 0; + struct ieee80211_node *ni; + struct mbuf *m; - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || sc->sc_invalid) - return; + /* XXX recursive TX completion -> TX? */ + ATH_TX_UNLOCK_ASSERT(sc); - ATH_TX_LOCK_ASSERT(sc); + /* + * We grab the node pointer, but we don't deref + * the node. The caller must be responsible for + * freeing the node reference if it decides to + * free the mbuf. + */ + ni = (struct ieee80211_node *) m0->m_pkthdr.rcvif; - ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start: called"); + ATH_TXBUF_LOCK(sc); + if (sc->sc_txbuf_cnt <= sc->sc_txq_data_minfree) { + /* XXX increment counter? */ + ATH_TXBUF_UNLOCK(sc); + IF_LOCK(&ifp->if_snd); + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + IF_UNLOCK(&ifp->if_snd); + return (-1); + } + ATH_TXBUF_UNLOCK(sc); - for (;;) { + /* + * Grab a TX buffer and associated resources. + */ + bf = ath_getbuf(sc, ATH_BUFTYPE_NORMAL); + if (bf == NULL) { + device_printf(sc->sc_dev, + "%s: couldn't allocate a buffer\n", + __func__); + return (-1); + } + + /* Setup the initial buffer node contents */ + bf->bf_m = m0; + bf->bf_node = ni; + + /* + * Check for fragmentation. If this frame + * has been broken up verify we have enough + * buffers to send all the fragments so all + * go out or none... + */ + TAILQ_INIT(&frags); + if (m0->m_flags & M_FRAG) + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: txfrag\n", __func__); + if ((m0->m_flags & M_FRAG) && + !ath_txfrag_setup(sc, &frags, m0, ni)) { + DPRINTF(sc, ATH_DEBUG_XMIT, + "%s: out of txfrag buffers\n", __func__); + sc->sc_stats.ast_tx_nofrag++; + ifp->if_oerrors++; + goto bad; + } + + /* + * Don't stuff the non-fragment frame onto the fragment + * queue. ath_txfrag_cleanup() should only be called on fragments - + * ie, the _extra_ ieee80211_node references - and not the single + * node reference already done as part of the net08211 TX call + * into the driver. + */ + + ATH_TX_LOCK(sc); + + /* + * Throw the single frame onto the queue. + */ + TAILQ_INSERT_TAIL(&sc->sc_txbuf_list, bf, bf_list); + + /* + * Update next packet duration length if it's a fragment. + * It's needed for accurate NAV calculations (which for + * fragments include the length of the NEXT fragment.) + */ + if (m0->m_nextpkt != NULL) + bf->bf_state.bfs_nextpktlen = + m0->m_nextpkt->m_pkthdr.len; + + /* + * Append the fragments. We have to populate bf and node + * references here as although the txfrag setup code does + * create buffers and increment the node ref, it doesn't + * populate the fields for us. + */ + m = m0->m_nextpkt; + while ( (bf = TAILQ_FIRST(&frags)) != NULL) { + bf->bf_m = m; + bf->bf_node = ni; + device_printf(sc->sc_dev, "%s: adding bf=%p, m=%p, ni=%p\n", + __func__, + bf, + bf->bf_m, + bf->bf_node); + TAILQ_REMOVE(&frags, bf, bf_list); + TAILQ_INSERT_TAIL(&sc->sc_txbuf_list, bf, bf_list); + + /* + * For duration (NAV) calculations, we need + * to know the next fragment size. + * + * XXX This isn't entirely accurate as it doesn't + * take pad bytes and such into account, but it'll do + * for fragment length / NAV calculations. + */ + if (m->m_nextpkt != NULL) + bf->bf_state.bfs_nextpktlen = + m->m_nextpkt->m_pkthdr.len; + + m = m->m_nextpkt; + } + ATH_TX_UNLOCK(sc); + + return (0); +bad: + device_printf(sc->sc_dev, "%s: bad?!\n", __func__); + bf->bf_m = NULL; + bf->bf_node = NULL; + ATH_TXBUF_LOCK(sc); + ath_returnbuf_head(sc, bf); + ath_txfrag_cleanup(sc, &frags, ni); + ATH_TXBUF_UNLOCK(sc); + return (-1); +} + +/* + * Flush the pending TX buffer chain. + */ +static void +ath_txq_qflush(struct ifnet *ifp) +{ + struct ath_softc *sc = ifp->if_softc; + ath_bufhead txlist; + struct ath_buf *bf; + + device_printf(sc->sc_dev, "%s: called\n", __func__); + TAILQ_INIT(&txlist); + + /* Grab lock */ + ATH_TX_LOCK(sc); + + /* Copy everything out of sc_txbuf_list into txlist */ + TAILQ_CONCAT(&txlist, &sc->sc_txbuf_list, bf_list); + + /* Unlock */ + ATH_TX_UNLOCK(sc); + + /* Now, walk the list, freeing things */ + while ((bf = TAILQ_FIRST(&txlist)) != NULL) { + TAILQ_REMOVE(&txlist, bf, bf_list); + + if (bf->bf_node) + ieee80211_free_node(bf->bf_node); + + m_free(bf->bf_m); + + /* XXX paranoia! */ + bf->bf_m = NULL; + bf->bf_node = NULL; + + /* + * XXX Perhaps do a second pass with the TXBUF lock + * held and free them all at once? + */ ATH_TXBUF_LOCK(sc); - if (sc->sc_txbuf_cnt <= sc->sc_txq_data_minfree) { - /* XXX increment counter? */ - ATH_TXBUF_UNLOCK(sc); - IF_LOCK(&ifp->if_snd); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - IF_UNLOCK(&ifp->if_snd); - break; - } + ath_returnbuf_head(sc, bf); ATH_TXBUF_UNLOCK(sc); - + } +} + +/* + * Walk the TX buffer queue and call ath_tx_start() on each + * of them. + */ +static void +ath_txq_qrun(struct ifnet *ifp) +{ + struct ath_softc *sc = ifp->if_softc; + ath_bufhead txlist; + struct ath_buf *bf, *bf_next; + struct ieee80211_node *ni; + struct mbuf *m; + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || sc->sc_invalid) + return; + + TAILQ_INIT(&txlist); + + /* + * Grab the frames to transmit from the tx queue + */ + + /* Copy everything out of sc_txbuf_list into txlist */ + ATH_TX_LOCK(sc); + TAILQ_CONCAT(&txlist, &sc->sc_txbuf_list, bf_list); + ATH_TX_UNLOCK(sc); + + /* + * For now, the ath_tx_start() code sits behind the same lock; + * worry about serialising this in a taskqueue later. + */ + + ATH_TX_LOCK(sc); + + /* + * Attempt to transmit each frame. + * + * In the old code path - if a TX fragment fails, subsequent + * fragments in that group would be aborted. + * + * It would be nice to chain together TX fragments in this + * way so they can be aborted together. + */ + TAILQ_FOREACH_SAFE(bf, &txlist, bf_list, bf_next) { /* - * Grab a TX buffer and associated resources. + * Clear, because we're going to reuse this + * as a real ath_buf now */ - bf = ath_getbuf(sc, ATH_BUFTYPE_NORMAL); - if (bf == NULL) - break; + ni = bf->bf_node; + m = bf->bf_m; + + bf->bf_node = NULL; + bf->bf_m = NULL; - IFQ_DEQUEUE(&ifp->if_snd, m); - if (m == NULL) { - ATH_TXBUF_LOCK(sc); - ath_returnbuf_head(sc, bf); - ATH_TXBUF_UNLOCK(sc); - break; - } - ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; - npkts ++; /* - * Check for fragmentation. If this frame - * has been broken up verify we have enough - * buffers to send all the fragments so all - * go out or none... - */ - TAILQ_INIT(&frags); - if ((m->m_flags & M_FRAG) && - !ath_txfrag_setup(sc, &frags, m, ni)) { - DPRINTF(sc, ATH_DEBUG_XMIT, - "%s: out of txfrag buffers\n", __func__); - sc->sc_stats.ast_tx_nofrag++; - ifp->if_oerrors++; - ath_freetx(m); - goto bad; - } - ifp->if_opackets++; - nextfrag: + * Remove it from the list. + */ + TAILQ_REMOVE(&txlist, bf, bf_list); + /* - * Pass the frame to the h/w for transmission. - * Fragmented frames have each frag chained together - * with m_nextpkt. We know there are sufficient ath_buf's - * to send all the frags because of work done by - * ath_txfrag_setup. We leave m_nextpkt set while - * calling ath_tx_start so it can use it to extend the - * the tx duration to cover the subsequent frag and - * so it can reclaim all the mbufs in case of an error; - * ath_tx_start clears m_nextpkt once it commits to - * handing the frame to the hardware. + * If we fail, free this buffer and go to the next one; + * ath_tx_start() frees the mbuf but not the node + * reference. */ - next = m->m_nextpkt; if (ath_tx_start(sc, ni, bf, m)) { - bad: + /* + * XXX m is freed by ath_tx_start(); node reference + * is not! + */ + DPRINTF(sc, ATH_DEBUG_XMIT, + "%s: failed; bf=%p, ni=%p, m=%p\n", + __func__, + bf, + ni, + m); ifp->if_oerrors++; - reclaim: bf->bf_m = NULL; bf->bf_node = NULL; ATH_TXBUF_LOCK(sc); ath_returnbuf_head(sc, bf); - ath_txfrag_cleanup(sc, &frags, ni); ATH_TXBUF_UNLOCK(sc); /* * XXX todo, free the node outside of @@ -2633,37 +2923,84 @@ ath_start(struct ifnet *ifp) */ if (ni != NULL) ieee80211_free_node(ni); - continue; + } else { + /* + * Check here if the node is in power save state. + * XXX we should hold a node ref here, and release + * it after the TX has completed. + */ + ath_tx_update_tim(sc, ni, 1); + ifp->if_opackets++; } /* - * Check here if the node is in power save state. + * XXX should check for state change and flip out + * if needed. */ - ath_tx_update_tim(sc, ni, 1); + } + ATH_TX_UNLOCK(sc); - if (next != NULL) { - /* - * Beware of state changing between frags. - * XXX check sta power-save state? - */ - if (ni->ni_vap->iv_state != IEEE80211_S_RUN) { - DPRINTF(sc, ATH_DEBUG_XMIT, - "%s: flush fragmented packet, state %s\n", - __func__, - ieee80211_state_name[ni->ni_vap->iv_state]); - ath_freetx(next); - goto reclaim; - } - m = next; - bf = TAILQ_FIRST(&frags); - KASSERT(bf != NULL, ("no buf for txfrag")); - TAILQ_REMOVE(&frags, bf, bf_list); - goto nextfrag; + /* + * If we break out early (eg a state change) we should prepend these + * frames onto the TX queue. + */ +} + +/* + * This is now primarily used by the net80211 layer to kick-start + * queue processing. + */ +void +ath_start(struct ifnet *ifp) +{ + struct mbuf *m; + struct ath_softc *sc = ifp->if_softc; + struct ieee80211_node *ni; + int npkts = 0; + + ATH_TX_UNLOCK_ASSERT(sc); + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || sc->sc_invalid) + return; + + /* + * If we're below the free buffer limit, don't dequeue anything. + * The original code would not dequeue anything from the queue + * if allocating an ath_buf failed. + * + * For if_transmit, we have to either queue or drop the frame. + * So we have to try and queue it _somewhere_. + */ + for (;;) { + IFQ_DEQUEUE(&ifp->if_snd, m); + if (m == NULL) { + break; } - sc->sc_wd_timer = 5; + /* + * If we do fail here, just break out for now + * and wait until we've transmitted something + * before we attempt again? + */ + if (ath_txq_qadd(ifp, m) < 0) { + DPRINTF(sc, ATH_DEBUG_XMIT, + "%s: ath_txq_qadd failed\n", + __func__); + ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; + if (ni != NULL) + ieee80211_free_node(ni); + ath_freetx(m); + break; + } + npkts++; } - ATH_KTR(sc, ATH_KTR_TX, 1, "ath_start: finished; npkts=%d", npkts); + + /* + * Kick the taskqueue into activity, but only if we + * queued something. + */ + if (npkts > 0) + ath_tx_kick(sc); } static int Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Tue Jan 15 17:50:07 2013 (r245464) +++ head/sys/dev/ath/if_ath_misc.h Tue Jan 15 18:01:23 2013 (r245465) @@ -124,9 +124,8 @@ static inline void ath_tx_kick(struct ath_softc *sc) { - ATH_TX_LOCK(sc); - ath_start(sc->sc_ifp); - ATH_TX_UNLOCK(sc); + /* XXX eventually try sc_tx_tq? */ + taskqueue_enqueue(sc->sc_tq, &sc->sc_txpkttask); } #endif Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Tue Jan 15 17:50:07 2013 (r245464) +++ head/sys/dev/ath/if_ath_sysctl.c Tue Jan 15 18:01:23 2013 (r245465) @@ -505,6 +505,33 @@ ath_sysctl_forcebstuck(SYSCTL_HANDLER_AR return 0; } +static int +ath_sysctl_hangcheck(SYSCTL_HANDLER_ARGS) +{ + struct ath_softc *sc = arg1; + int val = 0; + int error; + uint32_t mask = 0xffffffff; + uint32_t *sp; + uint32_t rsize; + struct ath_hal *ah = sc->sc_ah; + + error = sysctl_handle_int(oidp, &val, 0, req); + if (error || !req->newptr) + return error; + if (val == 0) + return 0; + + /* Do a hang check */ + if (!ath_hal_getdiagstate(ah, HAL_DIAG_CHECK_HANGS, + &mask, sizeof(mask), + (void *) &sp, &rsize)) + return (0); + device_printf(sc->sc_dev, "%s: sp=0x%08x\n", __func__, *sp); + + val = 0; + return 0; +} #ifdef ATH_DEBUG_ALQ static int @@ -661,6 +688,10 @@ ath_sysctlattach(struct ath_softc *sc) "forcebstuck", CTLTYPE_INT | CTLFLAG_RW, sc, 0, ath_sysctl_forcebstuck, "I", ""); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "hangcheck", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + ath_sysctl_hangcheck, "I", ""); + if (ath_hal_hasintmit(ah)) { SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "intmit", CTLTYPE_INT | CTLFLAG_RW, sc, 0, Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Tue Jan 15 17:50:07 2013 (r245464) +++ head/sys/dev/ath/if_ath_tx.c Tue Jan 15 18:01:23 2013 (r245465) @@ -1124,7 +1124,11 @@ ath_tx_calc_duration(struct ath_softc *s dur = rt->info[rix].lpAckDuration; if (wh->i_fc[1] & IEEE80211_FC1_MORE_FRAG) { dur += dur; /* additional SIFS+ACK */ - KASSERT(bf->bf_m->m_nextpkt != NULL, ("no fragment")); + if (bf->bf_state.bfs_nextpktlen == 0) { + device_printf(sc->sc_dev, + "%s: next txfrag len=0?\n", + __func__); + } /* * Include the size of next fragment so NAV is * updated properly. The last fragment uses only @@ -1135,7 +1139,7 @@ ath_tx_calc_duration(struct ath_softc *s * first fragment! */ dur += ath_hal_computetxtime(ah, rt, - bf->bf_m->m_nextpkt->m_pkthdr.len, + bf->bf_state.bfs_nextpktlen, rix, shortPreamble); } if (isfrag) { Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue Jan 15 17:50:07 2013 (r245464) +++ head/sys/dev/ath/if_athvar.h Tue Jan 15 18:01:23 2013 (r245465) @@ -279,6 +279,8 @@ struct ath_buf { int32_t bfs_keyix; /* crypto key index */ int32_t bfs_txantenna; /* TX antenna config */ + uint16_t bfs_nextpktlen; /* length of next frag pkt */ + /* Make this an 8 bit value? */ enum ieee80211_protmode bfs_protmode; @@ -494,6 +496,13 @@ struct ath_softc { struct ath_tx_methods sc_tx; struct ath_tx_edma_fifo sc_txedma[HAL_NUM_TX_QUEUES]; + /* + * This is (currently) protected by the TX queue lock; + * it should migrate to a separate lock later + * so as to minimise contention. + */ + ath_bufhead sc_txbuf_list; + int sc_rx_statuslen; int sc_tx_desclen; int sc_tx_statuslen; @@ -514,6 +523,7 @@ struct ath_softc { struct mtx sc_tx_mtx; /* TX access mutex */ char sc_tx_mtx_name[32]; struct taskqueue *sc_tq; /* private task queue */ + struct taskqueue *sc_tx_tq; /* private TX task queue */ struct ath_hal *sc_ah; /* Atheros HAL */ struct ath_ratectrl *sc_rc; /* tx rate control support */ struct ath_tx99 *sc_tx99; /* tx99 adjunct state */ @@ -660,6 +670,7 @@ struct ath_softc { struct ath_txq *sc_ac2q[5]; /* WME AC -> h/w q map */ struct task sc_txtask; /* tx int processing */ struct task sc_txqtask; /* tx proc processing */ + struct task sc_txpkttask; /* tx frame processing */ struct ath_descdma sc_txcompdma; /* TX EDMA completion */ struct mtx sc_txcomplock; /* TX EDMA completion lock */ From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 18:04:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B66AA382; Tue, 15 Jan 2013 18:04:15 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9DD2CC2B; Tue, 15 Jan 2013 18:04:15 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0FI4Frj024003; Tue, 15 Jan 2013 18:04:15 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0FI4FPt024002; Tue, 15 Jan 2013 18:04:15 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301151804.r0FI4FPt024002@svn.freebsd.org> From: Adrian Chadd Date: Tue, 15 Jan 2013 18:04:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245466 - 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.14 Precedence: list List-Id: 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, 15 Jan 2013 18:04:15 -0000 Author: adrian Date: Tue Jan 15 18:04:15 2013 New Revision: 245466 URL: http://svnweb.freebsd.org/changeset/base/245466 Log: Add some new debugging options for the ath(4) and ath_hal(4) drivers. Modified: head/sys/conf/options Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue Jan 15 18:01:23 2013 (r245465) +++ head/sys/conf/options Tue Jan 15 18:04:15 2013 (r245466) @@ -775,6 +775,8 @@ ATH_ENABLE_11N opt_ath.h ATH_ENABLE_DFS opt_ath.h ATH_EEPROM_FIRMWARE opt_ath.h ATH_ENABLE_RADIOTAP_VENDOR_EXT opt_ath.h +ATH_DEBUG_ALQ opt_ath.h +ATH_KTR_INTR_DEBUG opt_ath.h # options for the Atheros hal AH_SUPPORT_AR5416 opt_ah.h @@ -794,7 +796,7 @@ AH_NEED_DESC_SWAP opt_ah.h AH_USE_INIPDGAIN opt_ah.h AH_MAXCHAN opt_ah.h AH_RXCFG_SDMAMW_4BYTES opt_ah.h - +AH_INTERRUPT_DEBUGGING opt_ah.h # AR5416 and later interrupt mitigation # XXX do not use this for AR9130 AH_AR5416_INTERRUPT_MITIGATION opt_ah.h From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 18:09:57 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 23B8C59A; Tue, 15 Jan 2013 18:09:57 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) by mx1.freebsd.org (Postfix) with ESMTP id D436FCC8; Tue, 15 Jan 2013 18:09:56 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.5/8.14.5) with ESMTP id r0FI9sGC077210; Tue, 15 Jan 2013 10:09:54 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.5/8.14.5/Submit) id r0FI9r2l077209; Tue, 15 Jan 2013 10:09:53 -0800 (PST) (envelope-from sgk) Date: Tue, 15 Jan 2013 10:09:53 -0800 From: Steve Kargl To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Subject: Re: svn commit: r245269 - head/share/mk Message-ID: <20130115180953.GA77200@troutmask.apl.washington.edu> References: <201301102244.r0AMiJ1k059594@svn.freebsd.org> <20130114224326.GA72312@troutmask.apl.washington.edu> <86mwwaml0r.fsf@ds4.des.no> <20130115175941.GA77018@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20130115175941.GA77018@troutmask.apl.washington.edu> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 18:09:57 -0000 On Tue, Jan 15, 2013 at 09:59:41AM -0800, Steve Kargl wrote: > On Tue, Jan 15, 2013 at 06:08:36PM +0100, Dag-Erling Smørgrav wrote: > > Steve Kargl writes: > > > I suggest adding a blurb to src/UPDATING to help others with memory > > > loss issues. > > > > Thanks, can you commit that patch? > > > > Yes. > > But, I found that your commit only indirectly caused the > problem. The system that showed the problem with NO_KERBEROS > in /etc/make.conf never had kerberos installed, so your change > actually caused my buildworld to try to build kerberos. It > appears that usr.bin/compile_et is needed to bootstrap kerberos. > compile_et is not installed as a bootstrap-tool, so it must be > picking up a previously installed compile_et. At the moment, > I'm stumped as how to compile_et. On a system with kerberos installed and after a buildworld, I find % cd /usr/src % make buildenv Entering world for amd64:amd64 # which compile_et /usr/bin/compile_et # exit -- Steve From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 18:38:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CA5E4F6F; Tue, 15 Jan 2013 18:38:51 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BB903E7C; Tue, 15 Jan 2013 18:38:51 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0FIcpUF033781; Tue, 15 Jan 2013 18:38:51 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0FIcpUd033780; Tue, 15 Jan 2013 18:38:51 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201301151838.r0FIcpUd033780@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 15 Jan 2013 18:38:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245467 - 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.14 Precedence: list List-Id: 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, 15 Jan 2013 18:38:51 -0000 Author: np Date: Tue Jan 15 18:38:51 2013 New Revision: 245467 URL: http://svnweb.freebsd.org/changeset/base/245467 Log: cxgbe/tom: Add support for fully offloaded TCP/IPv6 connections (active open). MFC after: 1 week Modified: head/sys/dev/cxgbe/tom/t4_connect.c Modified: head/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_connect.c Tue Jan 15 18:04:15 2013 (r245466) +++ head/sys/dev/cxgbe/tom/t4_connect.c Tue Jan 15 18:38:51 2013 (r245467) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" +#include "opt_inet6.h" #ifdef TCP_OFFLOAD #include @@ -220,10 +221,9 @@ do_act_open_rpl(struct sge_iq *iq, const * Options2 for active open. */ static uint32_t -calc_opt2a(struct socket *so) +calc_opt2a(struct socket *so, struct toepcb *toep) { struct tcpcb *tp = so_sototcpcb(so); - struct toepcb *toep = tp->t_toe; struct port_info *pi = toep->port; struct adapter *sc = pi->adapter; uint32_t opt2 = 0; @@ -260,6 +260,12 @@ t4_init_connect_cpl_handlers(struct adap t4_register_cpl_handler(sc, CPL_ACT_OPEN_RPL, do_act_open_rpl); } +#define DONT_OFFLOAD_ACTIVE_OPEN(x) do { \ + reason = __LINE__; \ + rc = (x); \ + goto failed; \ +} while (0) + /* * active open (soconnect). * @@ -275,20 +281,19 @@ t4_connect(struct toedev *tod, struct so struct sockaddr *nam) { struct adapter *sc = tod->tod_softc; + struct tom_data *td = tod_td(tod); struct toepcb *toep = NULL; struct wrqe *wr = NULL; - struct cpl_act_open_req *cpl; - struct l2t_entry *e = NULL; struct ifnet *rt_ifp = rt->rt_ifp; struct port_info *pi; - int atid = -1, mtu_idx, rscale, qid_atid, rc = ENOMEM; + int mtu_idx, rscale, qid_atid, rc, isipv6; struct inpcb *inp = sotoinpcb(so); struct tcpcb *tp = intotcpcb(inp); + int reason; INP_WLOCK_ASSERT(inp); - - if (nam->sa_family != AF_INET) - CXGBE_UNIMPLEMENTED("IPv6 connect"); + KASSERT(nam->sa_family == AF_INET || nam->sa_family == AF_INET6, + ("%s: dest addr %p has family %u", __func__, nam, nam->sa_family)); if (rt_ifp->if_type == IFT_ETHER) pi = rt_ifp->if_softc; @@ -297,30 +302,29 @@ t4_connect(struct toedev *tod, struct so pi = ifp->if_softc; } else if (rt_ifp->if_type == IFT_IEEE8023ADLAG) - return (ENOSYS); /* XXX: implement lagg support */ + DONT_OFFLOAD_ACTIVE_OPEN(ENOSYS); /* XXX: implement lagg+TOE */ else - return (ENOTSUP); + DONT_OFFLOAD_ACTIVE_OPEN(ENOTSUP); toep = alloc_toepcb(pi, -1, -1, M_NOWAIT); if (toep == NULL) - goto failed; + DONT_OFFLOAD_ACTIVE_OPEN(ENOMEM); - atid = alloc_atid(sc, toep); - if (atid < 0) - goto failed; + toep->tid = alloc_atid(sc, toep); + if (toep->tid < 0) + DONT_OFFLOAD_ACTIVE_OPEN(ENOMEM); - e = t4_l2t_get(pi, rt_ifp, + toep->l2te = t4_l2t_get(pi, rt_ifp, rt->rt_flags & RTF_GATEWAY ? rt->rt_gateway : nam); - if (e == NULL) - goto failed; + if (toep->l2te == NULL) + DONT_OFFLOAD_ACTIVE_OPEN(ENOMEM); - wr = alloc_wrqe(sizeof(*cpl), toep->ctrlq); + isipv6 = nam->sa_family == AF_INET6; + wr = alloc_wrqe(isipv6 ? sizeof(struct cpl_act_open_req6) : + sizeof(struct cpl_act_open_req), toep->ctrlq); if (wr == NULL) - goto failed; - cpl = wrtod(wr); + DONT_OFFLOAD_ACTIVE_OPEN(ENOMEM); - toep->tid = atid; - toep->l2te = e; if (sc->tt.ddp && (so->so_options & SO_NO_DDP) == 0) set_tcpddp_ulp_mode(toep); else @@ -330,8 +334,6 @@ t4_connect(struct toedev *tod, struct so toep->rx_credits = min(select_rcv_wnd(so) >> 10, M_RCV_BUFSIZ); SOCKBUF_UNLOCK(&so->so_rcv); - offload_socket(so, toep); - /* * The kernel sets request_r_scale based on sb_max whereas we need to * take hardware's MAX_RCV_WND into account too. This is normally a @@ -342,39 +344,78 @@ t4_connect(struct toedev *tod, struct so else rscale = 0; mtu_idx = find_best_mtu_idx(sc, &inp->inp_inc, 0); - qid_atid = (toep->ofld_rxq->iq.abs_id << 14) | atid; + qid_atid = (toep->ofld_rxq->iq.abs_id << 14) | toep->tid; - INIT_TP_WR(cpl, 0); - OPCODE_TID(cpl) = htobe32(MK_OPCODE_TID(CPL_ACT_OPEN_REQ, qid_atid)); - inp_4tuple_get(inp, &cpl->local_ip, &cpl->local_port, &cpl->peer_ip, - &cpl->peer_port); - cpl->opt0 = calc_opt0(so, pi, e, mtu_idx, rscale, toep->rx_credits, - toep->ulp_mode); - cpl->params = select_ntuple(pi, e, sc->filter_mode); - cpl->opt2 = calc_opt2a(so); + if (isipv6) { + struct cpl_act_open_req6 *cpl = wrtod(wr); + + if ((inp->inp_vflag & INP_IPV6) == 0) { + /* XXX think about this a bit more */ + log(LOG_ERR, + "%s: time to think about AF_INET6 + vflag 0x%x.\n", + __func__, inp->inp_vflag); + DONT_OFFLOAD_ACTIVE_OPEN(ENOTSUP); + } + + toep->ce = hold_lip(td, &inp->in6p_laddr); + if (toep->ce == NULL) + DONT_OFFLOAD_ACTIVE_OPEN(ENOENT); + + INIT_TP_WR(cpl, 0); + OPCODE_TID(cpl) = htobe32(MK_OPCODE_TID(CPL_ACT_OPEN_REQ6, + qid_atid)); + + cpl->local_port = inp->inp_lport; + cpl->local_ip_hi = *(uint64_t *)&inp->in6p_laddr.s6_addr[0]; + cpl->local_ip_lo = *(uint64_t *)&inp->in6p_laddr.s6_addr[8]; + cpl->peer_port = inp->inp_fport; + cpl->peer_ip_hi = *(uint64_t *)&inp->in6p_faddr.s6_addr[0]; + cpl->peer_ip_lo = *(uint64_t *)&inp->in6p_faddr.s6_addr[8]; + cpl->opt0 = calc_opt0(so, pi, toep->l2te, mtu_idx, rscale, + toep->rx_credits, toep->ulp_mode); + cpl->params = select_ntuple(pi, toep->l2te, sc->filter_mode); + cpl->opt2 = calc_opt2a(so, toep); + } else { + struct cpl_act_open_req *cpl = wrtod(wr); + + INIT_TP_WR(cpl, 0); + OPCODE_TID(cpl) = htobe32(MK_OPCODE_TID(CPL_ACT_OPEN_REQ, + qid_atid)); + inp_4tuple_get(inp, &cpl->local_ip, &cpl->local_port, + &cpl->peer_ip, &cpl->peer_port); + cpl->opt0 = calc_opt0(so, pi, toep->l2te, mtu_idx, rscale, + toep->rx_credits, toep->ulp_mode); + cpl->params = select_ntuple(pi, toep->l2te, sc->filter_mode); + cpl->opt2 = calc_opt2a(so, toep); + } CTR5(KTR_CXGBE, "%s: atid %u (%s), toep %p, inp %p", __func__, toep->tid, tcpstates[tp->t_state], toep, inp); - rc = t4_l2t_send(sc, wr, e); + offload_socket(so, toep); + rc = t4_l2t_send(sc, wr, toep->l2te); if (rc == 0) { toep->flags |= TPF_CPL_PENDING; return (0); } undo_offload_socket(so); + reason = __LINE__; failed: - CTR5(KTR_CXGBE, "%s: FAILED, atid %d, toep %p, l2te %p, wr %p", - __func__, atid, toep, e, wr); + CTR3(KTR_CXGBE, "%s: not offloading (%d), rc %d", __func__, reason, rc); - if (e) - t4_l2t_release(e); if (wr) free_wrqe(wr); - if (atid >= 0) - free_atid(sc, atid); - if (toep) + + if (toep) { + if (toep->tid >= 0) + free_atid(sc, toep->tid); + if (toep->l2te) + t4_l2t_release(toep->l2te); + if (toep->ce) + release_lip(td, toep->ce); free_toepcb(toep); + } return (rc); } From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 18:50:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 81887332; Tue, 15 Jan 2013 18:50:41 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 72018EFF; Tue, 15 Jan 2013 18:50:41 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0FIofpG038536; Tue, 15 Jan 2013 18:50:41 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0FIoftY038535; Tue, 15 Jan 2013 18:50:41 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201301151850.r0FIoftY038535@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 15 Jan 2013 18:50:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245468 - 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.14 Precedence: list List-Id: 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, 15 Jan 2013 18:50:41 -0000 Author: np Date: Tue Jan 15 18:50:40 2013 New Revision: 245468 URL: http://svnweb.freebsd.org/changeset/base/245468 Log: cxgbe/tom: Add support for fully offloaded TCP/IPv6 connections (passive open). MFC after: 1 week Modified: head/sys/dev/cxgbe/tom/t4_listen.c Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Tue Jan 15 18:38:51 2013 (r245467) +++ head/sys/dev/cxgbe/tom/t4_listen.c Tue Jan 15 18:50:40 2013 (r245468) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" +#include "opt_inet6.h" #ifdef TCP_OFFLOAD #include @@ -50,6 +51,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #define TCPSTATES @@ -194,7 +197,7 @@ alloc_lctx(struct adapter *sc, struct in if (lctx == NULL) return (NULL); - lctx->stid = alloc_stid(sc, lctx, inp->inp_inc.inc_flags & INC_ISIPV6); + lctx->stid = alloc_stid(sc, lctx, inp->inp_vflag & INP_IPV6); if (lctx->stid < 0) { free(lctx, M_CXGBE); return (NULL); @@ -399,7 +402,7 @@ create_server(struct adapter *sc, struct { struct wrqe *wr; struct cpl_pass_open_req *req; - struct in_conninfo *inc = &lctx->inp->inp_inc; + struct inpcb *inp = lctx->inp; wr = alloc_wrqe(sizeof(*req), lctx->ctrlq); if (wr == NULL) { @@ -410,9 +413,9 @@ create_server(struct adapter *sc, struct INIT_TP_WR(req, 0); OPCODE_TID(req) = htobe32(MK_OPCODE_TID(CPL_PASS_OPEN_REQ, lctx->stid)); - req->local_port = inc->inc_lport; + req->local_port = inp->inp_lport; req->peer_port = 0; - req->local_ip = inc->inc_laddr.s_addr; + req->local_ip = inp->inp_laddr.s_addr; req->peer_ip = 0; req->opt0 = htobe64(V_TX_CHAN(lctx->ctrlq->eq.tx_chan)); req->opt1 = htobe64(V_CONN_POLICY(CPL_CONN_POLICY_ASK) | @@ -423,6 +426,36 @@ create_server(struct adapter *sc, struct } static int +create_server6(struct adapter *sc, struct listen_ctx *lctx) +{ + struct wrqe *wr; + struct cpl_pass_open_req6 *req; + struct inpcb *inp = lctx->inp; + + wr = alloc_wrqe(sizeof(*req), lctx->ctrlq); + if (wr == NULL) { + log(LOG_ERR, "%s: allocation failure", __func__); + return (ENOMEM); + } + req = wrtod(wr); + + INIT_TP_WR(req, 0); + OPCODE_TID(req) = htobe32(MK_OPCODE_TID(CPL_PASS_OPEN_REQ6, lctx->stid)); + req->local_port = inp->inp_lport; + req->peer_port = 0; + req->local_ip_hi = *(uint64_t *)&inp->in6p_laddr.s6_addr[0]; + req->local_ip_lo = *(uint64_t *)&inp->in6p_laddr.s6_addr[8]; + req->peer_ip_hi = 0; + req->peer_ip_lo = 0; + req->opt0 = htobe64(V_TX_CHAN(lctx->ctrlq->eq.tx_chan)); + req->opt1 = htobe64(V_CONN_POLICY(CPL_CONN_POLICY_ASK) | + F_SYN_RSS_ENABLE | V_SYN_RSS_QUEUE(lctx->ofld_rxq->iq.abs_id)); + + t4_wrq_tx(sc, wr); + return (0); +} + +static int destroy_server(struct adapter *sc, struct listen_ctx *lctx) { struct wrqe *wr; @@ -458,13 +491,10 @@ t4_listen_start(struct toedev *tod, stru struct port_info *pi; struct inpcb *inp = tp->t_inpcb; struct listen_ctx *lctx; - int i; + int i, rc; INP_WLOCK_ASSERT(inp); - if ((inp->inp_vflag & INP_IPV4) == 0) - return (0); - #if 0 ADAPTER_LOCK(sc); if (IS_BUSY(sc)) { @@ -481,8 +511,9 @@ t4_listen_start(struct toedev *tod, stru goto done; /* no port that's UP with IFCAP_TOE enabled */ /* - * Find a running port with IFCAP_TOE4. We'll use the first such port's - * queues to send the passive open and receive the reply to it. + * Find a running port with IFCAP_TOE (4 or 6). We'll use the first + * such port's queues to send the passive open and receive the reply to + * it. * * XXX: need a way to mark a port in use by offload. if_cxgbe should * then reject any attempt to bring down such a port (and maybe reject @@ -490,7 +521,7 @@ t4_listen_start(struct toedev *tod, stru */ for_each_port(sc, i) { if (isset(&sc->open_device_map, i) && - sc->port[i]->ifp->if_capenable & IFCAP_TOE4) + sc->port[i]->ifp->if_capenable & IFCAP_TOE) break; } KASSERT(i < sc->params.nports, @@ -509,12 +540,17 @@ t4_listen_start(struct toedev *tod, stru } listen_hash_add(sc, lctx); - CTR5(KTR_CXGBE, "%s: stid %u (%s), lctx %p, inp %p", __func__, - lctx->stid, tcpstates[tp->t_state], lctx, inp); + CTR6(KTR_CXGBE, "%s: stid %u (%s), lctx %p, inp %p vflag 0x%x", + __func__, lctx->stid, tcpstates[tp->t_state], lctx, inp, + inp->inp_vflag); - if (create_server(sc, lctx) != 0) { - log(LOG_ERR, "%s: %s failed to create hw listener.\n", __func__, - device_get_nameunit(sc->dev)); + if (inp->inp_vflag & INP_IPV6) + rc = create_server6(sc, lctx); + else + rc = create_server(sc, lctx); + if (rc != 0) { + log(LOG_ERR, "%s: %s failed to create hw listener: %d.\n", + __func__, device_get_nameunit(sc->dev), rc); (void) listen_hash_del(sc, inp); inp = release_lctx(sc, lctx); /* can't be freed, host stack has a reference */ @@ -618,7 +654,7 @@ t4_syncache_respond(struct toedev *tod, struct l2t_entry *e; struct tcpopt to; struct ip *ip = mtod(m, struct ip *); - struct tcphdr *th = (void *)(ip + 1); + struct tcphdr *th; wr = (struct wrqe *)atomic_readandclear_ptr(&synqe->wr); if (wr == NULL) { @@ -626,6 +662,10 @@ t4_syncache_respond(struct toedev *tod, return (EALREADY); } + if (ip->ip_v == IPVERSION) + th = (void *)(ip + 1); + else + th = (void *)((struct ip6_hdr *)ip + 1); bzero(&to, sizeof(to)); tcp_dooptions(&to, (void *)(th + 1), (th->th_off << 2) - sizeof(*th), TO_SYN); @@ -668,7 +708,7 @@ do_pass_open_rpl(struct sge_iq *iq, cons lctx->flags &= ~LCTX_RPL_PENDING; if (status != CPL_ERR_NONE) - log(LOG_ERR, "listener with stid %u failed: %d", stid, status); + log(LOG_ERR, "listener (stid %u) failed: %d\n", stid, status); #ifdef INVARIANTS /* @@ -738,7 +778,7 @@ do_close_server_rpl(struct sge_iq *iq, c CTR3(KTR_CXGBE, "%s: stid %u, status %u", __func__, stid, status); if (status != CPL_ERR_NONE) { - log(LOG_ERR, "%s: failed (%u) to close listener for stid %u", + log(LOG_ERR, "%s: failed (%u) to close listener for stid %u\n", __func__, status, stid); return (status); } @@ -996,21 +1036,29 @@ pass_accept_req_to_protohdrs(const struc const struct cpl_pass_accept_req *cpl = mtod(m, const void *); const struct ether_header *eh; unsigned int hlen = be32toh(cpl->hdr_len); - const struct ip *ip; + uintptr_t l3hdr; const struct tcphdr *tcp; eh = (const void *)(cpl + 1); - ip = (const void *)((uintptr_t)eh + G_ETH_HDR_LEN(hlen)); - tcp = (const void *)((uintptr_t)ip + G_IP_HDR_LEN(hlen)); + l3hdr = ((uintptr_t)eh + G_ETH_HDR_LEN(hlen)); + tcp = (const void *)(l3hdr + G_IP_HDR_LEN(hlen)); if (inc) { bzero(inc, sizeof(*inc)); - inc->inc_faddr = ip->ip_src; - inc->inc_laddr = ip->ip_dst; inc->inc_fport = tcp->th_sport; inc->inc_lport = tcp->th_dport; - if (ip->ip_v == 6) + if (((struct ip *)l3hdr)->ip_v == IPVERSION) { + const struct ip *ip = (const void *)l3hdr; + + inc->inc_faddr = ip->ip_src; + inc->inc_laddr = ip->ip_dst; + } else { + const struct ip6_hdr *ip6 = (const void *)l3hdr; + inc->inc_flags |= INC_ISIPV6; + inc->inc6_faddr = ip6->ip6_src; + inc->inc6_laddr = ip6->ip6_dst; + } } if (th) { @@ -1019,6 +1067,105 @@ pass_accept_req_to_protohdrs(const struc } } +static int +ifnet_has_ip6(struct ifnet *ifp, struct in6_addr *ip6) +{ + struct ifaddr *ifa; + struct sockaddr_in6 *sin6; + int found = 0; + struct in6_addr in6 = *ip6; + + /* Just as in ip6_input */ + if (in6_clearscope(&in6) || in6_clearscope(&in6)) + return (0); + in6_setscope(&in6, ifp, NULL); + + if_addr_rlock(ifp); + TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + sin6 = (void *)ifa->ifa_addr; + if (sin6->sin6_family != AF_INET6) + continue; + + if (IN6_ARE_ADDR_EQUAL(&sin6->sin6_addr, &in6)) { + found = 1; + break; + } + } + if_addr_runlock(ifp); + + return (found); +} + +static struct l2t_entry * +get_l2te_for_nexthop(struct port_info *pi, struct ifnet *ifp, + struct in_conninfo *inc) +{ + struct rtentry *rt; + struct l2t_entry *e; + struct sockaddr_in6 sin6; + struct sockaddr *dst = (void *)&sin6; + + if (inc->inc_flags & INC_ISIPV6) { + dst->sa_len = sizeof(struct sockaddr_in6); + dst->sa_family = AF_INET6; + ((struct sockaddr_in6 *)dst)->sin6_addr = inc->inc6_faddr; + + if (IN6_IS_ADDR_LINKLOCAL(&inc->inc6_laddr)) { + /* no need for route lookup */ + e = t4_l2t_get(pi, ifp, dst); + return (e); + } + } else { + dst->sa_len = sizeof(struct sockaddr_in); + dst->sa_family = AF_INET; + ((struct sockaddr_in *)dst)->sin_addr = inc->inc_faddr; + } + + rt = rtalloc1(dst, 0, 0); + if (rt == NULL) + return (NULL); + else { + struct sockaddr *nexthop; + + RT_UNLOCK(rt); + if (rt->rt_ifp != ifp) + e = NULL; + else { + if (rt->rt_flags & RTF_GATEWAY) + nexthop = rt->rt_gateway; + else + nexthop = dst; + e = t4_l2t_get(pi, ifp, nexthop); + } + RTFREE(rt); + } + + return (e); +} + +static int +ifnet_has_ip(struct ifnet *ifp, struct in_addr in) +{ + struct ifaddr *ifa; + struct sockaddr_in *sin; + int found = 0; + + if_addr_rlock(ifp); + TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + sin = (void *)ifa->ifa_addr; + if (sin->sin_family != AF_INET) + continue; + + if (sin->sin_addr.s_addr == in.s_addr) { + found = 1; + break; + } + } + if_addr_runlock(ifp); + + return (found); +} + #define REJECT_PASS_ACCEPT() do { \ reject_reason = __LINE__; \ goto reject; \ @@ -1054,10 +1201,8 @@ do_pass_accept_req(struct sge_iq *iq, co struct tcphdr th; struct tcpopt to; struct port_info *pi; - struct ifnet *ifp, *ifp_vlan = NULL; + struct ifnet *hw_ifp, *ifp; struct l2t_entry *e = NULL; - struct rtentry *rt; - struct sockaddr_in nam; int rscale, mtu_idx, rx_credits, rxqid, ulp_mode; struct synq_entry *synqe = NULL; int reject_reason; @@ -1077,31 +1222,24 @@ do_pass_accept_req(struct sge_iq *iq, co t4opt_to_tcpopt(&cpl->tcpopt, &to); pi = sc->port[G_SYN_INTF(be16toh(cpl->l2info))]; - ifp = pi->ifp; - m->m_pkthdr.rcvif = ifp; - tod = TOEDEV(ifp); - - /* - * Don't offload if the interface that received the SYN doesn't have - * IFCAP_TOE enabled. - */ - if ((ifp->if_capenable & IFCAP_TOE4) == 0) - REJECT_PASS_ACCEPT(); - - /* Don't offload IPv6 connections. XXX: add IPv6 support */ - if (inc.inc_flags & INC_ISIPV6) - REJECT_PASS_ACCEPT(); + hw_ifp = pi->ifp; /* the cxgbeX ifnet */ + m->m_pkthdr.rcvif = hw_ifp; + tod = TOEDEV(hw_ifp); /* - * Don't offload if the SYN had a VLAN tag and the vid doesn't match - * anything on this interface. + * Figure out if there is a pseudo interface (vlan, lagg, etc.) + * involved. Don't offload if the SYN had a VLAN tag and the vid + * doesn't match anything on this interface. + * + * XXX: lagg support, lagg + vlan support. */ vid = EVL_VLANOFTAG(be16toh(cpl->vlan)); if (vid != 0xfff) { - ifp_vlan = VLAN_DEVAT(ifp, vid); - if (ifp_vlan == NULL) + ifp = VLAN_DEVAT(hw_ifp, vid); + if (ifp == NULL) REJECT_PASS_ACCEPT(); - } + } else + ifp = hw_ifp; /* * Don't offload if the peer requested a TCP option that's not known to @@ -1110,31 +1248,36 @@ do_pass_accept_req(struct sge_iq *iq, co if (cpl->tcpopt.unknown) REJECT_PASS_ACCEPT(); - /* - * Don't offload if the outgoing interface for the route back to the - * peer is not the same as the interface that received the SYN. - * XXX: too restrictive. - */ - nam.sin_len = sizeof(nam); - nam.sin_family = AF_INET; - nam.sin_addr = inc.inc_faddr; - rt = rtalloc1((struct sockaddr *)&nam, 0, 0); - if (rt == NULL) - REJECT_PASS_ACCEPT(); - else { - struct sockaddr *nexthop; + if (inc.inc_flags & INC_ISIPV6) { - RT_UNLOCK(rt); - nexthop = rt->rt_flags & RTF_GATEWAY ? rt->rt_gateway : - (struct sockaddr *)&nam; - if (rt->rt_ifp == ifp || - (ifp_vlan != NULL && rt->rt_ifp == ifp_vlan)) - e = t4_l2t_get(pi, rt->rt_ifp, nexthop); - RTFREE(rt); - if (e == NULL) - REJECT_PASS_ACCEPT(); /* no l2te, or ifp mismatch */ + /* Don't offload if the ifcap isn't enabled */ + if ((ifp->if_capenable & IFCAP_TOE6) == 0) + REJECT_PASS_ACCEPT(); + + /* + * SYN must be directed to an IP6 address on this ifnet. This + * is more restrictive than in6_localip. + */ + if (!ifnet_has_ip6(ifp, &inc.inc6_laddr)) + REJECT_PASS_ACCEPT(); + } else { + + /* Don't offload if the ifcap isn't enabled */ + if ((ifp->if_capenable & IFCAP_TOE4) == 0) + REJECT_PASS_ACCEPT(); + + /* + * SYN must be directed to an IP address on this ifnet. This + * is more restrictive than in_localip. + */ + if (!ifnet_has_ip(ifp, inc.inc_laddr)) + REJECT_PASS_ACCEPT(); } + e = get_l2te_for_nexthop(pi, ifp, &inc); + if (e == NULL) + REJECT_PASS_ACCEPT(); + synqe = mbuf_to_synqe(m); if (synqe == NULL) REJECT_PASS_ACCEPT(); @@ -1226,7 +1369,7 @@ do_pass_accept_req(struct sge_iq *iq, co */ m = m_dup(synqe->syn, M_NOWAIT); if (m) - m->m_pkthdr.rcvif = ifp; + m->m_pkthdr.rcvif = hw_ifp; remove_tid(sc, synqe->tid); free(wr, M_CXGBE); @@ -1276,7 +1419,7 @@ reject: m->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | CSUM_IP_VALID | CSUM_DATA_VALID | CSUM_PSEUDO_HDR); m->m_pkthdr.csum_data = 0xffff; - ifp->if_input(ifp, m); + hw_ifp->if_input(hw_ifp, m); } return (reject_reason); From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 19:00:56 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D70598B9; Tue, 15 Jan 2013 19:00:56 +0000 (UTC) (envelope-from jmg@h2.funkthat.com) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) by mx1.freebsd.org (Postfix) with ESMTP id A183BF8C; Tue, 15 Jan 2013 19:00:56 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id r0FJ0tk8043486 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 15 Jan 2013 11:00:55 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id r0FJ0tAp043485; Tue, 15 Jan 2013 11:00:55 -0800 (PST) (envelope-from jmg) Date: Tue, 15 Jan 2013 11:00:55 -0800 From: John-Mark Gurney To: Ganbold Tsagaankhuu Subject: Re: svn commit: r245450 - in head/sys: arm/allwinner arm/conf boot/fdt/dts Message-ID: <20130115190055.GA1410@funkthat.com> References: <201301150826.r0F8QGJr044600@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201301150826.r0F8QGJr044600@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Tue, 15 Jan 2013 11:00:55 -0800 (PST) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 19:00:56 -0000 Ganbold Tsagaankhuu wrote this message on Tue, Jan 15, 2013 at 08:26 +0000: > + * Copyright (c) 2012 Ganbold Tsagaankhuu. Also, (c) doesn't add anything. It needs to be either Copyright (which you have) or a c in a circle, the parens around a c have not been given legal force... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 19:26:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3E58BC69; Tue, 15 Jan 2013 19:26:18 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2C094DD; Tue, 15 Jan 2013 19:26:18 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0FJQI6D007238; Tue, 15 Jan 2013 19:26:18 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0FJQHGK007215; Tue, 15 Jan 2013 19:26:18 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201301151926.r0FJQHGK007215@svn.freebsd.org> From: Alfred Perlstein Date: Tue, 15 Jan 2013 19:26:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245469 - 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.14 Precedence: list List-Id: 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, 15 Jan 2013 19:26:18 -0000 Author: alfred Date: Tue Jan 15 19:26:17 2013 New Revision: 245469 URL: http://svnweb.freebsd.org/changeset/base/245469 Log: Do not autotune ncallout to be greater than 18508. When maxusers was unrestricted and maxfiles was allowed to autotune much higher the result was that ncallout which was based on maxfiles and maxproc grew much higher than was needed. To fix this clip autotuning to the same number we would get with the old maxusers algorithm which would stop scaling at 384 maxusers. Growing ncalout higher is not likely to be needed since most consumers of timeout(9) are gone and any higher value for ncallout causes the callwheel hashes to be much larger than will even be needed for most applications. MFC after: 1 month Reviewed by: mav Modified: head/sys/kern/subr_param.c Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Tue Jan 15 18:50:40 2013 (r245468) +++ head/sys/kern/subr_param.c Tue Jan 15 19:26:17 2013 (r245469) @@ -326,8 +326,11 @@ init_param2(long physpages) /* * XXX: Does the callout wheel have to be so big? + * + * Clip callout to result of previous function of maxusers maximum + * 384. This is still huge, but acceptable. */ - ncallout = 16 + maxproc + maxfiles; + ncallout = imin(16 + maxproc + maxfiles, 18508); TUNABLE_INT_FETCH("kern.ncallout", &ncallout); /* From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 20:13:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 67EC41F7; Tue, 15 Jan 2013 20:13:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5A64C34F; Tue, 15 Jan 2013 20:13:26 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0FKDQgT025545; Tue, 15 Jan 2013 20:13:26 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0FKDQBm025543; Tue, 15 Jan 2013 20:13:26 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201301152013.r0FKDQBm025543@svn.freebsd.org> From: John Baldwin Date: Tue, 15 Jan 2013 20:13:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245471 - head/sys/dev/puc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 20:13:26 -0000 Author: jhb Date: Tue Jan 15 20:13:25 2013 New Revision: 245471 URL: http://svnweb.freebsd.org/changeset/base/245471 Log: Do not require a filter-only interrupt handler for puc ports that are not serial devices (such as printer ports). This allows ppc devices attached to puc to correctly setup an interrupt handler and work. Tested by: Andre Albsmeier Andre.Albsmeier@siemens.com MFC after: 1 week Modified: head/sys/dev/puc/puc.c Modified: head/sys/dev/puc/puc.c ============================================================================== --- head/sys/dev/puc/puc.c Tue Jan 15 20:10:49 2013 (r245470) +++ head/sys/dev/puc/puc.c Tue Jan 15 20:13:25 2013 (r245471) @@ -622,7 +622,7 @@ puc_bus_setup_intr(device_t dev, device_ if (cookiep == NULL || res != port->p_ires) return (EINVAL); /* We demand that serdev devices use filter_only interrupts. */ - if (ihand != NULL) + if (port->p_type == PUC_TYPE_SERIAL && ihand != NULL) return (ENXIO); if (rman_get_device(port->p_ires) != originator) return (ENXIO); From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 21:30:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 99675120 for ; Tue, 15 Jan 2013 21:30:36 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com [209.85.215.53]) by mx1.freebsd.org (Postfix) with ESMTP id 250BE953 for ; Tue, 15 Jan 2013 21:30:35 +0000 (UTC) Received: by mail-la0-f53.google.com with SMTP id fn20so663704lab.26 for ; Tue, 15 Jan 2013 13:30:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=Dhpdv3d2hIESTrmqeoXEmoBpTj9wtaG7NOasiEP94Iw=; b=OWebU3yIeVHDFwpoSBctaseFvpqyytf3LvHY732x8QFGycWsciOxfzG9cy8TLtka9e qXC/ec60Z1enyesggOz5/T2KlLfAjKaGqXoDyh/a1upMji50MfMrabEhGC8ajPnpunMl RDCuaWPkZbDCv5gpQ9pPyUpggLLM4aoZpBnG8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=Dhpdv3d2hIESTrmqeoXEmoBpTj9wtaG7NOasiEP94Iw=; b=LopxfQ7+OOBez8i4Dm8pzGTbGuKInbKyEbewPwsUlyBcBM18f+wPRre/Rs9uwR9vDh UdgmNDk6KR5b8uVFs52ckslIDInIa2v9oHIAVlSD8Nlunc/3ay7x1OUHPyVIiYGcVbhL /PN37NQhehwhSr6YrMihcCG0o4tH3gg3zG6x1nBQwPpcvUjHfOylZIdXbTgKFQQn1JQy eKV2+1Nfb8oQhDuHtKjXrwUebRX56RnC7lkXnVxfIGk7YGyn1cTALOiE+zeDEoPSo+qO PcRgHr5IOmUcAFWifGTLToAbz7CLPWCB5H1K4wjtCdLzdtmbug4nv2jBVlzrAhPv+NUO xvgg== Received: by 10.152.110.228 with SMTP id id4mr1502322lab.34.1358285428767; Tue, 15 Jan 2013 13:30:28 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.30.131 with HTTP; Tue, 15 Jan 2013 13:29:58 -0800 (PST) In-Reply-To: <20130115190055.GA1410@funkthat.com> References: <201301150826.r0F8QGJr044600@svn.freebsd.org> <20130115190055.GA1410@funkthat.com> From: Eitan Adler Date: Tue, 15 Jan 2013 16:29:58 -0500 X-Google-Sender-Auth: SxKwQ-_k_HMF7fM0hZYRDXcEWRw Message-ID: Subject: Re: svn commit: r245450 - in head/sys: arm/allwinner arm/conf boot/fdt/dts To: John-Mark Gurney Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQnh6CvQBG6fUtvsIZhIh53lGwiRRNKhsboA4IHPzUghNZlJANwjHaaxdhI6eKR75ErNGGPF Cc: svn-src-head@freebsd.org, Ganbold Tsagaankhuu , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 21:30:36 -0000 On 15 January 2013 14:00, John-Mark Gurney wrote: > Ganbold Tsagaankhuu wrote this message on Tue, Jan 15, 2013 at 08:26 +0000: >> + * Copyright (c) 2012 Ganbold Tsagaankhuu. > > Also, (c) doesn't add anything. It needs to be either Copyright (which > you have) or a c in a circle, the parens around a c have not been given > legal force... I am not a lawyer however I do not believe your statement has been true since the Berne Convention. Nothing is required to assert copyright. A c in a circle, p in a circle, "(c)", and "copyright" are *all* optional. That said (c) is widely recognized is a copyright symbol (imho) and may serve to increase damages from "willful infringement". That said, this being BSD licensed code the damages are likely to be minimal anyways. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 22:08:04 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6822F11A; Tue, 15 Jan 2013 22:08:04 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 34E12B4B; Tue, 15 Jan 2013 22:08:04 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0FM84H7059675; Tue, 15 Jan 2013 22:08:04 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0FM840l059674; Tue, 15 Jan 2013 22:08:04 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201301152208.r0FM840l059674@svn.freebsd.org> From: Olivier Houchard Date: Tue, 15 Jan 2013 22:08:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245475 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 22:08:04 -0000 Author: cognet Date: Tue Jan 15 22:08:03 2013 New Revision: 245475 URL: http://svnweb.freebsd.org/changeset/base/245475 Log: Don't define rel/acq variants of some atomic operations as the regular version for armv6. Modified: head/sys/arm/include/atomic.h Modified: head/sys/arm/include/atomic.h ============================================================================== --- head/sys/arm/include/atomic.h Tue Jan 15 21:25:01 2013 (r245474) +++ head/sys/arm/include/atomic.h Tue Jan 15 22:08:03 2013 (r245475) @@ -677,6 +677,17 @@ atomic_readandclear_32(volatile u_int32_ #define atomic_store_rel_long atomic_store_long #define atomic_load_acq_32 atomic_load_32 #define atomic_load_acq_long atomic_load_long +#define atomic_add_acq_long atomic_add_long +#define atomic_add_rel_long atomic_add_long +#define atomic_subtract_acq_long atomic_subtract_long +#define atomic_subtract_rel_long atomic_subtract_long +#define atomic_clear_acq_long atomic_clear_long +#define atomic_clear_rel_long atomic_clear_long +#define atomic_set_acq_long atomic_set_long +#define atomic_set_rel_long atomic_set_long +#define atomic_cmpset_acq_long atomic_cmpset_long +#define atomic_cmpset_rel_long atomic_cmpset_long +#define atomic_load_acq_long atomic_load_long #undef __with_interrupts_disabled static __inline void @@ -758,25 +769,13 @@ atomic_store_long(volatile u_long *dst, *dst = src; } -#define atomic_add_acq_long atomic_add_long -#define atomic_add_rel_long atomic_add_long -#define atomic_subtract_acq_long atomic_subtract_long -#define atomic_subtract_rel_long atomic_subtract_long -#define atomic_clear_acq_long atomic_clear_long -#define atomic_clear_rel_long atomic_clear_long -#define atomic_set_acq_long atomic_set_long -#define atomic_set_rel_long atomic_set_long -#define atomic_cmpset_acq_long atomic_cmpset_long -#define atomic_cmpset_rel_long atomic_cmpset_long -#define atomic_load_acq_long atomic_load_long - #define atomic_clear_ptr atomic_clear_32 #define atomic_set_ptr atomic_set_32 #define atomic_cmpset_ptr atomic_cmpset_32 #define atomic_cmpset_rel_ptr atomic_cmpset_rel_32 #define atomic_cmpset_acq_ptr atomic_cmpset_acq_32 #define atomic_store_ptr atomic_store_32 -#define atomic_store_rel_ptr atomic_store_ptr +#define atomic_store_rel_ptr atomic_store_rel_32 #define atomic_add_int atomic_add_32 #define atomic_add_acq_int atomic_add_acq_32 From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 22:08:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 54F43287; Tue, 15 Jan 2013 22:08:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2C353B50; Tue, 15 Jan 2013 22:08:18 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0FM8IcI059748; Tue, 15 Jan 2013 22:08:18 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0FM8HJZ059746; Tue, 15 Jan 2013 22:08:17 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201301152208.r0FM8HJZ059746@svn.freebsd.org> From: John Baldwin Date: Tue, 15 Jan 2013 22:08:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245476 - in head/sys: fs/nfs nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 22:08:18 -0000 Author: jhb Date: Tue Jan 15 22:08:17 2013 New Revision: 245476 URL: http://svnweb.freebsd.org/changeset/base/245476 Log: - More properly handle interrupted NFS requests on an interruptible mount by returning an error of EINTR rather than EACCES. - While here, bring back some (but not all) of the NFS RPC statistics lost when krpc was committed. Reviewed by: rmacklem MFC after: 1 week Modified: head/sys/fs/nfs/nfs_commonkrpc.c head/sys/nfsclient/nfs_krpc.c Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Tue Jan 15 22:08:03 2013 (r245475) +++ head/sys/fs/nfs/nfs_commonkrpc.c Tue Jan 15 22:08:17 2013 (r245476) @@ -767,12 +767,18 @@ tryagain: if (stat == RPC_SUCCESS) { error = 0; } else if (stat == RPC_TIMEDOUT) { + NFSINCRGLOBAL(newnfsstats.rpctimeouts); error = ETIMEDOUT; } else if (stat == RPC_VERSMISMATCH) { + NFSINCRGLOBAL(newnfsstats.rpcinvalid); error = EOPNOTSUPP; } else if (stat == RPC_PROGVERSMISMATCH) { + NFSINCRGLOBAL(newnfsstats.rpcinvalid); error = EPROTONOSUPPORT; + } else if (stat == RPC_INTR) { + error = EINTR; } else { + NFSINCRGLOBAL(newnfsstats.rpcinvalid); error = EACCES; } if (error) { Modified: head/sys/nfsclient/nfs_krpc.c ============================================================================== --- head/sys/nfsclient/nfs_krpc.c Tue Jan 15 22:08:03 2013 (r245475) +++ head/sys/nfsclient/nfs_krpc.c Tue Jan 15 22:08:17 2013 (r245476) @@ -549,14 +549,21 @@ tryagain: */ if (stat == RPC_SUCCESS) error = 0; - else if (stat == RPC_TIMEDOUT) + else if (stat == RPC_TIMEDOUT) { + nfsstats.rpctimeouts++; error = ETIMEDOUT; - else if (stat == RPC_VERSMISMATCH) + } else if (stat == RPC_VERSMISMATCH) { + nfsstats.rpcinvalid++; error = EOPNOTSUPP; - else if (stat == RPC_PROGVERSMISMATCH) + } else if (stat == RPC_PROGVERSMISMATCH) { + nfsstats.rpcinvalid++; error = EPROTONOSUPPORT; - else + } else if (stat == RPC_INTR) { + error = EINTR; + } else { + nfsstats.rpcinvalid++; error = EACCES; + } if (error) goto nfsmout; @@ -572,6 +579,7 @@ tryagain: if (error == ENOMEM) { m_freem(mrep); AUTH_DESTROY(auth); + nfsstats.rpcinvalid++; return (error); } From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 22:09:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EDA0C468; Tue, 15 Jan 2013 22:09:11 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DC645BE6; Tue, 15 Jan 2013 22:09:11 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0FM9BOb059999; Tue, 15 Jan 2013 22:09:11 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0FM9B7s059998; Tue, 15 Jan 2013 22:09:11 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201301152209.r0FM9B7s059998@svn.freebsd.org> From: Olivier Houchard Date: Tue, 15 Jan 2013 22:09:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245477 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 22:09:12 -0000 Author: cognet Date: Tue Jan 15 22:09:11 2013 New Revision: 245477 URL: http://svnweb.freebsd.org/changeset/base/245477 Log: Only spin on the blocked_lock for SCHED_ULE+SMP, as it's done on the other arches. Modified: head/sys/arm/arm/swtch.S Modified: head/sys/arm/arm/swtch.S ============================================================================== --- head/sys/arm/arm/swtch.S Tue Jan 15 22:08:17 2013 (r245476) +++ head/sys/arm/arm/swtch.S Tue Jan 15 22:09:11 2013 (r245477) @@ -79,6 +79,7 @@ */ #include "assym.s" +#include "opt_sched.h" #include #include @@ -428,6 +429,7 @@ ENTRY(cpu_switch) /* Release the old thread */ str r6, [r4, #TD_LOCK] +#if defined(SCHED_ULE) && defined(SMP) ldr r6, .Lblocked_lock GET_CURTHREAD_PTR(r3) @@ -435,6 +437,7 @@ ENTRY(cpu_switch) ldr r4, [r3, #TD_LOCK] cmp r4, r6 beq 1b +#endif /* XXXSCW: Safe to re-enable FIQs here */ From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 22:11:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 18398619; Tue, 15 Jan 2013 22:11:29 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 00235C0F; Tue, 15 Jan 2013 22:11:28 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0FMBSYI062229; Tue, 15 Jan 2013 22:11:28 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0FMBSf8062228; Tue, 15 Jan 2013 22:11:28 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201301152211.r0FMBSf8062228@svn.freebsd.org> From: Olivier Houchard Date: Tue, 15 Jan 2013 22:11:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245478 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Jan 2013 22:11:29 -0000 Author: cognet Date: Tue Jan 15 22:11:28 2013 New Revision: 245478 URL: http://svnweb.freebsd.org/changeset/base/245478 Log: Use armv7_drain_writebuf() and armv7_context_switch, instead of the arm11 variants. Modified: head/sys/arm/arm/cpufunc.c Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Tue Jan 15 22:09:11 2013 (r245477) +++ head/sys/arm/arm/cpufunc.c Tue Jan 15 22:11:28 2013 (r245478) @@ -1146,7 +1146,7 @@ struct cpu_functions cortexa_cpufuncs = /* Other functions */ cpufunc_nullop, /* flush_prefetchbuf */ - arm11_drain_writebuf, /* drain_writebuf */ + armv7_drain_writebuf, /* drain_writebuf */ cpufunc_nullop, /* flush_brnchtgt_C */ (void *)cpufunc_nullop, /* flush_brnchtgt_E */ @@ -1157,7 +1157,7 @@ struct cpu_functions cortexa_cpufuncs = cpufunc_null_fixup, /* dataabt_fixup */ cpufunc_null_fixup, /* prefetchabt_fixup */ - arm11_context_switch, /* context_switch */ + armv7_context_switch, /* context_switch */ cortexa_setup /* cpu setup */ }; From owner-svn-src-head@FreeBSD.ORG Tue Jan 15 23:34:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5F47A4A6; Tue, 15 Jan 2013 23:34:25 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 46C352A5; Tue, 15 Jan 2013 23:34:25 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0FNYPWf086432; Tue, 15 Jan 2013 23:34:25 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0FNYPtf086431; Tue, 15 Jan 2013 23:34:25 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201301152334.r0FNYPtf086431@svn.freebsd.org> From: Steven Hartland Date: Tue, 15 Jan 2013 23:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245479 - head/cddl/contrib/opensolaris/lib/libzfs/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.14 Precedence: list List-Id: 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, 15 Jan 2013 23:34:25 -0000 Author: smh Date: Tue Jan 15 23:34:24 2013 New Revision: 245479 URL: http://svnweb.freebsd.org/changeset/base/245479 Log: Reports pools which have a removed l2cache disk under -x as this is what happens when a cache device is dropped for any reason. Reviewed by: pjd Approved by: pjd (mentor) MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Tue Jan 15 22:11:28 2013 (r245478) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Tue Jan 15 23:34:24 2013 (r245479) @@ -150,6 +150,16 @@ find_vdev_problem(nvlist_t *vdev, int (* return (B_TRUE); } + /* + * Check any L2 cache devs + */ + if (nvlist_lookup_nvlist_array(vdev, ZPOOL_CONFIG_L2CACHE, &child, + &children) == 0) { + for (c = 0; c < children; c++) + if (find_vdev_problem(child[c], func)) + return (B_TRUE); + } + return (B_FALSE); } From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 01:22:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 270F4E0F; Wed, 16 Jan 2013 01:22:28 +0000 (UTC) (envelope-from ganbold@gmail.com) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by mx1.freebsd.org (Postfix) with ESMTP id C2B39B5B; Wed, 16 Jan 2013 01:22:27 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so1471665ieb.39 for ; Tue, 15 Jan 2013 17:22:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ZQsGLsbaJMPl0tl+aFHYTmH2oeH8wzeM6XqHYVTAtro=; b=YALYiorRwVnxws/zY9dqCAkOEkmwTQI58fCwy2D9t7Wfs6zjT4606bqNZYIEjbuIzj T09RD33qqOu+PEH/tz9ucqZsH4lyBSBPI2nQK0NJdthYuoa1VLsGjIoyBZcnRiv5ND1T ilfZ7gLbvNFDbtQa+0PkuZ1Ti+WjO5EZDZ7ltZavdjhK6xQAyEnUvqxVvmOBkAEYT+Tg nu1H0Z/hbjTdacKbuDtArVBg+LtM62u5PnH1ijZIPAGxiFDYZw0tWj+fiQ8hjB3dDzcI MoBYEwkpuqFPFIDdywJcqeDUceKsr5x0auDsqm0Kyy00NXlzYVUex+GPoat6BC0j2IOS 2Q6A== MIME-Version: 1.0 Received: by 10.43.114.4 with SMTP id ey4mr94747icc.27.1358299347026; Tue, 15 Jan 2013 17:22:27 -0800 (PST) Received: by 10.64.170.167 with HTTP; Tue, 15 Jan 2013 17:22:26 -0800 (PST) In-Reply-To: <20130115162116.GI20538@FreeBSD.org> References: <201301150826.r0F8QGJr044600@svn.freebsd.org> <20130115162116.GI20538@FreeBSD.org> Date: Wed, 16 Jan 2013 09:22:26 +0800 Message-ID: Subject: Re: svn commit: r245450 - in head/sys: arm/allwinner arm/conf boot/fdt/dts From: Ganbold Tsagaankhuu To: "Wojciech A. Koszek" Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, Ganbold Tsagaankhuu , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 16 Jan 2013 01:22:28 -0000 On Wed, Jan 16, 2013 at 12:21 AM, Wojciech A. Koszek wrote: > On Tue, Jan 15, 2013 at 08:26:16AM +0000, Ganbold Tsagaankhuu wrote: >> Author: ganbold (doc committer) >> Date: Tue Jan 15 08:26:16 2013 >> New Revision: 245450 >> URL: http://svnweb.freebsd.org/changeset/base/245450 >> >> Log: >> Initial support for Allwinner A10 SoC (Cubieboard) >> Add simple console driver >> Add interrupt handling and timer codes >> Add kernel config file >> Add dts file >> Approved by: gonzo > > Ganbold, > > Thanks for this commit. Comments below. > >> >> Added: head/sys/arm/allwinner/a10_machdep.c >> ============================================================================== >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/sys/arm/allwinner/a10_machdep.c Tue Jan 15 08:26:16 2013 (r245450) >> @@ -0,0 +1,122 @@ >> +/*- >> + * Copyright (c) 2012 Ganbold Tsagaankhuu. > > Dot '.' after name isn't necessary. > > I'd really appreciate having PDF filename of the documentation from which > the code was derived in the comments, e.g.: > > "This file is derived from X.PDF, ver1.0, date 2012/Y/Z" > >> + * >> + * from: FreeBSD: //depot/projects/arm/src/sys/arm/ti/ti_machdep.c >> + */ >> + > > [..] > >> +int >> +platform_devmap_init(void) >> +{ >> + int i = 0; >> + >> + fdt_devmap[i].pd_va = 0xE1C00000; >> + fdt_devmap[i].pd_pa = 0x01C00000; >> + fdt_devmap[i].pd_size = 0x00400000; /* 4 MB */ > > Do you think you could comment on what these mean (or pages in the PDF where > can I find them) next to these variables? > >> >> Added: head/sys/arm/allwinner/console.c >> ============================================================================== >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/sys/arm/allwinner/console.c Tue Jan 15 08:26:16 2013 (r245450) >> @@ -0,0 +1,146 @@ > [..] >> +#ifndef A10_UART_BASE >> +#define A10_UART_BASE 0xe1c28000 /* UART0 */ >> +#endif >> + >> +int reg_shift = 2; > > Could you make it static and move it below defines? > >> +#define UART_DLL 0 /* Out: Divisor Latch Low */ >> +#define UART_DLM 1 /* Out: Divisor Latch High */ >> +#define UART_FCR 2 /* Out: FIFO Control Register */ >> +#define UART_LCR 3 /* Out: Line Control Register */ >> +#define UART_MCR 4 /* Out: Modem Control Register */ >> +#define UART_LSR 5 /* In: Line Status Register */ >> +#define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */ >> +#define UART_LSR_DR 0x01 /* Receiver data ready */ >> +#define UART_MSR 6 /* In: Modem Status Register */ >> +#define UART_SCR 7 /* I/O: Scratch Register */ >> + >> + >> +/* >> + * uart related funcs >> + */ >> +static u_int32_t >> +uart_getreg(u_int32_t *bas) >> +{ >> + return *((volatile u_int32_t *)(bas)) & 0xff; >> +} >> + >> +static void >> +uart_setreg(u_int32_t *bas, u_int32_t val) >> +{ >> + *((volatile u_int32_t *)(bas)) = (u_int32_t)val; >> +} >> + >> +static int >> +ub_getc(void) >> +{ >> + while ((uart_getreg((u_int32_t *)(A10_UART_BASE + >> + (UART_LSR << reg_shift))) & UART_LSR_DR) == 0); >> + __asm __volatile("nop"); >> + >> + return (uart_getreg((u_int32_t *)A10_UART_BASE) & 0xff); >> +} >> + >> +static void >> +ub_putc(unsigned char c) >> +{ >> + if (c == '\n') >> + ub_putc('\r'); >> + >> + while ((uart_getreg((u_int32_t *)(A10_UART_BASE + >> + (UART_LSR << reg_shift))) & UART_LSR_THRE) == 0) >> + __asm __volatile("nop"); >> + >> + uart_setreg((u_int32_t *)A10_UART_BASE, c); >> +} > > Why aren't bus_* methods used here for accessing memory? This is just initial support of the SoC so eventually I hope it will be improved. sorry for the noise and thanks for the comments, Ganbold > >> +# >> +# >> +options PHYSADDR=0x40000000 >> + >> +makeoptions KERNPHYSADDR=0x40200000 > > Two tabs? > >> +options KERNPHYSADDR=0x40200000 >> +makeoptions KERNVIRTADDR=0xc0200000 >> +options KERNVIRTADDR=0xc0200000 >> + >> +options STARTUP_PAGETABLE_ADDR=0x48000000 >> + >> +files "../allwinner/files.a10" > > > >> *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > > -- > Wojciech A. Koszek > wkoszek@FreeBSD.czest.pl > http://FreeBSD.czest.pl/~wkoszek/ From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 01:30:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B2B27140; Wed, 16 Jan 2013 01:30:47 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A58D7C1A; Wed, 16 Jan 2013 01:30:47 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0G1UlYx022564; Wed, 16 Jan 2013 01:30:47 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0G1UlEp022562; Wed, 16 Jan 2013 01:30:47 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201301160130.r0G1UlEp022562@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 16 Jan 2013 01:30:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245485 - head/sys/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.14 Precedence: list List-Id: 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, 16 Jan 2013 01:30:47 -0000 Author: yongari Date: Wed Jan 16 01:30:46 2013 New Revision: 245485 URL: http://svnweb.freebsd.org/changeset/base/245485 Log: Add D-Link DFE-520TX rev C1. Tested by: Ruslan Makhmatkhanov < cvs-src <> yandex dot ru > MFC After: 1 week Modified: head/sys/pci/if_rl.c head/sys/pci/if_rlreg.h Modified: head/sys/pci/if_rl.c ============================================================================== --- head/sys/pci/if_rl.c Wed Jan 16 00:54:51 2013 (r245484) +++ head/sys/pci/if_rl.c Wed Jan 16 01:30:46 2013 (r245485) @@ -148,6 +148,8 @@ static const struct rl_type rl_devs[] = "Delta Electronics 8139 10/100BaseTX" }, { ADDTRON_VENDORID, ADDTRON_DEVICEID_8139, RL_8139, "Addtron Technology 8139 10/100BaseTX" }, + { DLINK_VENDORID, DLINK_DEVICEID_520TX_REVC1, RL_8139, + "D-Link DFE-520TX (rev. C1) 10/100BaseTX" }, { DLINK_VENDORID, DLINK_DEVICEID_530TXPLUS, RL_8139, "D-Link DFE-530TX+ 10/100BaseTX" }, { DLINK_VENDORID, DLINK_DEVICEID_690TXD, RL_8139, Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Wed Jan 16 00:54:51 2013 (r245484) +++ head/sys/pci/if_rlreg.h Wed Jan 16 01:30:46 2013 (r245485) @@ -1048,6 +1048,11 @@ struct rl_softc { #define DLINK_DEVICEID_530TXPLUS 0x1300 /* + * D-Link DFE-520TX rev. C1 device ID + */ +#define DLINK_DEVICEID_520TX_REVC1 0x4200 + +/* * D-Link DFE-5280T device ID */ #define DLINK_DEVICEID_528T 0x4300 From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 01:51:44 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 25EBB5E0; Wed, 16 Jan 2013 01:51:44 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id E60EFD6E; Wed, 16 Jan 2013 01:51:43 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.5/8.14.5) with ESMTP id r0G1pfPm064517; Tue, 15 Jan 2013 18:51:41 -0700 (MST) (envelope-from freebsd@damnhippie.dyndns.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r0G1pd3D004149; Tue, 15 Jan 2013 18:51:39 -0700 (MST) (envelope-from freebsd@damnhippie.dyndns.org) Subject: Re: svn commit: r245450 - in head/sys: arm/allwinner arm/conf boot/fdt/dts From: Ian Lepore To: Ganbold Tsagaankhuu In-Reply-To: References: <201301150826.r0F8QGJr044600@svn.freebsd.org> <20130115162116.GI20538@FreeBSD.org> Content-Type: text/plain; charset="us-ascii" Date: Tue, 15 Jan 2013 18:51:38 -0700 Message-ID: <1358301098.32417.138.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, Ganbold Tsagaankhuu , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, "Wojciech A. Koszek" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 16 Jan 2013 01:51:44 -0000 On Wed, 2013-01-16 at 09:22 +0800, Ganbold Tsagaankhuu wrote: > On Wed, Jan 16, 2013 at 12:21 AM, Wojciech A. Koszek > wrote: > > On Tue, Jan 15, 2013 at 08:26:16AM +0000, Ganbold Tsagaankhuu wrote: > >> Author: ganbold (doc committer) > >> Date: Tue Jan 15 08:26:16 2013 > >> New Revision: 245450 > >> URL: http://svnweb.freebsd.org/changeset/base/245450 > >> > >> Log: > >> Initial support for Allwinner A10 SoC (Cubieboard) > >> Add simple console driver > >> Add interrupt handling and timer codes > >> Add kernel config file > >> Add dts file > >> Approved by: gonzo > > > > Ganbold, > > > > Thanks for this commit. Comments below. > > > >> > >> Added: head/sys/arm/allwinner/a10_machdep.c > >> ============================================================================== > >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) > >> +++ head/sys/arm/allwinner/a10_machdep.c Tue Jan 15 08:26:16 2013 (r245450) > >> @@ -0,0 +1,122 @@ > >> +/*- > >> + * Copyright (c) 2012 Ganbold Tsagaankhuu. > > > > Dot '.' after name isn't necessary. > > > > I'd really appreciate having PDF filename of the documentation from which > > the code was derived in the comments, e.g.: > > > > "This file is derived from X.PDF, ver1.0, date 2012/Y/Z" > > > >> + * > >> + * from: FreeBSD: //depot/projects/arm/src/sys/arm/ti/ti_machdep.c > >> + */ > >> + > > > > [..] > > > >> +int > >> +platform_devmap_init(void) > >> +{ > >> + int i = 0; > >> + > >> + fdt_devmap[i].pd_va = 0xE1C00000; > >> + fdt_devmap[i].pd_pa = 0x01C00000; > >> + fdt_devmap[i].pd_size = 0x00400000; /* 4 MB */ > > > > Do you think you could comment on what these mean (or pages in the PDF where > > can I find them) next to these variables? > > > >> > >> Added: head/sys/arm/allwinner/console.c > >> ============================================================================== > >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) > >> +++ head/sys/arm/allwinner/console.c Tue Jan 15 08:26:16 2013 (r245450) > >> @@ -0,0 +1,146 @@ > > [..] > >> +#ifndef A10_UART_BASE > >> +#define A10_UART_BASE 0xe1c28000 /* UART0 */ > >> +#endif > >> + > >> +int reg_shift = 2; > > > > Could you make it static and move it below defines? > > > >> +#define UART_DLL 0 /* Out: Divisor Latch Low */ > >> +#define UART_DLM 1 /* Out: Divisor Latch High */ > >> +#define UART_FCR 2 /* Out: FIFO Control Register */ > >> +#define UART_LCR 3 /* Out: Line Control Register */ > >> +#define UART_MCR 4 /* Out: Modem Control Register */ > >> +#define UART_LSR 5 /* In: Line Status Register */ > >> +#define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */ > >> +#define UART_LSR_DR 0x01 /* Receiver data ready */ > >> +#define UART_MSR 6 /* In: Modem Status Register */ > >> +#define UART_SCR 7 /* I/O: Scratch Register */ > >> + > >> + > >> +/* > >> + * uart related funcs > >> + */ > >> +static u_int32_t > >> +uart_getreg(u_int32_t *bas) > >> +{ > >> + return *((volatile u_int32_t *)(bas)) & 0xff; > >> +} > >> + > >> +static void > >> +uart_setreg(u_int32_t *bas, u_int32_t val) > >> +{ > >> + *((volatile u_int32_t *)(bas)) = (u_int32_t)val; > >> +} > >> + > >> +static int > >> +ub_getc(void) > >> +{ > >> + while ((uart_getreg((u_int32_t *)(A10_UART_BASE + > >> + (UART_LSR << reg_shift))) & UART_LSR_DR) == 0); > >> + __asm __volatile("nop"); > >> + > >> + return (uart_getreg((u_int32_t *)A10_UART_BASE) & 0xff); > >> +} > >> + > >> +static void > >> +ub_putc(unsigned char c) > >> +{ > >> + if (c == '\n') > >> + ub_putc('\r'); > >> + > >> + while ((uart_getreg((u_int32_t *)(A10_UART_BASE + > >> + (UART_LSR << reg_shift))) & UART_LSR_THRE) == 0) > >> + __asm __volatile("nop"); > >> + > >> + uart_setreg((u_int32_t *)A10_UART_BASE, c); > >> +} > > > > Why aren't bus_* methods used here for accessing memory? > > This is just initial support of the SoC so eventually I hope it will > be improved. > > sorry for the noise and thanks for the comments, > > Ganbold > Actually these are console uart routines, which have to work before the bus_space system is available, hence the direct hardware access. -- Ian > > > >> +# > >> +# > >> +options PHYSADDR=0x40000000 > >> + > >> +makeoptions KERNPHYSADDR=0x40200000 > > > > Two tabs? > > > >> +options KERNPHYSADDR=0x40200000 > >> +makeoptions KERNVIRTADDR=0xc0200000 > >> +options KERNVIRTADDR=0xc0200000 > >> + > >> +options STARTUP_PAGETABLE_ADDR=0x48000000 > >> + > >> +files "../allwinner/files.a10" > > > > > > > >> *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > > > > -- > > Wojciech A. Koszek > > wkoszek@FreeBSD.czest.pl > > http://FreeBSD.czest.pl/~wkoszek/ From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 02:22:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AD4B3C6E; Wed, 16 Jan 2013 02:22:56 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9E5DCE8F; Wed, 16 Jan 2013 02:22:56 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0G2MuST038102; Wed, 16 Jan 2013 02:22:56 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0G2Mu9p038101; Wed, 16 Jan 2013 02:22:56 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201301160222.r0G2Mu9p038101@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 16 Jan 2013 02:22:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245487 - 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.14 Precedence: list List-Id: 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, 16 Jan 2013 02:22:56 -0000 Author: yongari Date: Wed Jan 16 02:22:56 2013 New Revision: 245487 URL: http://svnweb.freebsd.org/changeset/base/245487 Log: Add D-Link DFE-520TX (rev. C1) to HARDWARE section. MFC After: 1 week Modified: head/share/man/man4/rl.4 Modified: head/share/man/man4/rl.4 ============================================================================== --- head/share/man/man4/rl.4 Wed Jan 16 01:49:07 2013 (r245486) +++ head/share/man/man4/rl.4 Wed Jan 16 02:22:56 2013 (r245487) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 22, 2010 +.Dd January 16, 2013 .Dt RL 4 .Os .Sh NAME @@ -155,6 +155,8 @@ Corega FEther CB-TXD .It Corega FEtherII CB-TXD .It +D-Link DFE-520TX (rev. C1) +.It D-Link DFE-528TX .It D-Link DFE-530TX+ From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 05:00:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 452E9F8E; Wed, 16 Jan 2013 05:00:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2C8AF7EF; Wed, 16 Jan 2013 05:00:52 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0G50qPn086484; Wed, 16 Jan 2013 05:00:52 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0G50pWE086481; Wed, 16 Jan 2013 05:00:51 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201301160500.r0G50pWE086481@svn.freebsd.org> From: Eitan Adler Date: Wed, 16 Jan 2013 05:00:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245491 - head/usr.sbin/cpucontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 16 Jan 2013 05:00:52 -0000 Author: eadler Date: Wed Jan 16 05:00:51 2013 New Revision: 245491 URL: http://svnweb.freebsd.org/changeset/base/245491 Log: Avoid clobbering errno with a call to fprintf PR: bin/173923 Submitted by: Garrett Cooper Approved by: cperciva MFC After: 3 days Modified: head/usr.sbin/cpucontrol/intel.c head/usr.sbin/cpucontrol/via.c Modified: head/usr.sbin/cpucontrol/intel.c ============================================================================== --- head/usr.sbin/cpucontrol/intel.c Wed Jan 16 04:45:45 2013 (r245490) +++ head/usr.sbin/cpucontrol/intel.c Wed Jan 16 05:00:51 2013 (r245491) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -266,7 +267,9 @@ matched: args.size = data_size; error = ioctl(devfd, CPUCTL_UPDATE, &args); if (error < 0) { + error = errno; fprintf(stderr, "failed.\n"); + errno = error; WARN(0, "ioctl()"); goto fail; } Modified: head/usr.sbin/cpucontrol/via.c ============================================================================== --- head/usr.sbin/cpucontrol/via.c Wed Jan 16 04:45:45 2013 (r245490) +++ head/usr.sbin/cpucontrol/via.c Wed Jan 16 05:00:51 2013 (r245491) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -203,7 +204,9 @@ via_update(const char *dev, const char * args.size = data_size; error = ioctl(devfd, CPUCTL_UPDATE, &args); if (error < 0) { + error = errno; fprintf(stderr, "failed.\n"); + errno = error; WARN(0, "ioctl()"); goto fail; } From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 05:03:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 80FFD1B5; Wed, 16 Jan 2013 05:03:47 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6FB5880A; Wed, 16 Jan 2013 05:03:47 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0G53lUI087076; Wed, 16 Jan 2013 05:03:47 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0G53lFL087075; Wed, 16 Jan 2013 05:03:47 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201301160503.r0G53lFL087075@svn.freebsd.org> From: Eitan Adler Date: Wed, 16 Jan 2013 05:03:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245492 - head/sbin/setkey X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 16 Jan 2013 05:03:47 -0000 Author: eadler Date: Wed Jan 16 05:03:46 2013 New Revision: 245492 URL: http://svnweb.freebsd.org/changeset/base/245492 Log: Correct prefix for "locally installed things" Approved by: cperciva MFC After: 3 days Modified: head/sbin/setkey/Makefile Modified: head/sbin/setkey/Makefile ============================================================================== --- head/sbin/setkey/Makefile Wed Jan 16 05:00:51 2013 (r245491) +++ head/sbin/setkey/Makefile Wed Jan 16 05:03:46 2013 (r245492) @@ -61,7 +61,7 @@ CLEANFILES+= scriptdump y.tab.h #SCRIPTS= scriptdump -LOCALPREFIX= /usr +LOCALPREFIX= /usr/local scriptdump: scriptdump.pl sed -e 's#@LOCALPREFIX@#${LOCALPREFIX}#' < $> > scriptdump From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 05:03:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 76E851B6; Wed, 16 Jan 2013 05:03:50 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5F9BC80C; Wed, 16 Jan 2013 05:03:50 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0G53oFK087118; Wed, 16 Jan 2013 05:03:50 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0G53oNB087117; Wed, 16 Jan 2013 05:03:50 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201301160503.r0G53oNB087117@svn.freebsd.org> From: Eitan Adler Date: Wed, 16 Jan 2013 05:03:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245493 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 16 Jan 2013 05:03:50 -0000 Author: eadler Date: Wed Jan 16 05:03:49 2013 New Revision: 245493 URL: http://svnweb.freebsd.org/changeset/base/245493 Log: Remove unused variables Approved by: cperciva MFC After: 3 days Modified: head/usr.sbin/pw/pw_log.c Modified: head/usr.sbin/pw/pw_log.c ============================================================================== --- head/usr.sbin/pw/pw_log.c Wed Jan 16 05:03:46 2013 (r245492) +++ head/usr.sbin/pw/pw_log.c Wed Jan 16 05:03:49 2013 (r245493) @@ -47,7 +47,6 @@ pw_log(struct userconf * cnf, int mode, } if (logfile != NULL) { va_list argp; - int l; time_t now = time(NULL); struct tm *t = localtime(&now); char nfmt[256]; @@ -57,7 +56,6 @@ pw_log(struct userconf * cnf, int mode, name = "unknown"; /* ISO 8601 International Standard Date format */ strftime(nfmt, sizeof nfmt, "%Y-%m-%d %T ", t); - l = strlen(nfmt); sprintf(nfmt + strlen(nfmt), "[%s:%s%s] %s\n", name, Which[which], Modes[mode], fmt); va_start(argp, fmt); vfprintf(logfile, nfmt, argp); From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 05:03:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E493C1B7; Wed, 16 Jan 2013 05:03:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D7ECD80D; Wed, 16 Jan 2013 05:03:52 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0G53q5X087156; Wed, 16 Jan 2013 05:03:52 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0G53qie087155; Wed, 16 Jan 2013 05:03:52 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201301160503.r0G53qie087155@svn.freebsd.org> From: Eitan Adler Date: Wed, 16 Jan 2013 05:03:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245494 - head/bin/pwait X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 16 Jan 2013 05:03:53 -0000 Author: eadler Date: Wed Jan 16 05:03:52 2013 New Revision: 245494 URL: http://svnweb.freebsd.org/changeset/base/245494 Log: Free memory before exiting in order to silence a warning from the clang static analyzer Approved by: cperciva MFC after: 3 days Modified: head/bin/pwait/pwait.c Modified: head/bin/pwait/pwait.c ============================================================================== --- head/bin/pwait/pwait.c Wed Jan 16 05:03:49 2013 (r245493) +++ head/bin/pwait/pwait.c Wed Jan 16 05:03:52 2013 (r245494) @@ -141,5 +141,6 @@ main(int argc, char *argv[]) nleft -= n; } + free(e); return 0; } From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 05:32:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4E1C6B18; Wed, 16 Jan 2013 05:32:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3FBE6918; Wed, 16 Jan 2013 05:32:50 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0G5WnPs096026; Wed, 16 Jan 2013 05:32:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0G5Wn7k096025; Wed, 16 Jan 2013 05:32:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301160532.r0G5Wn7k096025@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 16 Jan 2013 05:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245495 - head/sys/fs/nullfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 16 Jan 2013 05:32:50 -0000 Author: kib Date: Wed Jan 16 05:32:49 2013 New Revision: 245495 URL: http://svnweb.freebsd.org/changeset/base/245495 Log: Remove the filtering of the acceptable mount options for nullfs, added in r245004. Although the report was for noatime option which is non-functional for the nullfs, other standard options like nosuid or noexec are useful with it. Reported by: Dewayne Geraghty MFC after: 3 days Modified: head/sys/fs/nullfs/null_vfsops.c Modified: head/sys/fs/nullfs/null_vfsops.c ============================================================================== --- head/sys/fs/nullfs/null_vfsops.c Wed Jan 16 05:03:52 2013 (r245494) +++ head/sys/fs/nullfs/null_vfsops.c Wed Jan 16 05:32:49 2013 (r245495) @@ -67,15 +67,6 @@ static vfs_vget_t nullfs_vget; static vfs_extattrctl_t nullfs_extattrctl; static vfs_reclaim_lowervp_t nullfs_reclaim_lowervp; -/* Mount options that we support. */ -static const char *nullfs_opts[] = { - "cache", - "export", - "from", - "target", - NULL -}; - /* * Mount null layer */ @@ -97,8 +88,6 @@ nullfs_mount(struct mount *mp) return (EPERM); if (mp->mnt_flag & MNT_ROOTFS) return (EOPNOTSUPP); - if (vfs_filteropt(mp->mnt_optnew, nullfs_opts)) - return (EINVAL); /* * Update is a no-op From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 06:43:19 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D2E35C63; Wed, 16 Jan 2013 06:43:19 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 71F7ACD7; Wed, 16 Jan 2013 06:43:18 +0000 (UTC) Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r0G6h98N031494 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Jan 2013 17:43:10 +1100 Date: Wed, 16 Jan 2013 17:43:09 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Wojciech A. Koszek" Subject: Re: svn commit: r245450 - in head/sys: arm/allwinner arm/conf boot/fdt/dts In-Reply-To: <20130115162116.GI20538@FreeBSD.org> Message-ID: <20130116170419.G1725@besplex.bde.org> References: <201301150826.r0F8QGJr044600@svn.freebsd.org> <20130115162116.GI20538@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.0 cv=R7tbgqtX c=1 sm=1 a=T_vc9_tLY8QA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=0w7YBWHZSsMA:10 a=rSZ73qvps9zlUWiUUE0A:9 a=CjuIK1q_8ugA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: svn-src-head@FreeBSD.org, Ganbold Tsagaankhuu , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 16 Jan 2013 06:43:19 -0000 On Tue, 15 Jan 2013, Wojciech A. Koszek wrote: > On Tue, Jan 15, 2013 at 08:26:16AM +0000, Ganbold Tsagaankhuu wrote: >> ... >> Added: head/sys/arm/allwinner/console.c >> ============================================================================== >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/sys/arm/allwinner/console.c Tue Jan 15 08:26:16 2013 (r245450) >> @@ -0,0 +1,146 @@ > [..] >> +#ifndef A10_UART_BASE >> +#define A10_UART_BASE 0xe1c28000 /* UART0 */ >> +#endif >> + >> +int reg_shift = 2; > > Could you make it static and move it below defines? > >> +#define UART_DLL 0 /* Out: Divisor Latch Low */ >> +#define UART_DLM 1 /* Out: Divisor Latch High */ >> +#define UART_FCR 2 /* Out: FIFO Control Register */ >> +#define UART_LCR 3 /* Out: Line Control Register */ >> +#define UART_MCR 4 /* Out: Modem Control Register */ >> +#define UART_LSR 5 /* In: Line Status Register */ >> +#define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */ >> +#define UART_LSR_DR 0x01 /* Receiver data ready */ >> +#define UART_MSR 6 /* In: Modem Status Register */ >> +#define UART_SCR 7 /* I/O: Scratch Register */ These are ordinary 16450 values which are defined in . This is misformatted with a space instead of a tab after #define. Since it's a 16450, uart(4) can probably handle the entire console driver, with fewer bugs (some locking is required in a general console driver). Of course, it's easier to write a primitive console driver by hacking on the raw registers than to interface with uart. >> + >> + >> +/* >> + * uart related funcs >> + */ Style bugs (extra and missing blank lines, and comment punctuation). >> +static u_int32_t >> +uart_getreg(u_int32_t *bas) >> +{ >> + return *((volatile u_int32_t *)(bas)) & 0xff; >> +} It's better to put the reg_shift complications at the lowest level. reg_shift could probably be const or #defined so that all the calculations with it can be done at runtime. >> + >> +static void >> +uart_setreg(u_int32_t *bas, u_int32_t val) >> +{ >> + *((volatile u_int32_t *)(bas)) = (u_int32_t)val; >> +} Bogus cast. val already has type u_int32_t. u_int32_t should be spelled uint32_t in new code. >> + >> +static int >> +ub_getc(void) >> +{ >> + while ((uart_getreg((u_int32_t *)(A10_UART_BASE + >> + (UART_LSR << reg_shift))) & UART_LSR_DR) == 0); >> + __asm __volatile("nop"); >> + >> + return (uart_getreg((u_int32_t *)A10_UART_BASE) & 0xff); >> +} >> + >> +static void >> +ub_putc(unsigned char c) >> +{ >> + if (c == '\n') >> + ub_putc('\r'); The normal console driver does this in upper layers. Is this driver only for a very specialized console driver for use at boot time? I'm not sure if uart(4) works then. >> + >> + while ((uart_getreg((u_int32_t *)(A10_UART_BASE + >> + (UART_LSR << reg_shift))) & UART_LSR_THRE) == 0) >> + __asm __volatile("nop"); >> + >> + uart_setreg((u_int32_t *)A10_UART_BASE, c); >> +} > > Why aren't bus_* methods used here for accessing memory? They don't support reg_shift, but should work otherwise. You do the shifting somewhere and then use bus-space at the level of uart_getreg() above. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 06:49:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AD958E5A; Wed, 16 Jan 2013 06:49:48 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-qa0-f50.google.com (mail-qa0-f50.google.com [209.85.216.50]) by mx1.freebsd.org (Postfix) with ESMTP id 45A93D29; Wed, 16 Jan 2013 06:49:47 +0000 (UTC) Received: by mail-qa0-f50.google.com with SMTP id cr7so909067qab.9 for ; Tue, 15 Jan 2013 22:49:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=kzoNGIDzNKP0BE90ji8Hh9VwV+X0ymv2QSGqJI6WBUw=; b=pC4Ua6IlApoSQ7ShFUGpcFMzOpwp+eEz+8acYwMYvOR22Zt3X9xcuXsQfQ2hmFGQdS +0CwmZJMi2RE8tRcU/TpwSNM+SiSf27XuS09Rsv0E/KItHxVlSeNFcw71FJ00cyt44Vt stNeGl7Zy+iqxgNdO+aAZB8RGyZrlDwUNpethSCOXfvSPg0iUR9lG7eJaOQFBHyIQsTy 5t04kYXOCsg9rxQbUgFjM3Qtkd75FlDEik4qXgoR1uV4IhLlnsfxDoUeHbglTWr9A8Ak Zct33Czb9rEC+ShqauzWkLHruXCA5/CguVGITNSk1jbeHuR3dyYsvoEWUqwfSiVcIDG+ 6Tbg== MIME-Version: 1.0 X-Received: by 10.229.102.79 with SMTP id f15mr25719qco.1.1358318980980; Tue, 15 Jan 2013 22:49:40 -0800 (PST) Received: by 10.49.12.178 with HTTP; Tue, 15 Jan 2013 22:49:40 -0800 (PST) In-Reply-To: <201301160503.r0G53qie087155@svn.freebsd.org> References: <201301160503.r0G53qie087155@svn.freebsd.org> Date: Tue, 15 Jan 2013 22:49:40 -0800 Message-ID: Subject: Re: svn commit: r245494 - head/bin/pwait From: Xin LI To: Eitan Adler Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 16 Jan 2013 06:49:48 -0000 This doesn't seem right -- you should never release memory before exit, especially for memory allocated in main(), unless this "main" is intended for different purpose like a monolithic shell that wants to avoid exec(). Note that pwait(1) have multiple exit points I don't think it's practical. Would you mind if I commit this changeset instead? I have the return -> exit change in my queue long ago but only noticed it today... Index: pwait.c =================================================================== --- pwait.c (revision 245497) +++ pwait.c (working copy) @@ -141,6 +141,5 @@ main(int argc, char *argv[]) nleft -= n; } - free(e); - return 0; + exit(EX_OK); } Cheers, On Tue, Jan 15, 2013 at 9:03 PM, Eitan Adler wrote: > Author: eadler > Date: Wed Jan 16 05:03:52 2013 > New Revision: 245494 > URL: http://svnweb.freebsd.org/changeset/base/245494 > > Log: > Free memory before exiting in order to silence a warning from the clang > static analyzer > > Approved by: cperciva > MFC after: 3 days > > Modified: > head/bin/pwait/pwait.c > > Modified: head/bin/pwait/pwait.c > > ============================================================================== > --- head/bin/pwait/pwait.c Wed Jan 16 05:03:49 2013 (r245493) > +++ head/bin/pwait/pwait.c Wed Jan 16 05:03:52 2013 (r245494) > @@ -141,5 +141,6 @@ main(int argc, char *argv[]) > nleft -= n; > } > > + free(e); > return 0; > } > -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 08:04:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9191F426; Wed, 16 Jan 2013 08:04:56 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 80BFB171; Wed, 16 Jan 2013 08:04:56 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0G84uE9041709; Wed, 16 Jan 2013 08:04:56 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0G84u9m041708; Wed, 16 Jan 2013 08:04:56 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201301160804.r0G84u9m041708@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Wed, 16 Jan 2013 08:04:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245500 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 16 Jan 2013 08:04:56 -0000 Author: ganbold (doc committer) Date: Wed Jan 16 08:04:55 2013 New Revision: 245500 URL: http://svnweb.freebsd.org/changeset/base/245500 Log: Fix style bugs Use defined constant instead of variable for reg_shift Change u_int32_t to uint32_t Approved by: gonzo Suggested by: bde, wkoszek Modified: head/sys/arm/allwinner/console.c Modified: head/sys/arm/allwinner/console.c ============================================================================== --- head/sys/arm/allwinner/console.c Wed Jan 16 07:39:20 2013 (r245499) +++ head/sys/arm/allwinner/console.c Wed Jan 16 08:04:55 2013 (r245500) @@ -40,43 +40,39 @@ __FBSDID("$FreeBSD$"); #define A10_UART_BASE 0xe1c28000 /* UART0 */ #endif -int reg_shift = 2; +#define REG_SHIFT 2 -#define UART_DLL 0 /* Out: Divisor Latch Low */ -#define UART_DLM 1 /* Out: Divisor Latch High */ -#define UART_FCR 2 /* Out: FIFO Control Register */ -#define UART_LCR 3 /* Out: Line Control Register */ -#define UART_MCR 4 /* Out: Modem Control Register */ -#define UART_LSR 5 /* In: Line Status Register */ -#define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */ -#define UART_LSR_DR 0x01 /* Receiver data ready */ -#define UART_MSR 6 /* In: Modem Status Register */ -#define UART_SCR 7 /* I/O: Scratch Register */ +#define UART_DLL 0 /* Out: Divisor Latch Low */ +#define UART_DLM 1 /* Out: Divisor Latch High */ +#define UART_FCR 2 /* Out: FIFO Control Register */ +#define UART_LCR 3 /* Out: Line Control Register */ +#define UART_MCR 4 /* Out: Modem Control Register */ +#define UART_LSR 5 /* In: Line Status Register */ +#define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */ +#define UART_LSR_DR 0x01 /* Receiver data ready */ +#define UART_MSR 6 /* In: Modem Status Register */ +#define UART_SCR 7 /* I/O: Scratch Register */ - -/* - * uart related funcs - */ -static u_int32_t -uart_getreg(u_int32_t *bas) +static uint32_t +uart_getreg(uint32_t *bas) { - return *((volatile u_int32_t *)(bas)) & 0xff; + return *((volatile uint32_t *)(bas)) & 0xff; } static void -uart_setreg(u_int32_t *bas, u_int32_t val) +uart_setreg(uint32_t *bas, uint32_t val) { - *((volatile u_int32_t *)(bas)) = (u_int32_t)val; + *((volatile uint32_t *)(bas)) = val; } static int ub_getc(void) { - while ((uart_getreg((u_int32_t *)(A10_UART_BASE + - (UART_LSR << reg_shift))) & UART_LSR_DR) == 0); + while ((uart_getreg((uint32_t *)(A10_UART_BASE + + (UART_LSR << REG_SHIFT))) & UART_LSR_DR) == 0); __asm __volatile("nop"); - return (uart_getreg((u_int32_t *)A10_UART_BASE) & 0xff); + return (uart_getreg((uint32_t *)A10_UART_BASE) & 0xff); } static void @@ -85,11 +81,11 @@ ub_putc(unsigned char c) if (c == '\n') ub_putc('\r'); - while ((uart_getreg((u_int32_t *)(A10_UART_BASE + - (UART_LSR << reg_shift))) & UART_LSR_THRE) == 0) + while ((uart_getreg((uint32_t *)(A10_UART_BASE + + (UART_LSR << REG_SHIFT))) & UART_LSR_THRE) == 0) __asm __volatile("nop"); - uart_setreg((u_int32_t *)A10_UART_BASE, c); + uart_setreg((uint32_t *)A10_UART_BASE, c); } static cn_probe_t uart_cnprobe; @@ -121,8 +117,8 @@ uart_cnprobe(struct consdev *cp) static void uart_cninit(struct consdev *cp) { - uart_setreg((u_int32_t *)(A10_UART_BASE + - (UART_FCR << reg_shift)), 0x06); + uart_setreg((uint32_t *)(A10_UART_BASE + + (UART_FCR << REG_SHIFT)), 0x06); } void From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 08:22:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F03E5CDC; Wed, 16 Jan 2013 08:22:07 +0000 (UTC) (envelope-from ganbold@gmail.com) Received: from mail-ie0-f182.google.com (mail-ie0-f182.google.com [209.85.223.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8C55525D; Wed, 16 Jan 2013 08:22:07 +0000 (UTC) Received: by mail-ie0-f182.google.com with SMTP id s9so1941148iec.27 for ; Wed, 16 Jan 2013 00:22:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=o6bSh3hbs+tVvlBtmeeMW6KKQjVc/170b7xu670t498=; b=OGkoTlhbOGUTaHxc3ZXyuxaU5gPbu+ohOiVKx8xhGnngN4LQ/GmrGqBYziq8SN5rtG pqNWyRHSJZUgDeKxLyrur/S8wH5O57TlQmAtjKu2JKqupZCaTOhmZVe9qmFrFZhKxFs8 YG5GdzJx2KNLyvI4W9jmXR0WjTupkuZTLgcrzmLlIUKqwzxlvE8hsPYUhjrNLxAGr4yJ pdBJ4V6/SZuDeLEofQzkVAYJwi8UnxiC78q4tav921Fxbon69LD0HW26GgZEC+GvwD0R tmusQcHO7Y6XHpzstP77iExjh4/y5a3RqbJb2o1b8z2vsWip2JtnoM4G9MC3/OdDDok0 kVqg== MIME-Version: 1.0 X-Received: by 10.50.5.133 with SMTP id s5mr212011igs.14.1358324527221; Wed, 16 Jan 2013 00:22:07 -0800 (PST) Received: by 10.64.170.167 with HTTP; Wed, 16 Jan 2013 00:22:07 -0800 (PST) In-Reply-To: <20130116170419.G1725@besplex.bde.org> References: <201301150826.r0F8QGJr044600@svn.freebsd.org> <20130115162116.GI20538@FreeBSD.org> <20130116170419.G1725@besplex.bde.org> Date: Wed, 16 Jan 2013 16:22:07 +0800 Message-ID: Subject: Re: svn commit: r245450 - in head/sys: arm/allwinner arm/conf boot/fdt/dts From: Ganbold Tsagaankhuu To: Bruce Evans Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, Ganbold Tsagaankhuu , svn-src-all@freebsd.org, src-committers@freebsd.org, "Wojciech A. Koszek" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 16 Jan 2013 08:22:08 -0000 On Wed, Jan 16, 2013 at 2:43 PM, Bruce Evans wrote: > On Tue, 15 Jan 2013, Wojciech A. Koszek wrote: > >> On Tue, Jan 15, 2013 at 08:26:16AM +0000, Ganbold Tsagaankhuu wrote: >>> >>> ... >>> >>> Added: head/sys/arm/allwinner/console.c >>> >>> ============================================================================== >>> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >>> +++ head/sys/arm/allwinner/console.c Tue Jan 15 08:26:16 2013 >>> (r245450) >>> @@ -0,0 +1,146 @@ >> >> [..] >>> >>> +#ifndef A10_UART_BASE >>> +#define A10_UART_BASE 0xe1c28000 /* UART0 */ >>> +#endif >>> + >>> +int reg_shift = 2; >> >> >> Could you make it static and move it below defines? >> >>> +#define UART_DLL 0 /* Out: Divisor Latch Low */ >>> +#define UART_DLM 1 /* Out: Divisor Latch High */ >>> +#define UART_FCR 2 /* Out: FIFO Control Register */ >>> +#define UART_LCR 3 /* Out: Line Control Register */ >>> +#define UART_MCR 4 /* Out: Modem Control Register */ >>> +#define UART_LSR 5 /* In: Line Status Register */ >>> +#define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */ >>> +#define UART_LSR_DR 0x01 /* Receiver data ready */ >>> +#define UART_MSR 6 /* In: Modem Status Register */ >>> +#define UART_SCR 7 /* I/O: Scratch Register */ > > > These are ordinary 16450 values which are defined in . > > This is misformatted with a space instead of a tab after #define. > > Since it's a 16450, uart(4) can probably handle the entire console driver, > with fewer bugs (some locking is required in a general console driver). > Of course, it's easier to write a primitive console driver by hacking on > the raw registers than to interface with uart. > > >>> + >>> + >>> +/* >>> + * uart related funcs >>> + */ > > > Style bugs (extra and missing blank lines, and comment punctuation). > > >>> +static u_int32_t >>> +uart_getreg(u_int32_t *bas) >>> +{ >>> + return *((volatile u_int32_t *)(bas)) & 0xff; >>> +} > > > It's better to put the reg_shift complications at the lowest level. > > reg_shift could probably be const or #defined so that all the calculations > with it can be done at runtime. > > >>> + >>> +static void >>> +uart_setreg(u_int32_t *bas, u_int32_t val) >>> +{ >>> + *((volatile u_int32_t *)(bas)) = (u_int32_t)val; >>> +} > > > Bogus cast. val already has type u_int32_t. u_int32_t should be spelled > uint32_t in new code. > > >>> + >>> +static int >>> +ub_getc(void) >>> +{ >>> + while ((uart_getreg((u_int32_t *)(A10_UART_BASE + >>> + (UART_LSR << reg_shift))) & UART_LSR_DR) == 0); >>> + __asm __volatile("nop"); >>> + >>> + return (uart_getreg((u_int32_t *)A10_UART_BASE) & 0xff); >>> +} >>> + >>> +static void >>> +ub_putc(unsigned char c) >>> +{ >>> + if (c == '\n') >>> + ub_putc('\r'); > > > The normal console driver does this in upper layers. Is this driver > only for a very specialized console driver for use at boot time? > I'm not sure if uart(4) works then. Current ns16550 driver doesn't work yet at boot time for A10. Ganbold > > >>> + >>> + while ((uart_getreg((u_int32_t *)(A10_UART_BASE + >>> + (UART_LSR << reg_shift))) & UART_LSR_THRE) == 0) >>> + __asm __volatile("nop"); >>> + >>> + uart_setreg((u_int32_t *)A10_UART_BASE, c); >>> +} >> >> >> Why aren't bus_* methods used here for accessing memory? > > > They don't support reg_shift, but should work otherwise. You do the > shifting somewhere and then use bus-space at the level of uart_getreg() > above. > > Bruce From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 17:48:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3F4CEBC5 for ; Wed, 16 Jan 2013 17:48:24 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com [209.85.215.48]) by mx1.freebsd.org (Postfix) with ESMTP id BDD9BDD5 for ; Wed, 16 Jan 2013 17:48:23 +0000 (UTC) Received: by mail-la0-f48.google.com with SMTP id ej20so1697433lab.7 for ; Wed, 16 Jan 2013 09:48:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=kjEH5x/zIp3U6wOR+d2W8zqX44EDt75L0hz8m9fUcKk=; b=DJAYmILR6wbgQvpH9I/5edSAER/mttcyhGn2TJVA0Yz7dirBlh4xG4yJT+7fBiPHRV WAnGzzN3150aS90VCZwUGcSUyvDrY9QuC5kKA1oLwHAj7peyAzQN47UEAFU64Fv6xVY4 wTtt8rZTgGnJjzLxZp+ylZuJdHLVmuW1sio7A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=kjEH5x/zIp3U6wOR+d2W8zqX44EDt75L0hz8m9fUcKk=; b=DTzh+5QRysEsP28iYiu9ndnMC4VcrXphy8F8ZAO5PjZnhu3i2PIHX8a3vOV1fAKYN+ cZZqZOkoFE1RbOwk6GNnJffw4dMyfZni9TSXOkFuWabFPNTxrxS8rc2IF/hMhJPDPjTm oU7a0nWgaSnoiVDRmRuiWXFDzWRV/xA0f7MIyl/fFjL0tgLir8CSzF7pxSwD8KqhDPUa NTKUG1DkGBJ/+bqQXFYHRHfbAZKXGELg3TWZLjIiEO68hYzbygc/AfxmTBTiu6zgZGeE DKToOG9voFzdZegIBvQWRpGCyKg7EU1FaopMHRPDDjFLYjIp8eWX0L4jNIP1zV87vLKJ x8sg== X-Received: by 10.112.23.34 with SMTP id j2mr983712lbf.118.1358358502201; Wed, 16 Jan 2013 09:48:22 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.30.131 with HTTP; Wed, 16 Jan 2013 09:47:52 -0800 (PST) In-Reply-To: References: <201301160503.r0G53qie087155@svn.freebsd.org> From: Eitan Adler Date: Wed, 16 Jan 2013 12:47:52 -0500 X-Google-Sender-Auth: nZcsX6vBtiXI6dGkt3yM4KjVrpk Message-ID: Subject: Re: svn commit: r245494 - head/bin/pwait To: Xin LI Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQlMDy3WUMO37tRgRQY07FP3d9xRhaeQSxpAo3m8r5ohaKQYFYBPh70vQ626ip2WoKBEbZIA Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 16 Jan 2013 17:48:24 -0000 On 16 January 2013 01:49, Xin LI wrote: > This doesn't seem right -- you should never release memory before exit, > especially for memory allocated in main(), unless this "main" is intended > for different purpose like a monolithic shell that wants to avoid exec(). > Note that pwait(1) have multiple exit points I don't think it's practical. ... There have been multiple conversations about this: on hackers, on the commit lists, and on the clang analyzer lists. I don't care much how the final code looks: with either free or return but please make sure that scan-build finds no warnings. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 18:11:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A3124734; Wed, 16 Jan 2013 18:11:54 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) by mx1.freebsd.org (Postfix) with ESMTP id 37710F68; Wed, 16 Jan 2013 18:11:54 +0000 (UTC) Received: from epsilon.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id 40B0612987; Wed, 16 Jan 2013 10:11:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1358359913; bh=sv6PTpPTMAoIoIqmImR+T76eGxU/hiAGaY/8mf8COhc=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=cJRIAqEzfhuXB4OOQog/aH7rfQ1L+SPQhMqCMaoMA1US8bdZkyAKl0MJNCTwNx0mP od2IRPKN5c3Jox1ty1iu6ib4H1VCBWvhrNyg4hWPKHDbCv19ZySKLtfZX6GTJvyP+I vTBmXD/rPwaaBwAUpcqJYCCZ6OOaKWOOSDdqCVBQ= Message-ID: <50F6ED68.50602@delphij.net> Date: Wed, 16 Jan 2013 10:11:52 -0800 From: Xin Li Organization: The FreeBSD Project MIME-Version: 1.0 To: Eitan Adler Subject: Re: svn commit: r245494 - head/bin/pwait References: <201301160503.r0G53qie087155@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Xin LI X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: d@delphij.net List-Id: 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, 16 Jan 2013 18:11:54 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 01/16/13 09:47, Eitan Adler wrote: > On 16 January 2013 01:49, Xin LI wrote: >> This doesn't seem right -- you should never release memory before >> exit, especially for memory allocated in main(), unless this >> "main" is intended for different purpose like a monolithic shell >> that wants to avoid exec(). Note that pwait(1) have multiple exit >> points I don't think it's practical. > > ... > > There have been multiple conversations about this: on hackers, on > the commit lists, and on the clang analyzer lists. > > I don't care much how the final code looks: with either free or > return but please make sure that scan-build finds no warnings. Yes I did. Using exit(3) tells clang that this is the final exit and thus eliminates the warning. It sounds like a bug (or arguably a feature) that clang does not recognize return in main()s... Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- iQEcBAEBCgAGBQJQ9u1oAAoJEG80Jeu8UPuzNF8IAIuLlVRawKYSgvW0Qqf01Pt3 l6UvBc/6U0LBVTgRUVNVDqlvjyP93pcnMpDGiGqGf/1TbizWhahIayB7NxPQoiqE 8iFRYxhMXJL+pMgckgB3twGOrXkSCCaWhudmNlx9pPXac2dqCFF4PXugVAV1xVVx JfdkCHhSMH+MVhzxkPN4XtZTvH288UiaeWRsCLEzVwylYOvMqslW0WhJYRCpn6ee XXeBBN8D/aYOPehHZ7/UhzatxIUOQMaW509rituOZ6IKF5PAHhPQsXwIRiG85mIb tbppR2Pwm0wg/mOFcr44P/zhdeiR4+JW1Tk65mmleoLsq8aufzT/OjJnVcD6860= =nsUL -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 18:15:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B6E10A34; Wed, 16 Jan 2013 18:15:26 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A983EFB9; Wed, 16 Jan 2013 18:15:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0GIFQDb007554; Wed, 16 Jan 2013 18:15:26 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0GIFQPk007553; Wed, 16 Jan 2013 18:15:26 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201301161815.r0GIFQPk007553@svn.freebsd.org> From: Xin LI Date: Wed, 16 Jan 2013 18:15:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245506 - head/bin/pwait X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 16 Jan 2013 18:15:26 -0000 Author: delphij Date: Wed Jan 16 18:15:25 2013 New Revision: 245506 URL: http://svnweb.freebsd.org/changeset/base/245506 Log: Use a different way to silence clang analyzer as done in r245494 by explicitly telling the compiler that we are on the exit route. X-MFC: together with r245494 Modified: head/bin/pwait/pwait.c Modified: head/bin/pwait/pwait.c ============================================================================== --- head/bin/pwait/pwait.c Wed Jan 16 09:07:49 2013 (r245505) +++ head/bin/pwait/pwait.c Wed Jan 16 18:15:25 2013 (r245506) @@ -141,6 +141,5 @@ main(int argc, char *argv[]) nleft -= n; } - free(e); - return 0; + exit(EX_OK); } From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 18:17:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9A495D8C; Wed, 16 Jan 2013 18:17:37 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-da0-f46.google.com (mail-da0-f46.google.com [209.85.210.46]) by mx1.freebsd.org (Postfix) with ESMTP id 5695AFE2; Wed, 16 Jan 2013 18:17:37 +0000 (UTC) Received: by mail-da0-f46.google.com with SMTP id p5so679556dak.19 for ; Wed, 16 Jan 2013 10:17:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:x-mailer:from:subject:date :to; bh=lvTz44N7Xi/SHCNNs51EzDyIiLnjQ6mSw+IgBVkpIII=; b=W7ZQWlrIzr9ofgE5jmZv4RwrsbbmA71bcEjet3ZZpFMoBXJbOsbHY7KWE2/SU3LmKE RGVsUPN3ycUSWVXMvSp8TLmcWr0ukQfcWDhyGPX63g5KcAEFTB0zJonkTrWCm+tsNdZW WxWbLvx0oi7H8FSf7rjaGj9Cw9OWuQKXVNpopyYWK/YrIe8tTE7AWtgkWg4pwZSN0Sgy RxhRdij2iFAPXMTk/4vL3ElU1Svs95brJEzwAXxsJeoJLsenHYjBY6lHEWb7gKJ4KkSU c0rFjQlO/l4RGCRjFC9m/X63a0XnXsG9qeqAk6sAn3glBW5zkG0rltEN9ludDekpPsB+ 2qQQ== X-Received: by 10.66.88.198 with SMTP id bi6mr5832831pab.54.1358360251540; Wed, 16 Jan 2013 10:17:31 -0800 (PST) Received: from [10.0.14.181] (mobile-166-137-216-036.mycingular.net. [166.137.216.36]) by mx.google.com with ESMTPS id qo10sm11985075pbc.58.2013.01.16.10.17.27 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 16 Jan 2013 10:17:30 -0800 (PST) References: <201301160503.r0G53qie087155@svn.freebsd.org> <50F6ED68.50602@delphij.net> Mime-Version: 1.0 (1.0) In-Reply-To: <50F6ED68.50602@delphij.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <0928E58E-F510-47CD-957F-8C321B1210CC@gmail.com> X-Mailer: iPhone Mail (10A523) From: Garrett Cooper Subject: Re: svn commit: r245494 - head/bin/pwait Date: Wed, 16 Jan 2013 10:17:20 -0800 To: "d@delphij.net" Cc: "svn-src-head@freebsd.org" , Xin LI , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Eitan Adler X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 16 Jan 2013 18:17:37 -0000 On Jan 16, 2013, at 10:11 AM, Xin Li wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 >=20 > On 01/16/13 09:47, Eitan Adler wrote: >> On 16 January 2013 01:49, Xin LI wrote: >>> This doesn't seem right -- you should never release memory before >>> exit, especially for memory allocated in main(), unless this >>> "main" is intended for different purpose like a monolithic shell >>> that wants to avoid exec(). Note that pwait(1) have multiple exit >>> points I don't think it's practical. >>=20 >> ... >>=20 >> There have been multiple conversations about this: on hackers, on >> the commit lists, and on the clang analyzer lists. >>=20 >> I don't care much how the final code looks: with either free or >> return but please make sure that scan-build finds no warnings. >=20 > Yes I did. Using exit(3) tells clang that this is the final exit and > thus eliminates the warning. >=20 > It sounds like a bug (or arguably a feature) that clang does not > recognize return in main()s... I would consider it a bug, but it's better to use exit(3) anyhow as it p= revents bugs from occurring in other OSes (like windows when you use atexit a= nd posix-compliant signal handlers). Thanks, -Garrett= From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 18:41:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F38BF6C7; Wed, 16 Jan 2013 18:41:21 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) by mx1.freebsd.org (Postfix) with ESMTP id C74EF1E9; Wed, 16 Jan 2013 18:41:21 +0000 (UTC) Received: from epsilon.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id 6230D12B12; Wed, 16 Jan 2013 10:41:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1358361681; bh=X5PTNL2A2h+rC9GwDeI3GgcqIIQSEae7sFDKqakWCCA=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=vWA1oG4ghvX6EqylpdOxQ7SwuYne+ci12TC2JoKHnp8+QigjW7dbkpN4MjQltP/di SZNpiOjPNFHShg0NgcMyIr9XC9qJ/PjFvAXtyall3z5528ScGpMXafH8TIszrM2W4T tZkq2zFVCzId6shpbq8RI7TcwFaCQAnIs41H3Pxc= Message-ID: <50F6F450.50102@delphij.net> Date: Wed, 16 Jan 2013 10:41:20 -0800 From: Xin Li Organization: The FreeBSD Project MIME-Version: 1.0 To: Garrett Cooper Subject: Re: svn commit: r245494 - head/bin/pwait References: <201301160503.r0G53qie087155@svn.freebsd.org> <50F6ED68.50602@delphij.net> <0928E58E-F510-47CD-957F-8C321B1210CC@gmail.com> In-Reply-To: <0928E58E-F510-47CD-957F-8C321B1210CC@gmail.com> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: "src-committers@freebsd.org" , Eitan Adler , Xin LI , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , "d@delphij.net" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: d@delphij.net List-Id: 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, 16 Jan 2013 18:41:22 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 01/16/13 10:17, Garrett Cooper wrote: > On Jan 16, 2013, at 10:11 AM, Xin Li wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 >> >> On 01/16/13 09:47, Eitan Adler wrote: >>> On 16 January 2013 01:49, Xin LI wrote: >>>> This doesn't seem right -- you should never release memory >>>> before exit, especially for memory allocated in main(), >>>> unless this "main" is intended for different purpose like a >>>> monolithic shell that wants to avoid exec(). Note that >>>> pwait(1) have multiple exit points I don't think it's >>>> practical. >>> >>> ... >>> >>> There have been multiple conversations about this: on hackers, >>> on the commit lists, and on the clang analyzer lists. >>> >>> I don't care much how the final code looks: with either free >>> or return but please make sure that scan-build finds no >>> warnings. >> >> Yes I did. Using exit(3) tells clang that this is the final exit >> and thus eliminates the warning. >> >> It sounds like a bug (or arguably a feature) that clang does not >> recognize return in main()s... > > I would consider it a bug, but it's better to use exit(3) anyhow as > it prevents bugs from occurring in other OSes (like windows when > you use atexit and posix-compliant signal handlers). Well, calling exit(3) actually do less on C++ (dtor's are not called in this case, if any local object is declared on stack, which is done when the code say 'return') but the difference is less on C. In style(9) there is no explicit mention of using exit(3) but the example do use exit() instead of return() for main(). By the way speaking for exit(3) preventing bugs on other OSes, do you have reference to these issue? It sounds weird as I would see these as serious leakage which are normally fixed very quickly and we shouldn't be the first people who seeing them... Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- iQEcBAEBCgAGBQJQ9vRQAAoJEG80Jeu8UPuz5KEH/RP2XYZvg2kB7vraWe08uIcs gcwYH4GVbxKbLWWjdSpBHLXVoPqOy7/n3UcKKt27vPzxo+VAiWZJUXPk9PZo0ePb WYqLEzjtfsYWbbIzdHzaB0pUQZ/QuzyFWICj7mkgJQwdTcejlsLAjZ4kqxfuj0wB kPPZ0zKPDT2CR7v/DgHkMMHshuuEw7xm1gij4y6ggVP/Hi4laJVmhJq1+h99Jrtu CrzUDRerXGwPg0qWP9xDylrHGOwAERgUWNgO6gJ1BP+LkAnltCcojFQZd3gs2epb HSS3ejrrR2IRM5jmBFW1L+SyKZHhDOvFtNHAoeAnAOp6Ay4R9U3hy+sVRtO6Oe8= =6JOJ -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 18:43:04 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6F8BC8F6; Wed, 16 Jan 2013 18:43:04 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 4BA81213; Wed, 16 Jan 2013 18:43:04 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 97F39B91A; Wed, 16 Jan 2013 13:43:03 -0500 (EST) From: John Baldwin To: Xin LI Subject: Re: svn commit: r245494 - head/bin/pwait Date: Wed, 16 Jan 2013 11:11:49 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201301160503.r0G53qie087155@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201301161111.49580.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 16 Jan 2013 13:43:03 -0500 (EST) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Eitan Adler X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 16 Jan 2013 18:43:04 -0000 On Wednesday, January 16, 2013 1:49:40 am Xin LI wrote: > This doesn't seem right -- you should never release memory before exit, > especially for memory allocated in main(), unless this "main" is intended > for different purpose like a monolithic shell that wants to avoid exec(). > Note that pwait(1) have multiple exit points I don't think it's practical. > > Would you mind if I commit this changeset instead? I have the return -> > exit change in my queue long ago but only noticed it today... I think the free shouldn't be there as well, but I think requiring an exit() instead of return to "fix" it is bogus as well. The static analyzer is just broken in this case. main() is special and returns from it should be treated like exit() and not cause false warnings about memory leaks. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 19:05:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4E650730; Wed, 16 Jan 2013 19:05:50 +0000 (UTC) (envelope-from carl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 40F1C379; Wed, 16 Jan 2013 19:05:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0GJ5oAu022705; Wed, 16 Jan 2013 19:05:50 GMT (envelope-from carl@svn.freebsd.org) Received: (from carl@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0GJ5oAW022704; Wed, 16 Jan 2013 19:05:50 GMT (envelope-from carl@svn.freebsd.org) Message-Id: <201301161905.r0GJ5oAW022704@svn.freebsd.org> From: Carl Delsey Date: Wed, 16 Jan 2013 19:05:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245507 - 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.14 Precedence: list List-Id: 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, 16 Jan 2013 19:05:50 -0000 Author: carl Date: Wed Jan 16 19:05:49 2013 New Revision: 245507 URL: http://svnweb.freebsd.org/changeset/base/245507 Log: Add myself and my mentor relationship. Approved by: jimharris (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Wed Jan 16 18:15:25 2013 (r245506) +++ head/share/misc/committers-src.dot Wed Jan 16 19:05:49 2013 (r245507) @@ -117,6 +117,7 @@ bruno [label="Bruno Ducrot\nbruno@FreeBS bryanv [label="Bryan Venteicher\nbryanv@FreeBSD.org\n2012/11/03"] bschmidt [label="Bernhard Schmidt\nbschmidt@FreeBSD.org\n2010/02/06"] bz [label="Bjoern A. Zeeb\nbz@FreeBSD.org\n2004/07/27"] +carl [label="Carl Delsey\ncarl@FreeBSD.org\n2013/01/14"] cognet [label="Olivier Houchard\ncognet@FreeBSD.org\n2002/10/09"] cokane [label="Coleman Kane\ncokane@FreeBSD.org\n2000/06/19"] cperciva [label="Colin Percival\ncperciva@FreeBSD.org\n2004/01/20"] @@ -454,6 +455,8 @@ jhb -> peterj jhb -> pfg jhb -> rnoland +jimharris -> carl + jkh -> grog jkh -> imp jkh -> jlemon From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 19:15:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 88FD1BD4 for ; Wed, 16 Jan 2013 19:15:34 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 0E27067A for ; Wed, 16 Jan 2013 19:15:33 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id gw10so1008635lab.13 for ; Wed, 16 Jan 2013 11:15:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=SzDi2cl3GSxaB2SDUbkXmasQM8r/YXhd5Ok3qjhHOCM=; b=GeG731Hn2tMnSg8OFV7PRPppezJThHaui6ObEOUGbEAlHhXbHCIuKheyJ//bTrMTF4 A/cSfexe+dojx29kQAnbl3wozOdYSebcG3arWXslcj0e9j3Qfhfspuaz8ZCJYB2QybmN g7Vq2sN2TOIMCzdQ6fiAvlAjPBweXAuIizv1Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=SzDi2cl3GSxaB2SDUbkXmasQM8r/YXhd5Ok3qjhHOCM=; b=NeQpGuLaNmDTSlHfAJFw5Wa7dyBQ2h/TXqTFUIZjZohbKDyPVYuxWV+8Fl8MuZBGcV iRagXNcKx2EUcmIc9dh2Q7fI6KjgdvHe2R5LevTVtL8WnwT1nI03DV23qHB4bgnZ56ZO gTlwo4uSTRIw2xgRdO0k/UqC2JP7kvESdDFhZW9fBG9U1tBA5QnkFeyu7CRQRLhxb7+O /FRMwQw4tIgD4On1G8fueDFk/gb3dy/y+9J2VzrQu4MHcSxlFEmchtJ/kIgoc4PqgTXM f/ifRYfTRcOlKEWOlh/d+J1HzJuQLepPvb7RxL+8YYdrZj1E7R7tiLvr/IAzfxn7/q3K pbnA== X-Received: by 10.112.38.66 with SMTP id e2mr1066797lbk.90.1358363731968; Wed, 16 Jan 2013 11:15:31 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.30.131 with HTTP; Wed, 16 Jan 2013 11:15:00 -0800 (PST) In-Reply-To: <50F6ED68.50602@delphij.net> References: <201301160503.r0G53qie087155@svn.freebsd.org> <50F6ED68.50602@delphij.net> From: Eitan Adler Date: Wed, 16 Jan 2013 14:15:00 -0500 X-Google-Sender-Auth: kvSEce2MwmLaj-gh-x2-M5opgko Message-ID: Subject: Re: svn commit: r245494 - head/bin/pwait To: d@delphij.net Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQmUPZ83R9i66adDdw8clDsSqKjlS5iB5kn/ac21Bq9FOFvHs3k/Mhmu4NhrBaKWpSWCZvAi Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Xin LI X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 16 Jan 2013 19:15:34 -0000 On 16 January 2013 13:11, Xin Li wrote: > Yes I did. Using exit(3) tells clang that this is the final exit and > thus eliminates the warning. > > It sounds like a bug (or arguably a feature) that clang does not > recognize return in main()s... It is not a bug: see http://clang-developers.42468.n3.nabble.com/Static-analyzer-possible-memory-leak-false-positive-td4026706.html -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 19:16:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B52B4E29; Wed, 16 Jan 2013 19:16:29 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-oa0-f43.google.com (mail-oa0-f43.google.com [209.85.219.43]) by mx1.freebsd.org (Postfix) with ESMTP id 482C4696; Wed, 16 Jan 2013 19:16:29 +0000 (UTC) Received: by mail-oa0-f43.google.com with SMTP id k1so1794625oag.16 for ; Wed, 16 Jan 2013 11:16:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=PfE5plrmjIScF6K2NEHNjfra4MtNR+xedh3tJbL4oHg=; b=ovdVXxtJ/Ps+eRutqGZtwcEXgm24BhQFs3pzrM/QfbUYDf65Or8wGKAF1O5ujkycp6 NlypO5lZySX4YmS3hiyWRHcfyNfRLgbfr0S/ncluR/jPVEZEzheK0yY8ng/YuikN+XOO JS5V++dYdG8PHCoY05cTKkUGI9vNx1t5vBEaXGYkEzxW9xkGcjiE99IyCg4DTz4NgSlC FtngHxb9O0yfS8hvZlESTCEFxg9QonJEwZZsIeDSp2p1GCFoVGVrSe/5dSRHfmZzhXBO aL0VmmVL1NolnaRTHihuWOmdeqRxQLq0z9cJGkMwtd1AhflSnOrc3X3y9okF46aGva5/ ti5Q== MIME-Version: 1.0 X-Received: by 10.60.0.165 with SMTP id 5mr1766712oef.128.1358363783274; Wed, 16 Jan 2013 11:16:23 -0800 (PST) Received: by 10.76.107.241 with HTTP; Wed, 16 Jan 2013 11:16:23 -0800 (PST) In-Reply-To: <50F6F450.50102@delphij.net> References: <201301160503.r0G53qie087155@svn.freebsd.org> <50F6ED68.50602@delphij.net> <0928E58E-F510-47CD-957F-8C321B1210CC@gmail.com> <50F6F450.50102@delphij.net> Date: Wed, 16 Jan 2013 11:16:23 -0800 Message-ID: Subject: Re: svn commit: r245494 - head/bin/pwait From: Garrett Cooper To: d@delphij.net Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , Xin LI , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Eitan Adler X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 16 Jan 2013 19:16:29 -0000 On Wed, Jan 16, 2013 at 10:41 AM, Xin Li wrote: ... > Well, calling exit(3) actually do less on C++ (dtor's are not called > in this case, if any local object is declared on stack, which is done > when the code say 'return') but the difference is less on C. Good to know -- thanks! > In style(9) there is no explicit mention of using exit(3) but the > example do use exit() instead of return() for main(). There's a fair amount of subtlety in style(9) ;)... > By the way speaking for exit(3) preventing bugs on other OSes, do you > have reference to these issue? It sounds weird as I would see these > as serious leakage which are normally fixed very quickly and we > shouldn't be the first people who seeing them... It wasn't really leakage, and it was only Windows (AFAICT) which is its own special case. MSVC++ has copious warnings about using POSIX APIs anyhow, so I figure it's a bad idea to depend on POSIX on Windows :(... There's a program that we have at $work that does dd equivalent logic for writing/verifying files and what was happening is that whenever the atexit handler was entered (basically whenever the terminating condition was met) it would segfault on Windows. It might have been a bug in terms of it entering the atexit(3) handler recursively (which didn't occur on other OSes, e.g. FreeBSD, Linux, and OSX), but I didn't take the time to track down the exact culprit (my goal was to only stop the bleeding ;)..). Thanks! -Garrett From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 21:36:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2B9DE347; Wed, 16 Jan 2013 21:36:32 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) by mx1.freebsd.org (Postfix) with ESMTP id E019BF86; Wed, 16 Jan 2013 21:36:31 +0000 (UTC) Received: from epsilon.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id 612461E4EA; Wed, 16 Jan 2013 13:36:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1358372191; bh=FxUsqW0y+o66sNfGQKxJ4gPwcBLNKnNnV7iGV3CLLV8=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=3FpuSYpWS1I8Ti4/c2iDG5MQ1OKA61Vnc+BUTZyT2+yg4aK2qodl0dQHQ2rAt6WC1 QBPiUWM/Wl31d3yTSbUEzZr0QsdOB2v51YdcWeMlsmhl9vQzhWgt1J0rsJGIgr901z cCxr1UfA7V+1FjoMK7qMFDzvG2JPxcdwXIeAUA8E= Message-ID: <50F71D5E.60604@delphij.net> Date: Wed, 16 Jan 2013 13:36:30 -0800 From: Xin Li Organization: The FreeBSD Project MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r245494 - head/bin/pwait References: <201301160503.r0G53qie087155@svn.freebsd.org> <201301161111.49580.jhb@freebsd.org> In-Reply-To: <201301161111.49580.jhb@freebsd.org> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , Eitan Adler , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Xin LI X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: d@delphij.net List-Id: 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, 16 Jan 2013 21:36:32 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 01/16/13 08:11, John Baldwin wrote: > On Wednesday, January 16, 2013 1:49:40 am Xin LI wrote: >> This doesn't seem right -- you should never release memory before >> exit, especially for memory allocated in main(), unless this >> "main" is intended for different purpose like a monolithic shell >> that wants to avoid exec(). Note that pwait(1) have multiple exit >> points I don't think it's practical. >> >> Would you mind if I commit this changeset instead? I have the >> return -> exit change in my queue long ago but only noticed it >> today... > > I think the free shouldn't be there as well, but I think requiring > an exit() instead of return to "fix" it is bogus as well. The > static analyzer is just broken in this case. main() is special and > returns from it should be treated like exit() and not cause false > warnings about memory leaks. Well, being a horrible idea itself to redefine main() to something else and expect the module to do no harm to its caller, I think Eitan still have a valid point that it could be a bad idea to ban this in wholesale within compiler, as the C standard don't ban using return's in main(). In style(9) the examples do use exit() for main() by the way. Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- iQEcBAEBCgAGBQJQ9x1eAAoJEG80Jeu8UPuzIGsH/ia5cFVA2Uo6w1tEvbbAVMUi +A580EYdQNdCFYVVGCIr6ZoCuZYsYqJdU0wT+xKjpE5qwaCfWVkESWbUGFVKUmFt F1bFZfVu1TgntopYFj5goRyUVvsEutUgh/D8khZSKn9Mnu6ijbeq2CKJi0SyhySw FcmGzp2YNk1B5BW8N8c4oRpLGvwtXPO4QBf5VAEoPU4ItY8bTukH2u09jOKaoh+7 J5eMU8KqWmxcuj6v5/8mb5iUN0oMprbdhVrpb0UpvIfM+TMQ3ISEbyJ5KeHW6dkV 5FLiu3arMe1p3k2yLrGYLB19lZfwtz3gM8QyorqAGK64uNY5oqwsA3UlIo01w48= =V4kG -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 21:52:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8946F642; Wed, 16 Jan 2013 21:52:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 704FC9E; Wed, 16 Jan 2013 21:52:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0GLqW5x073909; Wed, 16 Jan 2013 21:52:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0GLqVQM073905; Wed, 16 Jan 2013 21:52:31 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201301162152.r0GLqVQM073905@svn.freebsd.org> From: John Baldwin Date: Wed, 16 Jan 2013 21:52:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245508 - in head/sys: fs/nfs fs/nfsclient nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 16 Jan 2013 21:52:32 -0000 Author: jhb Date: Wed Jan 16 21:52:31 2013 New Revision: 245508 URL: http://svnweb.freebsd.org/changeset/base/245508 Log: Use the VA_UTIMES_NULL flag to detect when NULL was passed to utimes() instead of comparing the desired time against the current time as a heuristic. Reviewed by: rmacklem MFC after: 1 week Modified: head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfsclient/nfs_clport.c head/sys/nfsclient/nfs_subs.c Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Wed Jan 16 19:05:49 2013 (r245507) +++ head/sys/fs/nfs/nfs_commonsubs.c Wed Jan 16 21:52:31 2013 (r245508) @@ -1998,7 +1998,6 @@ nfsv4_fillattr(struct nfsrv_descript *nd struct statfs fs; struct nfsfsinfo fsinf; struct timespec temptime; - struct timeval curtime; NFSACL_T *aclp, *naclp = NULL; #ifdef QUOTA struct dqblk dqb; @@ -2412,8 +2411,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd retnum += NFSX_V4TIME; break; case NFSATTRBIT_TIMEACCESSSET: - NFSGETTIME(&curtime); - if (vap->va_atime.tv_sec != curtime.tv_sec) { + if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) { NFSM_BUILD(tl, u_int32_t *, NFSX_V4SETTIME); *tl++ = txdr_unsigned(NFSV4SATTRTIME_TOCLIENT); txdr_nfsv4time(&vap->va_atime, tl); @@ -2442,8 +2440,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd retnum += NFSX_V4TIME; break; case NFSATTRBIT_TIMEMODIFYSET: - NFSGETTIME(&curtime); - if (vap->va_mtime.tv_sec != curtime.tv_sec) { + if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) { NFSM_BUILD(tl, u_int32_t *, NFSX_V4SETTIME); *tl++ = txdr_unsigned(NFSV4SATTRTIME_TOCLIENT); txdr_nfsv4time(&vap->va_mtime, tl); Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Wed Jan 16 19:05:49 2013 (r245507) +++ head/sys/fs/nfsclient/nfs_clport.c Wed Jan 16 21:52:31 2013 (r245508) @@ -789,7 +789,7 @@ nfscl_fillsattr(struct nfsrv_descript *n *tl = newnfs_false; } if (vap->va_atime.tv_sec != VNOVAL) { - if (vap->va_atime.tv_sec != curtime.tv_sec) { + if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) { NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); txdr_nfsv3time(&vap->va_atime, tl); @@ -802,7 +802,7 @@ nfscl_fillsattr(struct nfsrv_descript *n *tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE); } if (vap->va_mtime.tv_sec != VNOVAL) { - if (vap->va_mtime.tv_sec != curtime.tv_sec) { + if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) { NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); txdr_nfsv3time(&vap->va_mtime, tl); Modified: head/sys/nfsclient/nfs_subs.c ============================================================================== --- head/sys/nfsclient/nfs_subs.c Wed Jan 16 19:05:49 2013 (r245507) +++ head/sys/nfsclient/nfs_subs.c Wed Jan 16 21:52:31 2013 (r245508) @@ -1110,7 +1110,7 @@ nfsm_v3attrbuild_xx(struct vattr *va, in *tl = nfs_false; } if (va->va_atime.tv_sec != VNOVAL) { - if (va->va_atime.tv_sec != time_second) { + if ((va->va_vaflags & VA_UTIMES_NULL) == 0) { tl = nfsm_build_xx(3 * NFSX_UNSIGNED, mb, bpos); *tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); txdr_nfsv3time(&va->va_atime, tl); @@ -1123,7 +1123,7 @@ nfsm_v3attrbuild_xx(struct vattr *va, in *tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE); } if (va->va_mtime.tv_sec != VNOVAL) { - if (va->va_mtime.tv_sec != time_second) { + if ((va->va_vaflags & VA_UTIMES_NULL) == 0) { tl = nfsm_build_xx(3 * NFSX_UNSIGNED, mb, bpos); *tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); txdr_nfsv3time(&va->va_mtime, tl); From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 22:44:26 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C7D6A217; Wed, 16 Jan 2013 22:44:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 704D52C9; Wed, 16 Jan 2013 22:44:26 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:84a:f2c4:59a0:2557] (unknown [IPv6:2001:7b8:3a7:0:84a:f2c4:59a0:2557]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id F0C945C37; Wed, 16 Jan 2013 23:44:24 +0100 (CET) Message-ID: <50F72D46.2090707@FreeBSD.org> Date: Wed, 16 Jan 2013 23:44:22 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20121128 Thunderbird/18.0 MIME-Version: 1.0 To: Brooks Davis Subject: Re: svn commit: r244401 - in head: contrib/libc-vis include lib/libc/gen References: <201212181637.qBIGbP7e084145@svn.freebsd.org> <50D65630.8010901@FreeBSD.org> <20130110234108.GB79810@lor.one-eyed-alien.net> In-Reply-To: <20130110234108.GB79810@lor.one-eyed-alien.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 16 Jan 2013 22:44:26 -0000 On 2013-01-11 00:41, Brooks Davis wrote: > On Sun, Dec 23, 2012 at 01:54:08AM +0100, Dimitry Andric wrote: >> On 2012-12-18 17:37, Brooks Davis wrote: >>> Author: brooks >>> Date: Tue Dec 18 16:37:24 2012 >>> New Revision: 244401 >>> URL: http://svnweb.freebsd.org/changeset/base/244401 >>> >>> Log: >>> Replace our implementation of the vis(3) and unvis(3) APIs with >>> NetBSD's. This output size limited versions of vis and unvis functions >>> as well as a set of vis variants that allow arbitrary characters to be >>> specified for encoding. >> >> This seems to break bootstrapping in some scenarios, in "stage 4.2: >> building libraries"; for example, with a test run with gcc on >> ref10-amd64.f.o I got this: >> >> gcc -O2 -pipe -I/scratch2/tmp/dim/head/lib/libc/include -I/scratch2/tmp/dim/head/lib/libc/../../include -I/scratch2/tmp/dim/head/lib/libc/amd64 -DNLS -D__DBINTERFACE_PRIVATE -I/scratch2/tmp/dim/head/lib/libc/../../contrib/gdtoa -DINET6 -I/scratch2/tmp/dim/obj/scratch2/tmp/dim/head/lib/libc -I/scratch2/tmp/dim/head/lib/libc/resolv -D_ACL_PRIVATE -DPOSIX_MISTAKE -I/scratch2/tmp/dim/head/lib/libc/../../contrib/jemalloc/include -I/scratch2/tmp/dim/head/lib/libc/../../contrib/tzcode/stdtime -I/scratch2/tmp/dim/head/lib/libc/stdtime -I/scratch2/tmp/dim/head/lib/libc/locale -DBROKEN_DES -DPORTMAP -DDES_BUILTIN -I/scratch2/tmp/dim/head/lib/libc/rpc -DYP -DNS_CACHING -D_FREEFALL_CONFIG -DSYMBOL_VERSIONING -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/vis.c -o vis.o >> /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c: In function 'unvis': >> /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:237: error: 'VIS_NOESCAPE' undeclared (first use in this function) >> /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:237: error: (Each undeclared identifier is reported only once >> /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:237: error: for each function it appears in.) >> /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:241: error: 'VIS_HTTP1808' undeclared (first use in this function) >> /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:245: error: 'VIS_HTTP1866' undeclared (first use in this function) >> /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:249: error: 'VIS_MIMESTYLE' undeclared (first use in this function) >> >> There should most likely be an explicit -I option to point the compiler >> at the correct vis.h header during the early stages, otherwise it will >> pick up /usr/include/vis.h, which does not have several of these new >> VIS_XXX defines. > > Sorry for not following up on this sooner. I've not seen this at all > and most of my builds are done on an 9.0-STABLE box so vis.h isn't > updated. Adding > > CFLAGS+= -I${CURDIR}/../../contrib/libc-vis > > to lib/libc/gen/Makefile.inc seems like it should fix this, but I'm > surprised not to have bumped into this or broken tinderbox. Is there > anything odd about your buildworld command? Not really, the environment was just this: 1) Building on ref10-amd64.f.o 2) CC=gcc, CXX=g++, CPP=gcpp Did you manage to reproduce the failure? From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 22:54:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5F2C65F8 for ; Wed, 16 Jan 2013 22:54:58 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com [209.85.215.44]) by mx1.freebsd.org (Postfix) with ESMTP id DF6D4358 for ; Wed, 16 Jan 2013 22:54:57 +0000 (UTC) Received: by mail-la0-f44.google.com with SMTP id eb20so873809lab.17 for ; Wed, 16 Jan 2013 14:54:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=yuWHtbqyZ6mDGFQcfvhdY8sk1uPxP1ojebATdErwRDs=; b=o8bgXHBx9DBZUMj42ceDTN8ayiYMWotEYrTkotuCsbXLJdcoCMH6Y2fB3umuXmDnEk 5rHtR7NLi6VUUM1NDmRC9WFQ9pGy/1BC5igra6QtDCqEHEU/3mJVrYwzmUWxSMsIdBRH fUxUI/07H2z8Yw4ZUwX3rV5uxUNEyx3k33u68= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=yuWHtbqyZ6mDGFQcfvhdY8sk1uPxP1ojebATdErwRDs=; b=jkMxkXxHAMaAnv8UW7OMUhhH4fHfqYXEz+vxj4D9Wc3eVp//tAWIjRc3WP7w+8lqWh 4FHZoU+XBZ48l4ktzuIFs0PY0RjvaSumcoKp9V9WTKtuc6xQF6Trg+8HB41mEAJaoOl9 bRPGcF/GlJ9beBvAmkw+HZ8SicEUKP0k4j1tzHAntbDXOOQR7+BBD3oziOWDtKSal/P3 3esrdofNJeccnguS4MZvONTvV+CKaIcbUgH0pDCBAjUfgS8Y7F00mD17df4b8R1kzTXY iG1AJypktNPtP3ulIGZXieS8kyo85FCa8z8rFu/xDKEIo3za3m6K7Cbg70ZPohHemt4w C5qQ== X-Received: by 10.152.125.136 with SMTP id mq8mr2752375lab.41.1358376896432; Wed, 16 Jan 2013 14:54:56 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.30.131 with HTTP; Wed, 16 Jan 2013 14:54:25 -0800 (PST) In-Reply-To: <201301151409.r0FE98HB050315@svn.freebsd.org> References: <201301151409.r0FE98HB050315@svn.freebsd.org> From: Eitan Adler Date: Wed, 16 Jan 2013 17:54:25 -0500 X-Google-Sender-Auth: g3Ts1RGaSMu0EyYdjcAlBqPqM7A Message-ID: Subject: Re: svn commit: r245458 - head/lib/libc/sys To: Andrey Zonov Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQmZs5A7lc8qv6mfr82hbqEu43jx5g3AHRfIoLqLF4qrvJ37Fo5a1cyhzv4UKy5ELpoPnb2B Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 16 Jan 2013 22:54:58 -0000 On 15 January 2013 09:09, Andrey Zonov wrote: > -.Va errno > -is set to indicate an error. ISTR that this is not shown in the -std text. Can this be retained? -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 22:59:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DF12E7D3; Wed, 16 Jan 2013 22:59:50 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C0B5E394; Wed, 16 Jan 2013 22:59:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0GMxoqJ092930; Wed, 16 Jan 2013 22:59:50 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0GMxocD092929; Wed, 16 Jan 2013 22:59:50 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201301162259.r0GMxocD092929@svn.freebsd.org> From: Xin LI Date: Wed, 16 Jan 2013 22:59:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245511 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 16 Jan 2013 22:59:50 -0000 Author: delphij Date: Wed Jan 16 22:59:50 2013 New Revision: 245511 URL: http://svnweb.freebsd.org/changeset/base/245511 Log: MFV r245510: improve the comment in txg.c Obtained from: Illumos (13910:f3454e0a097c) MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Wed Jan 16 22:50:40 2013 (r245510) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Wed Jan 16 22:59:50 2013 (r245511) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Portions Copyright 2011 Martin Matuska - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #include @@ -33,7 +33,76 @@ #include /* - * Pool-wide transaction groups. + * ZFS Transaction Groups + * ---------------------- + * + * ZFS transaction groups are, as the name implies, groups of transactions + * that act on persistent state. ZFS asserts consistency at the granularity of + * these transaction groups. Each successive transaction group (txg) is + * assigned a 64-bit consecutive identifier. There are three active + * transaction group states: open, quiescing, or syncing. At any given time, + * there may be an active txg associated with each state; each active txg may + * either be processing, or blocked waiting to enter the next state. There may + * be up to three active txgs, and there is always a txg in the open state + * (though it may be blocked waiting to enter the quiescing state). In broad + * strokes, transactions — operations that change in-memory structures — are + * accepted into the txg in the open state, and are completed while the txg is + * in the open or quiescing states. The accumulated changes are written to + * disk in the syncing state. + * + * Open + * + * When a new txg becomes active, it first enters the open state. New + * transactions — updates to in-memory structures — are assigned to the + * currently open txg. There is always a txg in the open state so that ZFS can + * accept new changes (though the txg may refuse new changes if it has hit + * some limit). ZFS advances the open txg to the next state for a variety of + * reasons such as it hitting a time or size threshold, or the execution of an + * administrative action that must be completed in the syncing state. + * + * Quiescing + * + * After a txg exits the open state, it enters the quiescing state. The + * quiescing state is intended to provide a buffer between accepting new + * transactions in the open state and writing them out to stable storage in + * the syncing state. While quiescing, transactions can continue their + * operation without delaying either of the other states. Typically, a txg is + * in the quiescing state very briefly since the operations are bounded by + * software latencies rather than, say, slower I/O latencies. After all + * transactions complete, the txg is ready to enter the next state. + * + * Syncing + * + * In the syncing state, the in-memory state built up during the open and (to + * a lesser degree) the quiescing states is written to stable storage. The + * process of writing out modified data can, in turn modify more data. For + * example when we write new blocks, we need to allocate space for them; those + * allocations modify metadata (space maps)... which themselves must be + * written to stable storage. During the sync state, ZFS iterates, writing out + * data until it converges and all in-memory changes have been written out. + * The first such pass is the largest as it encompasses all the modified user + * data (as opposed to filesystem metadata). Subsequent passes typically have + * far less data to write as they consist exclusively of filesystem metadata. + * + * To ensure convergence, after a certain number of passes ZFS begins + * overwriting locations on stable storage that had been allocated earlier in + * the syncing state (and subsequently freed). ZFS usually allocates new + * blocks to optimize for large, continuous, writes. For the syncing state to + * converge however it must complete a pass where no new blocks are allocated + * since each allocation requires a modification of persistent metadata. + * Further, to hasten convergence, after a prescribed number of passes, ZFS + * also defers frees, and stops compressing. + * + * In addition to writing out user data, we must also execute synctasks during + * the syncing context. A synctask is the mechanism by which some + * administrative activities work such as creating and destroying snapshots or + * datasets. Note that when a synctask is initiated it enters the open txg, + * and ZFS then pushes that txg as quickly as possible to completion of the + * syncing state in order to reduce the latency of the administrative + * activity. To complete the syncing state, ZFS writes out a new uberblock, + * the root of the tree of blocks that comprise all state stored on the ZFS + * pool. Finally, if there is a quiesced txg waiting, we signal that it can + * now transition to the syncing state. */ static void txg_sync_thread(void *arg); From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 23:16:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 94006F7B; Wed, 16 Jan 2013 23:16:42 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6C1AC6B8; Wed, 16 Jan 2013 23:16:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0GNGg46098953; Wed, 16 Jan 2013 23:16:42 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0GNGgju098951; Wed, 16 Jan 2013 23:16:42 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301162316.r0GNGgju098951@svn.freebsd.org> From: Brooks Davis Date: Wed, 16 Jan 2013 23:16:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245513 - in head: . etc/mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 16 Jan 2013 23:16:42 -0000 Author: brooks Date: Wed Jan 16 23:16:41 2013 New Revision: 245513 URL: http://svnweb.freebsd.org/changeset/base/245513 Log: According to the notes in ObsoleteFiles.inc we last installed section 1aout manpages in 2002. Stop making the directories and links to them. Modified: head/ObsoleteFiles.inc head/etc/mtree/BSD.usr.dist Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Jan 16 23:11:13 2013 (r245512) +++ head/ObsoleteFiles.inc Wed Jan 16 23:16:41 2013 (r245513) @@ -38,6 +38,13 @@ # xargs -n1 | sort | uniq -d; # done +# 20130116: removed long unused directories for .1aout section manpages +OLD_FILES+=usr/share/man/en.ISO8859-1/man1aout +OLD_FILES+=usr/share/man/en.UTF-8/man1aout +OLD_DIRS+=usr/share/man/man1aout +OLD_DIRS+=usr/share/man/cat1aout +OLD_DIRS+=usr/share/man/en.ISO8859-1/cat1aout +OLD_DIRS+=usr/share/man/en.UTF-8/cat1aout # 20121230: libdisk removed OLD_FILES+=usr/share/man/man3/libdisk.3.gz usr/include/libdisk.h OLD_FILES+=usr/lib/libdisk.a usr/lib32/libdisk.a Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Wed Jan 16 23:11:13 2013 (r245512) +++ head/etc/mtree/BSD.usr.dist Wed Jan 16 23:16:41 2013 (r245513) @@ -756,8 +756,6 @@ /set uname=man cat1 .. - cat1aout - .. cat2 .. cat3 @@ -795,8 +793,6 @@ en.ISO8859-1 uname=root cat1 .. - cat1aout - .. cat2 .. cat3 @@ -835,8 +831,6 @@ en.UTF-8 uname=root cat1 .. - cat1aout - .. cat2 .. cat3 @@ -913,8 +907,6 @@ .. man1 .. - man1aout - .. man2 .. man3 From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 23:20:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1D269279; Wed, 16 Jan 2013 23:20:25 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0F1FC6FB; Wed, 16 Jan 2013 23:20:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0GNKON0000977; Wed, 16 Jan 2013 23:20:24 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0GNKORP000975; Wed, 16 Jan 2013 23:20:24 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301162320.r0GNKORP000975@svn.freebsd.org> From: Brooks Davis Date: Wed, 16 Jan 2013 23:20:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245514 - head/usr.bin/man X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 16 Jan 2013 23:20:25 -0000 Author: brooks Date: Wed Jan 16 23:20:24 2013 New Revision: 245514 URL: http://svnweb.freebsd.org/changeset/base/245514 Log: Remove default support for 1aout section manpages. There haven't been any since at least July 2002. Modified: head/usr.bin/man/man.1 head/usr.bin/man/man.sh Modified: head/usr.bin/man/man.1 ============================================================================== --- head/usr.bin/man/man.1 Wed Jan 16 23:16:41 2013 (r245513) +++ head/usr.bin/man/man.1 Wed Jan 16 23:20:24 2013 (r245514) @@ -84,7 +84,7 @@ environment variable. .It Fl S Ar mansect Restricts manual sections searched to the specified colon delimited list. Defaults to -.Dq Li 1:1aout:8:2:3:n:4:5:6:7:9:l . +.Dq Li 1:8:2:3:n:4:5:6:7:9:l . Overrides the .Ev MANSECT environment variable. Modified: head/usr.bin/man/man.sh ============================================================================== --- head/usr.bin/man/man.sh Wed Jan 16 23:16:41 2013 (r245513) +++ head/usr.bin/man/man.sh Wed Jan 16 23:20:24 2013 (r245514) @@ -945,7 +945,7 @@ STTY=/bin/stty SYSCTL=/sbin/sysctl debug=0 -man_default_sections='1:1aout:8:2:3:n:4:5:6:7:9:l' +man_default_sections='1:8:2:3:n:4:5:6:7:9:l' man_default_path='/usr/share/man:/usr/share/openssl/man:/usr/local/man' cattool='/usr/bin/zcat -f' From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 23:21:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 96ACA566; Wed, 16 Jan 2013 23:21:05 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 84C03703; Wed, 16 Jan 2013 23:21:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0GNL5YE001261; Wed, 16 Jan 2013 23:21:05 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0GNL55G001259; Wed, 16 Jan 2013 23:21:05 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301162321.r0GNL55G001259@svn.freebsd.org> From: Brooks Davis Date: Wed, 16 Jan 2013 23:21:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245515 - 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.14 Precedence: list List-Id: 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, 16 Jan 2013 23:21:05 -0000 Author: brooks Date: Wed Jan 16 23:21:04 2013 New Revision: 245515 URL: http://svnweb.freebsd.org/changeset/base/245515 Log: Remove support for installing 1aout section manpages. Modified: head/share/mk/bsd.man.mk head/share/mk/bsd.prog.mk Modified: head/share/mk/bsd.man.mk ============================================================================== --- head/share/mk/bsd.man.mk Wed Jan 16 23:20:24 2013 (r245514) +++ head/share/mk/bsd.man.mk Wed Jan 16 23:21:04 2013 (r245515) @@ -62,7 +62,7 @@ MROFF_CMD?= groff -Tascii -mtty-char -ma MCOMPRESS_CMD?= ${COMPRESS_CMD} MCOMPRESS_EXT?= ${COMPRESS_EXT} -SECTIONS= 1 1aout 2 3 4 5 6 7 8 9 +SECTIONS= 1 2 3 4 5 6 7 8 9 .SUFFIXES: ${SECTIONS:S/^/./g} # Backwards compatibility. Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Wed Jan 16 23:20:24 2013 (r245514) +++ head/share/mk/bsd.prog.mk Wed Jan 16 23:21:04 2013 (r245515) @@ -95,8 +95,7 @@ ${PROG}: ${OBJS} .if ${MK_MAN} != "no" && !defined(MAN) && \ !defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \ !defined(MAN4) && !defined(MAN5) && !defined(MAN6) && \ - !defined(MAN7) && !defined(MAN8) && !defined(MAN9) && \ - !defined(MAN1aout) + !defined(MAN7) && !defined(MAN8) && !defined(MAN9) MAN= ${PROG}.1 MAN1= ${MAN} .endif From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 23:25:15 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5A0997E1; Wed, 16 Jan 2013 23:25:15 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 95863756; Wed, 16 Jan 2013 23:25:14 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r0GNP94R043530; Wed, 16 Jan 2013 17:25:09 -0600 (CST) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r0GNP9YC043529; Wed, 16 Jan 2013 17:25:09 -0600 (CST) (envelope-from brooks) Date: Wed, 16 Jan 2013 17:25:09 -0600 From: Brooks Davis To: Dimitry Andric Subject: Re: svn commit: r244401 - in head: contrib/libc-vis include lib/libc/gen Message-ID: <20130116232509.GB29437@lor.one-eyed-alien.net> References: <201212181637.qBIGbP7e084145@svn.freebsd.org> <50D65630.8010901@FreeBSD.org> <20130110234108.GB79810@lor.one-eyed-alien.net> <50F72D46.2090707@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5I6of5zJg18YgZEa" Content-Disposition: inline In-Reply-To: <50F72D46.2090707@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Brooks Davis , src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 16 Jan 2013 23:25:15 -0000 --5I6of5zJg18YgZEa Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 16, 2013 at 11:44:22PM +0100, Dimitry Andric wrote: > On 2013-01-11 00:41, Brooks Davis wrote: > > On Sun, Dec 23, 2012 at 01:54:08AM +0100, Dimitry Andric wrote: > >> On 2012-12-18 17:37, Brooks Davis wrote: > >>> Author: brooks > >>> Date: Tue Dec 18 16:37:24 2012 > >>> New Revision: 244401 > >>> URL: http://svnweb.freebsd.org/changeset/base/244401 > >>> > >>> Log: > >>> Replace our implementation of the vis(3) and unvis(3) APIs with > >>> NetBSD's. This output size limited versions of vis and unvis fun= ctions > >>> as well as a set of vis variants that allow arbitrary characters = to be > >>> specified for encoding. > >> > >> This seems to break bootstrapping in some scenarios, in "stage 4.2: > >> building libraries"; for example, with a test run with gcc on > >> ref10-amd64.f.o I got this: > >> > >> gcc -O2 -pipe -I/scratch2/tmp/dim/head/lib/libc/include -I/scratch2/= tmp/dim/head/lib/libc/../../include -I/scratch2/tmp/dim/head/lib/libc/amd64= -DNLS -D__DBINTERFACE_PRIVATE -I/scratch2/tmp/dim/head/lib/libc/../../con= trib/gdtoa -DINET6 -I/scratch2/tmp/dim/obj/scratch2/tmp/dim/head/lib/libc -= I/scratch2/tmp/dim/head/lib/libc/resolv -D_ACL_PRIVATE -DPOSIX_MISTAKE -I/s= cratch2/tmp/dim/head/lib/libc/../../contrib/jemalloc/include -I/scratch2/tm= p/dim/head/lib/libc/../../contrib/tzcode/stdtime -I/scratch2/tmp/dim/head/l= ib/libc/stdtime -I/scratch2/tmp/dim/head/lib/libc/locale -DBROKEN_DES -DPOR= TMAP -DDES_BUILTIN -I/scratch2/tmp/dim/head/lib/libc/rpc -DYP -DNS_CACHING = -D_FREEFALL_CONFIG -DSYMBOL_VERSIONING -std=3Dgnu99 -fstack-protector -Wsys= tem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-s= ign -c /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/vis.c -o vis.o > >> /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c: In fun= ction 'unvis': > >> /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:237: er= ror: 'VIS_NOESCAPE' undeclared (first use in this function) > >> /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:237: er= ror: (Each undeclared identifier is reported only once > >> /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:237: er= ror: for each function it appears in.) > >> /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:241: er= ror: 'VIS_HTTP1808' undeclared (first use in this function) > >> /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:245: er= ror: 'VIS_HTTP1866' undeclared (first use in this function) > >> /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:249: er= ror: 'VIS_MIMESTYLE' undeclared (first use in this function) > >> > >> There should most likely be an explicit -I option to point the compiler > >> at the correct vis.h header during the early stages, otherwise it will > >> pick up /usr/include/vis.h, which does not have several of these new > >> VIS_XXX defines. > > > > Sorry for not following up on this sooner. I've not seen this at all > > and most of my builds are done on an 9.0-STABLE box so vis.h isn't > > updated. Adding > > > > CFLAGS+=3D -I${CURDIR}/../../contrib/libc-vis > > > > to lib/libc/gen/Makefile.inc seems like it should fix this, but I'm > > surprised not to have bumped into this or broken tinderbox. Is there > > anything odd about your buildworld command? >=20 > Not really, the environment was just this: >=20 > 1) Building on ref10-amd64.f.o > 2) CC=3Dgcc, CXX=3Dg++, CPP=3Dgcpp >=20 > Did you manage to reproduce the failure? I never did with a buildworld. I could if I tried to build by hand after touching unvis.c so I added an entry to CFLAGS. I think it's more correct. -- Brooks --5I6of5zJg18YgZEa Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFQ9zbVXY6L6fI4GtQRAnaiAKC0/93L5TRXqaglRv9Tqy+SW9XQQACfTHl4 WqYnE1g2+Z/wDHJSTKYLLNk= =gKJ9 -----END PGP SIGNATURE----- --5I6of5zJg18YgZEa-- From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 23:48:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 24CA8D0F; Wed, 16 Jan 2013 23:48:56 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0C71B872; Wed, 16 Jan 2013 23:48:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0GNmtBN008024; Wed, 16 Jan 2013 23:48:55 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0GNmtek008023; Wed, 16 Jan 2013 23:48:55 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201301162348.r0GNmtek008023@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 16 Jan 2013 23:48:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245517 - 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.14 Precedence: list List-Id: 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, 16 Jan 2013 23:48:56 -0000 Author: np Date: Wed Jan 16 23:48:55 2013 New Revision: 245517 URL: http://svnweb.freebsd.org/changeset/base/245517 Log: cxgbe: Fix the for_each_foo macros -- the last argument should not share its name with any member of struct sge. MFC after: 3 days Modified: head/sys/dev/cxgbe/adapter.h Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Wed Jan 16 23:41:20 2013 (r245516) +++ head/sys/dev/cxgbe/adapter.h Wed Jan 16 23:48:55 2013 (r245517) @@ -647,18 +647,18 @@ struct adapter { #define TXQ_LOCK_ASSERT_OWNED(txq) EQ_LOCK_ASSERT_OWNED(&(txq)->eq) #define TXQ_LOCK_ASSERT_NOTOWNED(txq) EQ_LOCK_ASSERT_NOTOWNED(&(txq)->eq) -#define for_each_txq(pi, iter, txq) \ - txq = &pi->adapter->sge.txq[pi->first_txq]; \ - for (iter = 0; iter < pi->ntxq; ++iter, ++txq) -#define for_each_rxq(pi, iter, rxq) \ - rxq = &pi->adapter->sge.rxq[pi->first_rxq]; \ - for (iter = 0; iter < pi->nrxq; ++iter, ++rxq) -#define for_each_ofld_txq(pi, iter, ofld_txq) \ - ofld_txq = &pi->adapter->sge.ofld_txq[pi->first_ofld_txq]; \ - for (iter = 0; iter < pi->nofldtxq; ++iter, ++ofld_txq) -#define for_each_ofld_rxq(pi, iter, ofld_rxq) \ - ofld_rxq = &pi->adapter->sge.ofld_rxq[pi->first_ofld_rxq]; \ - for (iter = 0; iter < pi->nofldrxq; ++iter, ++ofld_rxq) +#define for_each_txq(pi, iter, q) \ + q = &pi->adapter->sge.txq[pi->first_txq]; \ + for (iter = 0; iter < pi->ntxq; ++iter, ++q) +#define for_each_rxq(pi, iter, q) \ + q = &pi->adapter->sge.rxq[pi->first_rxq]; \ + for (iter = 0; iter < pi->nrxq; ++iter, ++q) +#define for_each_ofld_txq(pi, iter, q) \ + q = &pi->adapter->sge.ofld_txq[pi->first_ofld_txq]; \ + for (iter = 0; iter < pi->nofldtxq; ++iter, ++q) +#define for_each_ofld_rxq(pi, iter, q) \ + q = &pi->adapter->sge.ofld_rxq[pi->first_ofld_rxq]; \ + for (iter = 0; iter < pi->nofldrxq; ++iter, ++q) /* One for errors, one for firmware events */ #define T4_EXTRA_INTR 2 From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 23:49:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9B294E91; Wed, 16 Jan 2013 23:49:56 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 82F14889; Wed, 16 Jan 2013 23:49:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0GNnubH008191; Wed, 16 Jan 2013 23:49:56 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0GNnuhi008190; Wed, 16 Jan 2013 23:49:56 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201301162349.r0GNnuhi008190@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 16 Jan 2013 23:49:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245518 - 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.14 Precedence: list List-Id: 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, 16 Jan 2013 23:49:56 -0000 Author: np Date: Wed Jan 16 23:49:55 2013 New Revision: 245518 URL: http://svnweb.freebsd.org/changeset/base/245518 Log: cxgbe: Do a more thorough job in the CLEAR_STATS ioctl. MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Wed Jan 16 23:48:55 2013 (r245517) +++ head/sys/dev/cxgbe/t4_main.c Wed Jan 16 23:49:55 2013 (r245518) @@ -5492,12 +5492,56 @@ t4_ioctl(struct cdev *dev, unsigned long rc = read_i2c(sc, (struct t4_i2c_data *)data); break; case CHELSIO_T4_CLEAR_STATS: { + int i; u_int port_id = *(uint32_t *)data; + struct port_info *pi; if (port_id >= sc->params.nports) return (EINVAL); + /* MAC stats */ t4_clr_port_stats(sc, port_id); + + pi = sc->port[port_id]; + if (pi->flags & PORT_INIT_DONE) { + struct sge_rxq *rxq; + struct sge_txq *txq; + struct sge_wrq *wrq; + + for_each_rxq(pi, i, rxq) { +#if defined(INET) || defined(INET6) + rxq->lro.lro_queued = 0; + rxq->lro.lro_flushed = 0; +#endif + rxq->rxcsum = 0; + rxq->vlan_extraction = 0; + } + + for_each_txq(pi, i, txq) { + txq->txcsum = 0; + txq->tso_wrs = 0; + txq->vlan_insertion = 0; + txq->imm_wrs = 0; + txq->sgl_wrs = 0; + txq->txpkt_wrs = 0; + txq->txpkts_wrs = 0; + txq->txpkts_pkts = 0; + txq->no_dmamap = 0; + txq->no_desc = 0; + } + +#ifdef TCP_OFFLOAD + /* nothing to clear for each ofld_rxq */ + + for_each_ofld_txq(pi, i, wrq) { + wrq->tx_wrs = 0; + wrq->no_desc = 0; + } +#endif + wrq = &sc->sge.ctrlq[pi->port_id]; + wrq->tx_wrs = 0; + wrq->no_desc = 0; + } break; } default: From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 00:09:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 49759348; Thu, 17 Jan 2013 00:09:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3B17B960; Thu, 17 Jan 2013 00:09:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0H09p9C014392; Thu, 17 Jan 2013 00:09:51 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0H09pC6014391; Thu, 17 Jan 2013 00:09:51 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301170009.r0H09pC6014391@svn.freebsd.org> From: Alexander Motin Date: Thu, 17 Jan 2013 00:09:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245519 - head/sys/geom/raid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 00:09:51 -0000 Author: mav Date: Thu Jan 17 00:09:50 2013 New Revision: 245519 URL: http://svnweb.freebsd.org/changeset/base/245519 Log: Recalculate volume size only for real CONCATs. For SINGLE trust volume size given by metadata, as it should be correct and in some cases can be smaller then subdisk size. Modified: head/sys/geom/raid/tr_concat.c Modified: head/sys/geom/raid/tr_concat.c ============================================================================== --- head/sys/geom/raid/tr_concat.c Wed Jan 16 23:49:55 2013 (r245518) +++ head/sys/geom/raid/tr_concat.c Thu Jan 17 00:09:50 2013 (r245519) @@ -124,7 +124,8 @@ g_raid_tr_update_state_concat(struct g_r * Some metadata modules may not know CONCAT volume * mediasize until all disks connected. Recalculate. */ - if (G_RAID_VOLUME_S_ALIVE(s) && + if (vol->v_raid_level == G_RAID_VOLUME_RL_CONCAT && + G_RAID_VOLUME_S_ALIVE(s) && !G_RAID_VOLUME_S_ALIVE(vol->v_state)) { size = 0; for (i = 0; i < vol->v_disks_count; i++) { From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 00:21:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 26A7CA38; Thu, 17 Jan 2013 00:21:46 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 18855A4C; Thu, 17 Jan 2013 00:21:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0H0LjKq019219; Thu, 17 Jan 2013 00:21:45 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0H0Lj1M019218; Thu, 17 Jan 2013 00:21:45 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201301170021.r0H0Lj1M019218@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 17 Jan 2013 00:21:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245520 - head/tools/tools/cxgbetool X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 00:21:46 -0000 Author: np Date: Thu Jan 17 00:21:45 2013 New Revision: 245520 URL: http://svnweb.freebsd.org/changeset/base/245520 Log: Allow "ivlan" (inner VLAN) to be used as an alias for "vlan" when specifying match criteria. "vlan" continues to be valid here, and it continues to be valid when deleting, rewriting, inserting, or stacking an 802.1q tag to a matching packet. MFC after: 3 days Modified: head/tools/tools/cxgbetool/cxgbetool.c Modified: head/tools/tools/cxgbetool/cxgbetool.c ============================================================================== --- head/tools/tools/cxgbetool/cxgbetool.c Thu Jan 17 00:09:50 2013 (r245519) +++ head/tools/tools/cxgbetool/cxgbetool.c Thu Jan 17 00:21:45 2013 (r245520) @@ -955,7 +955,7 @@ set_filter(uint32_t idx, int argc, const t.fs.mask.vnic = mask; t.fs.val.vnic_vld = 1; t.fs.mask.vnic_vld = 1; - } else if (!parse_val_mask("vlan", args, &val, &mask)) { + } else if (!parse_val_mask("ivlan", args, &val, &mask)) { t.fs.val.vlan = val; t.fs.mask.vlan = mask; t.fs.val.vlan_vld = 1; @@ -1047,10 +1047,17 @@ set_filter(uint32_t idx, int argc, const t.fs.newvlan = VLAN_REWRITE; } else if (argv[start_arg + 1][0] == '+') { t.fs.newvlan = VLAN_INSERT; + } else if (isdigit(argv[start_arg + 1][0]) && + !parse_val_mask("vlan", args, &val, &mask)) { + t.fs.val.vlan = val; + t.fs.mask.vlan = mask; + t.fs.val.vlan_vld = 1; + t.fs.mask.vlan_vld = 1; } else { warnx("unknown vlan parameter \"%s\"; must" - " be one of \"none\", \"=\" or" - " \"+\"", argv[start_arg + 1]); + " be one of \"none\", \"=\", " + " \"+\", or \"\"", + argv[start_arg + 1]); return (EINVAL); } if (t.fs.newvlan == VLAN_REWRITE || From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 00:50:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4B2A0191; Thu, 17 Jan 2013 00:50:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3A7ACB75; Thu, 17 Jan 2013 00:50:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0H0oQjD027010; Thu, 17 Jan 2013 00:50:26 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0H0oPMF026959; Thu, 17 Jan 2013 00:50:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301170050.r0H0oPMF026959@svn.freebsd.org> From: Alexander Motin Date: Thu, 17 Jan 2013 00:50:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245522 - in head: sbin/geom/class/raid sys/geom/raid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 00:50:26 -0000 Author: mav Date: Thu Jan 17 00:50:25 2013 New Revision: 245522 URL: http://svnweb.freebsd.org/changeset/base/245522 Log: For Promise/AMD metadata add support for disks with capacity above 2TiB and for volumes with sector size above 512 bytes. Modified: head/sbin/geom/class/raid/graid.8 head/sys/geom/raid/md_promise.c Modified: head/sbin/geom/class/raid/graid.8 ============================================================================== --- head/sbin/geom/class/raid/graid.8 Thu Jan 17 00:42:30 2013 (r245521) +++ head/sbin/geom/class/raid/graid.8 Thu Jan 17 00:50:25 2013 (r245522) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 13, 2012 +.Dd January 16, 2013 .Dt GRAID 8 .Os .Sh NAME @@ -274,7 +274,6 @@ complete it there. Do not run GEOM RAID class on migrating volumes under pain of possible data corruption! .Sh 2TiB BARRIERS -Promise metadata format does not support disks above 2TiB. NVIDIA metadata format does not support volumes above 2TiB. .Sh SYSCTL VARIABLES The following Modified: head/sys/geom/raid/md_promise.c ============================================================================== --- head/sys/geom/raid/md_promise.c Thu Jan 17 00:42:30 2013 (r245521) +++ head/sys/geom/raid/md_promise.c Thu Jan 17 00:50:25 2013 (r245522) @@ -84,7 +84,7 @@ struct promise_raid_conf { struct promise_raid_disk disk; /* This subdisk info. */ uint32_t disk_offset; /* Subdisk offset. */ uint32_t disk_sectors; /* Subdisk size */ - uint32_t rebuild_lba; /* Rebuild position. */ + uint32_t disk_rebuild; /* Rebuild position. */ uint16_t generation; /* Generation number. */ uint8_t status; /* Volume status. */ #define PROMISE_S_VALID 0x01 @@ -123,7 +123,17 @@ struct promise_raid_conf { uint32_t magic_4; uint32_t magic_5; uint32_t total_sectors_high; - uint32_t filler3[324]; + uint8_t magic_6; + uint8_t sector_size; + uint16_t magic_7; + uint32_t magic_8[32]; + uint16_t magic_9; + uint32_t disk_offset_high; + uint32_t disk_sectors_high; + uint32_t disk_rebuild_high; + uint16_t magic_10; + uint32_t magic_11[3]; + uint32_t filler3[284]; uint32_t checksum; } __packed; @@ -191,7 +201,7 @@ g_raid_md_promise_print(struct promise_r meta->disk.device, meta->disk.id); printf("disk_offset %u\n", meta->disk_offset); printf("disk_sectors %u\n", meta->disk_sectors); - printf("rebuild_lba %u\n", meta->rebuild_lba); + printf("disk_rebuild %u\n", meta->disk_rebuild); printf("generation %u\n", meta->generation); printf("status 0x%02x\n", meta->status); printf("type %u\n", meta->type); @@ -217,6 +227,10 @@ g_raid_md_promise_print(struct promise_r printf("magic_4 0x%08x\n", meta->magic_4); printf("magic_5 0x%08x\n", meta->magic_5); printf("total_sectors_high 0x%08x\n", meta->total_sectors_high); + printf("sector_size %u\n", meta->sector_size); + printf("disk_offset_high 0x%08x\n", meta->disk_offset_high); + printf("disk_sectors_high 0x%08x\n", meta->disk_sectors_high); + printf("disk_rebuild_high 0x%08x\n", meta->disk_rebuild_high); printf("=================================================\n"); } @@ -244,9 +258,9 @@ promise_meta_find_disk(struct promise_ra static int promise_meta_unused_range(struct promise_raid_conf **metaarr, int nsd, - uint32_t sectors, uint32_t *off, uint32_t *size) + off_t sectors, off_t *off, off_t *size) { - uint32_t coff, csize; + off_t coff, csize, tmp; int i, j; sectors -= 131072; @@ -257,10 +271,10 @@ promise_meta_unused_range(struct promise i = 0; while (1) { for (j = 0; j < nsd; j++) { - if (metaarr[j]->disk_offset >= coff) { - csize = MIN(csize, - metaarr[j]->disk_offset - coff); - } + tmp = ((off_t)metaarr[j]->disk_offset_high << 32) + + metaarr[j]->disk_offset; + if (tmp >= coff) + csize = MIN(csize, tmp - coff); } if (csize > *size) { *off = coff; @@ -268,7 +282,10 @@ promise_meta_unused_range(struct promise } if (i >= nsd) break; - coff = metaarr[i]->disk_offset + metaarr[i]->disk_sectors; + coff = ((off_t)metaarr[i]->disk_offset_high << 32) + + metaarr[i]->disk_offset + + ((off_t)metaarr[i]->disk_sectors_high << 32) + + metaarr[i]->disk_sectors; csize = sectors - coff; i++; }; @@ -369,6 +386,25 @@ next: return (subdisks); } + /* Remove filler garbage from fields used in newer metadata. */ + if (meta->disk_offset_high == 0x8b8c8d8e && + meta->disk_sectors_high == 0x8788898a && + meta->disk_rebuild_high == 0x83848586) { + meta->disk_offset_high = 0; + meta->disk_sectors_high = 0; + if (meta->disk_rebuild == UINT32_MAX) + meta->disk_rebuild_high = UINT32_MAX; + else + meta->disk_rebuild_high = 0; + if (meta->total_sectors_high == 0x15161718) { + meta->total_sectors_high = 0; + if (meta->rebuild_lba64 == 0x2122232425262728) + meta->rebuild_lba64 = UINT64_MAX; + } + } + if (meta->sector_size < 1 || meta->sector_size > 8) + meta->sector_size = 1; + /* Save this part and look for next. */ *metaarr = meta; metaarr++; @@ -386,8 +422,9 @@ promise_meta_write(struct g_consumer *cp struct g_provider *pp; struct promise_raid_conf *meta; char *buf; + off_t off, size; int error, i, subdisk, fake; - uint32_t checksum, *ptr, off, size; + uint32_t checksum, *ptr; pp = cp->provider; subdisk = 0; @@ -409,9 +446,12 @@ next: meta->disk.flags = PROMISE_F_ONLINE | PROMISE_F_VALID; meta->disk.number = 0xff; arc4rand(&meta->disk.id, sizeof(meta->disk.id), 0); - meta->disk_offset = off; - meta->disk_sectors = size; - meta->rebuild_lba = UINT32_MAX; + meta->disk_offset_high = off >> 32; + meta->disk_offset = (uint32_t)off; + meta->disk_sectors_high = size >> 32; + meta->disk_sectors = (uint32_t)size; + meta->disk_rebuild_high = UINT32_MAX; + meta->disk_rebuild = UINT32_MAX; fake = 1; } if (meta != NULL) { @@ -464,6 +504,7 @@ static int promise_meta_write_spare(struct g_consumer *cp) { struct promise_raid_conf *meta; + off_t tmp; int error; meta = malloc(sizeof(*meta), M_MD_PROMISE, M_WAITOK | M_ZERO); @@ -473,9 +514,11 @@ promise_meta_write_spare(struct g_consum meta->disk.flags = PROMISE_F_SPARE | PROMISE_F_ONLINE | PROMISE_F_VALID; meta->disk.number = 0xff; arc4rand(&meta->disk.id, sizeof(meta->disk.id), 0); - meta->disk_sectors = cp->provider->mediasize / cp->provider->sectorsize; - meta->disk_sectors -= 131072; - meta->rebuild_lba = UINT32_MAX; + tmp = cp->provider->mediasize / cp->provider->sectorsize - 131072; + meta->disk_sectors_high = tmp >> 32; + meta->disk_sectors = (uint32_t)tmp; + meta->disk_rebuild_high = UINT32_MAX; + meta->disk_rebuild = UINT32_MAX; error = promise_meta_write(cp, &meta, 1); free(meta, M_MD_PROMISE); return (error); @@ -617,9 +660,8 @@ g_raid_md_promise_start_disk(struct g_ra struct g_raid_md_promise_perdisk *pd; struct g_raid_md_promise_pervolume *pv; struct promise_raid_conf *meta; - off_t size; + off_t eoff, esize, size; int disk_pos, md_disk_pos, i, resurrection = 0; - uint32_t eoff, esize; sc = disk->d_softc; pd = (struct g_raid_md_promise_perdisk *)disk->d_md_data; @@ -729,8 +771,10 @@ nofit: sd->sd_offset = (off_t)eoff * 512; sd->sd_size = (off_t)esize * 512; } else { - sd->sd_offset = (off_t)pd->pd_meta[sdn]->disk_offset * 512; - sd->sd_size = (off_t)pd->pd_meta[sdn]->disk_sectors * 512; + sd->sd_offset = (((off_t)pd->pd_meta[sdn]->disk_offset_high + << 32) + pd->pd_meta[sdn]->disk_offset) * 512; + sd->sd_size = (((off_t)pd->pd_meta[sdn]->disk_sectors_high + << 32) + pd->pd_meta[sdn]->disk_sectors) * 512; } if (resurrection) { @@ -749,7 +793,8 @@ nofit: sd->sd_rebuild_pos = 0; else { sd->sd_rebuild_pos = - (off_t)pd->pd_meta[sdn]->rebuild_lba * 512; + (((off_t)pd->pd_meta[sdn]->disk_rebuild << 32) + + pd->pd_meta[sdn]->disk_rebuild) * 512; } } else if (!(meta->disks[md_disk_pos].flags & PROMISE_F_ONLINE)) { /* Rebuilding disk. */ @@ -875,13 +920,15 @@ g_raid_md_promise_start(struct g_raid_vo vol->v_disks_count = meta->total_disks; vol->v_mediasize = (off_t)meta->total_sectors * 512; //ZZZ if (meta->total_sectors_high < 256) /* If value looks sane. */ - vol->v_mediasize |= + vol->v_mediasize += ((off_t)meta->total_sectors_high << 32) * 512; //ZZZ - vol->v_sectorsize = 512; //ZZZ + vol->v_sectorsize = 512 * meta->sector_size; for (i = 0; i < vol->v_disks_count; i++) { sd = &vol->v_subdisks[i]; - sd->sd_offset = (off_t)meta->disk_offset * 512; //ZZZ - sd->sd_size = (off_t)meta->disk_sectors * 512; //ZZZ + sd->sd_offset = (((off_t)meta->disk_offset_high << 32) + + meta->disk_offset) * 512; + sd->sd_size = (((off_t)meta->disk_sectors_high << 32) + + meta->disk_sectors) * 512; } g_raid_start_volume(vol); @@ -1213,9 +1260,8 @@ g_raid_md_ctl_promise(struct g_raid_md_o const char *nodename, *verb, *volname, *levelname, *diskname; char *tmp; int *nargs, *force; - off_t size, sectorsize, strip; + off_t esize, offs[PROMISE_MAX_DISKS], size, sectorsize, strip; intmax_t *sizearg, *striparg; - uint32_t offs[PROMISE_MAX_DISKS], esize; int numdisks, i, len, level, qual; int error; @@ -1323,13 +1369,6 @@ g_raid_md_ctl_promise(struct g_raid_md_o cp->private = disk; g_topology_unlock(); - if (pp->mediasize / pp->sectorsize > UINT32_MAX) { - gctl_error(req, - "Disk '%s' is too big.", diskname); - error = -8; - break; - } - g_raid_get_disk_info(disk); /* Reserve some space for metadata. */ @@ -1394,10 +1433,6 @@ g_raid_md_ctl_promise(struct g_raid_md_o gctl_error(req, "Size too small."); return (-13); } - if (size > 0xffffffffllu * sectorsize) { - gctl_error(req, "Size too big."); - return (-14); - } /* We have all we need, create things: volume, ... */ pv = malloc(sizeof(*pv), M_MD_PROMISE, M_WAITOK | M_ZERO); @@ -1629,14 +1664,6 @@ g_raid_md_ctl_promise(struct g_raid_md_o pp = cp->provider; g_topology_unlock(); - if (pp->mediasize / pp->sectorsize > UINT32_MAX) { - gctl_error(req, - "Disk '%s' is too big.", diskname); - g_raid_kill_consumer(sc, cp); - error = -8; - break; - } - pd = malloc(sizeof(*pd), M_MD_PROMISE, M_WAITOK | M_ZERO); disk = g_raid_create_disk(sc); @@ -1733,9 +1760,9 @@ g_raid_md_write_promise(struct g_raid_md vol->v_raid_level == G_RAID_VOLUME_RL_RAID1E) meta->array_width /= 2; meta->array_number = vol->v_global_id; - meta->total_sectors = vol->v_mediasize / vol->v_sectorsize; - meta->total_sectors_high = - (vol->v_mediasize / vol->v_sectorsize) >> 32; + meta->total_sectors = vol->v_mediasize / 512; + meta->total_sectors_high = (vol->v_mediasize / 512) >> 32; + meta->sector_size = vol->v_sectorsize / 512; meta->cylinders = meta->total_sectors / (255 * 63) - 1; meta->heads = 254; meta->sectors = 63; @@ -1828,15 +1855,24 @@ g_raid_md_write_promise(struct g_raid_md pd->pd_meta[j] = promise_meta_copy(meta); pd->pd_meta[j]->disk = meta->disks[pos]; pd->pd_meta[j]->disk.number = pos; + pd->pd_meta[j]->disk_offset_high = + (sd->sd_offset / 512) >> 32; pd->pd_meta[j]->disk_offset = sd->sd_offset / 512; + pd->pd_meta[j]->disk_sectors_high = + (sd->sd_size / 512) >> 32; pd->pd_meta[j]->disk_sectors = sd->sd_size / 512; if (sd->sd_state == G_RAID_SUBDISK_S_REBUILD) { - pd->pd_meta[j]->rebuild_lba = + pd->pd_meta[j]->disk_rebuild_high = + (sd->sd_rebuild_pos / 512) >> 32; + pd->pd_meta[j]->disk_rebuild = sd->sd_rebuild_pos / 512; - } else if (sd->sd_state < G_RAID_SUBDISK_S_REBUILD) - pd->pd_meta[j]->rebuild_lba = 0; - else - pd->pd_meta[j]->rebuild_lba = UINT32_MAX; + } else if (sd->sd_state < G_RAID_SUBDISK_S_REBUILD) { + pd->pd_meta[j]->disk_rebuild_high = 0; + pd->pd_meta[j]->disk_rebuild = 0; + } else { + pd->pd_meta[j]->disk_rebuild_high = UINT32_MAX; + pd->pd_meta[j]->disk_rebuild = UINT32_MAX; + } pd->pd_updated = 1; } } From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 01:27:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 82BF0F9F; Thu, 17 Jan 2013 01:27:40 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6E6B1DF0; Thu, 17 Jan 2013 01:27:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0H1Rel1038118; Thu, 17 Jan 2013 01:27:40 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0H1Re6Y038117; Thu, 17 Jan 2013 01:27:40 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201301170127.r0H1Re6Y038117@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 17 Jan 2013 01:27:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245525 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 01:27:40 -0000 Author: bz Date: Thu Jan 17 01:27:39 2013 New Revision: 245525 URL: http://svnweb.freebsd.org/changeset/base/245525 Log: Add a conditional sleep 1 in case we add any IPv6 addresses to interfaces. Do this per jail started, not per address. This will allow DAD to complete and services to properly start. Before we have seen problems with services trying to start before the IPv6 address was available to use and thus erroring and failing to start. MFC after: 3 days Modified: head/etc/rc.d/jail Modified: head/etc/rc.d/jail ============================================================================== --- head/etc/rc.d/jail Thu Jan 17 01:19:14 2013 (r245524) +++ head/etc/rc.d/jail Thu Jan 17 01:27:39 2013 (r245525) @@ -509,7 +509,7 @@ jail_handle_ips_option() esac case "${_type}" in inet) ;; - inet6) ;; + inet6) ipv6_address_count=$((ipv6_address_count + 1)) ;; *) warn "Could not determine address family. Not going" \ "to ${_action} address '${_addr}' for ${_jail}." continue @@ -546,6 +546,7 @@ jail_ips() esac # Handle addresses. + ipv6_address_count=0 jail_handle_ips_option ${_action} "${_ip}" # Handle jail_xxx_ip_multi alias=0 @@ -558,6 +559,12 @@ jail_ips() ;; esac done + case ${ipv6_address_count} in + 0) ;; + *) # Sleep 1 second to let DAD complete before starting services. + sleep 1 + ;; + esac } jail_prestart() From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 01:29:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6475631D; Thu, 17 Jan 2013 01:29:42 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 226F1E11; Thu, 17 Jan 2013 01:29:42 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 9CEC525D38A5; Thu, 17 Jan 2013 01:29:39 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id CE268BE84A1; Thu, 17 Jan 2013 01:29:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id Kro1Wee88leK; Thu, 17 Jan 2013 01:29:37 +0000 (UTC) Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 5BE83BE84A0; Thu, 17 Jan 2013 01:29:37 +0000 (UTC) Date: Thu, 17 Jan 2013 01:29:36 +0000 (UTC) From: "Bjoern A. Zeeb" To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r245525 - head/etc/rc.d In-Reply-To: <201301170127.r0H1Re6Y038117@svn.freebsd.org> Message-ID: References: <201301170127.r0H1Re6Y038117@svn.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 01:29:42 -0000 On Thu, 17 Jan 2013, Bjoern A. Zeeb wrote: > Author: bz > Date: Thu Jan 17 01:27:39 2013 > New Revision: 245525 > URL: http://svnweb.freebsd.org/changeset/base/245525 > > Log: > Add a conditional sleep 1 in case we add any IPv6 addresses to interfaces. > Do this per jail started, not per address. This will allow DAD to complete > and services to properly start. Before we have seen problems with services > trying to start before the IPv6 address was available to use and thus > erroring and failing to start. > > MFC after: 3 days Reviewed by: simon Reported by: clusterad Seen before by: myself (but never fixed it properly) Samples of services seen starting up really fast and failing included openldap's slapd and I think even apache. > > Modified: > head/etc/rc.d/jail > > Modified: head/etc/rc.d/jail > ============================================================================== > --- head/etc/rc.d/jail Thu Jan 17 01:19:14 2013 (r245524) > +++ head/etc/rc.d/jail Thu Jan 17 01:27:39 2013 (r245525) > @@ -509,7 +509,7 @@ jail_handle_ips_option() > esac > case "${_type}" in > inet) ;; > - inet6) ;; > + inet6) ipv6_address_count=$((ipv6_address_count + 1)) ;; > *) warn "Could not determine address family. Not going" \ > "to ${_action} address '${_addr}' for ${_jail}." > continue > @@ -546,6 +546,7 @@ jail_ips() > esac > > # Handle addresses. > + ipv6_address_count=0 > jail_handle_ips_option ${_action} "${_ip}" > # Handle jail_xxx_ip_multi > alias=0 > @@ -558,6 +559,12 @@ jail_ips() > ;; > esac > done > + case ${ipv6_address_count} in > + 0) ;; > + *) # Sleep 1 second to let DAD complete before starting services. > + sleep 1 > + ;; > + esac > } > > jail_prestart() > -- Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family. From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 01:51:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CA51C861; Thu, 17 Jan 2013 01:51:05 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A766EF45; Thu, 17 Jan 2013 01:51:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0H1p5VB045984; Thu, 17 Jan 2013 01:51:05 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0H1p42P045979; Thu, 17 Jan 2013 01:51:04 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201301170151.r0H1p42P045979@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 17 Jan 2013 01:51:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245527 - in head: secure/lib/libssh secure/usr.bin/ssh secure/usr.sbin/sshd share/mk tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 01:51:05 -0000 Author: bz Date: Thu Jan 17 01:51:04 2013 New Revision: 245527 URL: http://svnweb.freebsd.org/changeset/base/245527 Log: Add a src.conf(5) option to allow users to compile in the "NONE cipher", which, only after authentication, disables crypto, and only for sessions without a terminal. Submitted by: Jeremy Chadwick (freebsd jdc.parodius.com) PR: bin/163095 MFC after: 10 days Added: head/tools/build/options/WITH_OPENSSH_NONE_CIPHER (contents, props changed) Modified: head/secure/lib/libssh/Makefile head/secure/usr.bin/ssh/Makefile head/secure/usr.sbin/sshd/Makefile head/share/mk/bsd.own.mk Modified: head/secure/lib/libssh/Makefile ============================================================================== --- head/secure/lib/libssh/Makefile Thu Jan 17 01:28:55 2013 (r245526) +++ head/secure/lib/libssh/Makefile Thu Jan 17 01:51:04 2013 (r245527) @@ -38,6 +38,10 @@ DPADD+= ${LIBGSSAPI} ${LIBKRB5} ${LIBHX5 LDADD+= -lgssapi -lkrb5 -lhx509 -lasn1 -lcom_err -lmd -lroken .endif +.if ${MK_OPENSSH_NONE_CIPHER} != "no" +CFLAGS+= -DNONE_CIPHER_ENABLED +.endif + NO_LINT= DPADD+= ${LIBCRYPTO} ${LIBCRYPT} Modified: head/secure/usr.bin/ssh/Makefile ============================================================================== --- head/secure/usr.bin/ssh/Makefile Thu Jan 17 01:28:55 2013 (r245526) +++ head/secure/usr.bin/ssh/Makefile Thu Jan 17 01:51:04 2013 (r245527) @@ -25,6 +25,10 @@ DPADD+= ${LIBGSSAPI} LDADD+= -lgssapi .endif +.if ${MK_OPENSSH_NONE_CIPHER} != "no" +CFLAGS+= -DNONE_CIPHER_ENABLED +.endif + DPADD+= ${LIBCRYPT} ${LIBCRYPTO} LDADD+= -lcrypt -lcrypto Modified: head/secure/usr.sbin/sshd/Makefile ============================================================================== --- head/secure/usr.sbin/sshd/Makefile Thu Jan 17 01:28:55 2013 (r245526) +++ head/secure/usr.sbin/sshd/Makefile Thu Jan 17 01:51:04 2013 (r245527) @@ -40,6 +40,10 @@ DPADD+= ${LIBGSSAPI_KRB5} ${LIBGSSAPI} LDADD+= -lgssapi_krb5 -lgssapi -lkrb5 -lasn1 .endif +.if ${MK_OPENSSH_NONE_CIPHER} != "no" +CFLAGS+= -DNONE_CIPHER_ENABLED +.endif + DPADD+= ${LIBCRYPTO} ${LIBCRYPT} LDADD+= -lcrypto -lcrypt Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Thu Jan 17 01:28:55 2013 (r245526) +++ head/share/mk/bsd.own.mk Thu Jan 17 01:51:04 2013 (r245527) @@ -360,6 +360,7 @@ __DEFAULT_NO_OPTIONS = \ NMTREE \ NAND \ OFED \ + OPENSSH_NONE_CIPHER \ SHARED_TOOLCHAIN # Added: head/tools/build/options/WITH_OPENSSH_NONE_CIPHER ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_OPENSSH_NONE_CIPHER Thu Jan 17 01:51:04 2013 (r245527) @@ -0,0 +1,9 @@ +.\" $FreeBSD$ +Set to include the "None" cipher support in OpenSSH and its libraries. +Additional adjustments may need to be done to system configuration +files, such as +.Xr sshd_config 5 , +to enable this cipher. +Please see +.Pa /usr/src/crypto/openssh/README.hpn +for full details. From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 02:07:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3D854FFD; Thu, 17 Jan 2013 02:07:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx07.syd.optusnet.com.au (fallbackmx07.syd.optusnet.com.au [211.29.132.9]) by mx1.freebsd.org (Postfix) with ESMTP id 5854A6B; Thu, 17 Jan 2013 02:07:56 +0000 (UTC) Received: from mail10.syd.optusnet.com.au (mail10.syd.optusnet.com.au [211.29.132.191]) by fallbackmx07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r0H27ndK004029; Thu, 17 Jan 2013 13:07:49 +1100 Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail10.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r0H27V75017594 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 17 Jan 2013 13:07:33 +1100 Date: Thu, 17 Jan 2013 13:07:31 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eitan Adler Subject: Re: svn commit: r245494 - head/bin/pwait In-Reply-To: Message-ID: <20130117125124.T1066@besplex.bde.org> References: <201301160503.r0G53qie087155@svn.freebsd.org> <50F6ED68.50602@delphij.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=Auu2R5BP c=1 sm=1 a=FCoFQeHV-_kA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=0Iti9RnyFakA:10 a=SWg00rOMAAAA:8 a=9I5xiGouAAAA:8 a=d02al9D6jb9SjW1LqP8A:9 a=CjuIK1q_8ugA:10 a=0yGDDesplhsA:10 a=3_5TX_vZOqAA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: "svn-src-head@freebsd.org" , Xin LI , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , d@delphij.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 02:07:57 -0000 On Wed, 16 Jan 2013, Eitan Adler wrote: > On 16 January 2013 13:11, Xin Li wrote: > >> Yes I did. Using exit(3) tells clang that this is the final exit and >> thus eliminates the warning. >> >> It sounds like a bug (or arguably a feature) that clang does not >> recognize return in main()s... > > It is not a bug: see Of course it is a bug. > http://clang-developers.42468.n3.nabble.com/Static-analyzer-possible-memory-leak-false-positive-td4026706.html Not much signal there. C99 requires main() to be handled specially in hosted environments. (In freestanding environments(), neither main() nor malloc() is special. Now the compiler could warn about main(), but it cannot know what malloc() does so it cannot warn about not freeing memory on return from main().) It requires that, if the return type of main() is compatible with int (and thus not void), then a return from the _initial_ call to main() is equivalent to calling exit() with an arg equal to the return value (and that if main() doesn't explicitly return or exit, but falls through to the closing brace, then this is equivalent to 'return (0);'. It seems to be permitted to call malloc() recursively (otherwise C99 w. The warning is useful if main() is called recursively. But few programs call main() recursively. pwait(1) obviously doesn't. The the bug is quality of implementation one. The static analyzer is too stupid to see that main() isn't called recursively. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 02:09:10 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4C9E6369; Thu, 17 Jan 2013 02:09:10 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) by mx1.freebsd.org (Postfix) with ESMTP id CA5C099; Thu, 17 Jan 2013 02:09:09 +0000 (UTC) Received: from alph.allbsd.org (p1137-ipbf1505funabasi.chiba.ocn.ne.jp [118.7.212.137]) (authenticated bits=128) by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id r0H28ps0009420 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 17 Jan 2013 11:09:02 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) (authenticated bits=0) by alph.allbsd.org (8.14.5/8.14.5) with ESMTP id r0H28naM008894; Thu, 17 Jan 2013 11:08:51 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Thu, 17 Jan 2013 11:07:23 +0900 (JST) Message-Id: <20130117.110723.1450987474949438621.hrs@allbsd.org> To: bz@FreeBSD.org Subject: Re: svn commit: r245525 - head/etc/rc.d From: Hiroki Sato In-Reply-To: <201301170127.r0H1Re6Y038117@svn.freebsd.org> References: <201301170127.r0H1Re6Y038117@svn.freebsd.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.5 on Emacs 23.4 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Thu_Jan_17_11_07_23_2013_045)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.allbsd.org [133.31.130.32]); Thu, 17 Jan 2013 11:09:02 +0900 (JST) X-Spam-Status: No, score=-98.1 required=13.0 tests=CONTENT_TYPE_PRESENT, ONLY1HOPDIRECT,SAMEHELOBY2HOP,USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 02:09:10 -0000 ----Security_Multipart(Thu_Jan_17_11_07_23_2013_045)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit "Bjoern A. Zeeb" wrote in <201301170127.r0H1Re6Y038117@svn.freebsd.org>: bz> Author: bz bz> Date: Thu Jan 17 01:27:39 2013 bz> New Revision: 245525 bz> URL: http://svnweb.freebsd.org/changeset/base/245525 bz> bz> Log: bz> Add a conditional sleep 1 in case we add any IPv6 addresses to interfaces. bz> Do this per jail started, not per address. This will allow DAD to complete bz> and services to properly start. Before we have seen problems with services bz> trying to start before the IPv6 address was available to use and thus bz> erroring and failing to start. bz> bz> MFC after: 3 days This may be too pedantic, but I think this delay should use DupAddrDetectTransmits (net.inet6.ip6.dad_count). The default value of RETRANS_TIMER and MAX_RTR_SOLICITATION_DELAY in RFC 4861 is 1 sec, so the theoretical delay value is (DupAddrDetectTransmits * RETRANS_TIMER + MAX_RTR_SOLICITATION_DELAY). The rc.d/netif script uses this value (typically 2 seconds) for DAD. I understand a simple 1 second delay works in practice, though. -- Hiroki ----Security_Multipart(Thu_Jan_17_11_07_23_2013_045)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAlD3XNsACgkQTyzT2CeTzy1GYQCg1lYMEWM8mGxzRr0SHzhiEJcB F78An1Nwwpymirv3IG6vzpvBczstMBl8 =CG8S -----END PGP SIGNATURE----- ----Security_Multipart(Thu_Jan_17_11_07_23_2013_045)---- From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 02:25:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 89BB8719; Thu, 17 Jan 2013 02:25:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id 16681134; Thu, 17 Jan 2013 02:25:22 +0000 (UTC) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r0H2PLkc005686; Thu, 17 Jan 2013 13:25:21 +1100 Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r0H2PCRf006526 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 17 Jan 2013 13:25:13 +1100 Date: Thu, 17 Jan 2013 13:25:12 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Xin LI Subject: Re: svn commit: r245506 - head/bin/pwait In-Reply-To: <201301161815.r0GIFQPk007553@svn.freebsd.org> Message-ID: <20130117130740.I1066@besplex.bde.org> References: <201301161815.r0GIFQPk007553@svn.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.0 cv=P/xiHV8u c=1 sm=1 a=jy4U5xBK6Z8A:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=0Iti9RnyFakA:10 a=TPjh7SLijXKq6PV6sMgA:9 a=CjuIK1q_8ugA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 02:25:23 -0000 On Wed, 16 Jan 2013, Xin LI wrote: > Log: > Use a different way to silence clang analyzer as done in r245494 by > explicitly telling the compiler that we are on the exit route. > > X-MFC: together with r245494 > > Modified: > head/bin/pwait/pwait.c > > Modified: head/bin/pwait/pwait.c > ============================================================================== > --- head/bin/pwait/pwait.c Wed Jan 16 09:07:49 2013 (r245505) > +++ head/bin/pwait/pwait.c Wed Jan 16 18:15:25 2013 (r245506) > @@ -141,6 +141,5 @@ main(int argc, char *argv[]) > nleft -= n; > } > > - free(e); > - return 0; > + exit(EX_OK); > } This uses the sysexits mistake. style(9) was fixed to not give an example of this mistake. Before this, sysexits was used a whole once in pwait(1) (for EX_USAGE) in usage(). EX_USAGE happens to be 64. As usual when the mistake is used, this is useless for humans (the usage message gives more info) and unusable for programs, especially since it is undocmented (pwait(1)'s man page just says ">0 if an error occurs". It doesn't even use '.Std' for this, but hard-codes it. The related utilities for kill(1) and pkill(1) and their man pages are better. kill(1) doesn't use the mistake, and its man page uses '.Std'. pkill(1) doesn't use the mistake; it uses small integers for exit statuses, and its man page seems to document these correctly (it cannot use .Std since the exit status isn't standard). Bruce From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 03:27:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EF4B6B9F; Thu, 17 Jan 2013 03:27:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E21026FB; Thu, 17 Jan 2013 03:27:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0H3R8Zq075325; Thu, 17 Jan 2013 03:27:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0H3R8pf075324; Thu, 17 Jan 2013 03:27:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301170327.r0H3R8pf075324@svn.freebsd.org> From: Alexander Motin Date: Thu, 17 Jan 2013 03:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245533 - head/sys/geom/raid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 03:27:09 -0000 Author: mav Date: Thu Jan 17 03:27:08 2013 New Revision: 245533 URL: http://svnweb.freebsd.org/changeset/base/245533 Log: - Fix rebuild position broken at r245522. - Identify one more metadata field. Modified: head/sys/geom/raid/md_promise.c Modified: head/sys/geom/raid/md_promise.c ============================================================================== --- head/sys/geom/raid/md_promise.c Thu Jan 17 03:25:31 2013 (r245532) +++ head/sys/geom/raid/md_promise.c Thu Jan 17 03:27:08 2013 (r245533) @@ -126,7 +126,8 @@ struct promise_raid_conf { uint8_t magic_6; uint8_t sector_size; uint16_t magic_7; - uint32_t magic_8[32]; + uint32_t magic_8[31]; + uint32_t backup_time; uint16_t magic_9; uint32_t disk_offset_high; uint32_t disk_sectors_high; @@ -228,6 +229,7 @@ g_raid_md_promise_print(struct promise_r printf("magic_5 0x%08x\n", meta->magic_5); printf("total_sectors_high 0x%08x\n", meta->total_sectors_high); printf("sector_size %u\n", meta->sector_size); + printf("backup_time %d\n", meta->backup_time); printf("disk_offset_high 0x%08x\n", meta->disk_offset_high); printf("disk_sectors_high 0x%08x\n", meta->disk_sectors_high); printf("disk_rebuild_high 0x%08x\n", meta->disk_rebuild_high); @@ -398,6 +400,7 @@ next: meta->disk_rebuild_high = 0; if (meta->total_sectors_high == 0x15161718) { meta->total_sectors_high = 0; + meta->backup_time = 0; if (meta->rebuild_lba64 == 0x2122232425262728) meta->rebuild_lba64 = UINT64_MAX; } @@ -793,7 +796,7 @@ nofit: sd->sd_rebuild_pos = 0; else { sd->sd_rebuild_pos = - (((off_t)pd->pd_meta[sdn]->disk_rebuild << 32) + + (((off_t)pd->pd_meta[sdn]->disk_rebuild_high << 32) + pd->pd_meta[sdn]->disk_rebuild) * 512; } } else if (!(meta->disks[md_disk_pos].flags & PROMISE_F_ONLINE)) { From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 03:41:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B27AB331 for ; Thu, 17 Jan 2013 03:41:23 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com [209.85.215.44]) by mx1.freebsd.org (Postfix) with ESMTP id 274F579B for ; Thu, 17 Jan 2013 03:41:22 +0000 (UTC) Received: by mail-la0-f44.google.com with SMTP id eb20so1011892lab.3 for ; Wed, 16 Jan 2013 19:41:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=teeKrHj9lJDjzm17y09JVV6TCs9lMPkl+GjnDlFmRAo=; b=No3hWx1G/aG4/ygIunsEJYWmv2QF/pG4tD4buqH/tlXQe7PG1QBBG203rOENc0+Mr7 M1Amt2czeKr8DT9vjAMAh9HJW6pHTgE1I/NAhXLH51pjPBTdwOZvVbw9Mp0yXnyRf9bc je9IDV8Q9A+hqg+tj4BG4WD6vUIRMOBXqrJL0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=teeKrHj9lJDjzm17y09JVV6TCs9lMPkl+GjnDlFmRAo=; b=lytgErtu2QijjJELk9xSTINGZ9BUawhBxgXInK/7cCmCoGrqDzQXbvCB5kP+uXZQhp wkQIHkC1ThGDhM/I1uFr0pAF5Iqx3jYIv5Mgw4CDjBs86BMFmSsR2YlEeh1ZOPlsku42 edGlT1w9yvUVnFCcR6CC1mU7s0y86p/iWjMqp0ZgnOW332Oj7OmpOCw1v1TDHzR1N1XA E28SR/mCL76J3S0cgEAYsYLNIPO1LRS118XkI97xmw4eS4lFP1v+6F7szkrLfcPpjdmi Nt4QQEWi9iTtoL5y4t3VY7sBvsuRqg2csUn03/mErFqTUQdbJtNRt/8bu1dzc+DZMwy7 p6LA== X-Received: by 10.152.125.136 with SMTP id mq8mr3286904lab.41.1358394081599; Wed, 16 Jan 2013 19:41:21 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.30.131 with HTTP; Wed, 16 Jan 2013 19:40:51 -0800 (PST) In-Reply-To: <20130117130740.I1066@besplex.bde.org> References: <201301161815.r0GIFQPk007553@svn.freebsd.org> <20130117130740.I1066@besplex.bde.org> From: Eitan Adler Date: Wed, 16 Jan 2013 22:40:51 -0500 X-Google-Sender-Auth: MvjbaOfpgIqbw6yjJMROFwC1Rfs Message-ID: Subject: Re: svn commit: r245506 - head/bin/pwait To: Bruce Evans Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQkzz0ZiYT8Ofm7FJ4ZPNOtiEnZgDwpoY/xPut7yWGAcrzEcCuDX+/Te53GDF+rfptj3BIzM Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 03:41:23 -0000 On 16 January 2013 21:25, Bruce Evans wrote: > This uses the sysexits mistake. style(9) was fixed to not give an example > of this mistake. Before this, sysexits was used a whole once in pwait(1) > (for EX_USAGE) in usage(). EX_USAGE happens to be 64. As usual when the > mistake is used, this is useless for humans (the usage message gives more > info) and unusable for programs, especially since it is undocmented > (pwait(1)'s man page just says ">0 if an error occurs". It doesn't even > use '.Std' for this, but hard-codes it. IMHO using sysexits gives more signal than using a binary 0 or 1. It is a mistake to have changed style(9) to avoid using sysexits. Instead the man page should detail the specific error that occurs directly, or by reference to sysexit. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 04:20:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 22A87327; Thu, 17 Jan 2013 04:20:32 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 15A9484E; Thu, 17 Jan 2013 04:20:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0H4KVkB092614; Thu, 17 Jan 2013 04:20:31 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0H4KVOb092613; Thu, 17 Jan 2013 04:20:31 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201301170420.r0H4KVOb092613@svn.freebsd.org> From: Eitan Adler Date: Thu, 17 Jan 2013 04:20:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245535 - head/bin/cp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 04:20:32 -0000 Author: eadler Date: Thu Jan 17 04:20:31 2013 New Revision: 245535 URL: http://svnweb.freebsd.org/changeset/base/245535 Log: Remove useless variable 'Pflag': -P is an alternative to -H and -L, and it is implemented using the Hflag and Lflag variables. Approved by: cperciva MFC after: 3 days Modified: head/bin/cp/cp.c Modified: head/bin/cp/cp.c ============================================================================== --- head/bin/cp/cp.c Thu Jan 17 03:27:53 2013 (r245534) +++ head/bin/cp/cp.c Thu Jan 17 04:20:31 2013 (r245535) @@ -98,30 +98,28 @@ main(int argc, char *argv[]) { struct stat to_stat, tmp_stat; enum op type; - int Hflag, Lflag, Pflag, ch, fts_options, r, have_trailing_slash; + int Hflag, Lflag, ch, fts_options, r, have_trailing_slash; char *target; fts_options = FTS_NOCHDIR | FTS_PHYSICAL; - Hflag = Lflag = Pflag = 0; + Hflag = Lflag = 0; while ((ch = getopt(argc, argv, "HLPRafilnprvx")) != -1) switch (ch) { case 'H': Hflag = 1; - Lflag = Pflag = 0; + Lflag = 0; break; case 'L': Lflag = 1; - Hflag = Pflag = 0; + Hflag = 0; break; case 'P': - Pflag = 1; Hflag = Lflag = 0; break; case 'R': Rflag = 1; break; case 'a': - Pflag = 1; pflag = 1; Rflag = 1; Hflag = Lflag = 0; @@ -146,7 +144,7 @@ main(int argc, char *argv[]) break; case 'r': rflag = Lflag = 1; - Hflag = Pflag = 0; + Hflag = 0; break; case 'v': vflag = 1; From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 04:20:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7180D554; Thu, 17 Jan 2013 04:20:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 55BD88B3; Thu, 17 Jan 2013 04:20:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0H4Ks8m092838; Thu, 17 Jan 2013 04:20:54 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0H4Ks7N092837; Thu, 17 Jan 2013 04:20:54 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201301170420.r0H4Ks7N092837@svn.freebsd.org> From: Eitan Adler Date: Thu, 17 Jan 2013 04:20:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245536 - head/tools/tools/notescheck X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 04:20:54 -0000 Author: eadler Date: Thu Jan 17 04:20:53 2013 New Revision: 245536 URL: http://svnweb.freebsd.org/changeset/base/245536 Log: Convert to Python 3 Approved by: cperciva Modified: head/tools/tools/notescheck/notescheck.py Modified: head/tools/tools/notescheck/notescheck.py ============================================================================== --- head/tools/tools/notescheck/notescheck.py Thu Jan 17 04:20:31 2013 (r245535) +++ head/tools/tools/notescheck/notescheck.py Thu Jan 17 04:20:53 2013 (r245536) @@ -12,9 +12,9 @@ import os.path import sys def usage(): - print >>sys.stderr, "notescheck " - print >>sys.stderr - print >>sys.stderr, "Where 'path' is a path to a kernel source tree." + print("notescheck ", file=sys.stderr) + print(file=sys.stderr) + print("Where 'path' is a path to a kernel source tree.", file=sys.stderr) # These files are used to determine if a path is a valid kernel source tree. requiredfiles = ['conf/files', 'conf/options', 'conf/NOTES'] @@ -62,9 +62,9 @@ class Option: self.type = type self.type_location = location elif self.type != type: - print "WARN: Attempt to change type of %s from %s to %s%s" % \ - (self.name, self.type, type, location) - print " Previous type set%s" % (self.type_location) + print("WARN: Attempt to change type of %s from %s to %s%s" % \ + (self.name, self.type, type, location)) + print(" Previous type set%s" % (self.type_location)) def add_define(self, platform): self.defines.add(platform) @@ -93,8 +93,8 @@ class Option: if global_platform in self.defines: # If the device is defined globally ans is never tested, whine. if len(self.tests) == 0: - print 'WARN: %s is defined globally but never tested' % \ - (self.title()) + print('WARN: %s is defined globally but never tested' % \ + (self.title())) return # If the device is defined globally and is tested on @@ -106,25 +106,25 @@ class Option: # If a device is defined globally but is only tested on a # single MD platform, then whine about this. - print 'WARN: %s is defined globally but only tested in %s NOTES' % \ - (self.title(), format_set(self.tests)) + print('WARN: %s is defined globally but only tested in %s NOTES' % \ + (self.title(), format_set(self.tests))) return # If an option or device is never tested, whine. if len(self.tests) == 0: - print 'WARN: %s is defined in %s but never tested' % \ - (self.title(), format_set(self.defines)) + print('WARN: %s is defined in %s but never tested' % \ + (self.title(), format_set(self.defines))) return # The set of MD platforms where this option is defined, but not tested. notest = self.defines - self.tests if len(notest) != 0: - print 'WARN: %s is not tested in %s NOTES' % \ - (self.title(), format_set(notest)) + print('WARN: %s is not tested in %s NOTES' % \ + (self.title(), format_set(notest))) return - print 'ERROR: bad state for %s: defined in %s, tested in %s' % \ - (self.title(), format_set(self.defines), format_set(self.tests)) + print('ERROR: bad state for %s: defined in %s, tested in %s' % \ + (self.title(), format_set(self.defines), format_set(self.tests))) # This class maintains a dictionary of options keyed by name. class Options: @@ -143,7 +143,7 @@ class Options: # Warn about inconsistencies def warn(self): - keys = self.options.keys() + keys = list(self.options.keys()) keys.sort() for key in keys: option = self.options[key] @@ -158,11 +158,11 @@ def find_platforms(tree): platforms = [] for file in glob.glob(tree + '*/conf/NOTES'): if not file.startswith(tree): - print >>sys.stderr, "Bad MD NOTES file %s" %(file) + print("Bad MD NOTES file %s" %(file), file=sys.stderr) sys.exit(1) platforms.append(file[len(tree):].split('/')[0]) if global_platform in platforms: - print >>sys.stderr, "Found MD NOTES file for global platform" + print("Found MD NOTES file for global platform", file=sys.stderr) sys.exit(1) return platforms @@ -224,7 +224,7 @@ def tokenize(line): # will contain 'number of quotes' + 1 entries, so it should have # an odd number of entries. if len(groups) % 2 == 0: - print >>sys.stderr, "Failed to tokenize: %s%s" (line, location) + print("Failed to tokenize: %s%s" (line, location), file=sys.stderr) return [] # String split all the "odd" groups since they are not quoted strings. @@ -256,7 +256,7 @@ def parse_files_line(line, platform): # Remaining lines better be optional or mandatory lines. if words[1] != 'optional' and words[1] != 'mandatory': - print >>sys.stderr, "Invalid files line: %s%s" % (line, location) + print("Invalid files line: %s%s" % (line, location), file=sys.stderr) # Drop the first two words and begin parsing keywords and devices. skip = False @@ -334,7 +334,7 @@ def main(argv=None): tree = tree + '/' for file in requiredfiles: if not os.path.exists(tree + file): - print>> sys.stderr, "Kernel source tree missing %s" % (file) + print("Kernel source tree missing %s" % (file), file=sys.stderr) return 1 platforms = find_platforms(tree) From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 05:56:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 573528BA; Thu, 17 Jan 2013 05:56:33 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3A6596D8; Thu, 17 Jan 2013 05:56:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0H5uXJV020027; Thu, 17 Jan 2013 05:56:33 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0H5uTw0020003; Thu, 17 Jan 2013 05:56:29 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201301170556.r0H5uTw0020003@svn.freebsd.org> From: Andrew Turner Date: Thu, 17 Jan 2013 05:56:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245539 - in head: contrib/gcc/config/arm gnu/lib/csu gnu/lib/libgcc gnu/lib/libgcov gnu/lib/libstdc++ gnu/usr.bin/cc gnu/usr.bin/cc/c++filt gnu/usr.bin/cc/cc1 gnu/usr.bin/cc/cc1plus gn... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 05:56:33 -0000 Author: andrew Date: Thu Jan 17 05:56:28 2013 New Revision: 245539 URL: http://svnweb.freebsd.org/changeset/base/245539 Log: Add compiler support for the ARM EABI. ARM EABI support is disabled by default and can be enabled by setting WITH_ARM_EABI when building, however only the kernel-toolchain target will work with this flag until the rest of the support is added. Added: head/tools/build/options/WITH_ARM_EABI (contents, props changed) Modified: head/contrib/gcc/config/arm/freebsd.h head/gnu/lib/csu/Makefile head/gnu/lib/libgcc/Makefile head/gnu/lib/libgcov/Makefile head/gnu/lib/libstdc++/Makefile head/gnu/usr.bin/cc/Makefile.inc head/gnu/usr.bin/cc/c++filt/Makefile head/gnu/usr.bin/cc/cc1/Makefile head/gnu/usr.bin/cc/cc1plus/Makefile head/gnu/usr.bin/cc/cc_int/Makefile head/gnu/usr.bin/cc/cc_tools/Makefile head/gnu/usr.bin/cc/doc/Makefile head/gnu/usr.bin/cc/gcov/Makefile head/gnu/usr.bin/cc/include/Makefile head/gnu/usr.bin/cc/libcpp/Makefile head/gnu/usr.bin/cc/libdecnumber/Makefile head/gnu/usr.bin/cc/libiberty/Makefile head/share/mk/bsd.own.mk Modified: head/contrib/gcc/config/arm/freebsd.h ============================================================================== --- head/contrib/gcc/config/arm/freebsd.h Thu Jan 17 05:55:53 2013 (r245538) +++ head/contrib/gcc/config/arm/freebsd.h Thu Jan 17 05:56:28 2013 (r245539) @@ -29,8 +29,13 @@ { "fbsd_dynamic_linker", FBSD_DYNAMIC_LINKER } #undef SUBTARGET_EXTRA_ASM_SPEC +#ifdef TARGET_ARM_EABI +#define SUBTARGET_EXTRA_ASM_SPEC \ + "%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=4} %{fpic|fpie:-k} %{fPIC|fPIE:-k}" +#else #define SUBTARGET_EXTRA_ASM_SPEC \ "-matpcs %{fpic|fpie:-k} %{fPIC|fPIE:-k}" +#endif /* Default to full FPA if -mhard-float is specified. */ #undef SUBTARGET_ASM_FLOAT_SPEC @@ -61,8 +66,25 @@ #define TARGET_ENDIAN_DEFAULT 0 #endif +#ifdef TARGET_ARM_EABI +/* We default to a soft-float ABI so that binaries can run on all + target hardware. */ +#undef TARGET_DEFAULT_FLOAT_ABI +#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT + +#undef ARM_DEFAULT_ABI +#define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX + +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + FBSD_TARGET_OS_CPP_BUILTINS(); \ + TARGET_BPABI_CPP_BUILTINS(); \ + } \ + while (false) +#else /* Default it to use ATPCS with soft-VFP. */ -#undef TARGET_DEFAULT #define TARGET_DEFAULT \ (MASK_APCS_FRAME \ | TARGET_ENDIAN_DEFAULT) @@ -70,6 +92,10 @@ #undef ARM_DEFAULT_ABI #define ARM_DEFAULT_ABI ARM_ABI_ATPCS +#undef FPUTYPE_DEFAULT +#define FPUTYPE_DEFAULT FPUTYPE_VFP +#endif + /* Define the actual types of some ANSI-mandated types. Needs to agree with . GCC defaults come from c-decl.c, c-common.c, and config//.h. */ @@ -134,5 +160,3 @@ do \ } \ while (0) -#undef FPUTYPE_DEFAULT -#define FPUTYPE_DEFAULT FPUTYPE_VFP Modified: head/gnu/lib/csu/Makefile ============================================================================== --- head/gnu/lib/csu/Makefile Thu Jan 17 05:55:53 2013 (r245538) +++ head/gnu/lib/csu/Makefile Thu Jan 17 05:56:28 2013 (r245539) @@ -24,6 +24,10 @@ CFLAGS+= -I${GCCLIB}/include -I${GCCDIR} CRTS_CFLAGS= -DCRTSTUFFS_O -DSHARED ${PICFLAG} MKDEP= -DCRT_BEGIN +.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +CFLAGS+= -DTARGET_ARM_EABI +.endif + .if ${MACHINE_CPUARCH} == "ia64" BEGINSRC= crtbegin.asm ENDSRC= crtend.asm Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Thu Jan 17 05:55:53 2013 (r245538) +++ head/gnu/lib/libgcc/Makefile Thu Jan 17 05:56:28 2013 (r245539) @@ -15,6 +15,10 @@ MK_SSP= no .include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt" +.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +CFLAGS+= -DTARGET_ARM_EABI +.endif + .if ${TARGET_CPUARCH} == "mips" LIB= gcc .endif @@ -55,10 +59,13 @@ LIB2FUNCS+= _fixuns${mode}si .endfor # Likewise double-word routines. +.if ${TARGET_CPUARCH} != "arm" || ${MK_ARM_EABI} == "no" +# These are implemented in an ARM specific file but will not be filtered out .for mode in sf df xf tf LIB2FUNCS+= _fix${mode}di _fixuns${mode}di LIB2FUNCS+= _floatdi${mode} _floatundi${mode} .endfor +.endif LIB2ADD = $(LIB2FUNCS_EXTRA) LIB2ADD_ST = $(LIB2FUNCS_STATIC_EXTRA) @@ -115,15 +122,14 @@ CFLAGS+= -fheinous-gnu-extensions LIB1ASMSRC = lib1funcs.asm LIB1ASMFUNCS = _dvmd_tls _bb_init_func -LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c +.if ${MK_ARM_EABI} != "no" +LIB1ASMFUNCS+= _addsubdf3 _addsubsf3 _cmpdf2 _cmpsf2 _fixdfsi _fixsfsi \ + _fixunsdfsi _fixunsdfsi _muldivdf3 _muldivsf3 _udivsi3 -# Not now -#LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func -#LIB1ASMFUNCS+= _call_via_rX _interwork_call_via_rX \ -# _lshrdi3 _ashrdi3 _ashldi3 \ -# _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \ -# _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \ -# _fixsfsi _fixunssfsi _floatdidf _floatdisf +LIB2ADDEH = unwind-arm.c libunwind.S pr-support.c unwind-c.c +.else +LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c +.endif .endif .if ${TARGET_CPUARCH} == mips @@ -329,6 +335,9 @@ CLEANFILES += cs-*.h option* SHLIB_MKMAP = ${GCCDIR}/mkmap-symver.awk SHLIB_MKMAP_OPTS = SHLIB_MAPFILES = ${GCCDIR}/libgcc-std.ver +.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +SHLIB_MAPFILES += ${GCCDIR}/config/arm/libgcc-bpabi.ver +.endif VERSION_MAP = libgcc.map libgcc.map: ${SHLIB_MKMAP} ${SHLIB_MAPFILES} ${SOBJS} ${OBJS:R:S/$/.So/} Modified: head/gnu/lib/libgcov/Makefile ============================================================================== --- head/gnu/lib/libgcov/Makefile Thu Jan 17 05:55:53 2013 (r245538) +++ head/gnu/lib/libgcov/Makefile Thu Jan 17 05:56:28 2013 (r245539) @@ -15,6 +15,11 @@ CFLAGS+= -DIN_GCC -DIN_LIBGCC2 -D__GCC_F CFLAGS+= -D_PTHREADS -DGTHREAD_USE_WEAK CFLAGS+= -I${.CURDIR}/../../usr.bin/cc/cc_tools \ -I${GCCLIB}/include -I${GCCDIR}/config -I${GCCDIR} -I. + +.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +CFLAGS+= -DTARGET_ARM_EABI +.endif + # # Library members defined in libgcov.c. # Defined in libgcov.c, included only in gcov library Modified: head/gnu/lib/libstdc++/Makefile ============================================================================== --- head/gnu/lib/libstdc++/Makefile Thu Jan 17 05:55:53 2013 (r245538) +++ head/gnu/lib/libstdc++/Makefile Thu Jan 17 05:56:28 2013 (r245539) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + GCCVER= 4.2 GCCDIR= ${.CURDIR}/../../../contrib/gcc GCCLIB= ${.CURDIR}/../../../contrib/gcclibs @@ -14,7 +16,7 @@ LIB= stdc++ SHLIB_MAJOR= 6 CFLAGS+= -DIN_GLIBCPP_V3 -DHAVE_CONFIG_H -.if ${MACHINE_CPUARCH} == "arm" +.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} == "no" CFLAGS+= -D_GLIBCXX_SJLJ_EXCEPTIONS=1 .endif CFLAGS+= -I${.CURDIR} -I${SUPDIR} -I${GCCDIR} -I${SRCDIR}/include @@ -594,7 +596,13 @@ gthr-default.h: ${GCCDIR}/gthr-posix.h CLEANFILES+= ${THRHDRS} +.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +unwind.h: ${GCCDIR}/config/arm/unwind-arm.h +.else unwind.h: ${GCCDIR}/unwind-generic.h +.endif + +unwind.h: ln -sf ${.ALLSRC} ${.TARGET} SRCS+= unwind.h Modified: head/gnu/usr.bin/cc/Makefile.inc ============================================================================== --- head/gnu/usr.bin/cc/Makefile.inc Thu Jan 17 05:55:53 2013 (r245538) +++ head/gnu/usr.bin/cc/Makefile.inc Thu Jan 17 05:56:28 2013 (r245539) @@ -26,6 +26,10 @@ CSTD?= gnu89 CFLAGS+= -DCROSS_COMPILE .endif +.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +CFLAGS+= -DTARGET_ARM_EABI +.endif + .if ${TARGET_ARCH} == "armeb" || ${TARGET_ARCH} == "armv6eb" CFLAGS += -DTARGET_ENDIAN_DEFAULT=MASK_BIG_END .endif Modified: head/gnu/usr.bin/cc/c++filt/Makefile ============================================================================== --- head/gnu/usr.bin/cc/c++filt/Makefile Thu Jan 17 05:55:53 2013 (r245538) +++ head/gnu/usr.bin/cc/c++filt/Makefile Thu Jan 17 05:56:28 2013 (r245539) @@ -1,5 +1,8 @@ # $FreeBSD$ +NO_MAN= +.include + .include "../Makefile.inc" .include "../Makefile.fe" @@ -7,7 +10,6 @@ PROG= c++filt SRCS= cp-demangle.c -NO_MAN= CFLAGS+= -DSTANDALONE_DEMANGLER -DVERSION=\"$(GCC_VERSION)\" Modified: head/gnu/usr.bin/cc/cc1/Makefile ============================================================================== --- head/gnu/usr.bin/cc/cc1/Makefile Thu Jan 17 05:55:53 2013 (r245538) +++ head/gnu/usr.bin/cc/cc1/Makefile Thu Jan 17 05:56:28 2013 (r245539) @@ -1,9 +1,10 @@ # $FreeBSD$ -.include "../Makefile.inc" NO_MAN= .include +.include "../Makefile.inc" + .PATH: ${GCCDIR} PROG= cc1 Modified: head/gnu/usr.bin/cc/cc1plus/Makefile ============================================================================== --- head/gnu/usr.bin/cc/cc1plus/Makefile Thu Jan 17 05:55:53 2013 (r245538) +++ head/gnu/usr.bin/cc/cc1plus/Makefile Thu Jan 17 05:56:28 2013 (r245539) @@ -1,9 +1,10 @@ # $FreeBSD$ -.include "../Makefile.inc" NO_MAN= .include +.include "../Makefile.inc" + .PATH: ${GCCDIR}/cp ${GCCDIR} PROG= cc1plus Modified: head/gnu/usr.bin/cc/cc_int/Makefile ============================================================================== --- head/gnu/usr.bin/cc/cc_int/Makefile Thu Jan 17 05:55:53 2013 (r245538) +++ head/gnu/usr.bin/cc/cc_int/Makefile Thu Jan 17 05:56:28 2013 (r245539) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + .include "../Makefile.inc" .include "../Makefile.ver" Modified: head/gnu/usr.bin/cc/cc_tools/Makefile ============================================================================== --- head/gnu/usr.bin/cc/cc_tools/Makefile Thu Jan 17 05:55:53 2013 (r245538) +++ head/gnu/usr.bin/cc/cc_tools/Makefile Thu Jan 17 05:56:28 2013 (r245539) @@ -51,6 +51,9 @@ TARGET_INC+= ${GCC_CPU}/elf.h .endif .if ${TARGET_CPUARCH} == "arm" TARGET_INC+= ${GCC_CPU}/aout.h +.if ${MK_ARM_EABI} != "no" +TARGET_INC+= ${GCC_CPU}/bpabi.h +.endif .endif .if ${TARGET_ARCH} == "powerpc64" TARGET_INC+= ${GCC_CPU}/biarch64.h @@ -349,7 +352,13 @@ gthr-default.h: ${GCCDIR}/gthr-posix.h GENSRCS+= gthr-default.h +.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +unwind.h: ${GCCDIR}/config/arm/unwind-arm.h +.else unwind.h: ${GCCDIR}/unwind-generic.h +.endif + +unwind.h: ln -sf ${.ALLSRC} ${.TARGET} GENSRCS+= unwind.h Modified: head/gnu/usr.bin/cc/doc/Makefile ============================================================================== --- head/gnu/usr.bin/cc/doc/Makefile Thu Jan 17 05:55:53 2013 (r245538) +++ head/gnu/usr.bin/cc/doc/Makefile Thu Jan 17 05:56:28 2013 (r245539) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + .include "../Makefile.inc" .include "../Makefile.ver" Modified: head/gnu/usr.bin/cc/gcov/Makefile ============================================================================== --- head/gnu/usr.bin/cc/gcov/Makefile Thu Jan 17 05:55:53 2013 (r245538) +++ head/gnu/usr.bin/cc/gcov/Makefile Thu Jan 17 05:56:28 2013 (r245539) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + .include "../Makefile.inc" .include "../Makefile.ver" Modified: head/gnu/usr.bin/cc/include/Makefile ============================================================================== --- head/gnu/usr.bin/cc/include/Makefile Thu Jan 17 05:55:53 2013 (r245538) +++ head/gnu/usr.bin/cc/include/Makefile Thu Jan 17 05:56:28 2013 (r245539) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + .include "../Makefile.inc" INCSDIR=${INCLUDEDIR}/gcc/${GCCVER} Modified: head/gnu/usr.bin/cc/libcpp/Makefile ============================================================================== --- head/gnu/usr.bin/cc/libcpp/Makefile Thu Jan 17 05:55:53 2013 (r245538) +++ head/gnu/usr.bin/cc/libcpp/Makefile Thu Jan 17 05:56:28 2013 (r245539) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + # Use our headers in preference to ones from ../cc_tools. CFLAGS+= -I${.CURDIR} -I. Modified: head/gnu/usr.bin/cc/libdecnumber/Makefile ============================================================================== --- head/gnu/usr.bin/cc/libdecnumber/Makefile Thu Jan 17 05:55:53 2013 (r245538) +++ head/gnu/usr.bin/cc/libdecnumber/Makefile Thu Jan 17 05:56:28 2013 (r245539) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + # Use our headers in preference to ones from ../cc_tools. CFLAGS+= -I${.CURDIR} -I. Modified: head/gnu/usr.bin/cc/libiberty/Makefile ============================================================================== --- head/gnu/usr.bin/cc/libiberty/Makefile Thu Jan 17 05:55:53 2013 (r245538) +++ head/gnu/usr.bin/cc/libiberty/Makefile Thu Jan 17 05:56:28 2013 (r245539) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + # # Make sure we will pick up our config.h file first, not the one from # cc_tools. Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Thu Jan 17 05:55:53 2013 (r245538) +++ head/share/mk/bsd.own.mk Thu Jan 17 05:56:28 2013 (r245539) @@ -343,6 +343,7 @@ __DEFAULT_YES_OPTIONS = \ ZONEINFO __DEFAULT_NO_OPTIONS = \ + ARM_EABI \ BIND_IDN \ BIND_LARGE_FILE \ BIND_LIBS \ Added: head/tools/build/options/WITH_ARM_EABI ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_ARM_EABI Thu Jan 17 05:56:28 2013 (r245539) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set the ARM ABI to EABI. From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 09:34:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C188081D; Thu, 17 Jan 2013 09:34:00 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9DD96F43; Thu, 17 Jan 2013 09:34:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0H9Y0xN085144; Thu, 17 Jan 2013 09:34:00 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0H9Y0jZ085143; Thu, 17 Jan 2013 09:34:00 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201301170934.r0H9Y0jZ085143@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 17 Jan 2013 09:34:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245547 - 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.14 Precedence: list List-Id: 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, 17 Jan 2013 09:34:00 -0000 Author: bz Date: Thu Jan 17 09:34:00 2013 New Revision: 245547 URL: http://svnweb.freebsd.org/changeset/base/245547 Log: Regen after adding WITH_OPENSSH_NONE_CIPHER in r245527. PR: bin/163095 MFC after: 10 days Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Thu Jan 17 08:59:11 2013 (r245546) +++ head/share/man/man5/src.conf.5 Thu Jan 17 09:34:00 2013 (r245547) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 236279 2012-05-30 02:37:20Z gjb .\" $FreeBSD$ -.Dd January 14, 2013 +.Dd January 17, 2013 .Dt SRC.CONF 5 .Os .Sh NAME @@ -805,7 +805,7 @@ Set to not build NLS catalogs. Set to not build NLS catalog support for .Xr csh 1 . .It Va WITH_NMTREE -.\" from FreeBSD: head/tools/build/options/WITH_NMTREE 245241 2013-01-09 21:07:08Z brooks +.\" from FreeBSD: head/tools/build/options/WITH_NMTREE 245435 2013-01-14 20:38:32Z brooks Set to install .Xr nmtree 8 as @@ -835,6 +835,16 @@ Infiniband software stack. .It Va WITHOUT_OPENSSH .\" from FreeBSD: head/tools/build/options/WITHOUT_OPENSSH 156932 2006-03-21 07:50:50Z ru Set to not build OpenSSH. +.It Va WITH_OPENSSH_NONE_CIPHER +.\" from FreeBSD: head/tools/build/options/WITH_OPENSSH_NONE_CIPHER 245527 2013-01-17 01:51:04Z bz +Set to include the "None" cipher support in OpenSSH and its libraries. +Additional adjustments may need to be done to system configuration +files, such as +.Xr sshd_config 5 , +to enable this cipher. +Please see +.Pa /usr/src/crypto/openssh/README.hpn +for full details. .It Va WITHOUT_OPENSSL .\" from FreeBSD: head/tools/build/options/WITHOUT_OPENSSL 156932 2006-03-21 07:50:50Z ru Set to not build OpenSSL. From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 09:37:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D603D9CF; Thu, 17 Jan 2013 09:37:43 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C85F9F6C; Thu, 17 Jan 2013 09:37:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0H9bhHs085652; Thu, 17 Jan 2013 09:37:43 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0H9bh4B085646; Thu, 17 Jan 2013 09:37:43 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201301170937.r0H9bh4B085646@svn.freebsd.org> From: Andrew Turner Date: Thu, 17 Jan 2013 09:37:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245548 - in head/sys: conf libkern/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 09:37:43 -0000 Author: andrew Date: Thu Jan 17 09:37:42 2013 New Revision: 245548 URL: http://svnweb.freebsd.org/changeset/base/245548 Log: Add the required __aeabi_* functions the kernel uses when built for ARM EABI Added: head/sys/libkern/arm/ldivmod.S (contents, props changed) head/sys/libkern/arm/ldivmod_helper.c (contents, props changed) Modified: head/sys/conf/files.arm head/sys/libkern/arm/divsi3.S Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Thu Jan 17 09:34:00 2013 (r245547) +++ head/sys/conf/files.arm Thu Jan 17 09:37:42 2013 (r245548) @@ -74,6 +74,8 @@ kern/subr_busdma_bufalloc.c standard kern/subr_dummy_vdso_tc.c standard libkern/arm/divsi3.S standard libkern/arm/ffs.S standard +libkern/arm/ldivmod.S standard +libkern/arm/ldivmod_helper.c standard libkern/arm/muldi3.c standard libkern/ashldi3.c standard libkern/ashrdi3.c standard Modified: head/sys/libkern/arm/divsi3.S ============================================================================== --- head/sys/libkern/arm/divsi3.S Thu Jan 17 09:34:00 2013 (r245547) +++ head/sys/libkern/arm/divsi3.S Thu Jan 17 09:37:42 2013 (r245548) @@ -49,6 +49,10 @@ ENTRY_NP(__modsi3) #endif RET +#ifdef __ARM_EABI__ +ENTRY_NP(__aeabi_uidiv) +ENTRY_NP(__aeabi_uidivmod) +#endif ENTRY_NP(__udivsi3) .L_udivide: /* r0 = r0 / r1; r1 = r0 % r1 */ eor r0, r1, r0 @@ -71,6 +75,10 @@ ENTRY_NP(__udivsi3) mov r1, #0 RET +#ifdef __ARM_EABI__ +ENTRY_NP(__aeabi_idiv) +ENTRY_NP(__aeabi_idivmod) +#endif ENTRY_NP(__divsi3) .L_divide: /* r0 = r0 / r1; r1 = r0 % r1 */ eor r0, r1, r0 Added: head/sys/libkern/arm/ldivmod.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/libkern/arm/ldivmod.S Thu Jan 17 09:37:42 2013 (r245548) @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2012 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#ifdef __ARM_EABI__ + +/* + * These calculate: + * q = n / m + * With a remainer r. + * + * They take n in {r0, r1} and m in {r2, r3} then pass them into the + * helper function. The hepler functions return q in {r0, r1} as + * required by the API spec however r is returned on the stack. The + * ABI required us to return r in {r2, r3}. + * + * We need to allocate 8 bytes on the stack to store r, the link + * register, and a pointer to the space where the helper function + * will write r to. After returning from the helper fuinction we load + * the old link register and r from the stack and return. + */ +ENTRY_NP(__aeabi_ldivmod) + sub sp, sp, #8 /* Space for the remainder */ + stmfd sp!, {sp, lr} /* Save a pointer to the above space and lr */ + bl PIC_SYM(_C_LABEL(__kern_ldivmod), PLT) + ldr lr, [sp, #4] /* Restore lr */ + add sp, sp, #8 /* Move sp to the remainder value */ + ldmfd sp!, {r2, r3} /* Load the remainder */ + RET + +ENTRY_NP(__aeabi_uldivmod) + sub sp, sp, #8 /* Space for the remainder */ + stmfd sp!, {sp, lr} /* Save a pointer to the above space and lr */ + bl PIC_SYM(_C_LABEL(__qdivrem), PLT) + ldr lr, [sp, #4] /* Restore lr */ + add sp, sp, #8 /* Move sp to the remainder value */ + ldmfd sp!, {r2, r3} /* Load the remainder */ + RET + +#endif + Added: head/sys/libkern/arm/ldivmod_helper.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/libkern/arm/ldivmod_helper.c Thu Jan 17 09:37:42 2013 (r245548) @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2012 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#ifdef __ARM_EABI__ +#include + +/* + * Helper for __aeabi_ldivmod. + * TODO: __divdi3 calls __qdivrem. We should do the same and use the + * remainder value rather than re-calculating it. + */ +long long __kern_ldivmod(long long, long long, long long *); + +long long +__kern_ldivmod(long long n, long long m, long long *rem) +{ + long long q; + + q = __divdi3(n, m); /* q = n / m */ + *rem = n - m * q; + + return q; +} + +#endif + From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 09:38:13 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6585AB49; Thu, 17 Jan 2013 09:38:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id E2AC8F79; Thu, 17 Jan 2013 09:38:12 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id r0H9cBBN001589; Thu, 17 Jan 2013 13:38:11 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id r0H9cBM2001588; Thu, 17 Jan 2013 13:38:11 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 17 Jan 2013 13:38:11 +0400 From: Gleb Smirnoff To: Hiroki Sato Subject: Re: svn commit: r245525 - head/etc/rc.d Message-ID: <20130117093811.GJ96599@FreeBSD.org> References: <201301170127.r0H1Re6Y038117@svn.freebsd.org> <20130117.110723.1450987474949438621.hrs@allbsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20130117.110723.1450987474949438621.hrs@allbsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, bz@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 09:38:13 -0000 On Thu, Jan 17, 2013 at 11:07:23AM +0900, Hiroki Sato wrote: H> bz> Author: bz H> bz> Date: Thu Jan 17 01:27:39 2013 H> bz> New Revision: 245525 H> bz> URL: http://svnweb.freebsd.org/changeset/base/245525 H> bz> H> bz> Log: H> bz> Add a conditional sleep 1 in case we add any IPv6 addresses to interfaces. H> bz> Do this per jail started, not per address. This will allow DAD to complete H> bz> and services to properly start. Before we have seen problems with services H> bz> trying to start before the IPv6 address was available to use and thus H> bz> erroring and failing to start. H> bz> H> bz> MFC after: 3 days H> H> This may be too pedantic, but I think this delay should use H> DupAddrDetectTransmits (net.inet6.ip6.dad_count). The default value H> of RETRANS_TIMER and MAX_RTR_SOLICITATION_DELAY in RFC 4861 is 1 sec, H> so the theoretical delay value is (DupAddrDetectTransmits * H> RETRANS_TIMER + MAX_RTR_SOLICITATION_DELAY). The rc.d/netif script H> uses this value (typically 2 seconds) for DAD. H> H> I understand a simple 1 second delay works in practice, though. I'd prefer even a sleep loop that exits once address is avaialable. An example is in ports/net/zebra/files/zebra.sh.in. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 09:47:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A7ED4E64; Thu, 17 Jan 2013 09:47:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8267EFCA; Thu, 17 Jan 2013 09:47:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0H9lvZu088576; Thu, 17 Jan 2013 09:47:57 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0H9lvRG088575; Thu, 17 Jan 2013 09:47:57 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201301170947.r0H9lvRG088575@svn.freebsd.org> From: Andrew Turner Date: Thu, 17 Jan 2013 09:47:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245549 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 09:47:57 -0000 Author: andrew Date: Thu Jan 17 09:47:56 2013 New Revision: 245549 URL: http://svnweb.freebsd.org/changeset/base/245549 Log: Implement stack unwinding based on section 9 of the "Exception handling ABI for the ARM architecture" documentation. The unwind tables are currently not stored in the kernel but will be added later. Modified: head/sys/arm/arm/db_trace.c Modified: head/sys/arm/arm/db_trace.c ============================================================================== --- head/sys/arm/arm/db_trace.c Thu Jan 17 09:37:42 2013 (r245548) +++ head/sys/arm/arm/db_trace.c Thu Jan 17 09:47:56 2013 (r245549) @@ -50,6 +50,395 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef __ARM_EABI__ +/* + * Definitions for the instruction interpreter. + * + * The ARM EABI specifies how to perform the frame unwinding in the + * Exception Handling ABI for the ARM Architecture document. To perform + * the unwind we need to know the initial frame pointer, stack pointer, + * link register and program counter. We then find the entry within the + * index table that points to the function the program counter is within. + * This gives us either a list of three instructions to process, a 31-bit + * relative offset to a table of instructions, or a value telling us + * we can't unwind any further. + * + * When we have the instructions to process we need to decode them + * following table 4 in section 9.3. This describes a collection of bit + * patterns to encode that steps to take to update the stack pointer and + * link register to the correct values at the start of the function. + */ + +/* A special case when we are unable to unwind past this function */ +#define EXIDX_CANTUNWIND 1 + +/* The register names */ +#define FP 11 +#define SP 13 +#define LR 14 +#define PC 15 + +/* + * These are set in the linker script. Their addresses will be + * either the start or end of the exception table or index. + */ +extern int extab_start, extab_end, exidx_start, exidx_end; + +/* + * Entry types. + * These are the only entry types that have been seen in the kernel. + */ +#define ENTRY_MASK 0xff000000 +#define ENTRY_ARM_SU16 0x80000000 +#define ENTRY_ARM_LU16 0x81000000 + +/* Instruction masks. */ +#define INSN_VSP_MASK 0xc0 +#define INSN_VSP_SIZE_MASK 0x3f +#define INSN_STD_MASK 0xf0 +#define INSN_STD_DATA_MASK 0x0f +#define INSN_POP_TYPE_MASK 0x08 +#define INSN_POP_COUNT_MASK 0x07 +#define INSN_VSP_LARGE_INC_MASK 0xff + +/* Instruction definitions */ +#define INSN_VSP_INC 0x00 +#define INSN_VSP_DEC 0x40 +#define INSN_POP_MASKED 0x80 +#define INSN_VSP_REG 0x90 +#define INSN_POP_COUNT 0xa0 +#define INSN_FINISH 0xb0 +#define INSN_VSP_LARGE_INC 0xb2 + +/* An item in the exception index table */ +struct unwind_idx { + uint32_t offset; + uint32_t insn; +}; + +/* The state of the unwind process */ +struct unwind_state { + uint32_t registers[16]; + uint32_t start_pc; + uint32_t *insn; + u_int entries; + u_int byte; + uint16_t update_mask; +}; + +/* We need to provide these but never use them */ +void __aeabi_unwind_cpp_pr0(void); +void __aeabi_unwind_cpp_pr1(void); +void __aeabi_unwind_cpp_pr2(void); + +void +__aeabi_unwind_cpp_pr0(void) +{ + panic("__aeabi_unwind_cpp_pr0"); +} + +void +__aeabi_unwind_cpp_pr1(void) +{ + panic("__aeabi_unwind_cpp_pr1"); +} + +void +__aeabi_unwind_cpp_pr2(void) +{ + panic("__aeabi_unwind_cpp_pr2"); +} + +/* Expand a 31-bit signed value to a 32-bit signed value */ +static __inline int32_t +db_expand_prel31(uint32_t prel31) +{ + + return ((int32_t)(prel31 & 0x7fffffffu) << 1) / 2; +} + +/* + * Perform a binary search of the index table to find the function + * with the largest address that doesn't exceed addr. + */ +static struct unwind_idx * +db_find_index(uint32_t addr) +{ + unsigned int min, mid, max; + struct unwind_idx *start; + struct unwind_idx *item; + int32_t prel31_addr; + uint32_t func_addr; + + start = (struct unwind_idx *)&exidx_start; + + min = 0; + max = (&exidx_end - &exidx_start) / 2; + + while (min != max) { + mid = min + (max - min + 1) / 2; + + item = &start[mid]; + + prel31_addr = db_expand_prel31(item->offset); + func_addr = (uint32_t)&item->offset + prel31_addr; + + if (func_addr <= addr) { + min = mid; + } else { + max = mid - 1; + } + } + + return &start[min]; +} + +/* Reads the next byte from the instruction list */ +static uint8_t +db_unwind_exec_read_byte(struct unwind_state *state) +{ + uint8_t insn; + + /* Read the unwind instruction */ + insn = (*state->insn) >> (state->byte * 8); + + /* Update the location of the next instruction */ + if (state->byte == 0) { + state->byte = 3; + state->insn++; + state->entries--; + } else + state->byte--; + + return insn; +} + +/* Executes the next instruction on the list */ +static int +db_unwind_exec_insn(struct unwind_state *state) +{ + unsigned int insn; + uint32_t *vsp = (uint32_t *)state->registers[SP]; + int update_vsp = 0; + + /* This should never happen */ + if (state->entries == 0) + return 1; + + /* Read the next instruction */ + insn = db_unwind_exec_read_byte(state); + + if ((insn & INSN_VSP_MASK) == INSN_VSP_INC) { + state->registers[SP] += ((insn & INSN_VSP_SIZE_MASK) << 2) + 4; + + } else if ((insn & INSN_VSP_MASK) == INSN_VSP_DEC) { + state->registers[SP] -= ((insn & INSN_VSP_SIZE_MASK) << 2) + 4; + + } else if ((insn & INSN_STD_MASK) == INSN_POP_MASKED) { + unsigned int mask, reg; + + /* Load the mask */ + mask = db_unwind_exec_read_byte(state); + mask |= (insn & INSN_STD_DATA_MASK) << 8; + + /* We have a refuse to unwind instruction */ + if (mask == 0) + return 1; + + /* Update SP */ + update_vsp = 1; + + /* Load the registers */ + for (reg = 4; mask && reg < 16; mask >>= 1, reg++) { + if (mask & 1) { + state->registers[reg] = *vsp++; + state->update_mask |= 1 << reg; + + /* If we have updated SP kep its value */ + if (reg == SP) + update_vsp = 0; + } + } + + } else if ((insn & INSN_STD_MASK) == INSN_VSP_REG && + ((insn & INSN_STD_DATA_MASK) != 13) && + ((insn & INSN_STD_DATA_MASK) != 15)) { + /* sp = register */ + state->registers[SP] = + state->registers[insn & INSN_STD_DATA_MASK]; + + } else if ((insn & INSN_STD_MASK) == INSN_POP_COUNT) { + unsigned int count, reg; + + /* Read how many registers to load */ + count = insn & INSN_POP_COUNT_MASK; + + /* Update sp */ + update_vsp = 1; + + /* Pop the registers */ + for (reg = 4; reg <= 4 + count; reg++) { + state->registers[reg] = *vsp++; + state->update_mask |= 1 << reg; + } + + /* Check if we are in the pop r14 version */ + if ((insn & INSN_POP_TYPE_MASK) != 0) { + state->registers[14] = *vsp++; + } + + } else if (insn == INSN_FINISH) { + /* Stop processing */ + state->entries = 0; + + } else if ((insn & INSN_VSP_LARGE_INC_MASK) == INSN_VSP_LARGE_INC) { + unsigned int uleb128; + + /* Read the increment value */ + uleb128 = db_unwind_exec_read_byte(state); + + state->registers[SP] += 0x204 + (uleb128 << 2); + + } else { + /* We hit a new instruction that needs to be implemented */ + db_printf("Unhandled instruction %.2x\n", insn); + return 1; + } + + if (update_vsp) { + state->registers[SP] = (uint32_t)vsp; + } + +#if 0 + db_printf("fp = %08x, sp = %08x, lr = %08x, pc = %08x\n", + state->registers[FP], state->registers[SP], state->registers[LR], + state->registers[PC]); +#endif + + return 0; +} + +/* Performs the unwind of a function */ +static int +db_unwind_tab(struct unwind_state *state) +{ + uint32_t entry; + + /* Set PC to a known value */ + state->registers[PC] = 0; + + /* Read the personality */ + entry = *state->insn & ENTRY_MASK; + + if (entry == ENTRY_ARM_SU16) { + state->byte = 2; + state->entries = 1; + } else if (entry == ENTRY_ARM_LU16) { + state->byte = 1; + state->entries = ((*state->insn >> 16) & 0xFF) + 1; + } else { + db_printf("Unknown entry: %x\n", entry); + return 1; + } + + while (state->entries > 0) { + if (db_unwind_exec_insn(state) != 0) + return 1; + } + + /* + * The program counter was not updated, load it from the link register. + */ + if (state->registers[PC] == 0) + state->registers[PC] = state->registers[LR]; + + return 0; +} + +static void +db_stack_trace_cmd(struct unwind_state *state) +{ + struct unwind_idx *index; + const char *name; + db_expr_t value; + db_expr_t offset; + c_db_sym_t sym; + u_int reg, i; + char *sep; + + while (1) { + /* Reset the mask of updated registers */ + state->update_mask = 0; + + /* The pc value is correct and will be overwritten, save it */ + state->start_pc = state->registers[PC]; + + /* Find the item to run */ + index = db_find_index(state->start_pc); + + if (index->insn == EXIDX_CANTUNWIND) { + printf("Unable to unwind\n"); + break; + } else if (index->insn & (1 << 31)) { + /* The data is within the instruction */ + state->insn = &index->insn; + } else { + /* We have a prel31 offset to the unwind table */ + uint32_t prel31_tbl = db_expand_prel31(index->insn); + + state->insn = (uint32_t *)((uintptr_t)&index->insn + + prel31_tbl); + } + + /* Run the unwind function */ + if (db_unwind_tab(state) != 0) + break; + + /* This is not a kernel address, stop processing */ + if (state->registers[PC] < VM_MIN_KERNEL_ADDRESS) + break; + + /* Print the frame details */ + sym = db_search_symbol(state->start_pc, DB_STGY_ANY, &offset); + if (sym == C_DB_SYM_NULL) { + value = 0; + name = "(null)"; + } else + db_symbol_values(sym, &name, &value); + db_printf("%s() at ", name); + db_printsym(state->start_pc, DB_STGY_PROC); + db_printf("\n"); + db_printf("\t pc = 0x%08x lr = 0x%08x (", state->start_pc, + state->registers[LR]); + db_printsym(state->registers[LR], DB_STGY_PROC); + db_printf(")\n"); + db_printf("\t sp = 0x%08x fp = 0x%08x", + state->registers[SP], state->registers[FP]); + + /* Don't print the registers we have already printed */ + state->update_mask &= ~((1 << SP) | (1 << FP) | (1 << LR) | + (1 << PC)); + sep = "\n\t"; + for (i = 0, reg = 0; state->update_mask != 0; + state->update_mask >>= 1, reg++) { + if ((state->update_mask & 1) != 0) { + db_printf("%s%sr%d = 0x%08x", sep, + (reg < 10) ? " " : "", reg, + state->registers[reg]); + i++; + if (i == 2) { + sep = "\n\t"; + i = 0; + } else + sep = " "; + + } + } + db_printf("\n"); + } +} +#endif + /* * APCS stack frames are awkward beasts, so I don't think even trying to use * a structure to represent them is a good idea. @@ -78,6 +467,7 @@ __FBSDID("$FreeBSD$"); * fields are actually present. */ +#ifndef __ARM_EABI__ /* The frame format is differend in AAPCS */ static void db_stack_trace_cmd(db_expr_t addr, db_expr_t count, boolean_t kernel_only) { @@ -171,6 +561,7 @@ db_stack_trace_cmd(db_expr_t addr, db_ex } } } +#endif /* XXX stubs */ void @@ -193,11 +584,24 @@ db_md_set_watchpoint(db_expr_t addr, db_ int db_trace_thread(struct thread *thr, int count) { +#ifdef __ARM_EABI__ + struct unwind_state state; +#endif struct pcb *ctx; if (thr != curthread) { ctx = kdb_thr_ctx(thr); + +#ifdef __ARM_EABI__ + state.registers[FP] = ctx->un_32.pcb32_r11; + state.registers[SP] = ctx->un_32.pcb32_sp; + state.registers[LR] = ctx->un_32.pcb32_lr; + state.registers[PC] = ctx->un_32.pcb32_pc; + + db_stack_trace_cmd(&state); +#else db_stack_trace_cmd(ctx->un_32.pcb32_r11, -1, TRUE); +#endif } else db_trace_self(); return (0); @@ -206,8 +610,20 @@ db_trace_thread(struct thread *thr, int void db_trace_self(void) { +#ifdef __ARM_EABI__ + struct unwind_state state; + register uint32_t sp __asm__ ("sp"); + + state.registers[FP] = (uint32_t)__builtin_frame_address(0); + state.registers[SP] = (uint32_t)sp; + state.registers[LR] = (uint32_t)__builtin_return_address(0); + state.registers[PC] = (uint32_t)db_trace_self; + + db_stack_trace_cmd(&state); +#else db_addr_t addr; addr = (db_addr_t)__builtin_frame_address(0); db_stack_trace_cmd(addr, -1, FALSE); +#endif } From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 09:52:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AA6151C1; Thu, 17 Jan 2013 09:52:36 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9D2DCFFA; Thu, 17 Jan 2013 09:52:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0H9qalx090834; Thu, 17 Jan 2013 09:52:36 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0H9qaEA090832; Thu, 17 Jan 2013 09:52:36 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201301170952.r0H9qaEA090832@svn.freebsd.org> From: Andrew Turner Date: Thu, 17 Jan 2013 09:52:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245551 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 09:52:36 -0000 Author: andrew Date: Thu Jan 17 09:52:35 2013 New Revision: 245551 URL: http://svnweb.freebsd.org/changeset/base/245551 Log: * Correct KINFO_PROC_SIZE for ARM EABI. * Update the syscall interface to pass in the syscall value in register r7. Modified: head/sys/arm/arm/trap.c head/sys/arm/include/proc.h Modified: head/sys/arm/arm/trap.c ============================================================================== --- head/sys/arm/arm/trap.c Thu Jan 17 09:50:18 2013 (r245550) +++ head/sys/arm/arm/trap.c Thu Jan 17 09:52:35 2013 (r245551) @@ -866,7 +866,11 @@ cpu_fetch_syscall_args(struct thread *td register_t *ap; int error; +#ifdef __ARM_EABI__ + sa->code = td->td_frame->tf_r7; +#else sa->code = sa->insn & 0x000fffff; +#endif ap = &td->td_frame->tf_r0; if (sa->code == SYS_syscall) { sa->code = *ap++; @@ -905,16 +909,18 @@ syscall(struct thread *td, trapframe_t * struct syscall_args sa; int error; +#ifndef __ARM_EABI__ sa.insn = *(uint32_t *)(frame->tf_pc - INSN_SIZE); switch (sa.insn & SWI_OS_MASK) { case 0: /* XXX: we need our own one. */ - sa.nap = 4; break; default: call_trapsignal(td, SIGILL, 0); userret(td, frame); return; } +#endif + sa.nap = 4; error = syscallenter(td, &sa); KASSERT(error != 0 || td->td_ar == NULL, Modified: head/sys/arm/include/proc.h ============================================================================== --- head/sys/arm/include/proc.h Thu Jan 17 09:50:18 2013 (r245550) +++ head/sys/arm/include/proc.h Thu Jan 17 09:52:35 2013 (r245551) @@ -60,7 +60,11 @@ struct mdproc { void *md_sigtramp; }; +#ifdef __ARM_EABI__ +#define KINFO_PROC_SIZE 816 +#else #define KINFO_PROC_SIZE 792 +#endif #define MAXARGS 8 struct syscall_args { @@ -69,7 +73,9 @@ struct syscall_args { register_t args[MAXARGS]; int narg; u_int nap; +#ifndef __ARM_EABI__ u_int32_t insn; +#endif }; #endif /* !_MACHINE_PROC_H_ */ From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 09:57:43 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6FF0038B; Thu, 17 Jan 2013 09:57:43 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id F1FC799; Thu, 17 Jan 2013 09:57:42 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 0473925D388E; Thu, 17 Jan 2013 09:57:42 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 4F6A3BE84A0; Thu, 17 Jan 2013 09:57:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id Gw1JnwO0C8UA; Thu, 17 Jan 2013 09:57:38 +0000 (UTC) Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 9B69FBE8466; Thu, 17 Jan 2013 09:57:38 +0000 (UTC) Date: Thu, 17 Jan 2013 09:57:37 +0000 (UTC) From: "Bjoern A. Zeeb" To: Gleb Smirnoff Subject: Re: svn commit: r245525 - head/etc/rc.d In-Reply-To: <20130117093811.GJ96599@FreeBSD.org> Message-ID: References: <201301170127.r0H1Re6Y038117@svn.freebsd.org> <20130117.110723.1450987474949438621.hrs@allbsd.org> <20130117093811.GJ96599@FreeBSD.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Hiroki Sato , src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 09:57:43 -0000 On Thu, 17 Jan 2013, Gleb Smirnoff wrote: > On Thu, Jan 17, 2013 at 11:07:23AM +0900, Hiroki Sato wrote: > H> bz> Author: bz > H> bz> Date: Thu Jan 17 01:27:39 2013 > H> bz> New Revision: 245525 > H> bz> URL: http://svnweb.freebsd.org/changeset/base/245525 > H> bz> > H> bz> Log: > H> bz> Add a conditional sleep 1 in case we add any IPv6 addresses to interfaces. > H> bz> Do this per jail started, not per address. This will allow DAD to complete > H> bz> and services to properly start. Before we have seen problems with services > H> bz> trying to start before the IPv6 address was available to use and thus > H> bz> erroring and failing to start. > H> bz> > H> bz> MFC after: 3 days > H> > H> This may be too pedantic, but I think this delay should use > H> DupAddrDetectTransmits (net.inet6.ip6.dad_count). The default value > H> of RETRANS_TIMER and MAX_RTR_SOLICITATION_DELAY in RFC 4861 is 1 sec, > H> so the theoretical delay value is (DupAddrDetectTransmits * > H> RETRANS_TIMER + MAX_RTR_SOLICITATION_DELAY). The rc.d/netif script > H> uses this value (typically 2 seconds) for DAD. > H> > H> I understand a simple 1 second delay works in practice, though. > > I'd prefer even a sleep loop that exits once address is avaialable. An > example is in ports/net/zebra/files/zebra.sh.in. That file doesn't seem to exist but a sleep loop is even worse unless it's bound by the maximum time allowed possibly. So we'd be down to an extra second again. The problem is that a) the second is too long already if you'd be starting 300 jails, it's an extra 5 minutes of startup time. b) the shell script is supposed to go away as-is anyway, and c) in case of duplicate address we are not failing either, so this is just "bandaid for best effort and stop annoyance". If you'd want to fix it perfectly you'd probably start adding all IP addresses for all jails to start in one go, do the max wait time as hrs explained or optimize that polling the interfaces and break out if all are good (which will most likely take longer actually than sleep 2 for a larger number of jails), and then start all the jails. /bz -- Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family. From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 13:24:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1ECA577F for ; Thu, 17 Jan 2013 13:24:20 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com [209.85.215.51]) by mx1.freebsd.org (Postfix) with ESMTP id 77010DA8 for ; Thu, 17 Jan 2013 13:24:18 +0000 (UTC) Received: by mail-la0-f51.google.com with SMTP id fj20so2581726lab.24 for ; Thu, 17 Jan 2013 05:24:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:x-enigmail-version:content-type :x-gm-message-state; bh=GQai17YZpx6xMM11S/3nsVg4oQPUuNuGvY+kzVT9v+Y=; b=eQ9tgKkb7BAUKhdkLftQiyfE2DD5Dc+wlsCQ7YfMnJfTQ5ya4Zb+Xl3USPzBhCavLH eM0Z2V8YzkKNUKkQFYNkf9BocG7E1Nj82glBVVHCaaUf6JPo7YwGEeTnfxX00xJWzAD0 l696FfKr7FjSye6qnzTRwU0g4dWtqnzzqdtltd4F7tizM7Qs+B+zo77WC1Tch/OSS9mI zNLbM+kvprgwAOfIwhgFQ2aFs2XN9+Zfl5agKIGA97pDwDUEFyAHQdYhvgjHVouSMykz GqgljpB4AvlaFQg+1GzCDTbAgVr3h48dLgCbcKGi0JNb7T+EqVWmAAvJWKAB9ACGDUrd OSkw== X-Received: by 10.152.132.137 with SMTP id ou9mr4928353lab.7.1358429057686; Thu, 17 Jan 2013 05:24:17 -0800 (PST) Received: from dhcp170-82-red.yandex.net (dhcp170-82-red.yandex.net. [95.108.170.82]) by mx.google.com with ESMTPS id gi3sm306188lab.7.2013.01.17.05.24.15 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 17 Jan 2013 05:24:16 -0800 (PST) Sender: Andrey Zonov Message-ID: <50F7FB74.2030507@FreeBSD.org> Date: Thu, 17 Jan 2013 17:24:04 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: Eitan Adler Subject: Re: svn commit: r245458 - head/lib/libc/sys References: <201301151409.r0FE98HB050315@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.5 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2KLEHUGIKJHBPLMTDOUBI" X-Gm-Message-State: ALoCoQloin0lwNj0Hm+5K5X67qFom9IRwM13MD5U0hIZF0uhb/r+6JAURXL379nQkI47vM/BO/d1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 13:24:20 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2KLEHUGIKJHBPLMTDOUBI Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 1/17/13 2:54 AM, Eitan Adler wrote: > On 15 January 2013 09:09, Andrey Zonov wrote: >> -.Va errno >> -is set to indicate an error. >=20 > ISTR that this is not shown in the -std text. Can this be retained? >=20 This is what I see on my machine for man 2 chroot: RETURN VALUES Upon successful completion, the value 0 is returned; otherwise the value -1 is returned and the global variable errno is set to indicate the error. --=20 Andrey Zonov ------enig2KLEHUGIKJHBPLMTDOUBI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) Comment: GPGTools - http://gpgtools.org iQEcBAEBAgAGBQJQ9/t9AAoJEBWLemxX/CvTuZkIALdlGMB+ijkDOtauMZyQcwaj R2cTKgzADGs4QnMngAST2vLB+mZRwh+VYz8R+T6c1dXbSX9J8LG+0Hm8PSaCgers BI9TPQ4MmIXs45mz1ewTSl7P27qC1ePbV31d7+pcba7vTXE+WjZS7jwaMd3UKtfg 8WMcAQGSMZkbgwrrcxnlXJcHGjbSHc9m9S1t33/w034UZxFrs1Ih8wg4jT2mxi4K LfnYYw3hTsEG1syijLYC1OG8eKbZeqO25FZZ8ZGpOxpcgnbDTothje9L8fKQdx8u bN/ONjDIPu0GFmE9lrZRo7LUrhLL629Ndx/ntaZmmeU2JWifMM1ZztAPpT0Rd3s= =UkYh -----END PGP SIGNATURE----- ------enig2KLEHUGIKJHBPLMTDOUBI-- From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 15:15:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 73D0662F for ; Thu, 17 Jan 2013 15:15:56 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com [209.85.217.175]) by mx1.freebsd.org (Postfix) with ESMTP id 994A2753 for ; Thu, 17 Jan 2013 15:15:55 +0000 (UTC) Received: by mail-lb0-f175.google.com with SMTP id n3so1674178lbo.34 for ; Thu, 17 Jan 2013 07:15:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=whG+j4ZkGGKp20vH6Z8R/VunK4e4NyBi6jh27WjF+w4=; b=SE43W/997QomTuNXiiQ3cKpKMwr/cXmiR1GHPhyBylbuNKuC3XBSGsl96dKGf7u9K7 Z4s/ipdJ5e61woPuQ8MfL9Q6xH6Q+4HpkS0wUkOeADx3e5pJjbeHbKiX6b+qKZVTGuRy TGWt0NwStgJOmmpmxx6eHtQ2IU3adldOEHTDY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=whG+j4ZkGGKp20vH6Z8R/VunK4e4NyBi6jh27WjF+w4=; b=B/yIUnX0Egi1rImak/klXh57XE43YzSzadbeJS68AixR+XVF2xwUj+aNBghkme6n7Y Wh2ZtYx0VwMNtL86QU1e9yMsghZcHNGzRsQodzsvh7b8Jdd1dpgC4PaFW3KyAVzZjmeQ sWc+I5yTHDYODDrmIBnu/A+n1GMRYyy77rCURBvc6Yjj4TnqKq6OqcSluJHsVsVBkOde IasCkcOhmNSBmHcoBaJusobuG2pNz08m774o3GQlE4AMWUPiKwvIR25PS8fgBj6XLtwg xD6JS4/1VGEWJZ4OYCIM6fP53PGKfSJyYUhAfUeW9wQZelSC5hGzQKm6g7T+5LOpkh9a 8D5A== X-Received: by 10.112.13.162 with SMTP id i2mr2300420lbc.76.1358435748778; Thu, 17 Jan 2013 07:15:48 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.30.131 with HTTP; Thu, 17 Jan 2013 07:15:18 -0800 (PST) In-Reply-To: <50F7FB74.2030507@FreeBSD.org> References: <201301151409.r0FE98HB050315@svn.freebsd.org> <50F7FB74.2030507@FreeBSD.org> From: Eitan Adler Date: Thu, 17 Jan 2013 10:15:18 -0500 X-Google-Sender-Auth: BihPlPGgrqxfgQUTdHcDOgjAvOw Message-ID: Subject: Re: svn commit: r245458 - head/lib/libc/sys To: Andrey Zonov Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQn5Y4tGp4g5iJvZ23jTY3PKAZwOjpOeWDhVeri/K1blZmCskMk5GUMbF8aIJBM0cRCjTfKe Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 15:15:56 -0000 On 17 January 2013 08:24, Andrey Zonov wrote: > On 1/17/13 2:54 AM, Eitan Adler wrote: >> On 15 January 2013 09:09, Andrey Zonov wrote: >>> -.Va errno >>> -is set to indicate an error. >> >> ISTR that this is not shown in the -std text. Can this be retained? >> > > This is what I see on my machine for man 2 chroot: > > RETURN VALUES > Upon successful completion, the value 0 is returned; otherwise the > value -1 is returned and the global variable errno is set to > indicate the > error. My memory was wrong. Thanks for the correction. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 16:26:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AA4976D5; Thu, 17 Jan 2013 16:26:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9C759CD8; Thu, 17 Jan 2013 16:26:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0HGQexr008087; Thu, 17 Jan 2013 16:26:40 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0HGQe1Q008086; Thu, 17 Jan 2013 16:26:40 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301171626.r0HGQe1Q008086@svn.freebsd.org> From: Adrian Chadd Date: Thu, 17 Jan 2013 16:26:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245554 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 16:26:40 -0000 Author: adrian Date: Thu Jan 17 16:26:40 2013 New Revision: 245554 URL: http://svnweb.freebsd.org/changeset/base/245554 Log: Add a quick work-around if ath_beacon_config() to not die if it's called when an interface is going down. Right now it's quite possible (but very unlikely!) that ath_reset() or similar is called, leading to a beacon config call, in parallel with the last VAP being destroyed. This likely should be fixed by making sure the bmiss/bstuck/watchdog taskqueues are canceled whenever the last VAP is destroyed. Modified: head/sys/dev/ath/if_ath_beacon.c Modified: head/sys/dev/ath/if_ath_beacon.c ============================================================================== --- head/sys/dev/ath/if_ath_beacon.c Thu Jan 17 16:11:38 2013 (r245553) +++ head/sys/dev/ath/if_ath_beacon.c Thu Jan 17 16:26:40 2013 (r245554) @@ -705,6 +705,16 @@ ath_beacon_config(struct ath_softc *sc, if (vap == NULL) vap = TAILQ_FIRST(&ic->ic_vaps); /* XXX */ + /* + * Just ensure that we aren't being called when the last + * VAP is destroyed. + */ + if (vap == NULL) { + device_printf(sc->sc_dev, "%s: called with no VAPs\n", + __func__); + return; + } + ni = ieee80211_ref_node(vap->iv_bss); /* extract tstamp from last beacon and convert to TU */ From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 16:43:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D322DE64; Thu, 17 Jan 2013 16:43:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AE318E26; Thu, 17 Jan 2013 16:43:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0HGhxxU014490; Thu, 17 Jan 2013 16:43:59 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0HGhxUN014489; Thu, 17 Jan 2013 16:43:59 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301171643.r0HGhxUN014489@svn.freebsd.org> From: Adrian Chadd Date: Thu, 17 Jan 2013 16:43:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245556 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 16:43:59 -0000 Author: adrian Date: Thu Jan 17 16:43:59 2013 New Revision: 245556 URL: http://svnweb.freebsd.org/changeset/base/245556 Log: Fix hangs (exposed by spectral scan activity) in STA mode when the chip hangs. * Always do a reset in ath_bmiss_proc(), regardless of whether the hardware is "hung" or not. Specifically, for spectral scan, there's likely a whole bunch of potential hangs that we don't (yet) recognise in the HAL. So to avoid staying RX deaf persisting until the station disassociates, just do a no-loss reset. * Set sc_beacons=1 in STA mode. During a reset, the beacon programming isn't done. (It's likely I need to set sc_syncbeacons during a hang reset, but I digress.) Thus after a reset, there's no beacon timer programming to send a BMISS interrupt if beacons aren't heard .. thus if the AP disappears, you won't get notified and you'll have to reset your interface. This hasn't yet fixed all of the hangs that I've seen when debugging spectral scan, but it's certainly reduced the hang frequency and it should improve general STA stability in very noisy environments. Tested: * AR9280, STA mode, spectral scan off/on PR: kern/175227 Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Thu Jan 17 16:39:21 2013 (r245555) +++ head/sys/dev/ath/if_ath.c Thu Jan 17 16:43:59 2013 (r245556) @@ -1883,11 +1883,19 @@ ath_bmiss_proc(void *arg, int pending) DPRINTF(sc, ATH_DEBUG_ANY, "%s: pending %u\n", __func__, pending); + /* + * Do a reset upon any becaon miss event. + * + * It may be a non-recognised RX clear hang which needs a reset + * to clear. + */ if (ath_hal_gethangstate(sc->sc_ah, 0xff, &hangs) && hangs != 0) { + ath_reset(ifp, ATH_RESET_NOLOSS); if_printf(ifp, "bb hang detected (0x%x), resetting\n", hangs); + } else { ath_reset(ifp, ATH_RESET_NOLOSS); - } else ieee80211_beacon_miss(ifp->if_l2com); + } } /* @@ -5056,6 +5064,7 @@ ath_newstate(struct ieee80211vap *vap, e int i, error, stamode; u_int32_t rfilt; int csa_run_transition = 0; + static const HAL_LED_STATE leds[] = { HAL_LED_INIT, /* IEEE80211_S_INIT */ HAL_LED_SCAN, /* IEEE80211_S_SCAN */ @@ -5200,10 +5209,32 @@ ath_newstate(struct ieee80211vap *vap, e * force a beacon update so we pick up a lack of * beacons from an AP in CAC and thus force a * scan. + * + * And, there's also corner cases here where + * after a scan, the AP may have disappeared. + * In that case, we may not receive an actual + * beacon to update the beacon timer and thus we + * won't get notified of the missing beacons. */ sc->sc_syncbeacon = 1; +#if 0 if (csa_run_transition) +#endif ath_beacon_config(sc, vap); + + /* + * PR: kern/175227 + * + * Reconfigure beacons during reset; as otherwise + * we won't get the beacon timers reprogrammed + * after a reset and thus we won't pick up a + * beacon miss interrupt. + * + * Hopefully we'll see a beacon before the BMISS + * timer fires (too often), leading to a STA + * disassociation. + */ + sc->sc_beacons = 1; break; case IEEE80211_M_MONITOR: /* From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 17:12:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B868FDF3; Thu, 17 Jan 2013 17:12:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9C869EE; Thu, 17 Jan 2013 17:12:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0HHCj8L023767; Thu, 17 Jan 2013 17:12:45 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0HHCj7r023765; Thu, 17 Jan 2013 17:12:45 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301171712.r0HHCj7r023765@svn.freebsd.org> From: Adrian Chadd Date: Thu, 17 Jan 2013 17:12:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245560 - head/tools/tools/ath/athalq X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 17:12:45 -0000 Author: adrian Date: Thu Jan 17 17:12:44 2013 New Revision: 245560 URL: http://svnweb.freebsd.org/changeset/base/245560 Log: Add extra debugging fields. Modified: head/tools/tools/ath/athalq/ar5212_ds.c head/tools/tools/ath/athalq/ar5416_ds.c Modified: head/tools/tools/ath/athalq/ar5212_ds.c ============================================================================== --- head/tools/tools/ath/athalq/ar5212_ds.c Thu Jan 17 17:08:10 2013 (r245559) +++ head/tools/tools/ath/athalq/ar5212_ds.c Thu Jan 17 17:12:44 2013 (r245560) @@ -45,9 +45,11 @@ ar5212_decode_txstatus(struct if_ath_alq /* XXX assumes txs is smaller than PAYLOAD_LEN! */ memcpy(&txs, &a->payload, sizeof(struct ar5212_desc)); - printf("[%u] [%llu] TXSTATUS\n", + printf("[%u] [%llu] TXSTATUS: TxDone=%d, TS=0x%08x\n\n", (unsigned int) be32toh(a->hdr.tstamp), - (unsigned long long) be64toh(a->hdr.threadid)); + (unsigned long long) be64toh(a->hdr.threadid), + MF(txs.u.tx.status1, AR_Done), + MS(txs.u.tx.status0, AR_SendTimestamp)); /* ds_txstatus0 */ printf(" Frmok=%d, xretries=%d, fifounderrun=%d, filt=%d\n", @@ -147,9 +149,11 @@ ar5212_decode_rxstatus(struct if_ath_alq /* XXX assumes rxs is smaller than PAYLOAD_LEN! */ memcpy(&rxs, &a->payload, sizeof(struct ar5212_desc)); - printf("[%u] [%llu] RXSTATUS\n", + printf("[%u] [%llu] RXSTATUS: RxOK=%d TS=0x%08x\n", (unsigned int) be32toh(a->hdr.tstamp), - (unsigned long long) be64toh(a->hdr.threadid)); + (unsigned long long) be64toh(a->hdr.threadid), + MF(rxs.ds_rxstatus1, AR_Done), + MS(rxs.ds_rxstatus1, AR_RcvTimestamp)); printf(" link=0x%08x, data=0x%08x, ctl0=0x%08x, ctl2=0x%08x\n", rxs.ds_link, Modified: head/tools/tools/ath/athalq/ar5416_ds.c ============================================================================== --- head/tools/tools/ath/athalq/ar5416_ds.c Thu Jan 17 17:08:10 2013 (r245559) +++ head/tools/tools/ath/athalq/ar5416_ds.c Thu Jan 17 17:12:44 2013 (r245560) @@ -45,9 +45,11 @@ ar5416_decode_txstatus(struct if_ath_alq /* XXX assumes txs is smaller than PAYLOAD_LEN! */ memcpy(&txs, &a->payload, sizeof(struct ar5416_desc)); - printf("[%u] [%llu] TXSTATUS\n", + printf("[%u] [%llu] TXSTATUS: TxDone=%d, TS=0x%08x\n", (unsigned int) be32toh(a->hdr.tstamp), - (unsigned long long) be64toh(a->hdr.threadid)); + (unsigned long long) be64toh(a->hdr.threadid), + MF(txs.u.tx.status[9], AR_TxDone), + txs.u.tx.status[2]); /* ds_txstatus0 */ printf(" RX RSSI 0 [%d %d %d]\n", @@ -250,9 +252,11 @@ ar5416_decode_rxstatus(struct if_ath_alq /* XXX assumes rxs is smaller than PAYLOAD_LEN! */ memcpy(&rxs, &a->payload, sizeof(struct ar5416_desc)); - printf("[%u] [%llu] RXSTATUS\n", + printf("[%u] [%llu] RXSTATUS: RxDone=%d, TS=0x%08x\n", (unsigned int) be32toh(a->hdr.tstamp), - (unsigned long long) be64toh(a->hdr.threadid)); + (unsigned long long) be64toh(a->hdr.threadid), + MF(rxs.ds_rxstatus8, AR_RxDone), + rxs.ds_rxstatus2); printf(" link=0x%08x, data=0x%08x, ctl0=0x%08x, ctl2=0x%08x\n", rxs.ds_link, From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 17:27:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D71056A8; Thu, 17 Jan 2013 17:27:11 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B0FCC34C; Thu, 17 Jan 2013 17:27:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0HHRBpW028184; Thu, 17 Jan 2013 17:27:11 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0HHRBEs028180; Thu, 17 Jan 2013 17:27:11 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301171727.r0HHRBEs028180@svn.freebsd.org> From: Brooks Davis Date: Thu, 17 Jan 2013 17:27:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245561 - in head: . cddl/lib/libdtrace 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.14 Precedence: list List-Id: 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, 17 Jan 2013 17:27:11 -0000 Author: brooks Date: Thu Jan 17 17:27:10 2013 New Revision: 245561 URL: http://svnweb.freebsd.org/changeset/base/245561 Log: Add a new LIBRARIES_ONLY make variable to disable the build and install of files other than the actual libraries. Use LIBRARIES_ONLY to supress the inclusion of files in the lib32 distribution that are duplicates of files in base. Sponsored by: DARPA, AFRL Reviewed by: emaste Modified: head/Makefile.inc1 head/cddl/lib/libdtrace/Makefile head/share/mk/bsd.README head/share/mk/bsd.lib.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Jan 17 17:12:44 2013 (r245560) +++ head/Makefile.inc1 Thu Jan 17 17:27:10 2013 (r245561) @@ -336,6 +336,7 @@ LIB32WMAKEFLAGS+= \ CXX="${CXX} ${LIB32FLAGS}" \ DESTDIR=${LIB32TMP} \ -DCOMPAT_32BIT \ + -DLIBRARIES_ONLY \ -DNO_CPU_CFLAGS \ -DNO_CTF \ -DNO_LINT Modified: head/cddl/lib/libdtrace/Makefile ============================================================================== --- head/cddl/lib/libdtrace/Makefile Thu Jan 17 17:12:44 2013 (r245560) +++ head/cddl/lib/libdtrace/Makefile Thu Jan 17 17:27:10 2013 (r245561) @@ -103,7 +103,7 @@ dt_names.c: beforedepend: dt_errtags.c dt_names.c beforeinstall: -.if exists(${DESTDIR}/usr/lib/dtrace) +.if !defined(LIBRARIES_ONLY) && exists(${DESTDIR}/usr/lib/dtrace) .for file in ${DSRCS} ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} ${.CURDIR}/${file} ${DESTDIR}/usr/lib/dtrace .endfor Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Thu Jan 17 17:12:44 2013 (r245560) +++ head/share/mk/bsd.README Thu Jan 17 17:27:10 2013 (r245561) @@ -356,6 +356,8 @@ SHLIB_LDSCRIPT Template file to generate Unless used, a simple symlink is created to the real shared object. +LIBRARIES_ONLY Do not build or install files other than the library. + The include file includes the file named "../Makefile.inc" if it exists, as well as the include file . Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Thu Jan 17 17:12:44 2013 (r245560) +++ head/share/mk/bsd.lib.mk Thu Jan 17 17:27:10 2013 (r245561) @@ -331,9 +331,12 @@ _libinstall: .endif .endif # !defined(INTERNALLIB) +.if !defined(LIBRARIES_ONLY) .include .include .include +.endif + .include .if ${MK_MAN} != "no" @@ -348,7 +351,7 @@ lint: ${SRCS:M*.c} ${LINT} ${LINTFLAGS} ${CFLAGS:M-[DIU]*} ${.ALLSRC} .endif -.if ${MK_MAN} != "no" +.if ${MK_MAN} != "no" && !defined(LIBRARIES_ONLY) .include .endif From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 18:00:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 12C5B3E0; Thu, 17 Jan 2013 18:00:20 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 017C5749; Thu, 17 Jan 2013 18:00:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0HI0Jeu038814; Thu, 17 Jan 2013 18:00:19 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0HI0JR0038813; Thu, 17 Jan 2013 18:00:19 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201301171800.r0HI0JR0038813@svn.freebsd.org> From: Ian Lepore Date: Thu, 17 Jan 2013 18:00:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245562 - 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.14 Precedence: list List-Id: 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, 17 Jan 2013 18:00:20 -0000 Author: ian Date: Thu Jan 17 18:00:19 2013 New Revision: 245562 URL: http://svnweb.freebsd.org/changeset/base/245562 Log: Add myself as a committer, and my mentor relationship. Approved by: cognet (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Thu Jan 17 17:27:10 2013 (r245561) +++ head/share/misc/committers-src.dot Thu Jan 17 18:00:19 2013 (r245562) @@ -160,6 +160,7 @@ grog [label="Greg Lehey\ngrog@FreeBSD.or gshapiro [label="Gregory Shapiro\ngshapiro@FreeBSD.org\n2000/07/12"] harti [label="Hartmut Brandt\nharti@FreeBSD.org\n2003/01/29"] hmp [label="Hiten Pandya\nhmp@FreeBSD.org\n2004/03/23"] +ian [label="Ian Lepore\nian@FreeBSD.org\n2013/01/07"] iedowse [label="Ian Dowse\niedowse@FreeBSD.org\n2000/12/01"] imp [label="Warner Losh\nimp@FreeBSD.org\n1996/09/20"] ivoras [label="Ivan Voras\nivoras@FreeBSD.org\n2008/06/10"] @@ -339,6 +340,7 @@ bz -> syrinx cognet -> jceel cognet -> kevlo +cognet -> ian cperciva -> eadler cperciva -> flz From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 18:26:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 574449E6; Thu, 17 Jan 2013 18:26:57 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 44785873; Thu, 17 Jan 2013 18:26:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0HIQvm6045886; Thu, 17 Jan 2013 18:26:57 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0HIQvv7045885; Thu, 17 Jan 2013 18:26:57 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301171826.r0HIQvv7045885@svn.freebsd.org> From: Brooks Davis Date: Thu, 17 Jan 2013 18:26:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245563 - 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.14 Precedence: list List-Id: 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, 17 Jan 2013 18:26:57 -0000 Author: brooks Date: Thu Jan 17 18:26:56 2013 New Revision: 245563 URL: http://svnweb.freebsd.org/changeset/base/245563 Log: Correct the distrib-dirs target in the -DDB_FROM_SRC case. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Jan 17 18:00:19 2013 (r245562) +++ head/Makefile.inc1 Thu Jan 17 18:26:56 2013 (r245563) @@ -767,7 +767,7 @@ redistribute: distrib-dirs distribution: cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \ - ${IMAKE_INSTALL} ${.TARGET} + ${IMAKE_INSTALL} ${IMAKE_MTREE} ${.TARGET} # # buildkernel and installkernel From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 18:32:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AFDB3FB6; Thu, 17 Jan 2013 18:32:31 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9C3768C7; Thu, 17 Jan 2013 18:32:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0HIWVf0048280; Thu, 17 Jan 2013 18:32:31 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0HIWVuW048278; Thu, 17 Jan 2013 18:32:31 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301171832.r0HIWVuW048278@svn.freebsd.org> From: Brooks Davis Date: Thu, 17 Jan 2013 18:32:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245565 - in head: . etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 18:32:31 -0000 Author: brooks Date: Thu Jan 17 18:32:30 2013 New Revision: 245565 URL: http://svnweb.freebsd.org/changeset/base/245565 Log: Rework the mtree portion of etc/Makefile's distrib-dirs target to run mtree in a shell loop so there is only one mtree commandline. Move the implementation of LOCAL_MTREE into etc/Makefile. Sponsored by: DARPA, AFRL Reviewed by: mtree :) Modified: head/Makefile.inc1 head/etc/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Jan 17 18:28:26 2013 (r245564) +++ head/Makefile.inc1 Thu Jan 17 18:32:30 2013 (r245565) @@ -717,7 +717,7 @@ distributeworld installworld: installche .endfor -mkdir ${DESTDIR}/${DISTDIR}/base ${_+_}cd ${.CURDIR}; ${IMAKE} distrib-dirs \ - DESTDIR=${DESTDIR}/${DISTDIR}/base + LOCAL_MTREE=${LOCAL_MTREE} DESTDIR=${DESTDIR}/${DISTDIR}/base .endif ${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}; \ ${IMAKEENV} rm -rf ${INSTALLTMP} @@ -1248,11 +1248,7 @@ cross-tools: # hierarchy - ensure that all the needed directories are present # hierarchy hier: - cd ${.CURDIR}/etc; ${MAKE} distrib-dirs -.for _mtree in ${LOCAL_MTREE} - mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/${_mtree} \ - -p ${DESTDIR}/ -.endfor + cd ${.CURDIR}/etc; ${MAKE} LOCAL_MTREE=${LOCAL_MTREE} distrib-dirs # # libraries - build all libraries, and install them under ${DESTDIR}. Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Thu Jan 17 18:28:26 2013 (r245564) +++ head/etc/Makefile Thu Jan 17 18:32:30 2013 (r245565) @@ -293,26 +293,37 @@ distribution: MTREE_CMD?= mtree -distrib-dirs: - ${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/ - ${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var - ${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr - ${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.include.dist \ - -p ${DESTDIR}/usr/include +MTREES= mtree/BSD.root.dist / \ + mtree/BSD.var.dist /var \ + mtree/BSD.usr.dist /usr \ + mtree/BSD.include.dist /usr/include .if ${MK_BIND_LIBS} != "no" - ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.include.dist \ - -p ${DESTDIR}/usr/include +MTREES+= mtree/BIND.include.dist /usr/include .endif .if ${MK_BIND_MTREE} != "no" - ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.chroot.dist \ - -p ${DESTDIR}/var/named +MTREES+= mtree/BIND.chroot.dist /var/named .endif .if ${MK_GROFF} != "no" - ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.groff.dist -p ${DESTDIR}/usr +MTREES+= mtree/BSD.groff.dist /usr .endif .if ${MK_SENDMAIL} != "no" - ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.sendmail.dist -p ${DESTDIR}/ +MTREES+= mtree/BSD.sendmail.dist / .endif +.for mtree in ${LOCAL_MTREE} +MTREES+= ../${mtree} / +.endfor + +distrib-dirs: + @set ${MTREES}; \ + while test $$# -ge 2; do \ + m=${.CURDIR}/$$1; \ + shift; \ + d=${DESTDIR}$$1; \ + shift; \ + ${ECHO} ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} \ + -f $$m -p $$d; \ + ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \ + done; true cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys cd ${DESTDIR}/usr/share/man/en.ISO8859-1; ln -sf ../man* . cd ${DESTDIR}/usr/share/man/en.UTF-8; ln -sf ../man* . From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 18:40:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 36FD13CE; Thu, 17 Jan 2013 18:40:50 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 0DF16942; Thu, 17 Jan 2013 18:40:50 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 20A12B924; Thu, 17 Jan 2013 13:40:49 -0500 (EST) From: John Baldwin To: Eitan Adler Subject: Re: svn commit: r245494 - head/bin/pwait Date: Thu, 17 Jan 2013 10:35:14 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201301160503.r0G53qie087155@svn.freebsd.org> <50F6ED68.50602@delphij.net> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201301171035.14799.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 17 Jan 2013 13:40:49 -0500 (EST) Cc: "svn-src-head@freebsd.org" , Xin LI , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , d@delphij.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 18:40:50 -0000 On Wednesday, January 16, 2013 2:15:00 pm Eitan Adler wrote: > On 16 January 2013 13:11, Xin Li wrote: > > > Yes I did. Using exit(3) tells clang that this is the final exit and > > thus eliminates the warning. > > > > It sounds like a bug (or arguably a feature) that clang does not > > recognize return in main()s... > > It is not a bug: see > http://clang-developers.42468.n3.nabble.com/Static-analyzer-possible-memory- leak-false-positive-td4026706.html No, it is clearly a bug. It is a waste of time and adds obfuscation (and runtime overhead) to go free a bunch of stuff just before a return() from main(). The vast, vast majority of time main() is used as main(), so it should clearly by the default behavior to treat a return() from main() the same as exit() and possibly have an option to toggle that setting. As to the last post in that thread, the same problem exists if you malloc something early in main() and later call exit(), so that has no bearing on whether or not a return() from main() should be treated as an exit(). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 18:40:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2779B3D3; Thu, 17 Jan 2013 18:40:53 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 03376944; Thu, 17 Jan 2013 18:40:53 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 2CB7CB953; Thu, 17 Jan 2013 13:40:52 -0500 (EST) From: John Baldwin To: Eitan Adler Subject: Re: svn commit: r245506 - head/bin/pwait Date: Thu, 17 Jan 2013 10:50:07 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201301161815.r0GIFQPk007553@svn.freebsd.org> <20130117130740.I1066@besplex.bde.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201301171050.07596.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 17 Jan 2013 13:40:52 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI , Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 18:40:53 -0000 On Wednesday, January 16, 2013 10:40:51 pm Eitan Adler wrote: > On 16 January 2013 21:25, Bruce Evans wrote: > > This uses the sysexits mistake. style(9) was fixed to not give an example > > of this mistake. Before this, sysexits was used a whole once in pwait(1) > > (for EX_USAGE) in usage(). EX_USAGE happens to be 64. As usual when the > > mistake is used, this is useless for humans (the usage message gives more > > info) and unusable for programs, especially since it is undocmented > > (pwait(1)'s man page just says ">0 if an error occurs". It doesn't even > > use '.Std' for this, but hard-codes it. > > IMHO using sysexits gives more signal than using a binary 0 or 1. It > is a mistake to have changed style(9) to avoid using sysexits. > Instead the man page should detail the specific error that occurs > directly, or by reference to sysexit. Eh, I think bde@ has quite a bit more experience with this than you. is not part of POSIX or any other standard. It's comments reference delivermail (the predecessor to sendmail). Looking at its history, it has never been changed in FreeBSD, and it's history in CSRG is rather spartan and mostly tied to delivermail/sendmail: http://svnweb.freebsd.org/csrg/include/sysexits.h?view=log In practice it's list of error value is limited and has not grown to handle new errors in over two decades (as opposed to, say, the list of errnos). OTOH, it seems the history section in sysexits(3) is slightly off as the CSRG history suggests it was present in at least 4.2BSD. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 18:41:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 277806E2; Thu, 17 Jan 2013 18:41:01 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 03DE094B; Thu, 17 Jan 2013 18:41:01 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 5C99DB9B8; Thu, 17 Jan 2013 13:41:00 -0500 (EST) From: John Baldwin To: d@delphij.net Subject: Re: svn commit: r245494 - head/bin/pwait Date: Thu, 17 Jan 2013 13:40:35 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201301160503.r0G53qie087155@svn.freebsd.org> <201301161111.49580.jhb@freebsd.org> <50F71D5E.60604@delphij.net> In-Reply-To: <50F71D5E.60604@delphij.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201301171340.35912.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 17 Jan 2013 13:41:00 -0500 (EST) Cc: "svn-src-head@freebsd.org" , Eitan Adler , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Xin LI X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 18:41:01 -0000 On Wednesday, January 16, 2013 4:36:30 pm Xin Li wrote: > On 01/16/13 08:11, John Baldwin wrote: > > On Wednesday, January 16, 2013 1:49:40 am Xin LI wrote: > >> This doesn't seem right -- you should never release memory before > >> exit, especially for memory allocated in main(), unless this > >> "main" is intended for different purpose like a monolithic shell > >> that wants to avoid exec(). Note that pwait(1) have multiple exit > >> points I don't think it's practical. > >> > >> Would you mind if I commit this changeset instead? I have the > >> return -> exit change in my queue long ago but only noticed it > >> today... > > > > I think the free shouldn't be there as well, but I think requiring > > an exit() instead of return to "fix" it is bogus as well. The > > static analyzer is just broken in this case. main() is special and > > returns from it should be treated like exit() and not cause false > > warnings about memory leaks. > > Well, being a horrible idea itself to redefine main() to something > else and expect the module to do no harm to its caller, I think Eitan > still have a valid point that it could be a bad idea to ban this in > wholesale within compiler, as the C standard don't ban using return's > in main(). As I said in a later followup, I think there should be an option, but it should default to treating return from main as exit(). > In style(9) the examples do use exit() for main() by the way. Yes, but as other folks have pointed out, return() can be more suitable in other cases (specifically with C++ when you want objects in scope to be properly destroyed). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 18:45:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A70E6E18; Thu, 17 Jan 2013 18:45:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8FB5D9D3; Thu, 17 Jan 2013 18:45:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0HIjKlT051540; Thu, 17 Jan 2013 18:45:20 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0HIjKlJ051539; Thu, 17 Jan 2013 18:45:20 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201301171845.r0HIjKlJ051539@svn.freebsd.org> From: John Baldwin Date: Thu, 17 Jan 2013 18:45:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245566 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 18:45:20 -0000 Author: jhb Date: Thu Jan 17 18:45:20 2013 New Revision: 245566 URL: http://svnweb.freebsd.org/changeset/base/245566 Log: Remove a no-longer-used variable after the previous change to use VA_UTIMES_NULL. Submitted by: bde, rmacklem MFC after: 1 week Modified: head/sys/fs/nfsclient/nfs_clport.c Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Thu Jan 17 18:32:30 2013 (r245565) +++ head/sys/fs/nfsclient/nfs_clport.c Thu Jan 17 18:45:20 2013 (r245566) @@ -726,7 +726,6 @@ nfscl_fillsattr(struct nfsrv_descript *n u_int32_t *tl; struct nfsv2_sattr *sp; nfsattrbit_t attrbits; - struct timeval curtime; switch (nd->nd_flag & (ND_NFSV2 | ND_NFSV3 | ND_NFSV4)) { case ND_NFSV2: @@ -755,7 +754,6 @@ nfscl_fillsattr(struct nfsrv_descript *n txdr_nfsv2time(&vap->va_mtime, &sp->sa_mtime); break; case ND_NFSV3: - getmicrotime(&curtime); if (vap->va_mode != (mode_t)VNOVAL) { NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); *tl++ = newnfs_true; From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 18:48:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 98E2BFC5 for ; Thu, 17 Jan 2013 18:48:36 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com [209.85.215.44]) by mx1.freebsd.org (Postfix) with ESMTP id 213B99F9 for ; Thu, 17 Jan 2013 18:48:35 +0000 (UTC) Received: by mail-la0-f44.google.com with SMTP id eb20so1908532lab.31 for ; Thu, 17 Jan 2013 10:48:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=VpGCW59xd/0P2ah/JSqk3amLtTCepHTrH5mWzk3zh10=; b=JEPU3YJDyhwgbrgyl5FlDKouI4C8Pe7bNgIZEsOnrNmzGQO0XN7ZcVmMr6nTX5lj5h WC6Ih8bo8bGmI7eXll8Z+P9OOKbf336bO29JEJBHnAp+f4DX4DvqDmaHF8idvrUJpie+ 9b2SB20pgPb3duseObrmdLx43IgH92GgOSzOY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding:x-gm-message-state; bh=VpGCW59xd/0P2ah/JSqk3amLtTCepHTrH5mWzk3zh10=; b=I5eCv5O2U8tfrvToEbuo4tW25U+euBZAwoBL/6q28JErQHT74DGhaJFE96LU3r+R1c 2HCo0J7pkWwIAP1w7+VolDnxisBCwO+cMtbmwB83FB12BeTKySZkSzLNzX8bLq4YVYDD y58zsdS0iLC6knrBnS7ldVyMHIDMtmv7sIt4pQDfAkpHBpZ+o+WfJ/vFmkQsaq+/PTeT ZwZ9BdEALrGShjrpnKcDZbX/Tq4JVqgFEEzsIukBbnrLcyRn+6pQuJ1WKWEQiOZBkEeM +p1sGghiD3ElPEuh7yPHBwfF3EtuNi0toxCF0BbCRsfElcXejn2vBlZIvK+AvD62+4dF ri+w== X-Received: by 10.112.82.136 with SMTP id i8mr2597703lby.74.1358448514848; Thu, 17 Jan 2013 10:48:34 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.30.131 with HTTP; Thu, 17 Jan 2013 10:48:04 -0800 (PST) In-Reply-To: <201301171035.14799.jhb@freebsd.org> References: <201301160503.r0G53qie087155@svn.freebsd.org> <50F6ED68.50602@delphij.net> <201301171035.14799.jhb@freebsd.org> From: Eitan Adler Date: Thu, 17 Jan 2013 13:48:04 -0500 X-Google-Sender-Auth: bE8b3inw3pLkIKVvkMJSxBd5CW0 Message-ID: Subject: Re: svn commit: r245494 - head/bin/pwait To: John Baldwin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQmG65JM6MculQ11ypJOWao9RFOZeAgr//yF5f5rvwDSs5re2UxAIRgUtEohGmDyMGPYMyVE Cc: "src-committers@freebsd.org" , Xin LI , Erik Cederstrand , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , d@delphij.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 18:48:36 -0000 On 17 January 2013 10:35, John Baldwin wrote: > No, it is clearly a bug. It is a waste of time and adds obfuscation (and > runtime overhead) to go free a bunch of stuff just before a return() from > main(). It is by-design according to the clang folks. They have expressed in interest in offering a knob to change this behavior, but I do not know the status of it. That said, I believe Xin's recent commit fixed the issue of adding an additional free. IMHO the compiler should also be able to optimize this case of free out. FWIW I have a very strong feeling of D=C3=A9j=C3=A0 vu here: we have discus= sed this exact type of change before. --=20 Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 18:52:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8453A30A; Thu, 17 Jan 2013 18:52:50 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 76E51A40; Thu, 17 Jan 2013 18:52:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0HIqocC054075; Thu, 17 Jan 2013 18:52:50 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0HIqocu054073; Thu, 17 Jan 2013 18:52:50 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201301171852.r0HIqocu054073@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 17 Jan 2013 18:52:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245567 - 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.14 Precedence: list List-Id: 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, 17 Jan 2013 18:52:50 -0000 Author: np Date: Thu Jan 17 18:52:49 2013 New Revision: 245567 URL: http://svnweb.freebsd.org/changeset/base/245567 Log: cxgbe: Make the for_each macros safer to use by turning them into a single statement each. Submitted by: Christoph Mallon MFC after: 1 week Modified: head/sys/dev/cxgbe/adapter.h Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Thu Jan 17 18:45:20 2013 (r245566) +++ head/sys/dev/cxgbe/adapter.h Thu Jan 17 18:52:49 2013 (r245567) @@ -648,17 +648,17 @@ struct adapter { #define TXQ_LOCK_ASSERT_NOTOWNED(txq) EQ_LOCK_ASSERT_NOTOWNED(&(txq)->eq) #define for_each_txq(pi, iter, q) \ - q = &pi->adapter->sge.txq[pi->first_txq]; \ - for (iter = 0; iter < pi->ntxq; ++iter, ++q) + for (q = &pi->adapter->sge.txq[pi->first_txq], iter = 0; \ + iter < pi->ntxq; ++iter, ++q) #define for_each_rxq(pi, iter, q) \ - q = &pi->adapter->sge.rxq[pi->first_rxq]; \ - for (iter = 0; iter < pi->nrxq; ++iter, ++q) + for (q = &pi->adapter->sge.rxq[pi->first_rxq], iter = 0; \ + iter < pi->nrxq; ++iter, ++q) #define for_each_ofld_txq(pi, iter, q) \ - q = &pi->adapter->sge.ofld_txq[pi->first_ofld_txq]; \ - for (iter = 0; iter < pi->nofldtxq; ++iter, ++q) + for (q = &pi->adapter->sge.ofld_txq[pi->first_ofld_txq], iter = 0; \ + iter < pi->nofldtxq; ++iter, ++q) #define for_each_ofld_rxq(pi, iter, q) \ - q = &pi->adapter->sge.ofld_rxq[pi->first_ofld_rxq]; \ - for (iter = 0; iter < pi->nofldrxq; ++iter, ++q) + for (q = &pi->adapter->sge.ofld_rxq[pi->first_ofld_rxq], iter = 0; \ + iter < pi->nofldrxq; ++iter, ++q) /* One for errors, one for firmware events */ #define T4_EXTRA_INTR 2 From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 19:03:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4098D8BE; Thu, 17 Jan 2013 19:03:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2F37EAB3; Thu, 17 Jan 2013 19:03:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0HJ3PQB057386; Thu, 17 Jan 2013 19:03:25 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0HJ3OoS057384; Thu, 17 Jan 2013 19:03:24 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201301171903.r0HJ3OoS057384@svn.freebsd.org> From: John Baldwin Date: Thu, 17 Jan 2013 19:03:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245568 - head/sys/nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 19:03:25 -0000 Author: jhb Date: Thu Jan 17 19:03:24 2013 New Revision: 245568 URL: http://svnweb.freebsd.org/changeset/base/245568 Log: Remove the unused nfs_curusec(). Modified: head/sys/nfs/nfs_common.c head/sys/nfs/nfs_common.h Modified: head/sys/nfs/nfs_common.c ============================================================================== --- head/sys/nfs/nfs_common.c Thu Jan 17 18:52:49 2013 (r245567) +++ head/sys/nfs/nfs_common.c Thu Jan 17 19:03:24 2013 (r245568) @@ -90,15 +90,6 @@ static int nfs_realign_count; SYSCTL_INT(_vfs_nfs_common, OID_AUTO, realign_count, CTLFLAG_RD, &nfs_realign_count, 0, "Number of mbuf realignments done"); -u_quad_t -nfs_curusec(void) -{ - struct timeval tv; - - getmicrotime(&tv); - return ((u_quad_t)tv.tv_sec * 1000000 + (u_quad_t)tv.tv_usec); -} - /* * copies mbuf chain to the uio scatter/gather list */ Modified: head/sys/nfs/nfs_common.h ============================================================================== --- head/sys/nfs/nfs_common.h Thu Jan 17 18:52:49 2013 (r245567) +++ head/sys/nfs/nfs_common.h Thu Jan 17 19:03:24 2013 (r245568) @@ -46,7 +46,6 @@ extern nfstype nfsv3_type[]; #define vtonfsv3_type(a) txdr_unsigned(nfsv3_type[((int32_t)(a))]) int nfs_adv(struct mbuf **, caddr_t *, int, int); -u_quad_t nfs_curusec(void); void *nfsm_disct(struct mbuf **, caddr_t *, int, int, int); int nfs_realign(struct mbuf **, int); From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 19:27:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 12C263BD; Thu, 17 Jan 2013 19:27:13 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EEC9CC2F; Thu, 17 Jan 2013 19:27:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0HJRCB7064375; Thu, 17 Jan 2013 19:27:12 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0HJRCwh064374; Thu, 17 Jan 2013 19:27:12 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201301171927.r0HJRCwh064374@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 17 Jan 2013 19:27:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245570 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 19:27:13 -0000 Author: luigi Date: Thu Jan 17 19:27:12 2013 New Revision: 245570 URL: http://svnweb.freebsd.org/changeset/base/245570 Log: remove an incorrect comment and debugging code Modified: head/sys/dev/netmap/ixgbe_netmap.h Modified: head/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- head/sys/dev/netmap/ixgbe_netmap.h Thu Jan 17 19:08:20 2013 (r245569) +++ head/sys/dev/netmap/ixgbe_netmap.h Thu Jan 17 19:27:12 2013 (r245570) @@ -63,9 +63,6 @@ * This is tricky, much better to use TDH for now. */ SYSCTL_DECL(_dev_netmap); -static int ix_write_len; -SYSCTL_INT(_dev_netmap, OID_AUTO, ix_write_len, - CTLFLAG_RW, &ix_write_len, 0, "write rx len"); static int ix_rx_miss, ix_rx_miss_bufs, ix_use_dd, ix_crcstrip; SYSCTL_INT(_dev_netmap, OID_AUTO, ix_crcstrip, CTLFLAG_RW, &ix_crcstrip, 0, "strip CRC on rx frames"); @@ -485,12 +482,8 @@ ixgbe_netmap_rxsync(struct ifnet *ifp, u * rxr->next_to_check is set to 0 on a ring reinit */ if (netmap_no_pendintr || force_update) { - /* XXX apparently the length field in advanced descriptors - * does not include the CRC irrespective of the setting - * of CRCSTRIP. The data sheets say differently. - * Very strange. - */ int crclen = ix_crcstrip ? 0 : 4; + l = rxr->next_to_check; j = netmap_idx_n2k(kring, l); @@ -501,8 +494,6 @@ ixgbe_netmap_rxsync(struct ifnet *ifp, u if ((staterr & IXGBE_RXD_STAT_DD) == 0) break; ring->slot[j].len = le16toh(curr->wb.upper.length) - crclen; - if (ix_write_len) - D("rx[%d] len %d", j, ring->slot[j].len); bus_dmamap_sync(rxr->ptag, rxr->rx_buffers[l].pmap, BUS_DMASYNC_POSTREAD); j = (j == lim) ? 0 : j + 1; From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 20:21:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7EA1167D; Thu, 17 Jan 2013 20:21:31 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 593ABEF9; Thu, 17 Jan 2013 20:21:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0HKLVA7082421; Thu, 17 Jan 2013 20:21:31 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0HKLVVK082420; Thu, 17 Jan 2013 20:21:31 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301172021.r0HKLVVK082420@svn.freebsd.org> From: Brooks Davis Date: Thu, 17 Jan 2013 20:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245571 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 20:21:31 -0000 Author: brooks Date: Thu Jan 17 20:21:30 2013 New Revision: 245571 URL: http://svnweb.freebsd.org/changeset/base/245571 Log: In preparation for logging metadata about each filesystem object refactor the link section of distrib-dirs to alwasy install to a full path (the link contents remain relative as they should). Eliminate the use of the "rm -r[f] ; ln -s " pattern in favor of "ln -sf ". None of these links could be directories on a system installed in the last decade. Sponsored by: DARPA, AFRL Reviewed by: mtree Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Thu Jan 17 19:27:12 2013 (r245570) +++ head/etc/Makefile Thu Jan 17 20:21:30 2013 (r245571) @@ -324,32 +324,26 @@ distrib-dirs: -f $$m -p $$d; \ ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \ done; true - cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys - cd ${DESTDIR}/usr/share/man/en.ISO8859-1; ln -sf ../man* . - cd ${DESTDIR}/usr/share/man/en.UTF-8; ln -sf ../man* . + ln -sf usr/src/sys ${DESTDIR}/sys cd ${DESTDIR}/usr/share/man; \ - set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \ - while [ $$# -gt 0 ] ; \ - do \ - rm -rf "$$1"; \ - ln -s "$$2" "$$1"; \ - shift; shift; \ + for mandir in man*; do \ + ln -sf ../$$mandir ${DESTDIR}/usr/share/man/en.ISO8859-1/; \ + ln -sf ../$$mandir ${DESTDIR}/usr/share/man/en.UTF-8/; \ done cd ${DESTDIR}/usr/share/openssl/man; \ + for mandir in man*; do \ + ln -sf ../$$mandir \ + ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1/; \ + done set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \ - while [ $$# -gt 0 ] ; \ - do \ - rm -rf "$$1"; \ - ln -s "$$2" "$$1"; \ + while [ $$# -gt 0 ] ; do \ + ln -sf "$$2" "${DESTDIR}/usr/share/man/$$1"; \ + ln -sf "$$2" "${DESTDIR}/usr/share/openssl/man/$$1"; \ shift; shift; \ done - cd ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1; ln -sf ../man* . - cd ${DESTDIR}/usr/share/nls; \ set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \ - while [ $$# -gt 0 ] ; \ - do \ - rm -rf "$$1"; \ - ln -s "$$2" "$$1"; \ + while [ $$# -gt 0 ] ; do \ + ln -sf "$$2" "${DESTDIR}/usr/share/nls/$$1"; \ shift; shift; \ done From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 20:39:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BAA37AD4; Thu, 17 Jan 2013 20:39:33 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 1E68FF93; Thu, 17 Jan 2013 20:39:32 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id A46DDAFA; Thu, 17 Jan 2013 21:36:54 +0100 (CET) Date: Thu, 17 Jan 2013 21:39:55 +0100 From: Pawel Jakub Dawidek To: John Baldwin Subject: Re: svn commit: r245506 - head/bin/pwait Message-ID: <20130117203955.GA1679@garage.freebsd.pl> References: <201301161815.r0GIFQPk007553@svn.freebsd.org> <20130117130740.I1066@besplex.bde.org> <201301171050.07596.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5vNYLRcllDrimb99" Content-Disposition: inline In-Reply-To: <201301171050.07596.jhb@freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@freebsd.org, Eitan Adler , svn-src-all@freebsd.org, Xin LI , Bruce Evans , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 20:39:33 -0000 --5vNYLRcllDrimb99 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 17, 2013 at 10:50:07AM -0500, John Baldwin wrote: > On Wednesday, January 16, 2013 10:40:51 pm Eitan Adler wrote: > > On 16 January 2013 21:25, Bruce Evans wrote: > > > This uses the sysexits mistake. style(9) was fixed to not give an ex= ample > > > of this mistake. Before this, sysexits was used a whole once in pwai= t(1) > > > (for EX_USAGE) in usage(). EX_USAGE happens to be 64. As usual when= the > > > mistake is used, this is useless for humans (the usage message gives = more > > > info) and unusable for programs, especially since it is undocmented > > > (pwait(1)'s man page just says ">0 if an error occurs". It doesn't e= ven > > > use '.Std' for this, but hard-codes it. > >=20 > > IMHO using sysexits gives more signal than using a binary 0 or 1. It > > is a mistake to have changed style(9) to avoid using sysexits. > > Instead the man page should detail the specific error that occurs > > directly, or by reference to sysexit. >=20 > Eh, I think bde@ has quite a bit more experience with this than you. =20 > is not part of POSIX or any other standard. It's comments= =20 > reference delivermail (the predecessor to sendmail). Looking at its hist= ory,=20 > it has never been changed in FreeBSD, and it's history in CSRG is rather= =20 > spartan and mostly tied to delivermail/sendmail: >=20 > http://svnweb.freebsd.org/csrg/include/sysexits.h?view=3Dlog >=20 > In practice it's list of error value is limited and has not grown to hand= le=20 > new errors in over two decades (as opposed to, say, the list of errnos). = =20 > OTOH, it seems the history section in sysexits(3) is slightly off as the = CSRG=20 > history suggests it was present in at least 4.2BSD. Well, if we decide sysexits(3) are useless, then it would be nice to recommend against using it in sysexits(3) manual page. Currently it is rather seductive: According to style(9), it is not a good practice to call exit(3) with arbitrary values to indicate a failure condition when ending a program. Instead, the pre-defined exit codes from sysexits should be used, so the caller of the process can get a rough estimation about the failure class without looking up the source code. I, for one, used it pretty extensively in HAST:) % grep EX_ /usr/src/sbin/hastd/*.c | wc -l 67 In my humble opinion using sysexits(3) is better than just putting exit(1) everywhere. Actually HAST or some of my other projects was making decision about restarting a processes if the exit code was EX_TEMPFAIL (if the failure was temporary it is fine to restart, if it is not then better not to enter some infinite loop). I am fully aware that sysexits(3) doesn't cover many important cases, but those cases differ from application to application. The exact same problem exists for errno. For me those values represent sets of failure cases rather than allow to distinguish between every possible failure case. It would probably be the best to define exit codes for every application separately, but maybe selection of exit codes provided by sysexits(3) is good enough and definiately better than 0/1. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --5vNYLRcllDrimb99 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlD4YZsACgkQForvXbEpPzTVJwCgv7hEhx7XqKq959ILjHqsKkiq URMAnij4tkluaEFmgxIN8FkL7L6tvuoy =bJeC -----END PGP SIGNATURE----- --5vNYLRcllDrimb99-- From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 20:48:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 26E18DB8 for ; Thu, 17 Jan 2013 20:48:27 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com [209.85.217.171]) by mx1.freebsd.org (Postfix) with ESMTP id A4E9DFEA for ; Thu, 17 Jan 2013 20:48:26 +0000 (UTC) Received: by mail-lb0-f171.google.com with SMTP id gg13so696194lbb.30 for ; Thu, 17 Jan 2013 12:48:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=x+OCwqlTAxAiukznQs8My5LEcltLKmR0KtJcSO41rrU=; b=Oo1F+Ad1WPuBr/bd0I7P/u7qsi+B/mQBm7I9RTHXws3lN/joZXEMe5TKFZW0VYrO/4 8Si+sjrWhZrxEWgSBWQUE4h9oJT9M+EI2diUm2JDVidnBryzd4dXnqfp7dsPj5PibsOG K+jAbD88JFRZJLIoVK8gzB4YBfkLDdSR/to7Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=x+OCwqlTAxAiukznQs8My5LEcltLKmR0KtJcSO41rrU=; b=G4ZAfImi0TkyPPlM5QsFSmOKweTMQXJvc9XedYhR0KF2ZYKtLdTlPUHs22xR/Lyo8r FUaNC2Tj8cTJArFGjNxhZhw/mK1d1y/IsGOOMZth7BAznI28LuXNWsPO2jZWXmdV/C4C aWxBWhXovKEXPhIL1WoB2GjQ8O3+BwRC5Haw6DRM1NvA0ZkpUrIZNra9fIkD5Z1B6uhn NxScvIuEsyDCf0aRf7Ucg8wbbYb/aLDhfXVqKgFuXaQSPLFmsy4qZ7LxPfk3yMlfbxLM eooO2tOyWD51/Y6PdBY6EH5NqHdycWLaq3TqrBBCt7lvGWuHUU/QL9nsPjC+v+HioSQD i+Kw== X-Received: by 10.152.144.4 with SMTP id si4mr6134243lab.10.1358455699812; Thu, 17 Jan 2013 12:48:19 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.30.131 with HTTP; Thu, 17 Jan 2013 12:47:48 -0800 (PST) In-Reply-To: <201301171050.07596.jhb@freebsd.org> References: <201301161815.r0GIFQPk007553@svn.freebsd.org> <20130117130740.I1066@besplex.bde.org> <201301171050.07596.jhb@freebsd.org> From: Eitan Adler Date: Thu, 17 Jan 2013 15:47:48 -0500 X-Google-Sender-Auth: eqnyFpvTHc1EspiCLsv3oZBu1jM Message-ID: Subject: Re: svn commit: r245506 - head/bin/pwait To: John Baldwin Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQkHAEb0qT1hBQcm0bFQfvvS9rqp7uRACMfWV3ONN7DJpoeYHEl4Bl3GZgkrItM5f7ggr3ju Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI , Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 20:48:27 -0000 On 17 January 2013 10:50, John Baldwin wrote: > Eh, I think bde@ has quite a bit more experience with this than you. No doubt. > is not part of POSIX or any other standard. It's comments > reference delivermail (the predecessor to sendmail). Looking at its history, ... Understood. I have found value in programs which output specific error returns instead of "1" or "0". The specific use of sysexits instead of each application choose their own is a nicety. > In practice it's list of error value is limited and has not grown to handle > new errors in over two decades (as opposed to, say, the list of errnos). Perhaps it is best to extend it instead of deprecating it? -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 21:02:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EC54FDD; Thu, 17 Jan 2013 21:02:54 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DD3B6D7; Thu, 17 Jan 2013 21:02:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0HL2s9w095158; Thu, 17 Jan 2013 21:02:54 GMT (envelope-from csjp@svn.freebsd.org) Received: (from csjp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0HL2sjL095155; Thu, 17 Jan 2013 21:02:54 GMT (envelope-from csjp@svn.freebsd.org) Message-Id: <201301172102.r0HL2sjL095155@svn.freebsd.org> From: "Christian S.J. Peron" Date: Thu, 17 Jan 2013 21:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245573 - head/sys/security/audit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 21:02:55 -0000 Author: csjp Date: Thu Jan 17 21:02:53 2013 New Revision: 245573 URL: http://svnweb.freebsd.org/changeset/base/245573 Log: Implement the zonename token for jailed processes. If a process has an auditid/preselection masks specified, and is jailed, include the zonename (jailname) token as a part of the audit record. Reviewed by: pjd MFC after: 2 weeks Modified: head/sys/security/audit/audit.c head/sys/security/audit/audit_bsm.c head/sys/security/audit/audit_private.h Modified: head/sys/security/audit/audit.c ============================================================================== --- head/sys/security/audit/audit.c Thu Jan 17 20:21:56 2013 (r245572) +++ head/sys/security/audit/audit.c Thu Jan 17 21:02:53 2013 (r245573) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -211,6 +212,7 @@ audit_record_ctor(void *mem, int size, v struct kaudit_record *ar; struct thread *td; struct ucred *cred; + struct prison *pr; KASSERT(sizeof(*ar) == size, ("audit_record_ctor: wrong size")); @@ -233,6 +235,17 @@ audit_record_ctor(void *mem, int size, v ar->k_ar.ar_subj_pid = td->td_proc->p_pid; ar->k_ar.ar_subj_amask = cred->cr_audit.ai_mask; ar->k_ar.ar_subj_term_addr = cred->cr_audit.ai_termid; + /* + * If this process is jailed, make sure we capture the name of the + * jail so we can use it to generate a zonename token when we covert + * this record to BSM. + */ + if (jailed(cred)) { + pr = cred->cr_prison; + (void) strlcpy(ar->k_ar.ar_jailname, pr->pr_name, + sizeof(ar->k_ar.ar_jailname)); + } else + ar->k_ar.ar_jailname[0] = '\0'; return (0); } Modified: head/sys/security/audit/audit_bsm.c ============================================================================== --- head/sys/security/audit/audit_bsm.c Thu Jan 17 20:21:56 2013 (r245572) +++ head/sys/security/audit/audit_bsm.c Thu Jan 17 21:02:53 2013 (r245573) @@ -462,7 +462,7 @@ audit_sys_auditon(struct audit_record *a int kaudit_to_bsm(struct kaudit_record *kar, struct au_record **pau) { - struct au_token *tok, *subj_tok; + struct au_token *tok, *subj_tok, *jail_tok; struct au_record *rec; au_tid_t tid; struct audit_record *ar; @@ -475,8 +475,13 @@ kaudit_to_bsm(struct kaudit_record *kar, rec = kau_open(); /* - * Create the subject token. + * Create the subject token. If this credential was jailed be sure to + * generate a zonename token. */ + if (ar->ar_jailname[0] != '\0') + jail_tok = au_to_zonename(ar->ar_jailname); + else + jail_tok = NULL; switch (ar->ar_subj_term_addr.at_type) { case AU_IPv4: tid.port = ar->ar_subj_term_addr.at_port; @@ -1623,11 +1628,15 @@ kaudit_to_bsm(struct kaudit_record *kar, /* * Write the subject token so it is properly freed here. */ + if (jail_tok != NULL) + kau_write(rec, jail_tok); kau_write(rec, subj_tok); kau_free(rec); return (BSM_NOAUDIT); } + if (jail_tok != NULL) + kau_write(rec, jail_tok); kau_write(rec, subj_tok); tok = au_to_return32(au_errno_to_bsm(ar->ar_errno), ar->ar_retval); kau_write(rec, tok); /* Every record gets a return token */ Modified: head/sys/security/audit/audit_private.h ============================================================================== --- head/sys/security/audit/audit_private.h Thu Jan 17 20:21:56 2013 (r245572) +++ head/sys/security/audit/audit_private.h Thu Jan 17 21:02:53 2013 (r245573) @@ -230,6 +230,7 @@ struct audit_record { int ar_arg_exitretval; struct sockaddr_storage ar_arg_sockaddr; cap_rights_t ar_arg_rights; + char ar_jailname[MAXHOSTNAMELEN]; }; /* From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 21:22:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A76925E8; Thu, 17 Jan 2013 21:22:11 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 7B525186; Thu, 17 Jan 2013 21:22:11 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B7F5DB911; Thu, 17 Jan 2013 16:22:10 -0500 (EST) From: John Baldwin To: src-committers@freebsd.org Subject: Re: svn commit: r245568 - head/sys/nfs Date: Thu, 17 Jan 2013 14:59:00 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201301171903.r0HJ3OoS057384@svn.freebsd.org> In-Reply-To: <201301171903.r0HJ3OoS057384@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201301171459.00463.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 17 Jan 2013 16:22:10 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 21:22:11 -0000 On Thursday, January 17, 2013 2:03:24 pm John Baldwin wrote: > Author: jhb > Date: Thu Jan 17 19:03:24 2013 > New Revision: 245568 > URL: http://svnweb.freebsd.org/changeset/base/245568 > > Log: > Remove the unused nfs_curusec(). > > Modified: > head/sys/nfs/nfs_common.c > head/sys/nfs/nfs_common.h 7.x used this in the old RPC code (pre-krpc) and in the write gathering code (which has not been reimplemented in 8.x+). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 21:28:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0AC218CE; Thu, 17 Jan 2013 21:28:33 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E29591D0; Thu, 17 Jan 2013 21:28:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0HLSWIJ002402; Thu, 17 Jan 2013 21:28:32 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0HLSWH8002398; Thu, 17 Jan 2013 21:28:32 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201301172128.r0HLSWH8002398@svn.freebsd.org> From: Andre Oppermann Date: Thu, 17 Jan 2013 21:28:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245575 - 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.14 Precedence: list List-Id: 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, 17 Jan 2013 21:28:33 -0000 Author: andre Date: Thu Jan 17 21:28:31 2013 New Revision: 245575 URL: http://svnweb.freebsd.org/changeset/base/245575 Log: Move the mbuf memory limit calculations from init_param2() to tunable_mbinit() where it is next to where it is used later. Change the sysinit level of tunable_mbinit() from SI_SUB_TUNABLES to SI_SUB_KMEM after the VM is running. This allows to use better methods to determine the effectively available physical and virtual memory available to the kernel. Update comments. In a second step it can be merged into mbuf_init(). Modified: head/sys/kern/kern_mbuf.c head/sys/kern/subr_param.c head/sys/sys/mbuf.h Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Thu Jan 17 21:20:15 2013 (r245574) +++ head/sys/kern/kern_mbuf.c Thu Jan 17 21:28:31 2013 (r245575) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -104,15 +105,24 @@ int nmbjumbo16; /* limits number of 16 struct mbstat mbstat; /* - * tunable_mbinit() has to be run before init_maxsockets() thus - * the SYSINIT order below is SI_ORDER_MIDDLE while init_maxsockets() - * runs at SI_ORDER_ANY. - * - * NB: This has to be done before VM init. + * tunable_mbinit() has to be run before any mbuf allocations are done. */ static void tunable_mbinit(void *dummy) { + quad_t realmem, maxmbufmem; + + /* + * The default limit for all mbuf related memory is 1/2 of all + * available kernel memory (physical or kmem). + * At most it can be 3/4 of available kernel memory. + */ + realmem = qmin((quad_t)physmem * PAGE_SIZE, + vm_map_max(kernel_map) - vm_map_min(kernel_map)); + maxmbufmem = realmem / 2; + TUNABLE_QUAD_FETCH("kern.maxmbufmem", &maxmbufmem); + if (maxmbufmem > realmem / 4 * 3) + maxmbufmem = realmem / 4 * 3; TUNABLE_INT_FETCH("kern.ipc.nmbclusters", &nmbclusters); if (nmbclusters == 0) @@ -139,7 +149,7 @@ tunable_mbinit(void *dummy) nmbufs = lmax(maxmbufmem / MSIZE / 5, nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16); } -SYSINIT(tunable_mbinit, SI_SUB_TUNABLES, SI_ORDER_MIDDLE, tunable_mbinit, NULL); +SYSINIT(tunable_mbinit, SI_SUB_KMEM, SI_ORDER_MIDDLE, tunable_mbinit, NULL); static int sysctl_nmbclusters(SYSCTL_HANDLER_ARGS) @@ -279,16 +289,14 @@ static int mb_zinit_pack(void *, int, in static void mb_zfini_pack(void *, int); static void mb_reclaim(void *); -static void mbuf_init(void *); static void *mbuf_jumbo_alloc(uma_zone_t, int, uint8_t *, int); -/* Ensure that MSIZE must be a power of 2. */ +/* Ensure that MSIZE is a power of 2. */ CTASSERT((((MSIZE - 1) ^ MSIZE) + 1) >> 1 == MSIZE); /* * Initialize FreeBSD Network buffer allocation. */ -SYSINIT(mbuf, SI_SUB_MBUF, SI_ORDER_FIRST, mbuf_init, NULL); static void mbuf_init(void *dummy) { @@ -396,6 +404,7 @@ mbuf_init(void *dummy) mbstat.sf_iocnt = 0; mbstat.sf_allocwait = mbstat.sf_allocfail = 0; } +SYSINIT(mbuf, SI_SUB_MBUF, SI_ORDER_FIRST, mbuf_init, NULL); /* * UMA backend page allocator for the jumbo frame zones. Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Thu Jan 17 21:20:15 2013 (r245574) +++ head/sys/kern/subr_param.c Thu Jan 17 21:28:31 2013 (r245575) @@ -93,7 +93,6 @@ int ncallout; /* maximum # of timer ev int nbuf; int ngroups_max; /* max # groups per process */ int nswbuf; -quad_t maxmbufmem; /* max mbuf memory */ pid_t pid_max = PID_MAX; long maxswzone; /* max swmeta KVA storage */ long maxbcache; /* max buffer cache KVA storage */ @@ -274,7 +273,6 @@ init_param1(void) void init_param2(long physpages) { - quad_t realmem; /* Base parameters */ maxusers = MAXUSERS; @@ -334,18 +332,6 @@ init_param2(long physpages) TUNABLE_INT_FETCH("kern.ncallout", &ncallout); /* - * The default limit for all mbuf related memory is 1/2 of all - * available kernel memory (physical or kmem). - * At most it can be 3/4 of available kernel memory. - */ - realmem = qmin((quad_t)physpages * PAGE_SIZE, - VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS); - maxmbufmem = realmem / 2; - TUNABLE_QUAD_FETCH("kern.maxmbufmem", &maxmbufmem); - if (maxmbufmem > (realmem / 4) * 3) - maxmbufmem = (realmem / 4) * 3; - - /* * The default for maxpipekva is min(1/64 of the kernel address space, * max(1/64 of main memory, 512KB)). See sys_pipe.c for more details. */ Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Thu Jan 17 21:20:15 2013 (r245574) +++ head/sys/sys/mbuf.h Thu Jan 17 21:28:31 2013 (r245575) @@ -384,7 +384,6 @@ struct mbstat { * * The rest of it is defined in kern/kern_mbuf.c */ -extern quad_t maxmbufmem; extern uma_zone_t zone_mbuf; extern uma_zone_t zone_clust; extern uma_zone_t zone_pack; From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 21:32:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AEA9EA89; Thu, 17 Jan 2013 21:32:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 925121FB; Thu, 17 Jan 2013 21:32:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0HLWQNv004839; Thu, 17 Jan 2013 21:32:26 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0HLWQHD004835; Thu, 17 Jan 2013 21:32:26 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201301172132.r0HLWQHD004835@svn.freebsd.org> From: John Baldwin Date: Thu, 17 Jan 2013 21:32:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245577 - in head/sys: amd64/amd64 i386/i386 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.14 Precedence: list List-Id: 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, 17 Jan 2013 21:32:26 -0000 Author: jhb Date: Thu Jan 17 21:32:25 2013 New Revision: 245577 URL: http://svnweb.freebsd.org/changeset/base/245577 Log: Don't attempt to use clflush on the local APIC register window. Various CPUs exhibit bad behavior if this is done (Intel Errata AAJ3, hangs on Pentium-M, and trashing of the local APIC registers on a VIA C7). The local APIC is implicitly mapped UC already via MTRRs, so the clflush isn't necessary anyway. MFC after: 2 weeks Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c head/sys/x86/x86/local_apic.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Jan 17 21:32:03 2013 (r245576) +++ head/sys/amd64/amd64/pmap.c Thu Jan 17 21:32:25 2013 (r245577) @@ -1150,6 +1150,15 @@ pmap_invalidate_cache_range(vm_offset_t eva - sva < PMAP_CLFLUSH_THRESHOLD) { /* + * XXX: Some CPUs fault, hang, or trash the local APIC + * registers if we use CLFLUSH on the local APIC + * range. The local APIC is always uncached, so we + * don't need to flush for that range anyway. + */ + if (pmap_kextract(sva) == lapic_paddr) + return; + + /* * Otherwise, do per-cache line flush. Use the mfence * instruction to insure that previous stores are * included in the write-back. The processor Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Thu Jan 17 21:32:03 2013 (r245576) +++ head/sys/i386/i386/pmap.c Thu Jan 17 21:32:25 2013 (r245577) @@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$"); * and to when physical maps must be made correct. */ +#include "opt_apic.h" #include "opt_cpu.h" #include "opt_pmap.h" #include "opt_smp.h" @@ -1175,6 +1176,16 @@ pmap_invalidate_cache_range(vm_offset_t else if ((cpu_feature & CPUID_CLFSH) != 0 && eva - sva < PMAP_CLFLUSH_THRESHOLD) { +#ifdef DEV_APIC + /* + * XXX: Some CPUs fault, hang, or trash the local APIC + * registers if we use CLFLUSH on the local APIC + * range. The local APIC is always uncached, so we + * don't need to flush for that range anyway. + */ + if (pmap_kextract(sva) == lapic_paddr) + return; +#endif /* * Otherwise, do per-cache line flush. Use the mfence * instruction to insure that previous stores are Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Thu Jan 17 21:32:03 2013 (r245576) +++ head/sys/x86/x86/local_apic.c Thu Jan 17 21:32:25 2013 (r245577) @@ -227,8 +227,8 @@ lapic_init(vm_paddr_t addr) /* Map the local APIC and setup the spurious interrupt handler. */ KASSERT(trunc_page(addr) == addr, ("local APIC not aligned on a page boundary")); - lapic = pmap_mapdev(addr, sizeof(lapic_t)); lapic_paddr = addr; + lapic = pmap_mapdev(addr, sizeof(lapic_t)); setidt(APIC_SPURIOUS_INT, IDTVEC(spuriousint), SDT_APIC, SEL_KPL, GSEL_APIC); From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 22:14:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AB710BFA; Thu, 17 Jan 2013 22:14:59 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 93D008A9; Thu, 17 Jan 2013 22:14:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0HMExon019555; Thu, 17 Jan 2013 22:14:59 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0HMEwN5019545; Thu, 17 Jan 2013 22:14:58 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201301172214.r0HMEwN5019545@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 17 Jan 2013 22:14:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245579 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 22:14:59 -0000 Author: luigi Date: Thu Jan 17 22:14:58 2013 New Revision: 245579 URL: http://svnweb.freebsd.org/changeset/base/245579 Log: add some definition and driver changes in preparation for two upcoming features: semi-transparent mode: when a device is opened in this mode, the user program will be able to mark slots that must be forwarded to the "other" side (i.e. from NIC to host stack, or viceversa), and the forwarding will occur automatically at the next netmap syscall. This saves the need to open another file descriptor and do the forwarding manually. direct-forwarding mode: when operating with a VALE port, the user can specify in the slot the actual destination port, overriding the forwarding decision made by a lookup of the destination MAC. This can be useful to implement packet dispatchers. No API changes will be introduced. No new functionality in this patch yet. Modified: head/sys/dev/netmap/if_em_netmap.h head/sys/dev/netmap/if_igb_netmap.h head/sys/dev/netmap/if_lem_netmap.h head/sys/dev/netmap/if_re_netmap.h head/sys/dev/netmap/ixgbe_netmap.h head/sys/dev/netmap/netmap_kern.h Modified: head/sys/dev/netmap/if_em_netmap.h ============================================================================== --- head/sys/dev/netmap/if_em_netmap.h Thu Jan 17 21:32:53 2013 (r245578) +++ head/sys/dev/netmap/if_em_netmap.h Thu Jan 17 22:14:58 2013 (r245579) @@ -292,6 +292,8 @@ em_netmap_rxsync(struct ifnet *ifp, u_in l = rxr->next_to_check; j = netmap_idx_n2k(kring, l); if (netmap_no_pendintr || force_update) { + uint16_t slot_flags = kring->nkr_slot_flags; + for (n = 0; ; n++) { struct e1000_rx_desc *curr = &rxr->rx_base[l]; uint32_t staterr = le32toh(curr->status); @@ -299,6 +301,7 @@ em_netmap_rxsync(struct ifnet *ifp, u_in if ((staterr & E1000_RXD_STAT_DD) == 0) break; ring->slot[j].len = le16toh(curr->length); + ring->slot[j].flags = slot_flags; bus_dmamap_sync(rxr->rxtag, rxr->rx_buffers[l].map, BUS_DMASYNC_POSTREAD); j = (j == lim) ? 0 : j + 1; Modified: head/sys/dev/netmap/if_igb_netmap.h ============================================================================== --- head/sys/dev/netmap/if_igb_netmap.h Thu Jan 17 21:32:53 2013 (r245578) +++ head/sys/dev/netmap/if_igb_netmap.h Thu Jan 17 22:14:58 2013 (r245579) @@ -263,6 +263,8 @@ igb_netmap_rxsync(struct ifnet *ifp, u_i l = rxr->next_to_check; j = netmap_idx_n2k(kring, l); if (netmap_no_pendintr || force_update) { + uint16_t slot_flags = kring->nkr_slot_flags; + for (n = 0; ; n++) { union e1000_adv_rx_desc *curr = &rxr->rx_base[l]; uint32_t staterr = le32toh(curr->wb.upper.status_error); @@ -270,6 +272,7 @@ igb_netmap_rxsync(struct ifnet *ifp, u_i if ((staterr & E1000_RXD_STAT_DD) == 0) break; ring->slot[j].len = le16toh(curr->wb.upper.length); + ring->slot[j].flags = slot_flags; bus_dmamap_sync(rxr->ptag, rxr->rx_buffers[l].pmap, BUS_DMASYNC_POSTREAD); j = (j == lim) ? 0 : j + 1; Modified: head/sys/dev/netmap/if_lem_netmap.h ============================================================================== --- head/sys/dev/netmap/if_lem_netmap.h Thu Jan 17 21:32:53 2013 (r245578) +++ head/sys/dev/netmap/if_lem_netmap.h Thu Jan 17 22:14:58 2013 (r245579) @@ -253,6 +253,8 @@ lem_netmap_rxsync(struct ifnet *ifp, u_i l = adapter->next_rx_desc_to_check; j = netmap_idx_n2k(kring, l); if (netmap_no_pendintr || force_update) { + uint16_t slot_flags = kring->nkr_slot_flags; + for (n = 0; ; n++) { struct e1000_rx_desc *curr = &adapter->rx_desc_base[l]; uint32_t staterr = le32toh(curr->status); @@ -266,6 +268,7 @@ lem_netmap_rxsync(struct ifnet *ifp, u_i len = 0; } ring->slot[j].len = len; + ring->slot[j].flags = slot_flags; bus_dmamap_sync(adapter->rxtag, adapter->rx_buffer_area[l].map, BUS_DMASYNC_POSTREAD); Modified: head/sys/dev/netmap/if_re_netmap.h ============================================================================== --- head/sys/dev/netmap/if_re_netmap.h Thu Jan 17 21:32:53 2013 (r245578) +++ head/sys/dev/netmap/if_re_netmap.h Thu Jan 17 22:14:58 2013 (r245579) @@ -245,6 +245,8 @@ re_netmap_rxsync(struct ifnet *ifp, u_in l = sc->rl_ldata.rl_rx_prodidx; /* next pkt to check */ j = netmap_idx_n2k(kring, l); /* the kring index */ if (netmap_no_pendintr || force_update) { + uint16_t slot_flags = kring->nkr_slot_flags; + for (n = kring->nr_hwavail; n < lim ; n++) { struct rl_desc *cur_rx = &sc->rl_ldata.rl_rx_list[l]; uint32_t rxstat = le32toh(cur_rx->rl_cmdstat); @@ -256,6 +258,7 @@ re_netmap_rxsync(struct ifnet *ifp, u_in /* XXX subtract crc */ total_len = (total_len < 4) ? 0 : total_len - 4; kring->ring->slot[j].len = total_len; + kring->ring->slot[j].flags = slot_flags; /* sync was in re_newbuf() */ bus_dmamap_sync(sc->rl_ldata.rl_rx_mtag, rxd[l].rx_dmamap, BUS_DMASYNC_POSTREAD); Modified: head/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- head/sys/dev/netmap/ixgbe_netmap.h Thu Jan 17 21:32:53 2013 (r245578) +++ head/sys/dev/netmap/ixgbe_netmap.h Thu Jan 17 22:14:58 2013 (r245579) @@ -483,6 +483,7 @@ ixgbe_netmap_rxsync(struct ifnet *ifp, u */ if (netmap_no_pendintr || force_update) { int crclen = ix_crcstrip ? 0 : 4; + uint16_t slot_flags = kring->nkr_slot_flags; l = rxr->next_to_check; j = netmap_idx_n2k(kring, l); @@ -494,6 +495,7 @@ ixgbe_netmap_rxsync(struct ifnet *ifp, u if ((staterr & IXGBE_RXD_STAT_DD) == 0) break; ring->slot[j].len = le16toh(curr->wb.upper.length) - crclen; + ring->slot[j].flags = slot_flags; bus_dmamap_sync(rxr->ptag, rxr->rx_buffers[l].pmap, BUS_DMASYNC_POSTREAD); j = (j == lim) ? 0 : j + 1; Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Thu Jan 17 21:32:53 2013 (r245578) +++ head/sys/dev/netmap/netmap_kern.h Thu Jan 17 22:14:58 2013 (r245579) @@ -119,6 +119,10 @@ struct netmap_adapter; * RX rings: the next empty buffer (hwcur + hwavail + hwofs) coincides with * the next empty buffer as known by the hardware (next_to_check or so). * TX rings: hwcur + hwofs coincides with next_to_send + * + * For received packets, slot->flags is set to nkr_slot_flags + * so we can provide a proper initial value (e.g. set NS_FORWARD + * when operating in 'transparent' mode). */ struct netmap_kring { struct netmap_ring *ring; @@ -128,6 +132,7 @@ struct netmap_kring { #define NKR_PENDINTR 0x1 // Pending interrupt. u_int nkr_num_slots; + uint16_t nkr_slot_flags; /* initial value for flags */ int nkr_hwofs; /* offset between NIC and netmap ring */ struct netmap_adapter *na; NM_SELINFO_T si; /* poll/select wait queue */ From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 23:05:04 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 99E57D10; Thu, 17 Jan 2013 23:05:04 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8D879B00; Thu, 17 Jan 2013 23:05:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0HN54Lq037020; Thu, 17 Jan 2013 23:05:04 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0HN5434037019; Thu, 17 Jan 2013 23:05:04 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301172305.r0HN5434037019@svn.freebsd.org> From: Brooks Davis Date: Thu, 17 Jan 2013 23:05:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245580 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 23:05:04 -0000 Author: brooks Date: Thu Jan 17 23:05:03 2013 New Revision: 245580 URL: http://svnweb.freebsd.org/changeset/base/245580 Log: In r245571, "rm -rf ; ln -s " needed to be replaced with "ln -sfh " or the links would fail when a valid link to a directly was in place at . Reported by: peter Tested by: peter Pointy hat to: brooks Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Thu Jan 17 22:14:58 2013 (r245579) +++ head/etc/Makefile Thu Jan 17 23:05:03 2013 (r245580) @@ -324,26 +324,26 @@ distrib-dirs: -f $$m -p $$d; \ ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \ done; true - ln -sf usr/src/sys ${DESTDIR}/sys + ln -sfh usr/src/sys ${DESTDIR}/sys cd ${DESTDIR}/usr/share/man; \ for mandir in man*; do \ - ln -sf ../$$mandir ${DESTDIR}/usr/share/man/en.ISO8859-1/; \ - ln -sf ../$$mandir ${DESTDIR}/usr/share/man/en.UTF-8/; \ + ln -sfh ../$$mandir ${DESTDIR}/usr/share/man/en.ISO8859-1/; \ + ln -sfh ../$$mandir ${DESTDIR}/usr/share/man/en.UTF-8/; \ done cd ${DESTDIR}/usr/share/openssl/man; \ for mandir in man*; do \ - ln -sf ../$$mandir \ + ln -sfh ../$$mandir \ ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1/; \ done set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \ while [ $$# -gt 0 ] ; do \ - ln -sf "$$2" "${DESTDIR}/usr/share/man/$$1"; \ - ln -sf "$$2" "${DESTDIR}/usr/share/openssl/man/$$1"; \ + ln -sfh "$$2" "${DESTDIR}/usr/share/man/$$1"; \ + ln -sfh "$$2" "${DESTDIR}/usr/share/openssl/man/$$1"; \ shift; shift; \ done set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \ while [ $$# -gt 0 ] ; do \ - ln -sf "$$2" "${DESTDIR}/usr/share/nls/$$1"; \ + ln -sfh "$$2" "${DESTDIR}/usr/share/nls/$$1"; \ shift; shift; \ done From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 23:14:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CE0653CC; Thu, 17 Jan 2013 23:14:17 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A8BCABE8; Thu, 17 Jan 2013 23:14:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0HNEH5F040605; Thu, 17 Jan 2013 23:14:17 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0HNEHsu040603; Thu, 17 Jan 2013 23:14:17 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201301172314.r0HNEHsu040603@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 17 Jan 2013 23:14:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245581 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 23:14:17 -0000 Author: luigi Date: Thu Jan 17 23:14:17 2013 New Revision: 245581 URL: http://svnweb.freebsd.org/changeset/base/245581 Log: remove the old memory allocator, not useful anymore Deleted: head/sys/dev/netmap/netmap_mem1.c From owner-svn-src-head@FreeBSD.ORG Thu Jan 17 23:56:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DD0B4BAA; Thu, 17 Jan 2013 23:56:48 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CAF88E14; Thu, 17 Jan 2013 23:56:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0HNumLu054220; Thu, 17 Jan 2013 23:56:48 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0HNuiRE054187; Thu, 17 Jan 2013 23:56:44 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201301172356.r0HNuiRE054187@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 17 Jan 2013 23:56:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245582 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/compon... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 17 Jan 2013 23:56:48 -0000 Author: jkim Date: Thu Jan 17 23:56:43 2013 New Revision: 245582 URL: http://svnweb.freebsd.org/changeset/base/245582 Log: Merge ACPICA 20130117. Added: head/sys/contrib/dev/acpica/compiler/aslfileio.c - copied, changed from r244972, vendor-sys/acpica/dist/source/compiler/aslfileio.c head/sys/contrib/dev/acpica/compiler/aslhex.c - copied, changed from r244972, vendor-sys/acpica/dist/source/compiler/aslhex.c head/sys/contrib/dev/acpica/compiler/aslmethod.c - copied, changed from r244972, vendor-sys/acpica/dist/source/compiler/aslmethod.c head/sys/contrib/dev/acpica/compiler/aslnamesp.c - copied, changed from r244972, vendor-sys/acpica/dist/source/compiler/aslnamesp.c head/sys/contrib/dev/acpica/compiler/aslxref.c - copied, changed from r244972, vendor-sys/acpica/dist/source/compiler/aslxref.c head/sys/contrib/dev/acpica/components/debugger/dbconvert.c - copied, changed from r244972, vendor-sys/acpica/dist/source/components/debugger/dbconvert.c head/sys/contrib/dev/acpica/components/events/evhandler.c - copied, changed from r244972, vendor-sys/acpica/dist/source/components/events/evhandler.c head/sys/contrib/dev/acpica/components/namespace/nsprepkg.c - copied, changed from r244972, vendor-sys/acpica/dist/source/components/namespace/nsprepkg.c head/sys/contrib/dev/acpica/components/parser/psobject.c - copied, changed from r244972, vendor-sys/acpica/dist/source/components/parser/psobject.c head/sys/contrib/dev/acpica/components/parser/psopinfo.c - copied, changed from r244972, vendor-sys/acpica/dist/source/components/parser/psopinfo.c head/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c - copied, changed from r244972, vendor-sys/acpica/dist/source/components/resources/rsdumpinfo.c head/sys/contrib/dev/acpica/components/utilities/utownerid.c - copied, changed from r244972, vendor-sys/acpica/dist/source/components/utilities/utownerid.c head/sys/contrib/dev/acpica/components/utilities/utstring.c - copied, changed from r244972, vendor-sys/acpica/dist/source/components/utilities/utstring.c Modified: head/sys/conf/files head/sys/contrib/dev/acpica/changes.txt (contents, props changed) head/sys/contrib/dev/acpica/common/adfile.c head/sys/contrib/dev/acpica/common/adisasm.c head/sys/contrib/dev/acpica/common/adwalk.c head/sys/contrib/dev/acpica/common/ahpredef.c head/sys/contrib/dev/acpica/common/dmextern.c head/sys/contrib/dev/acpica/common/dmrestag.c head/sys/contrib/dev/acpica/common/dmtable.c head/sys/contrib/dev/acpica/common/dmtbdump.c head/sys/contrib/dev/acpica/common/dmtbinfo.c head/sys/contrib/dev/acpica/common/getopt.c head/sys/contrib/dev/acpica/compiler/aslanalyze.c head/sys/contrib/dev/acpica/compiler/aslbtypes.c head/sys/contrib/dev/acpica/compiler/aslcodegen.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/aslcompiler.l head/sys/contrib/dev/acpica/compiler/aslcompiler.y head/sys/contrib/dev/acpica/compiler/asldefine.h head/sys/contrib/dev/acpica/compiler/aslerror.c head/sys/contrib/dev/acpica/compiler/aslfiles.c head/sys/contrib/dev/acpica/compiler/aslfold.c head/sys/contrib/dev/acpica/compiler/aslglobal.h head/sys/contrib/dev/acpica/compiler/asllength.c head/sys/contrib/dev/acpica/compiler/asllisting.c head/sys/contrib/dev/acpica/compiler/aslload.c head/sys/contrib/dev/acpica/compiler/asllookup.c head/sys/contrib/dev/acpica/compiler/aslmain.c head/sys/contrib/dev/acpica/compiler/aslmap.c head/sys/contrib/dev/acpica/compiler/aslmessages.h head/sys/contrib/dev/acpica/compiler/aslopcodes.c head/sys/contrib/dev/acpica/compiler/asloperands.c head/sys/contrib/dev/acpica/compiler/aslopt.c head/sys/contrib/dev/acpica/compiler/aslpredef.c head/sys/contrib/dev/acpica/compiler/aslresource.c head/sys/contrib/dev/acpica/compiler/aslrestype1.c head/sys/contrib/dev/acpica/compiler/aslrestype1i.c head/sys/contrib/dev/acpica/compiler/aslrestype2.c head/sys/contrib/dev/acpica/compiler/aslrestype2d.c head/sys/contrib/dev/acpica/compiler/aslrestype2e.c head/sys/contrib/dev/acpica/compiler/aslrestype2q.c head/sys/contrib/dev/acpica/compiler/aslrestype2s.c head/sys/contrib/dev/acpica/compiler/aslrestype2w.c head/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/compiler/aslstubs.c head/sys/contrib/dev/acpica/compiler/aslsupport.l head/sys/contrib/dev/acpica/compiler/asltransform.c head/sys/contrib/dev/acpica/compiler/asltree.c head/sys/contrib/dev/acpica/compiler/asltypes.h head/sys/contrib/dev/acpica/compiler/aslutils.c head/sys/contrib/dev/acpica/compiler/asluuid.c head/sys/contrib/dev/acpica/compiler/aslwalks.c head/sys/contrib/dev/acpica/compiler/dtcompile.c head/sys/contrib/dev/acpica/compiler/dtcompiler.h head/sys/contrib/dev/acpica/compiler/dtexpress.c head/sys/contrib/dev/acpica/compiler/dtfield.c head/sys/contrib/dev/acpica/compiler/dtio.c head/sys/contrib/dev/acpica/compiler/dtparser.l head/sys/contrib/dev/acpica/compiler/dtparser.y head/sys/contrib/dev/acpica/compiler/dtsubtable.c head/sys/contrib/dev/acpica/compiler/dttable.c head/sys/contrib/dev/acpica/compiler/dttemplate.c head/sys/contrib/dev/acpica/compiler/dttemplate.h head/sys/contrib/dev/acpica/compiler/dtutils.c head/sys/contrib/dev/acpica/compiler/preprocess.h head/sys/contrib/dev/acpica/compiler/prexpress.c head/sys/contrib/dev/acpica/compiler/prmacros.c head/sys/contrib/dev/acpica/compiler/prparser.l head/sys/contrib/dev/acpica/compiler/prparser.y head/sys/contrib/dev/acpica/compiler/prscan.c head/sys/contrib/dev/acpica/compiler/prutils.c head/sys/contrib/dev/acpica/components/debugger/dbcmds.c head/sys/contrib/dev/acpica/components/debugger/dbdisply.c head/sys/contrib/dev/acpica/components/debugger/dbexec.c head/sys/contrib/dev/acpica/components/debugger/dbfileio.c head/sys/contrib/dev/acpica/components/debugger/dbhistry.c head/sys/contrib/dev/acpica/components/debugger/dbinput.c head/sys/contrib/dev/acpica/components/debugger/dbmethod.c head/sys/contrib/dev/acpica/components/debugger/dbnames.c head/sys/contrib/dev/acpica/components/debugger/dbstats.c head/sys/contrib/dev/acpica/components/debugger/dbutils.c head/sys/contrib/dev/acpica/components/debugger/dbxface.c head/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c head/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c head/sys/contrib/dev/acpica/components/disassembler/dmnames.c head/sys/contrib/dev/acpica/components/disassembler/dmobject.c head/sys/contrib/dev/acpica/components/disassembler/dmopcode.c head/sys/contrib/dev/acpica/components/disassembler/dmresrc.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcl.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c head/sys/contrib/dev/acpica/components/disassembler/dmutils.c head/sys/contrib/dev/acpica/components/disassembler/dmwalk.c head/sys/contrib/dev/acpica/components/dispatcher/dsargs.c head/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c head/sys/contrib/dev/acpica/components/dispatcher/dsinit.c head/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c head/sys/contrib/dev/acpica/components/dispatcher/dsmthdat.c head/sys/contrib/dev/acpica/components/dispatcher/dsobject.c head/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c head/sys/contrib/dev/acpica/components/dispatcher/dsutils.c head/sys/contrib/dev/acpica/components/dispatcher/dswexec.c head/sys/contrib/dev/acpica/components/dispatcher/dswload.c head/sys/contrib/dev/acpica/components/dispatcher/dswload2.c head/sys/contrib/dev/acpica/components/dispatcher/dswscope.c head/sys/contrib/dev/acpica/components/dispatcher/dswstate.c head/sys/contrib/dev/acpica/components/events/evevent.c head/sys/contrib/dev/acpica/components/events/evglock.c head/sys/contrib/dev/acpica/components/events/evgpe.c head/sys/contrib/dev/acpica/components/events/evgpeblk.c head/sys/contrib/dev/acpica/components/events/evgpeinit.c head/sys/contrib/dev/acpica/components/events/evgpeutil.c head/sys/contrib/dev/acpica/components/events/evmisc.c head/sys/contrib/dev/acpica/components/events/evregion.c head/sys/contrib/dev/acpica/components/events/evrgnini.c head/sys/contrib/dev/acpica/components/events/evsci.c head/sys/contrib/dev/acpica/components/events/evxface.c head/sys/contrib/dev/acpica/components/events/evxfevnt.c head/sys/contrib/dev/acpica/components/events/evxfgpe.c head/sys/contrib/dev/acpica/components/events/evxfregn.c head/sys/contrib/dev/acpica/components/executer/exconfig.c head/sys/contrib/dev/acpica/components/executer/exconvrt.c head/sys/contrib/dev/acpica/components/executer/excreate.c head/sys/contrib/dev/acpica/components/executer/exdebug.c head/sys/contrib/dev/acpica/components/executer/exdump.c head/sys/contrib/dev/acpica/components/executer/exfield.c head/sys/contrib/dev/acpica/components/executer/exfldio.c head/sys/contrib/dev/acpica/components/executer/exmisc.c head/sys/contrib/dev/acpica/components/executer/exmutex.c head/sys/contrib/dev/acpica/components/executer/exnames.c head/sys/contrib/dev/acpica/components/executer/exoparg1.c head/sys/contrib/dev/acpica/components/executer/exoparg2.c head/sys/contrib/dev/acpica/components/executer/exoparg3.c head/sys/contrib/dev/acpica/components/executer/exoparg6.c head/sys/contrib/dev/acpica/components/executer/exprep.c head/sys/contrib/dev/acpica/components/executer/exregion.c head/sys/contrib/dev/acpica/components/executer/exresnte.c head/sys/contrib/dev/acpica/components/executer/exresolv.c head/sys/contrib/dev/acpica/components/executer/exresop.c head/sys/contrib/dev/acpica/components/executer/exstore.c head/sys/contrib/dev/acpica/components/executer/exstoren.c head/sys/contrib/dev/acpica/components/executer/exstorob.c head/sys/contrib/dev/acpica/components/executer/exsystem.c head/sys/contrib/dev/acpica/components/executer/exutils.c head/sys/contrib/dev/acpica/components/hardware/hwacpi.c head/sys/contrib/dev/acpica/components/hardware/hwesleep.c head/sys/contrib/dev/acpica/components/hardware/hwgpe.c head/sys/contrib/dev/acpica/components/hardware/hwpci.c head/sys/contrib/dev/acpica/components/hardware/hwregs.c head/sys/contrib/dev/acpica/components/hardware/hwsleep.c head/sys/contrib/dev/acpica/components/hardware/hwtimer.c head/sys/contrib/dev/acpica/components/hardware/hwvalid.c head/sys/contrib/dev/acpica/components/hardware/hwxface.c head/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c head/sys/contrib/dev/acpica/components/namespace/nsaccess.c head/sys/contrib/dev/acpica/components/namespace/nsalloc.c head/sys/contrib/dev/acpica/components/namespace/nsdump.c head/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c head/sys/contrib/dev/acpica/components/namespace/nseval.c head/sys/contrib/dev/acpica/components/namespace/nsinit.c head/sys/contrib/dev/acpica/components/namespace/nsload.c head/sys/contrib/dev/acpica/components/namespace/nsnames.c head/sys/contrib/dev/acpica/components/namespace/nsobject.c head/sys/contrib/dev/acpica/components/namespace/nsparse.c head/sys/contrib/dev/acpica/components/namespace/nspredef.c head/sys/contrib/dev/acpica/components/namespace/nsrepair.c head/sys/contrib/dev/acpica/components/namespace/nsrepair2.c head/sys/contrib/dev/acpica/components/namespace/nssearch.c head/sys/contrib/dev/acpica/components/namespace/nsutils.c head/sys/contrib/dev/acpica/components/namespace/nswalk.c head/sys/contrib/dev/acpica/components/namespace/nsxfeval.c head/sys/contrib/dev/acpica/components/namespace/nsxfname.c head/sys/contrib/dev/acpica/components/namespace/nsxfobj.c head/sys/contrib/dev/acpica/components/parser/psargs.c head/sys/contrib/dev/acpica/components/parser/psloop.c head/sys/contrib/dev/acpica/components/parser/psopcode.c head/sys/contrib/dev/acpica/components/parser/psparse.c head/sys/contrib/dev/acpica/components/parser/psscope.c head/sys/contrib/dev/acpica/components/parser/pstree.c head/sys/contrib/dev/acpica/components/parser/psutils.c head/sys/contrib/dev/acpica/components/parser/pswalk.c head/sys/contrib/dev/acpica/components/parser/psxface.c head/sys/contrib/dev/acpica/components/resources/rsaddr.c head/sys/contrib/dev/acpica/components/resources/rscalc.c head/sys/contrib/dev/acpica/components/resources/rscreate.c head/sys/contrib/dev/acpica/components/resources/rsdump.c head/sys/contrib/dev/acpica/components/resources/rsinfo.c head/sys/contrib/dev/acpica/components/resources/rsio.c head/sys/contrib/dev/acpica/components/resources/rsirq.c head/sys/contrib/dev/acpica/components/resources/rslist.c head/sys/contrib/dev/acpica/components/resources/rsmemory.c head/sys/contrib/dev/acpica/components/resources/rsmisc.c head/sys/contrib/dev/acpica/components/resources/rsserial.c head/sys/contrib/dev/acpica/components/resources/rsutils.c head/sys/contrib/dev/acpica/components/resources/rsxface.c head/sys/contrib/dev/acpica/components/tables/tbfadt.c head/sys/contrib/dev/acpica/components/tables/tbfind.c head/sys/contrib/dev/acpica/components/tables/tbinstal.c head/sys/contrib/dev/acpica/components/tables/tbutils.c head/sys/contrib/dev/acpica/components/tables/tbxface.c head/sys/contrib/dev/acpica/components/tables/tbxfload.c head/sys/contrib/dev/acpica/components/tables/tbxfroot.c head/sys/contrib/dev/acpica/components/utilities/utaddress.c head/sys/contrib/dev/acpica/components/utilities/utalloc.c head/sys/contrib/dev/acpica/components/utilities/utcache.c head/sys/contrib/dev/acpica/components/utilities/utcopy.c head/sys/contrib/dev/acpica/components/utilities/utdebug.c head/sys/contrib/dev/acpica/components/utilities/utdecode.c head/sys/contrib/dev/acpica/components/utilities/utdelete.c head/sys/contrib/dev/acpica/components/utilities/uteval.c head/sys/contrib/dev/acpica/components/utilities/utexcep.c head/sys/contrib/dev/acpica/components/utilities/utglobal.c head/sys/contrib/dev/acpica/components/utilities/utids.c head/sys/contrib/dev/acpica/components/utilities/utinit.c head/sys/contrib/dev/acpica/components/utilities/utlock.c head/sys/contrib/dev/acpica/components/utilities/utmath.c head/sys/contrib/dev/acpica/components/utilities/utmisc.c head/sys/contrib/dev/acpica/components/utilities/utmutex.c head/sys/contrib/dev/acpica/components/utilities/utobject.c head/sys/contrib/dev/acpica/components/utilities/utosi.c head/sys/contrib/dev/acpica/components/utilities/utresrc.c head/sys/contrib/dev/acpica/components/utilities/utstate.c head/sys/contrib/dev/acpica/components/utilities/uttrack.c head/sys/contrib/dev/acpica/components/utilities/utxface.c head/sys/contrib/dev/acpica/components/utilities/utxferror.c head/sys/contrib/dev/acpica/components/utilities/utxfinit.c head/sys/contrib/dev/acpica/components/utilities/utxfmutex.c head/sys/contrib/dev/acpica/include/acapps.h head/sys/contrib/dev/acpica/include/acbuffer.h head/sys/contrib/dev/acpica/include/accommon.h head/sys/contrib/dev/acpica/include/acconfig.h head/sys/contrib/dev/acpica/include/acdebug.h head/sys/contrib/dev/acpica/include/acdisasm.h head/sys/contrib/dev/acpica/include/acdispat.h head/sys/contrib/dev/acpica/include/acevents.h head/sys/contrib/dev/acpica/include/acexcep.h head/sys/contrib/dev/acpica/include/acglobal.h head/sys/contrib/dev/acpica/include/achware.h head/sys/contrib/dev/acpica/include/acinterp.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acmacros.h head/sys/contrib/dev/acpica/include/acnames.h head/sys/contrib/dev/acpica/include/acnamesp.h head/sys/contrib/dev/acpica/include/acobject.h head/sys/contrib/dev/acpica/include/acopcode.h head/sys/contrib/dev/acpica/include/acoutput.h head/sys/contrib/dev/acpica/include/acparser.h head/sys/contrib/dev/acpica/include/acpi.h head/sys/contrib/dev/acpica/include/acpiosxf.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/acpredef.h head/sys/contrib/dev/acpica/include/acresrc.h head/sys/contrib/dev/acpica/include/acrestyp.h head/sys/contrib/dev/acpica/include/acstruct.h head/sys/contrib/dev/acpica/include/actables.h head/sys/contrib/dev/acpica/include/actbl.h head/sys/contrib/dev/acpica/include/actbl1.h head/sys/contrib/dev/acpica/include/actbl2.h head/sys/contrib/dev/acpica/include/actbl3.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/contrib/dev/acpica/include/acutils.h head/sys/contrib/dev/acpica/include/amlcode.h head/sys/contrib/dev/acpica/include/amlresrc.h head/sys/contrib/dev/acpica/include/platform/acenv.h head/sys/contrib/dev/acpica/include/platform/acfreebsd.h head/sys/contrib/dev/acpica/include/platform/acgcc.h head/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c head/sys/dev/acpica/acpi.c head/usr.sbin/acpi/acpidb/Makefile head/usr.sbin/acpi/iasl/Makefile Directory Properties: head/sys/contrib/dev/acpica/ (props changed) head/sys/contrib/dev/acpica/common/ (props changed) head/sys/contrib/dev/acpica/compiler/ (props changed) head/sys/contrib/dev/acpica/components/debugger/ (props changed) head/sys/contrib/dev/acpica/components/disassembler/ (props changed) head/sys/contrib/dev/acpica/components/dispatcher/ (props changed) head/sys/contrib/dev/acpica/components/events/ (props changed) head/sys/contrib/dev/acpica/components/executer/ (props changed) head/sys/contrib/dev/acpica/components/hardware/ (props changed) head/sys/contrib/dev/acpica/components/namespace/ (props changed) head/sys/contrib/dev/acpica/components/parser/ (props changed) head/sys/contrib/dev/acpica/components/resources/ (props changed) head/sys/contrib/dev/acpica/components/tables/ (props changed) head/sys/contrib/dev/acpica/components/utilities/ (props changed) head/sys/contrib/dev/acpica/include/ (props changed) head/sys/contrib/dev/acpica/os_specific/ (props changed) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jan 17 23:14:17 2013 (r245581) +++ head/sys/conf/files Thu Jan 17 23:56:43 2013 (r245582) @@ -283,6 +283,7 @@ contrib/altq/altq/altq_rio.c optional a contrib/altq/altq/altq_rmclass.c optional altq contrib/altq/altq/altq_subr.c optional altq contrib/dev/acpica/components/debugger/dbcmds.c optional acpi acpi_debug +contrib/dev/acpica/components/debugger/dbconvert.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbdisply.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbexec.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbfileio.c optional acpi acpi_debug @@ -324,6 +325,7 @@ contrib/dev/acpica/components/events/evg contrib/dev/acpica/components/events/evgpeblk.c optional acpi contrib/dev/acpica/components/events/evgpeinit.c optional acpi contrib/dev/acpica/components/events/evgpeutil.c optional acpi +contrib/dev/acpica/components/events/evhandler.c optional acpi contrib/dev/acpica/components/events/evmisc.c optional acpi contrib/dev/acpica/components/events/evregion.c optional acpi contrib/dev/acpica/components/events/evrgnini.c optional acpi @@ -376,6 +378,7 @@ contrib/dev/acpica/components/namespace/ contrib/dev/acpica/components/namespace/nsobject.c optional acpi contrib/dev/acpica/components/namespace/nsparse.c optional acpi contrib/dev/acpica/components/namespace/nspredef.c optional acpi +contrib/dev/acpica/components/namespace/nsprepkg.c optional acpi contrib/dev/acpica/components/namespace/nsrepair.c optional acpi contrib/dev/acpica/components/namespace/nsrepair2.c optional acpi contrib/dev/acpica/components/namespace/nssearch.c optional acpi @@ -386,7 +389,9 @@ contrib/dev/acpica/components/namespace/ contrib/dev/acpica/components/namespace/nsxfobj.c optional acpi contrib/dev/acpica/components/parser/psargs.c optional acpi contrib/dev/acpica/components/parser/psloop.c optional acpi +contrib/dev/acpica/components/parser/psobject.c optional acpi contrib/dev/acpica/components/parser/psopcode.c optional acpi +contrib/dev/acpica/components/parser/psopinfo.c optional acpi contrib/dev/acpica/components/parser/psparse.c optional acpi contrib/dev/acpica/components/parser/psscope.c optional acpi contrib/dev/acpica/components/parser/pstree.c optional acpi @@ -397,6 +402,7 @@ contrib/dev/acpica/components/resources/ contrib/dev/acpica/components/resources/rscalc.c optional acpi contrib/dev/acpica/components/resources/rscreate.c optional acpi contrib/dev/acpica/components/resources/rsdump.c optional acpi +contrib/dev/acpica/components/resources/rsdumpinfo.c optional acpi contrib/dev/acpica/components/resources/rsinfo.c optional acpi contrib/dev/acpica/components/resources/rsio.c optional acpi contrib/dev/acpica/components/resources/rsirq.c optional acpi @@ -431,8 +437,10 @@ contrib/dev/acpica/components/utilities/ contrib/dev/acpica/components/utilities/utmutex.c optional acpi contrib/dev/acpica/components/utilities/utobject.c optional acpi contrib/dev/acpica/components/utilities/utosi.c optional acpi +contrib/dev/acpica/components/utilities/utownerid.c optional acpi contrib/dev/acpica/components/utilities/utresrc.c optional acpi contrib/dev/acpica/components/utilities/utstate.c optional acpi +contrib/dev/acpica/components/utilities/utstring.c optional acpi contrib/dev/acpica/components/utilities/utxface.c optional acpi contrib/dev/acpica/components/utilities/utxferror.c optional acpi contrib/dev/acpica/components/utilities/utxfinit.c optional acpi Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Thu Jan 17 23:14:17 2013 (r245581) +++ head/sys/contrib/dev/acpica/changes.txt Thu Jan 17 23:56:43 2013 (r245582) @@ -1,8 +1,154 @@ ---------------------------------------- -14 November 2012. Summary of changes for version 20121114: +17 January 2013. Summary of changes for version 20130117: + + +1) ACPICA Kernel-resident Subsystem: + +Updated the AcpiGetSleepTypeData interface: Allow the \_Sx methods to +return either 1 or 2 integers. Although the ACPI spec defines the \_Sx +objects to return a package containing one integer, most BIOS code returns +two integers and the previous code reflects that. However, we also need to +support BIOS code that actually implements to the ACPI spec, and this +change reflects this. + +Fixed two issues with the ACPI_DEBUG_PRINT macros: +1) Added the ACPI_DO_WHILE macro to the main DEBUG_PRINT helper macro for +C compilers that require this support. +2) Renamed the internal ACPI_DEBUG macro to ACPI_DO_DEBUG_PRINT since +ACPI_DEBUG is already used by many of the various hosts. + +Updated all ACPICA copyrights and signons to 2013. Added the 2013 +copyright to all module headers and signons, including the standard Linux +header. This affects virtually every file in the ACPICA core subsystem, +iASL compiler, all ACPICA utilities, and the test suites. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Previous Release: + Non-Debug Version: 94.5K Code, 25.5K Data, 120.0K Total + Debug Version: 182.2K Code, 74.9K Data, 257.1K Total + Current Release: + Non-Debug Version: 94.5K Code, 25.4K Data, 119.9K Total + Debug Version: 182.3K Code, 75.0K Data, 257.3K Total + + +2) iASL Compiler/Disassembler and Tools: + +Generic Unix OSL: Use a buffer to eliminate multiple vfprintf()s and +prevent a possible fault on some hosts. Some C libraries modify the arg +pointer parameter to vfprintf making it difficult to call it twice in the +AcpiOsVprintf function. Use a local buffer to workaround this issue. This +does not affect the Windows OSL since the Win C library does not modify +the arg pointer. Chao Guan, Bob Moore. + +iASL: Fixed a possible infinite loop when the maximum error count is +reached. If an output file other than the .AML file is specified (such as +a listing file), and the maximum number of errors is reached, do not +attempt to flush data to the output file(s) as the compiler is aborting. +This can cause an infinite loop as the max error count code essentially +keeps calling itself. + +iASL/Disassembler: Added an option (-in) to ignore NOOP opcodes/operators. +Implemented for both the compiler and the disassembler. Often, the NOOP +opcode is used as padding for packages that are changed dynamically by the +BIOS. When disassembled and recompiled, these NOOPs will cause syntax +errors. This option causes the disassembler to ignore all NOOP opcodes +(0xA3), and it also causes the compiler to ignore all ASL source code NOOP +statements as well. + +Debugger: Enhanced the Sleep command to execute all sleep states. This +change allows Sleep to be invoked with no arguments and causes the +debugger to execute all of the sleep states, 0-5, automatically. + +---------------------------------------- +20 December 2012. Summary of changes for version 20121220: + +1) ACPICA Kernel-resident Subsystem: -This release is available at https://www.acpica.org/downloads -The ACPI 5.0 specification is available at www.acpi.info +Implemented a new interface, AcpiWalkResourceBuffer. This interface is an +alternate entry point for AcpiWalkResources and improves the usability of +the resource manager by accepting as input a buffer containing the output +of either a _CRS, _PRS, or _AEI method. The key functionality is that the +input buffer is not deleted by this interface so that it can be used by +the host later. See the ACPICA reference for details. + +Interpreter: Add a warning if a 64-bit constant appears in a 32-bit table +(DSDT version < 2). The constant will be truncated and this warning +reflects that behavior. + +Resource Manager: Add support for the new ACPI 5.0 wake bit in the IRQ, +ExtendedInterrupt, and GpioInt descriptors. This change adds support to +both get and set the new wake bit in these descriptors, separately from +the existing share bit. Reported by Aaron Lu. + +Interpreter: Fix Store() when an implicit conversion is not possible. For +example, in the cases such as a store of a string to an existing package +object, implement the store as a CopyObject(). This is a small departure +from the ACPI specification which states that the control method should be +aborted in this case. However, the ASLTS suite depends on this behavior. + +Performance improvement for the various FUNCTION_TRACE and DEBUG_PRINT +macros: check if debug output is currently enabled as soon as possible to +minimize performance impact if debug is in fact not enabled. + +Source code restructuring: Cleanup to improve modularity. The following +new files have been added: dbconvert.c, evhandler.c, nsprepkg.c, +psopinfo.c, psobject.c, rsdumpinfo.c, utstring.c, and utownerid.c. +Associated makefiles and project files have been updated. + +Changed an exception code for LoadTable operator. For the case where one +of the input strings is too long, change the returned exception code from +AE_BAD_PARAMETER to AE_AML_STRING_LIMIT. + +Fixed a possible memory leak in dispatcher error path. On error, delete +the mutex object created during method mutex creation. Reported by +tim.gardner@canonical.com. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Previous Release: + Non-Debug Version: 94.3K Code, 25.3K Data, 119.6K Total + Debug Version: 175.5K Code, 74.5K Data, 250.0K Total + Current Release: + Non-Debug Version: 94.5K Code, 25.5K Data, 120.0K Total + Debug Version: 182.2K Code, 74.9K Data, 257.1K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Disallow a method call as argument to the ObjectType ASL operator. +This change tracks an errata to the ACPI 5.0 document. The AML grammar +will not allow the interpreter to differentiate between a method and a +method invocation when these are used as an argument to the ObjectType +operator. The ACPI specification change is to disallow a method invocation +(UserTerm) for the ObjectType operator. + +Finish support for the TPM2 and CSRT tables in the headers, table +compiler, and disassembler. + +Unix user-space OSL: Fix a problem with WaitSemaphore where the timeout +always expires immediately if the semaphore is not available. The original +code was using a relative-time timeout, but sem_timedwait requires the use +of an absolute time. + +iASL: Added a remark if the Timer() operator is used within a 32-bit +table. This operator returns a 64-bit time value that will be truncated +within a 32-bit table. + +iASL Source code restructuring: Cleanup to improve modularity. The +following new files have been added: aslhex.c, aslxref.c, aslnamesp.c, +aslmethod.c, and aslfileio.c. Associated makefiles and project files have +been updated. + + +---------------------------------------- +14 November 2012. Summary of changes for version 20121114: 1) ACPICA Kernel-resident Subsystem: Modified: head/sys/contrib/dev/acpica/common/adfile.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adfile.c Thu Jan 17 23:14:17 2013 (r245581) +++ head/sys/contrib/dev/acpica/common/adfile.c Thu Jan 17 23:56:43 2013 (r245582) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2013, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/adisasm.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adisasm.c Thu Jan 17 23:14:17 2013 (r245581) +++ head/sys/contrib/dev/acpica/common/adisasm.c Thu Jan 17 23:56:43 2013 (r245582) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2013, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -69,11 +69,11 @@ extern int AslCompilerd #endif ACPI_STATUS -LsDisplayNamespace ( +NsDisplayNamespace ( void); void -LsSetupNsList ( +NsSetupNamespaceListing ( void *Handle); @@ -429,8 +429,8 @@ AdAmlDisassemble ( { AcpiOsPrintf ("/**** Before second load\n"); - LsSetupNsList (File); - LsDisplayNamespace (); + NsSetupNamespaceListing (File); + NsDisplayNamespace (); AcpiOsPrintf ("*****/\n"); } @@ -498,8 +498,8 @@ AdAmlDisassemble ( if (AslCompilerdebug) { AcpiOsPrintf ("/**** After second load and resource conversion\n"); - LsSetupNsList (File); - LsDisplayNamespace (); + NsSetupNamespaceListing (File); + NsDisplayNamespace (); AcpiOsPrintf ("*****/\n"); AcpiDmDumpTree (AcpiGbl_ParseOpRoot); @@ -549,8 +549,8 @@ Cleanup: { if (AslCompilerdebug) /* Display final namespace, with transforms */ { - LsSetupNsList (File); - LsDisplayNamespace (); + NsSetupNamespaceListing (File); + NsDisplayNamespace (); } fclose (File); Modified: head/sys/contrib/dev/acpica/common/adwalk.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adwalk.c Thu Jan 17 23:14:17 2013 (r245581) +++ head/sys/contrib/dev/acpica/common/adwalk.c Thu Jan 17 23:56:43 2013 (r245582) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2013, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/ahpredef.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahpredef.c Thu Jan 17 23:14:17 2013 (r245581) +++ head/sys/contrib/dev/acpica/common/ahpredef.c Thu Jan 17 23:56:43 2013 (r245582) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2013, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/dmextern.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmextern.c Thu Jan 17 23:14:17 2013 (r245581) +++ head/sys/contrib/dev/acpica/common/dmextern.c Thu Jan 17 23:56:43 2013 (r245582) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2013, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/dmrestag.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmrestag.c Thu Jan 17 23:14:17 2013 (r245581) +++ head/sys/contrib/dev/acpica/common/dmrestag.c Thu Jan 17 23:56:43 2013 (r245582) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2013, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -89,7 +89,7 @@ AcpiDmAddResourceToNamespace ( UINT32 Length, UINT32 Offset, UINT8 ResourceIndex, - void *Context); + void **Context); static void AcpiDmAddResourcesToNamespace ( @@ -993,7 +993,7 @@ AcpiDmAddResourcesToNamespace ( */ AcpiUtWalkAmlResources (NULL, (UINT8 *) NextOp->Named.Data, (ACPI_SIZE) NextOp->Common.Value.Integer, - AcpiDmAddResourceToNamespace, BufferNode); + AcpiDmAddResourceToNamespace, (void **) BufferNode); } @@ -1019,7 +1019,7 @@ AcpiDmAddResourceToNamespace ( UINT32 Length, UINT32 Offset, UINT8 ResourceIndex, - void *Context) + void **Context) { ACPI_STATUS Status; ACPI_GENERIC_STATE ScopeInfo; Modified: head/sys/contrib/dev/acpica/common/dmtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtable.c Thu Jan 17 23:14:17 2013 (r245581) +++ head/sys/contrib/dev/acpica/common/dmtable.c Thu Jan 17 23:56:43 2013 (r245582) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2013, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -281,7 +281,7 @@ ACPI_DMTABLE_DATA AcpiDmTableData[] = {ACPI_SIG_BGRT, AcpiDmTableInfoBgrt, NULL, NULL, TemplateBgrt, "Boot Graphics Resource Table"}, {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot, "Simple Boot Flag Table"}, {ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep, "Corrected Platform Error Polling table"}, - {ACPI_SIG_CSRT, NULL, AcpiDmDumpCsrt, NULL, NULL, "Core System Resource Table"}, + {ACPI_SIG_CSRT, NULL, AcpiDmDumpCsrt, DtCompileCsrt, TemplateCsrt, "Core System Resource Table"}, {ACPI_SIG_DBG2, NULL, AcpiDmDumpDbg2, NULL, NULL, "Debug Port table type 2"}, {ACPI_SIG_DBGP, AcpiDmTableInfoDbgp, NULL, NULL, TemplateDbgp, "Debug Port table"}, {ACPI_SIG_DMAR, NULL, AcpiDmDumpDmar, DtCompileDmar, TemplateDmar, "DMA Remapping table"}, @@ -310,6 +310,7 @@ ACPI_DMTABLE_DATA AcpiDmTableData[] = {ACPI_SIG_SPMI, AcpiDmTableInfoSpmi, NULL, NULL, TemplateSpmi, "Server Platform Management Interface table"}, {ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, DtCompileSrat, TemplateSrat, "System Resource Affinity Table"}, {ACPI_SIG_TCPA, AcpiDmTableInfoTcpa, NULL, NULL, TemplateTcpa, "Trusted Computing Platform Alliance table"}, + {ACPI_SIG_TPM2, AcpiDmTableInfoTpm2, NULL, NULL, TemplateTpm2, "Trusted Platform Module hardware interface table"}, {ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, DtCompileUefi, TemplateUefi, "UEFI Boot Optimization Table"}, {ACPI_SIG_WAET, AcpiDmTableInfoWaet, NULL, NULL, TemplateWaet, "Windows ACPI Emulated Devices Table"}, {ACPI_SIG_WDAT, NULL, AcpiDmDumpWdat, DtCompileWdat, TemplateWdat, "Watchdog Action Table"}, Modified: head/sys/contrib/dev/acpica/common/dmtbdump.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbdump.c Thu Jan 17 23:14:17 2013 (r245581) +++ head/sys/contrib/dev/acpica/common/dmtbdump.c Thu Jan 17 23:56:43 2013 (r245582) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2013, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -614,6 +614,7 @@ AcpiDmDumpCsrt ( { ACPI_STATUS Status; ACPI_CSRT_GROUP *SubTable; + ACPI_CSRT_SHARED_INFO *SharedInfoTable; ACPI_CSRT_DESCRIPTOR *SubSubTable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_CSRT); @@ -629,6 +630,8 @@ AcpiDmDumpCsrt ( SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset); while (Offset < Table->Length) { + /* Resource group subtable */ + AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset, SubTable, SubTable->Length, AcpiDmTableInfoCsrt0); @@ -637,15 +640,23 @@ AcpiDmDumpCsrt ( return; } + /* Shared info subtable (One per resource group) */ + SubOffset = sizeof (ACPI_CSRT_GROUP); + SharedInfoTable = ACPI_ADD_PTR (ACPI_CSRT_SHARED_INFO, Table, + Offset + SubOffset); - /* Shared resource group info buffer */ + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Length, Offset + SubOffset, SharedInfoTable, + sizeof (ACPI_CSRT_SHARED_INFO), AcpiDmTableInfoCsrt1); + if (ACPI_FAILURE (Status)) + { + return; + } - AcpiDmDumpBuffer (SubTable, SubOffset, SubTable->InfoLength, - Offset+SubOffset, "Shared Data"); - SubOffset += SubTable->InfoLength; + SubOffset += SubTable->SharedInfoLength; - /* Sub-Sub-tables (Resource Descriptors) */ + /* Sub-Subtables (Resource Descriptors) */ SubSubTable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, Table, Offset + SubOffset); @@ -655,7 +666,7 @@ AcpiDmDumpCsrt ( { AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset + SubOffset, SubSubTable, - SubSubTable->Length, AcpiDmTableInfoCsrt1); + SubSubTable->Length, AcpiDmTableInfoCsrt2); if (ACPI_FAILURE (Status)) { return; @@ -671,7 +682,7 @@ AcpiDmDumpCsrt ( Offset + SubOffset + SubSubOffset, "ResourceInfo"); SubSubOffset += InfoLength; - /* Point to next sub-sub-table */ + /* Point to next sub-subtable */ SubOffset += SubSubTable->Length; SubSubTable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, SubSubTable, Modified: head/sys/contrib/dev/acpica/common/dmtbinfo.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbinfo.c Thu Jan 17 23:14:17 2013 (r245581) +++ head/sys/contrib/dev/acpica/common/dmtbinfo.c Thu Jan 17 23:56:43 2013 (r245582) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2013, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -111,6 +111,7 @@ #define ACPI_SPMI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SPMI,f) #define ACPI_SRAT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SRAT,f) #define ACPI_TCPA_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA,f) +#define ACPI_TPM2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TPM2,f) #define ACPI_UEFI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_UEFI,f) #define ACPI_WAET_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WAET,f) #define ACPI_WDAT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WDAT,f) @@ -128,7 +129,8 @@ #define ACPI_ASF4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_ADDRESS,f) #define ACPI_CPEP0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CPEP_POLLING,f) #define ACPI_CSRT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_GROUP,f) -#define ACPI_CSRT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_DESCRIPTOR,f) +#define ACPI_CSRT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_SHARED_INFO,f) +#define ACPI_CSRT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_DESCRIPTOR,f) #define ACPI_DBG20_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DBG2_DEVICE,f) #define ACPI_DMARS_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_DEVICE_SCOPE,f) #define ACPI_DMAR0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_HARDWARE_UNIT,f) @@ -662,18 +664,38 @@ ACPI_DMTABLE_INFO AcpiDmTableI {ACPI_DMT_UINT16, ACPI_CSRT0_OFFSET (SubdeviceId), "Subdevice ID", 0}, {ACPI_DMT_UINT16, ACPI_CSRT0_OFFSET (Revision), "Revision", 0}, {ACPI_DMT_UINT16, ACPI_CSRT0_OFFSET (Reserved), "Reserved", 0}, - {ACPI_DMT_UINT32, ACPI_CSRT0_OFFSET (InfoLength), "InfoLength", 0}, + {ACPI_DMT_UINT32, ACPI_CSRT0_OFFSET (SharedInfoLength), "Shared Info Length", 0}, ACPI_DMT_TERMINATOR }; -/* Resource Descriptor subtable */ +/* Shared Info subtable */ ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt1[] = { - {ACPI_DMT_UINT32, ACPI_CSRT1_OFFSET (Length), "Length", 0}, - {ACPI_DMT_UINT16, ACPI_CSRT1_OFFSET (Type), "Type", 0}, - {ACPI_DMT_UINT16, ACPI_CSRT1_OFFSET (Subtype), "Subtype", 0}, - {ACPI_DMT_UINT32, ACPI_CSRT1_OFFSET (Uid), "UID", 0}, + {ACPI_DMT_UINT16, ACPI_CSRT1_OFFSET (MajorVersion), "Major Version", 0}, + {ACPI_DMT_UINT16, ACPI_CSRT1_OFFSET (MinorVersion), "Minor Version", 0}, + {ACPI_DMT_UINT32, ACPI_CSRT1_OFFSET (MmioBaseLow), "MMIO Base Address Low", 0}, + {ACPI_DMT_UINT32, ACPI_CSRT1_OFFSET (MmioBaseHigh), "MMIO Base Address High", 0}, + {ACPI_DMT_UINT32, ACPI_CSRT1_OFFSET (GsiInterrupt), "GSI Interrupt", 0}, + {ACPI_DMT_UINT8, ACPI_CSRT1_OFFSET (InterruptPolarity), "Interrupt Polarity", 0}, + {ACPI_DMT_UINT8, ACPI_CSRT1_OFFSET (InterruptMode), "Interrupt Mode", 0}, + {ACPI_DMT_UINT8, ACPI_CSRT1_OFFSET (NumChannels), "Num Channels", 0}, + {ACPI_DMT_UINT8, ACPI_CSRT1_OFFSET (DmaAddressWidth), "DMA Address Width", 0}, + {ACPI_DMT_UINT16, ACPI_CSRT1_OFFSET (BaseRequestLine), "Base Request Line", 0}, + {ACPI_DMT_UINT16, ACPI_CSRT1_OFFSET (NumHandshakeSignals), "Num Handshake Signals", 0}, + {ACPI_DMT_UINT32, ACPI_CSRT1_OFFSET (MaxBlockSize), "Max Block Size", 0}, + ACPI_DMT_TERMINATOR +}; + + +/* Resource Descriptor subtable */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt2[] = +{ + {ACPI_DMT_UINT32, ACPI_CSRT2_OFFSET (Length), "Length", 0}, + {ACPI_DMT_UINT16, ACPI_CSRT2_OFFSET (Type), "Type", 0}, + {ACPI_DMT_UINT16, ACPI_CSRT2_OFFSET (Subtype), "Subtype", 0}, + {ACPI_DMT_UINT32, ACPI_CSRT2_OFFSET (Uid), "UID", 0}, ACPI_DMT_TERMINATOR }; @@ -1984,6 +2006,21 @@ ACPI_DMTABLE_INFO AcpiDmTableI /******************************************************************************* * + * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table + * + ******************************************************************************/ + +ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2[] = +{ + {ACPI_DMT_UINT32, ACPI_TPM2_OFFSET (Flags), "Flags", 0}, + {ACPI_DMT_UINT64, ACPI_TPM2_OFFSET (ControlAddress), "Control Address", 0}, + {ACPI_DMT_UINT32, ACPI_TPM2_OFFSET (StartMethod), "Start Method", 0}, + ACPI_DMT_TERMINATOR +}; + + +/******************************************************************************* + * * UEFI - UEFI Boot optimization Table * ******************************************************************************/ Modified: head/sys/contrib/dev/acpica/common/getopt.c ============================================================================== --- head/sys/contrib/dev/acpica/common/getopt.c Thu Jan 17 23:14:17 2013 (r245581) +++ head/sys/contrib/dev/acpica/common/getopt.c Thu Jan 17 23:56:43 2013 (r245582) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2013, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslanalyze.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslanalyze.c Thu Jan 17 23:14:17 2013 (r245581) +++ head/sys/contrib/dev/acpica/compiler/aslanalyze.c Thu Jan 17 23:56:43 2013 (r245582) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2013, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslbtypes.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslbtypes.c Thu Jan 17 23:14:17 2013 (r245581) +++ head/sys/contrib/dev/acpica/compiler/aslbtypes.c Thu Jan 17 23:56:43 2013 (r245582) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2013, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslcodegen.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcodegen.c Thu Jan 17 23:14:17 2013 (r245581) +++ head/sys/contrib/dev/acpica/compiler/aslcodegen.c Thu Jan 17 23:56:43 2013 (r245582) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2013, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslcompile.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompile.c Thu Jan 17 23:14:17 2013 (r245581) +++ head/sys/contrib/dev/acpica/compiler/aslcompile.c Thu Jan 17 23:56:43 2013 (r245582) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2013, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -617,7 +617,7 @@ CmDoCompile ( /* Namespace cross-reference */ AslGbl_NamespaceEvent = UtBeginEvent ("Cross reference parse tree and Namespace"); - Status = LkCrossReferenceNamespace (); + Status = XfCrossReferenceNamespace (); if (ACPI_FAILURE (Status)) { goto ErrorExit; @@ -639,8 +639,8 @@ CmDoCompile ( DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Method analysis\n\n"); TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE, - AnMethodAnalysisWalkBegin, - AnMethodAnalysisWalkEnd, &AnalysisWalkInfo); + MtMethodAnalysisWalkBegin, + MtMethodAnalysisWalkEnd, &AnalysisWalkInfo); UtEndEvent (Event); /* Semantic error checking part two - typing of method returns */ @@ -719,11 +719,11 @@ CmDoOutputFiles ( /* Create listings and hex files */ LsDoListings (); - LsDoHexOutput (); + HxDoHexOutput (); /* Dump the namespace to the .nsp file if requested */ - (void) LsDisplayNamespace (); + (void) NsDisplayNamespace (); } @@ -766,12 +766,12 @@ CmDumpAllEvents ( Delta = (UINT32) (Event->EndTime - Event->StartTime); - USec = Delta / 10; - MSec = Delta / 10000; + USec = Delta / ACPI_100NSEC_PER_USEC; + MSec = Delta / ACPI_100NSEC_PER_MSEC; /* Round milliseconds up */ - if ((USec - (MSec * 1000)) >= 500) + if ((USec - (MSec * ACPI_USEC_PER_MSEC)) >= 500) { MSec++; } Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.h Thu Jan 17 23:14:17 2013 (r245581) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.h Thu Jan 17 23:56:43 2013 (r245582) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2013, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -188,19 +188,23 @@ AnOperandTypecheckWalkEnd ( void *Context); ACPI_STATUS -AnMethodAnalysisWalkBegin ( +AnMethodTypingWalkEnd ( ACPI_PARSE_OBJECT *Op, UINT32 Level, void *Context); + +/* + * aslmethod - Control method analysis walk + */ ACPI_STATUS -AnMethodAnalysisWalkEnd ( +MtMethodAnalysisWalkBegin ( ACPI_PARSE_OBJECT *Op, UINT32 Level, void *Context); ACPI_STATUS -AnMethodTypingWalkEnd ( +MtMethodAnalysisWalkEnd ( ACPI_PARSE_OBJECT *Op, UINT32 Level, void *Context); @@ -342,6 +346,12 @@ LsDoListings ( void); void +LsDumpAsciiInComment ( + UINT32 FileId, + UINT32 Count, + UINT8 *Buffer); + +void LsWriteNodeToAsmListing ( ACPI_PARSE_OBJECT *Op); @@ -351,13 +361,18 @@ LsWriteNode ( UINT32 FileId); void -LsDoHexOutput ( +LsDumpParseTree ( void); + +/* + * aslhex - generate all "hex" output files (C, ASM, ASL) + */ void -LsDumpParseTree ( +HxDoHexOutput ( void); + /* * aslfold - constant folding */ @@ -689,26 +704,34 @@ LdLoadNamespace ( /* - * asllookup - namespace cross reference + * asllookup - namespace lookup functions */ -ACPI_STATUS -LkCrossReferenceNamespace ( - void); - void LkFindUnreferencedObjects ( void); + +/* + * aslnamesp - namespace output file generation + */ ACPI_STATUS -LsDisplayNamespace ( +NsDisplayNamespace ( void); void -LsSetupNsList ( +NsSetupNamespaceListing ( void *Handle); /* + * aslxref - namespace cross reference + */ +ACPI_STATUS +XfCrossReferenceNamespace ( + void); + + +/* * aslutils - common compiler utilites */ void Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.l ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.l Thu Jan 17 23:14:17 2013 (r245581) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.l Thu Jan 17 23:56:43 2013 (r245582) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2013, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -201,7 +201,7 @@ NamePathTail [.]{NameSeg} "Mutex" { count (2); return (PARSEOP_MUTEX); } "Name" { count (2); return (PARSEOP_NAME); } "NAnd" { count (3); return (PARSEOP_NAND); } -"Noop" { count (3); return (PARSEOP_NOOP); } +"Noop" { if (!AcpiGbl_IgnoreNoopOperator) {count (3); return (PARSEOP_NOOP);} } "NOr" { count (3); return (PARSEOP_NOR); } "Not" { count (3); return (PARSEOP_NOT); } "Notify" { count (3); return (PARSEOP_NOTIFY); } Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.y ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.y Thu Jan 17 23:14:17 2013 (r245581) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.y Thu Jan 17 23:56:43 2013 (r245582) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2013, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -661,6 +661,7 @@ void * AslLocalAllo /* Types */ %type SuperName +%type ObjectTypeName %type ArgTerm %type LocalTerm %type DebugTerm @@ -1991,7 +1992,7 @@ NotTerm ObjectTypeTerm : PARSEOP_OBJECTTYPE '(' {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE);} - SuperName + ObjectTypeName ')' {$$ = TrLinkChildren ($3,1,$4);} | PARSEOP_OBJECTTYPE '(' error ')' {$$ = AslDoError(); yyclearin;} @@ -2439,6 +2440,18 @@ SuperName | LocalTerm {} | DebugTerm {} | Type6Opcode {} + +/* For ObjectType: SuperName except for UserTerm (method invocation) */ + +ObjectTypeName + : NameString {} + | ArgTerm {} + | LocalTerm {} + | DebugTerm {} + | RefOfTerm {} + | DerefOfTerm {} + | IndexTerm {} + /* | UserTerm {} */ /* Caused reduce/reduce with Type6Opcode->UserTerm */ ; Modified: head/sys/contrib/dev/acpica/compiler/asldefine.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asldefine.h Thu Jan 17 23:14:17 2013 (r245581) +++ head/sys/contrib/dev/acpica/compiler/asldefine.h Thu Jan 17 23:56:43 2013 (r245582) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2013, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslerror.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslerror.c Thu Jan 17 23:14:17 2013 (r245581) +++ head/sys/contrib/dev/acpica/compiler/aslerror.c Thu Jan 17 23:56:43 2013 (r245582) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2013, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -660,7 +660,6 @@ AslCommonError ( Gbl_SourceLine = 0; Gbl_NextError = Gbl_ErrorLog; - CmDoOutputFiles (); CmCleanupAndExit (); exit(1); } Copied and modified: head/sys/contrib/dev/acpica/compiler/aslfileio.c (from r244972, vendor-sys/acpica/dist/source/compiler/aslfileio.c) ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslfileio.c Wed Jan 2 19:02:16 2013 (r244972, copy source) +++ head/sys/contrib/dev/acpica/compiler/aslfileio.c Thu Jan 17 23:56:43 2013 (r245582) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2013, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,7 +41,7 @@ * POSSIBILITY OF SUCH DAMAGES. */ -#include "aslcompiler.h" +#include #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslfileio") Modified: head/sys/contrib/dev/acpica/compiler/aslfiles.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslfiles.c Thu Jan 17 23:14:17 2013 (r245581) +++ head/sys/contrib/dev/acpica/compiler/aslfiles.c Thu Jan 17 23:56:43 2013 (r245582) @@ -1,11 +1,11 @@ /****************************************************************************** * - * Module Name: aslfiles - file I/O suppoert + * Module Name: aslfiles - File support functions * *****************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2013, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -64,352 +64,6 @@ FlParseInputPathname ( /******************************************************************************* * - * FUNCTION: AslAbort - * - * PARAMETERS: None - * - * RETURN: None - * - * DESCRIPTION: Dump the error log and abort the compiler. Used for serious - * I/O errors - * - ******************************************************************************/ - -void -AslAbort ( - void) -{ - - AePrintErrorLog (ASL_FILE_STDERR); - if (Gbl_DebugFlag) - { - /* Print error summary to stdout also */ - - AePrintErrorLog (ASL_FILE_STDOUT); - } - - exit (1); -} - - -/******************************************************************************* - * - * FUNCTION: FlFileError - * - * PARAMETERS: FileId - Index into file info array - * ErrorId - Index into error message array - * - * RETURN: None - * - * DESCRIPTION: Decode errno to an error message and add the entire error - * to the error log. - * - ******************************************************************************/ - -void -FlFileError ( - UINT32 FileId, - UINT8 ErrorId) -{ - - sprintf (MsgBuffer, "\"%s\" (%s)", Gbl_Files[FileId].Filename, - strerror (errno)); - AslCommonError (ASL_ERROR, ErrorId, 0, 0, 0, 0, NULL, MsgBuffer); -} - - -/******************************************************************************* - * - * FUNCTION: FlOpenFile - * - * PARAMETERS: FileId - Index into file info array - * Filename - file pathname to open - * Mode - Open mode for fopen - * - * RETURN: None - * - * DESCRIPTION: Open a file. - * NOTE: Aborts compiler on any error. - * - ******************************************************************************/ - -void -FlOpenFile ( - UINT32 FileId, - char *Filename, - char *Mode) -{ - FILE *File; - - - File = fopen (Filename, Mode); - if (!File) - { - FlFileError (FileId, ASL_MSG_OPEN); - AslAbort (); - } - - Gbl_Files[FileId].Filename = Filename; - Gbl_Files[FileId].Handle = File; -} - - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Jan 18 02:36:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6CECB933; Fri, 18 Jan 2013 02:36:07 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5ADFB6E0; Fri, 18 Jan 2013 02:36:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0I2a7ae007718; Fri, 18 Jan 2013 02:36:07 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0I2a7i9007717; Fri, 18 Jan 2013 02:36:07 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201301180236.r0I2a7i9007717@svn.freebsd.org> From: Alfred Perlstein Date: Fri, 18 Jan 2013 02:36:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245584 - head/usr.sbin/watchdogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 18 Jan 2013 02:36:07 -0000 Author: alfred Date: Fri Jan 18 02:36:06 2013 New Revision: 245584 URL: http://svnweb.freebsd.org/changeset/base/245584 Log: Spelling: exitting -> exiting MFC after: 2 weeks Modified: head/usr.sbin/watchdogd/watchdogd.c Modified: head/usr.sbin/watchdogd/watchdogd.c ============================================================================== --- head/usr.sbin/watchdogd/watchdogd.c Fri Jan 18 00:26:54 2013 (r245583) +++ head/usr.sbin/watchdogd/watchdogd.c Fri Jan 18 02:36:06 2013 (r245584) @@ -188,7 +188,7 @@ watchdog_loop(void) if (watchdog_onoff(0) == 0) { end_program = 2; } else { - warnx("Could not stop the watchdog, not exitting"); + warnx("Could not stop the watchdog, not exiting"); end_program = 0; } } From owner-svn-src-head@FreeBSD.ORG Fri Jan 18 04:03:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5047890A; Fri, 18 Jan 2013 04:03:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id AACF1A52; Fri, 18 Jan 2013 04:03:43 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r0I43WwW054686; Fri, 18 Jan 2013 06:03:32 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.4 kib.kiev.ua r0I43WwW054686 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r0I43WKx054685; Fri, 18 Jan 2013 06:03:32 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 18 Jan 2013 06:03:32 +0200 From: Konstantin Belousov To: John Baldwin Subject: Re: svn commit: r245577 - in head/sys: amd64/amd64 i386/i386 x86/x86 Message-ID: <20130118040332.GT2522@kib.kiev.ua> References: <201301172132.r0HLWQHD004835@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zpd1bWBxfrI+71+6" Content-Disposition: inline In-Reply-To: <201301172132.r0HLWQHD004835@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) 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 version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 18 Jan 2013 04:03:44 -0000 --zpd1bWBxfrI+71+6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 17, 2013 at 09:32:26PM +0000, John Baldwin wrote: > Author: jhb > Date: Thu Jan 17 21:32:25 2013 > New Revision: 245577 > URL: http://svnweb.freebsd.org/changeset/base/245577 >=20 > Log: > Don't attempt to use clflush on the local APIC register window. Various > CPUs exhibit bad behavior if this is done (Intel Errata AAJ3, hangs on > Pentium-M, and trashing of the local APIC registers on a VIA C7). The > local APIC is implicitly mapped UC already via MTRRs, so the clflush is= n't > necessary anyway. > =20 > MFC after: 2 weeks I am curious, was there a case where the clflush was really executed on the LAPIC register window with the pristine HEAD code ? I think that there is no Intel processors which support clflush instruction and do not have self-snoop. On the other hand, please note that the same change could be due for the pmap_invalidate_cache_pages(). Unlike pmap_invalidate_cache_range(), _pages() uses clflush unconditionally on purpose, since it is intended for devices which do not snoop. --zpd1bWBxfrI+71+6 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQ+MmTAAoJEJDCuSvBvK1BYCgQAJq2wMsms/Y/j8FjwWynSp0n LL+4XHq6fVH8wQEr27Y2poVmqjPGb38SprQDzzA/bk7/ihF1KX8UeYYRKo4J2PvI j9wErfFOpvoLh8RmXXHsjW0rnVmENnvKv3V7ylRSfVxCSolivIoTBfOLnPaW6ZCC GT8WrDmyWWMp5BLl+6uvLkCYSpowIPRA+TGEIqJ59iKFFpoM8X+00mi6lBe1jLH6 U5g1HPcFG+s+1K5P1gfNM5FARxq30rku2pZtbhP6xoGrNbIPYoEFynJNUXYz5wsM WfubWKhmqWrIAYdgLoMAdtV3Op9847LHo8k+QX+quUHM3sQpDc7EpUAHDl37dwgN vUp3KbiYNUpPO4Y15wPfTCtSJuYB5zletPHPSRkwB5wIsqtcBLZszUkEBHX4rE64 8FyyPei5F43RWv4VphMWRX+xCrAvYMkrUb81p4q24i5drmDUmrnEzUyKmnJHPmpO 8pbcEfrkog2WdmN512jeEg/0fHl7G2PQROpK6+cgad0U1I7sIt5mqbgrfg7nY8a0 bdLQL6KCCZP2hSkyUIiQ1S+RdPemYsknnq1vEc43z5ecBXEdw++pAzXp98DhEKWv cANU7sR5cDCTrdhkxPNV74T1VsgjMGXnkp/8g2usAdSCVFvHzGZWySwRXKFi+eV8 wlsg7NGTR2D9ZtbyHz8n =PmLn -----END PGP SIGNATURE----- --zpd1bWBxfrI+71+6-- From owner-svn-src-head@FreeBSD.ORG Fri Jan 18 07:18:49 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 083111A3; Fri, 18 Jan 2013 07:18:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id 9288715E; Fri, 18 Jan 2013 07:18:48 +0000 (UTC) Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r0I7Ib6v018069 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 18 Jan 2013 18:18:38 +1100 Date: Fri, 18 Jan 2013 18:18:37 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Pawel Jakub Dawidek Subject: Re: svn commit: r245506 - head/bin/pwait In-Reply-To: <20130117203955.GA1679@garage.freebsd.pl> Message-ID: <20130118174501.O1209@besplex.bde.org> References: <201301161815.r0GIFQPk007553@svn.freebsd.org> <20130117130740.I1066@besplex.bde.org> <201301171050.07596.jhb@freebsd.org> <20130117203955.GA1679@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=Zty1sKHG c=1 sm=1 a=jy4U5xBK6Z8A:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=0Iti9RnyFakA:10 a=6I5d2MoRAAAA:8 a=lWXf_K5OjqMkl9xFCKUA:9 a=CjuIK1q_8ugA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: src-committers@FreeBSD.org, Eitan Adler , John Baldwin , svn-src-all@FreeBSD.org, Xin LI , Bruce Evans , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 18 Jan 2013 07:18:49 -0000 On Thu, 17 Jan 2013, Pawel Jakub Dawidek wrote: > On Thu, Jan 17, 2013 at 10:50:07AM -0500, John Baldwin wrote: >> On Wednesday, January 16, 2013 10:40:51 pm Eitan Adler wrote: >>> On 16 January 2013 21:25, Bruce Evans wrote: >>>> This uses the sysexits mistake. style(9) was fixed to not give an example >>>> of this mistake. Before this, sysexits was used a whole once in pwait(1) >>>> (for EX_USAGE) in usage(). EX_USAGE happens to be 64. As usual when the >>>> mistake is used, this is useless for humans (the usage message gives more >>>> info) and unusable for programs, especially since it is undocmented >>>> (pwait(1)'s man page just says ">0 if an error occurs". It doesn't even >>>> use '.Std' for this, but hard-codes it. >>> >>> IMHO using sysexits gives more signal than using a binary 0 or 1. It >>> is a mistake to have changed style(9) to avoid using sysexits. >>> Instead the man page should detail the specific error that occurs >>> directly, or by reference to sysexit. >> >> Eh, I think bde@ has quite a bit more experience with this than you. >> is not part of POSIX or any other standard. It's comments >> reference delivermail (the predecessor to sendmail). Looking at its history, >> it has never been changed in FreeBSD, and it's history in CSRG is rather >> spartan and mostly tied to delivermail/sendmail: >> >> http://svnweb.freebsd.org/csrg/include/sysexits.h?view=log >> >> In practice it's list of error value is limited and has not grown to handle >> new errors in over two decades (as opposed to, say, the list of errnos). >> OTOH, it seems the history section in sysexits(3) is slightly off as the CSRG >> history suggests it was present in at least 4.2BSD. > > Well, if we decide sysexits(3) are useless, then it would be nice to > recommend against using it in sysexits(3) manual page. Currently it is > rather seductive: > > According to style(9), it is not a good practice to call exit(3) > with arbitrary values to indicate a failure condition when > ending a program. Instead, the pre-defined exit codes from > sysexits should be used, so the caller of the process can get a > rough estimation about the failure class without looking up the > source code. Oops, this wasn't changed when the mistake was fixed in style(9) :-). The orignal BSD style guide (/usr/src/admin/style/style) actually says not to use [non-arbitrary] sequential values to indicate all exit points: % /* % * Exits should be 0 on success, and 1 on failure. Don't denote % * all the possible exit points, using the integers 1 through 300. % */ % exit(0); /* Avoid obvious comments such as "Exit 0 on success." */ but was changed in FreeBSD to say something quite different: % Exits should be 0 on success, or according to the predefined values in % sysexits(3). % % exit(EX_OK); /* % * Avoid obvious comments such as % * "Exit 0 on success." % */ and then was changed to say something even further removed from the original: % Exits should be 0 on success, or 1 on failure. % % exit(0); /* % * Avoid obvious comments such as % * "Exit 0 on success." % */ % } I thought that it was changed to at least mention the Standard but not very useful EXIT_SUCCESS and EXIT_FAILURE. It should also not disallow an error code of 2 which is often used for more severe errors. > I, for one, used it pretty extensively in HAST:) > > % grep EX_ /usr/src/sbin/hastd/*.c | wc -l > 67 > > In my humble opinion using sysexits(3) is better than just putting > exit(1) everywhere. Actually HAST or some of my other projects was > making decision about restarting a processes if the exit code was > EX_TEMPFAIL (if the failure was temporary it is fine to restart, if it > is not then better not to enter some infinite loop). A set of programs like sendmail or hastd can reasonably communicate using the exit code. For humans, it is easier to read the message on stderr in in a log file that should accompany almost all exits. Non-sets of programs shouldn't be burdened by having to provide, document and maintain unique exit codes for programs outside the set which will almost never make decisions based on the uniqueness. The EX_TEMPFAIL retry seems to be the only useful use of sysexits even in hastd. It mostly logs the error with a message giving more detail. EX_USAGE is an especially useless exit status. From pwait.c: % static void % usage(void) % { % % fprintf(stderr, "usage: pwait [-v] pid ...\n"); % exit(EX_USAGE); % } Consider possible users of this program: - a human can read "usage: ". EX_USAGE adds nothing to this. - a program that doesn't know correct usage isn't going to be able to with correct usage after seeing the EX_USAGE. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Jan 18 07:29:07 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 91E38479; Fri, 18 Jan 2013 07:29:07 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail36.syd.optusnet.com.au (mail36.syd.optusnet.com.au [211.29.133.76]) by mx1.freebsd.org (Postfix) with ESMTP id 147391A7; Fri, 18 Jan 2013 07:29:06 +0000 (UTC) Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail36.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r0I7SwZr009082 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 18 Jan 2013 18:28:59 +1100 Date: Fri, 18 Jan 2013 18:28:58 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans Subject: Re: svn commit: r245506 - head/bin/pwait In-Reply-To: <20130118174501.O1209@besplex.bde.org> Message-ID: <20130118182035.R1209@besplex.bde.org> References: <201301161815.r0GIFQPk007553@svn.freebsd.org> <20130117130740.I1066@besplex.bde.org> <201301171050.07596.jhb@freebsd.org> <20130117203955.GA1679@garage.freebsd.pl> <20130118174501.O1209@besplex.bde.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.0 cv=Zty1sKHG c=1 sm=1 a=jy4U5xBK6Z8A:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=0Iti9RnyFakA:10 a=WHtsyqLFiwetzuXcfecA:9 a=CjuIK1q_8ugA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: src-committers@FreeBSD.org, Eitan Adler , John Baldwin , svn-src-all@FreeBSD.org, Xin LI , svn-src-head@FreeBSD.org, Pawel Jakub Dawidek X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 18 Jan 2013 07:29:07 -0000 On Fri, 18 Jan 2013, Bruce Evans wrote: > The orignal BSD style guide (/usr/src/admin/style/style) actually says > not to use [non-arbitrary] sequential values to indicate all exit points: > ... > but was changed in FreeBSD to say something quite different: > ... > and then was changed to say something even further removed from the original: > ... > I thought that it was changed to at least mention the Standard but not > very useful EXIT_SUCCESS and EXIT_FAILURE. It should also not disallow > an error code of 2 which is often used for more severe errors. PS: I forgot to mention the NetBSD style guide (/usr/src/share/misc/style). At least the 2005 version of it says: % /* % * Exits should be EXIT_SUCCESS on success, and EXIT_FAILURE on % * failure. Don't denote all the possible exit points, using the % * integers 1 through 127. Avoid obvious comments such as "Exit % * 0 on success.". Since main is a function that returns an int, % * prefer returning from it, than calling exit. % */ % return EXIT_SUCCESS; It's interesting that it covers another point in this thread (of whether to return or exit from main()). I like returning from main(), but don't like requiring it. This and other parts of the NetBSD version also remove the examples and the requirement of spaces around return values. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Jan 18 15:57:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E444B920; Fri, 18 Jan 2013 15:57:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D4AC61DB; Fri, 18 Jan 2013 15:57:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0IFvAiv050320; Fri, 18 Jan 2013 15:57:10 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0IFvAbt050315; Fri, 18 Jan 2013 15:57:10 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201301181557.r0IFvAbt050315@svn.freebsd.org> From: Eitan Adler Date: Fri, 18 Jan 2013 15:57:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245606 - in head: share/mk tools/build/mk tools/build/options 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.14 Precedence: list List-Id: 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, 18 Jan 2013 15:57:11 -0000 Author: eadler Date: Fri Jan 18 15:57:09 2013 New Revision: 245606 URL: http://svnweb.freebsd.org/changeset/base/245606 Log: Add option to make pc-sysinstall optional Approved by: cperciva Added: head/tools/build/options/WITHOUT_PC_SYSINSTALL (contents, props changed) Modified: head/share/mk/bsd.own.mk head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.sbin/Makefile Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Fri Jan 18 14:36:23 2013 (r245605) +++ head/share/mk/bsd.own.mk Fri Jan 18 15:57:09 2013 (r245606) @@ -309,6 +309,7 @@ __DEFAULT_YES_OPTIONS = \ OPENSSH \ OPENSSL \ PAM \ + PC_SYSINSTALL \ PF \ PKGBOOTSTRAP \ PKGTOOLS \ Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Jan 18 14:36:23 2013 (r245605) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Jan 18 15:57:09 2013 (r245606) @@ -3654,6 +3654,95 @@ OLD_FILES+=usr/share/man/man8/ntptime.8. # to be filled in #.endif +.if ${MK_PC_SYSINSTALL} == no +# backend-partmanager +OLD_FILES+=usr/share/pc-sysinstall/backend-partmanager/create-part.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-partmanager/delete-part.sh +# backend-query +OLD_FILES+=usr/share/pc-sysinstall/backend-query/detect-emulation.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/detect-laptop.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/detect-nics.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/disk-info.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/disk-list.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/disk-part.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/enable-net.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/get-packages.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/list-components.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/list-config.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/list-mirrors.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/list-packages.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/list-rsync-backups.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/list-tzones.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/query-langs.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/send-logs.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/setup-ssh-keys.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/set-mirror.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/sys-mem.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/test-live.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/test-netup.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/update-part-list.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/xkeyboard-layouts.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/xkeyboard-models.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/xkeyboard-variants.sh +# backend +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-bsdlabel.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-cleanup.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-disk.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-extractimage.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-ftp.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-installcomponents.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-installpackages.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-localize.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-mountdisk.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-mountoptical.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-networking.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-newfs.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-parse.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-packages.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-runcommands.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-unmount.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-upgrade.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-users.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/installimage.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/parseconfig.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/startautoinstall.sh +# conf +OLD_FILES+=usr/share/pc-sysinstall/conf/avail-langs +OLD_FILES+=usr/share/pc-sysinstall/conf/exclude-from-upgrade +OLD_FILES+=usr/share/pc-sysinstall/conf/license/bsd-en.txt +OLD_FILES+=usr/share/pc-sysinstall/conf/license/intel-en.txt +OLD_FILES+=usr/share/pc-sysinstall/conf/license/nvidia-en.txt +OLD_FILES+=usr/share/pc-sysinstall/conf/pc-sysinstall.conf +# doc +OLD_FILES+=usr/share/pc-sysinstall/doc/help-disk-list +OLD_FILES+=usr/share/pc-sysinstall/doc/help-disk-size +OLD_FILES+=usr/share/pc-sysinstall/doc/help-index +OLD_FILES+=usr/share/pc-sysinstall/doc/help-start-autoinstall +# examples +OLD_FILES+=usr/share/examples/pc-sysinstall/README +OLD_FILES+=usr/share/examples/pc-sysinstall/pc-autoinstall.conf +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.fbsd-netinstall +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.geli +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.gmirror +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.netinstall +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.restore +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.rsync +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.upgrade +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.zfs +# pc-sysinstall +OLD_FILES+=usr/sbin/pc-sysinstall +OLD_FILES+=usr/share/man/man8/pc-sysinstall.8.gz +OLD_DIRS+=usr/share/pc-sysinstall/backend +OLD_DIRS+=usr/share/pc-sysinstall/backend-partmanager +OLD_DIRS+=usr/share/pc-sysinstall/backend-query +OLD_DIRS+=usr/share/pc-sysinstall/conf/license +OLD_DIRS+=usr/share/pc-sysinstall/conf +OLD_DIRS+=usr/share/pc-sysinstall/doc +OLD_DIRS+=usr/share/pc-sysinstall +OLD_DIRS+=usr/share/examples/pc-sysinstall +.endif + .if ${MK_PF} == no OLD_FILES+=etc/periodic/security/520.pfdenied OLD_FILES+=etc/pf.os Added: head/tools/build/options/WITHOUT_PC_SYSINSTALL ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_PC_SYSINSTALL Fri Jan 18 15:57:09 2013 (r245606) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr pc-sysinstall 8 +and related programs. Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Fri Jan 18 14:36:23 2013 (r245605) +++ head/usr.sbin/Makefile Fri Jan 18 15:57:09 2013 (r245606) @@ -57,7 +57,7 @@ SUBDIR= adduser \ nfsuserd \ nmtree \ nologin \ - pc-sysinstall \ + ${_pc_sysinstall} \ pciconf \ periodic \ powerd \ @@ -265,6 +265,10 @@ SUBDIR+= ntp SUBDIR+= keyserv .endif +.if ${MK_PC_SYSINSTALL} != "no" +_pc_sysinstall= pc-sysinstall +.endif + .if ${MK_PF} != "no" SUBDIR+= ftp-proxy .endif From owner-svn-src-head@FreeBSD.ORG Fri Jan 18 17:13:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1DA69469; Fri, 18 Jan 2013 17:13:11 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id D215C888; Fri, 18 Jan 2013 17:13:10 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 28696B986; Fri, 18 Jan 2013 12:13:10 -0500 (EST) From: John Baldwin To: Konstantin Belousov Subject: Re: svn commit: r245577 - in head/sys: amd64/amd64 i386/i386 x86/x86 Date: Fri, 18 Jan 2013 10:52:54 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201301172132.r0HLWQHD004835@svn.freebsd.org> <20130118040332.GT2522@kib.kiev.ua> In-Reply-To: <20130118040332.GT2522@kib.kiev.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201301181052.54464.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 18 Jan 2013 12:13:10 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 18 Jan 2013 17:13:11 -0000 On Thursday, January 17, 2013 11:03:32 pm Konstantin Belousov wrote: > On Thu, Jan 17, 2013 at 09:32:26PM +0000, John Baldwin wrote: > > Author: jhb > > Date: Thu Jan 17 21:32:25 2013 > > New Revision: 245577 > > URL: http://svnweb.freebsd.org/changeset/base/245577 > > > > Log: > > Don't attempt to use clflush on the local APIC register window. Various > > CPUs exhibit bad behavior if this is done (Intel Errata AAJ3, hangs on > > Pentium-M, and trashing of the local APIC registers on a VIA C7). The > > local APIC is implicitly mapped UC already via MTRRs, so the clflush isn't > > necessary anyway. > > > > MFC after: 2 weeks > I am curious, was there a case where the clflush was really executed > on the LAPIC register window with the pristine HEAD code ? I think > that there is no Intel processors which support clflush instruction > and do not have self-snoop. The VIA CPUs. I had a submitter report that a clflush against the local APIC range would sometimes cause the entire local APIC range to get overwritten with a single cacheline (repeated throughout the window). Also, in theory we could perhaps stop masking CLFLUSH in VM's when SS is masked. > On the other hand, please note that the same change could be due for the > pmap_invalidate_cache_pages(). Unlike pmap_invalidate_cache_range(), > _pages() uses clflush unconditionally on purpose, since it is intended > for devices which do not snoop. Hmm, maybe. I'm not sure that call is ever used on the local APIC since the relevant page should already be UC from the boot-time call? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Jan 18 18:24:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 14EA2EE5; Fri, 18 Jan 2013 18:24:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ED12DE40; Fri, 18 Jan 2013 18:24:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0IIOfis094868; Fri, 18 Jan 2013 18:24:41 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0IIOfxd094865; Fri, 18 Jan 2013 18:24:41 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201301181824.r0IIOfxd094865@svn.freebsd.org> From: John Baldwin Date: Fri, 18 Jan 2013 18:24:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245610 - head/bin/ps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 18 Jan 2013 18:24:42 -0000 Author: jhb Date: Fri Jan 18 18:24:40 2013 New Revision: 245610 URL: http://svnweb.freebsd.org/changeset/base/245610 Log: Include the thread name along with the command name when displaying the command name of a thread from a multi-threaded process that doesn't have an available argument list (such as kernel processes) and threads display is enabled via -H. Reviewed by: alfred, delphij, eric@vangyzen.net MFC after: 1 week Modified: head/bin/ps/extern.h head/bin/ps/fmt.c head/bin/ps/ps.c Modified: head/bin/ps/extern.h ============================================================================== --- head/bin/ps/extern.h Fri Jan 18 17:49:00 2013 (r245609) +++ head/bin/ps/extern.h Fri Jan 18 18:24:40 2013 (r245610) @@ -51,7 +51,7 @@ char *elapsed(KINFO *, VARENT *); char *elapseds(KINFO *, VARENT *); char *emulname(KINFO *, VARENT *); VARENT *find_varentry(VAR *); -const char *fmt_argv(char **, char *, size_t); +const char *fmt_argv(char **, char *, char *, size_t); double getpcpu(const KINFO *); char *kvar(KINFO *, VARENT *); char *label(KINFO *, VARENT *); Modified: head/bin/ps/fmt.c ============================================================================== --- head/bin/ps/fmt.c Fri Jan 18 17:49:00 2013 (r245609) +++ head/bin/ps/fmt.c Fri Jan 18 18:24:40 2013 (r245610) @@ -105,7 +105,7 @@ cmdpart(char *arg0) } const char * -fmt_argv(char **argv, char *cmd, size_t maxlen) +fmt_argv(char **argv, char *cmd, char *thread, size_t maxlen) { size_t len; char *ap, *cp; @@ -122,9 +122,14 @@ fmt_argv(char **argv, char *cmd, size_t cp = malloc(len); if (cp == NULL) errx(1, "malloc failed"); - if (ap == NULL) - sprintf(cp, "[%.*s]", (int)maxlen, cmd); - else if (strncmp(cmdpart(argv[0]), cmd, maxlen) != 0) + if (ap == NULL) { + if (showthreads && thread != NULL) { + asprintf(&ap, "%s/%s", cmd, thread); + sprintf(cp, "[%.*s]", (int)maxlen, ap); + free(ap); + } else + sprintf(cp, "[%.*s]", (int)maxlen, cmd); + } else if (strncmp(cmdpart(argv[0]), cmd, maxlen) != 0) sprintf(cp, "%s (%.*s)", ap, (int)maxlen, cmd); else strcpy(cp, ap); Modified: head/bin/ps/ps.c ============================================================================== --- head/bin/ps/ps.c Fri Jan 18 17:49:00 2013 (r245609) +++ head/bin/ps/ps.c Fri Jan 18 18:24:40 2013 (r245610) @@ -141,7 +141,7 @@ static void format_output(KINFO *); static void *expand_list(struct listinfo *); static const char * fmt(char **(*)(kvm_t *, const struct kinfo_proc *, int), - KINFO *, char *, int); + KINFO *, char *, char *, int); static void free_list(struct listinfo *); static void init_list(struct listinfo *, addelem_rtn, int, const char *); static char *kludge_oldps_options(const char *, char *, const char *); @@ -1163,11 +1163,12 @@ sizevars(void) static const char * fmt(char **(*fn)(kvm_t *, const struct kinfo_proc *, int), KINFO *ki, - char *comm, int maxlen) + char *comm, char *thread, int maxlen) { const char *s; - s = fmt_argv((*fn)(kd, ki->ki_p, termwidth), comm, maxlen); + s = fmt_argv((*fn)(kd, ki->ki_p, termwidth), comm, + ki->ki_p->ki_numthreads > 1 ? thread : NULL, maxlen); return (s); } @@ -1195,7 +1196,7 @@ saveuser(KINFO *ki) ki->ki_args = strdup(""); else if (UREADOK(ki) || (ki->ki_p->ki_args != NULL)) ki->ki_args = strdup(fmt(kvm_getargv, ki, - ki->ki_p->ki_comm, MAXCOMLEN)); + ki->ki_p->ki_comm, ki->ki_p->ki_tdname, MAXCOMLEN)); else asprintf(&ki->ki_args, "(%s)", ki->ki_p->ki_comm); if (ki->ki_args == NULL) @@ -1206,7 +1207,7 @@ saveuser(KINFO *ki) if (needenv) { if (UREADOK(ki)) ki->ki_env = strdup(fmt(kvm_getenvv, ki, - (char *)NULL, 0)); + (char *)NULL, (char *)NULL, 0)); else ki->ki_env = strdup("()"); if (ki->ki_env == NULL) From owner-svn-src-head@FreeBSD.ORG Fri Jan 18 18:43:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9274BCC1; Fri, 18 Jan 2013 18:43:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 757F9FAA; Fri, 18 Jan 2013 18:43:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0IIhd7e000540; Fri, 18 Jan 2013 18:43:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0IIhcwZ000536; Fri, 18 Jan 2013 18:43:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201301181843.r0IIhcwZ000536@svn.freebsd.org> From: John Baldwin Date: Fri, 18 Jan 2013 18:43:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245611 - in head/sys: fs/nfsclient fs/nfsserver nfsclient nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 18 Jan 2013 18:43:39 -0000 Author: jhb Date: Fri Jan 18 18:43:38 2013 New Revision: 245611 URL: http://svnweb.freebsd.org/changeset/base/245611 Log: Use vfs_timestamp() to set file timestamps rather than invoking getmicrotime() or getnanotime() directly in NFS. Reviewed by: rmacklem, bde MFC after: 1 week Modified: head/sys/fs/nfsclient/nfs_clvnops.c head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/nfsclient/nfs_vnops.c head/sys/nfsserver/nfs_srvsubs.c Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Fri Jan 18 18:24:40 2013 (r245610) +++ head/sys/fs/nfsclient/nfs_clvnops.c Fri Jan 18 18:43:38 2013 (r245611) @@ -3247,7 +3247,7 @@ nfsfifo_read(struct vop_read_args *ap) */ mtx_lock(&np->n_mtx); np->n_flag |= NACC; - getnanotime(&np->n_atim); + vfs_timestamp(&np->n_atim); mtx_unlock(&np->n_mtx); error = fifo_specops.vop_read(ap); return error; @@ -3266,7 +3266,7 @@ nfsfifo_write(struct vop_write_args *ap) */ mtx_lock(&np->n_mtx); np->n_flag |= NUPD; - getnanotime(&np->n_mtim); + vfs_timestamp(&np->n_mtim); mtx_unlock(&np->n_mtx); return(fifo_specops.vop_write(ap)); } @@ -3286,7 +3286,7 @@ nfsfifo_close(struct vop_close_args *ap) mtx_lock(&np->n_mtx); if (np->n_flag & (NACC | NUPD)) { - getnanotime(&ts); + vfs_timestamp(&ts); if (np->n_flag & NACC) np->n_atim = ts; if (np->n_flag & NUPD) Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Fri Jan 18 18:24:40 2013 (r245610) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Fri Jan 18 18:43:38 2013 (r245611) @@ -1476,7 +1476,7 @@ nfsvno_updfilerev(struct vnode *vp, stru struct vattr va; VATTR_NULL(&va); - getnanotime(&va.va_mtime); + vfs_timestamp(&va.va_mtime); (void) VOP_SETATTR(vp, &va, cred); (void) nfsvno_getattr(vp, nvap, cred, p, 1); } @@ -2248,7 +2248,6 @@ nfsrv_sattr(struct nfsrv_descript *nd, s { u_int32_t *tl; struct nfsv2_sattr *sp; - struct timeval curtime; int error = 0, toclient = 0; switch (nd->nd_flag & (ND_NFSV2 | ND_NFSV3 | ND_NFSV4)) { @@ -2307,9 +2306,7 @@ nfsrv_sattr(struct nfsrv_descript *nd, s toclient = 1; break; case NFSV3SATTRTIME_TOSERVER: - NFSGETTIME(&curtime); - nvap->na_atime.tv_sec = curtime.tv_sec; - nvap->na_atime.tv_nsec = curtime.tv_usec * 1000; + vfs_timestamp(&nvap->na_atime); nvap->na_vaflags |= VA_UTIMES_NULL; break; }; @@ -2321,9 +2318,7 @@ nfsrv_sattr(struct nfsrv_descript *nd, s nvap->na_vaflags &= ~VA_UTIMES_NULL; break; case NFSV3SATTRTIME_TOSERVER: - NFSGETTIME(&curtime); - nvap->na_mtime.tv_sec = curtime.tv_sec; - nvap->na_mtime.tv_nsec = curtime.tv_usec * 1000; + vfs_timestamp(&nvap->na_mtime); if (!toclient) nvap->na_vaflags |= VA_UTIMES_NULL; break; @@ -2353,7 +2348,6 @@ nfsv4_sattr(struct nfsrv_descript *nd, s u_char *cp, namestr[NFSV4_SMALLSTR + 1]; uid_t uid; gid_t gid; - struct timeval curtime; error = nfsrv_getattrbits(nd, attrbitp, NULL, &retnotsup); if (error) @@ -2488,9 +2482,7 @@ nfsv4_sattr(struct nfsrv_descript *nd, s toclient = 1; attrsum += NFSX_V4TIME; } else { - NFSGETTIME(&curtime); - nvap->na_atime.tv_sec = curtime.tv_sec; - nvap->na_atime.tv_nsec = curtime.tv_usec * 1000; + vfs_timestamp(&nvap->na_atime); nvap->na_vaflags |= VA_UTIMES_NULL; } break; @@ -2515,9 +2507,7 @@ nfsv4_sattr(struct nfsrv_descript *nd, s nvap->na_vaflags &= ~VA_UTIMES_NULL; attrsum += NFSX_V4TIME; } else { - NFSGETTIME(&curtime); - nvap->na_mtime.tv_sec = curtime.tv_sec; - nvap->na_mtime.tv_nsec = curtime.tv_usec * 1000; + vfs_timestamp(&nvap->na_mtime); if (!toclient) nvap->na_vaflags |= VA_UTIMES_NULL; } Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Fri Jan 18 18:24:40 2013 (r245610) +++ head/sys/nfsclient/nfs_vnops.c Fri Jan 18 18:43:38 2013 (r245611) @@ -3458,7 +3458,7 @@ nfsfifo_read(struct vop_read_args *ap) */ mtx_lock(&np->n_mtx); np->n_flag |= NACC; - getnanotime(&np->n_atim); + vfs_timestamp(&np->n_atim); mtx_unlock(&np->n_mtx); error = fifo_specops.vop_read(ap); return error; @@ -3477,7 +3477,7 @@ nfsfifo_write(struct vop_write_args *ap) */ mtx_lock(&np->n_mtx); np->n_flag |= NUPD; - getnanotime(&np->n_mtim); + vfs_timestamp(&np->n_mtim); mtx_unlock(&np->n_mtx); return(fifo_specops.vop_write(ap)); } @@ -3497,7 +3497,7 @@ nfsfifo_close(struct vop_close_args *ap) mtx_lock(&np->n_mtx); if (np->n_flag & (NACC | NUPD)) { - getnanotime(&ts); + vfs_timestamp(&ts); if (np->n_flag & NACC) np->n_atim = ts; if (np->n_flag & NUPD) Modified: head/sys/nfsserver/nfs_srvsubs.c ============================================================================== --- head/sys/nfsserver/nfs_srvsubs.c Fri Jan 18 18:24:40 2013 (r245610) +++ head/sys/nfsserver/nfs_srvsubs.c Fri Jan 18 18:43:38 2013 (r245611) @@ -1393,7 +1393,7 @@ nfsm_srvsattr_xx(struct vattr *a, struct toclient = 1; break; case NFSV3SATTRTIME_TOSERVER: - getnanotime(&(a)->va_atime); + vfs_timestamp(&a->va_atime); a->va_vaflags |= VA_UTIMES_NULL; break; } @@ -1409,7 +1409,7 @@ nfsm_srvsattr_xx(struct vattr *a, struct a->va_vaflags &= ~VA_UTIMES_NULL; break; case NFSV3SATTRTIME_TOSERVER: - getnanotime(&(a)->va_mtime); + vfs_timestamp(&a->va_mtime); if (toclient == 0) a->va_vaflags |= VA_UTIMES_NULL; break; From owner-svn-src-head@FreeBSD.ORG Fri Jan 18 19:11:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BE38A919; Fri, 18 Jan 2013 19:11:17 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AA99310D; Fri, 18 Jan 2013 19:11:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0IJBHPg009359; Fri, 18 Jan 2013 19:11:17 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0IJBHHu009358; Fri, 18 Jan 2013 19:11:17 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201301181911.r0IJBHHu009358@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 18 Jan 2013 19:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245612 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 18 Jan 2013 19:11:17 -0000 Author: pfg Date: Fri Jan 18 19:11:17 2013 New Revision: 245612 URL: http://svnweb.freebsd.org/changeset/base/245612 Log: ext2fs: Add some DOINGASYNC check to match ffs. This is mostly cosmetical. Reviewed by: bde MFC after: 3 days Modified: head/sys/fs/ext2fs/ext2_inode.c Modified: head/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode.c Fri Jan 18 18:43:38 2013 (r245611) +++ head/sys/fs/ext2fs/ext2_inode.c Fri Jan 18 19:11:17 2013 (r245612) @@ -180,7 +180,7 @@ ext2_truncate(vp, length, flags, cred, t else bawrite(bp); oip->i_flag |= IN_CHANGE | IN_UPDATE; - return (ext2_update(ovp, 1)); + return (ext2_update(ovp, !DOINGASYNC(ovp))); } /* * Shorten the size of the file. If the file is not being @@ -238,7 +238,7 @@ ext2_truncate(vp, length, flags, cred, t for (i = NDADDR - 1; i > lastblock; i--) oip->i_db[i] = 0; oip->i_flag |= IN_CHANGE | IN_UPDATE; - allerror = ext2_update(ovp, 1); + allerror = ext2_update(ovp, !DOINGASYNC(ovp)); /* * Having written the new inode to disk, save its new configuration @@ -420,9 +420,13 @@ ext2_indirtrunc(ip, lbn, dbn, lastbn, le (u_int)(NINDIR(fs) - (last + 1)) * sizeof(int32_t)); if (last == -1) bp->b_flags |= B_INVAL; - error = bwrite(bp); - if (error) - allerror = error; + if (DOINGASYNC(vp)) { + bdwrite(bp); + } else { + error = bwrite(bp); + if (error) + allerror = error; + } bap = copy; /* From owner-svn-src-head@FreeBSD.ORG Fri Jan 18 19:42:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8197717F; Fri, 18 Jan 2013 19:42:09 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6FE59223; Fri, 18 Jan 2013 19:42:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0IJg9rK018073; Fri, 18 Jan 2013 19:42:09 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0IJg9TK018072; Fri, 18 Jan 2013 19:42:09 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201301181942.r0IJg9TK018072@svn.freebsd.org> From: Xin LI Date: Fri, 18 Jan 2013 19:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245613 - head/sys/fs/nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 18 Jan 2013 19:42:09 -0000 Author: delphij Date: Fri Jan 18 19:42:08 2013 New Revision: 245613 URL: http://svnweb.freebsd.org/changeset/base/245613 Log: Make it possible to force async at server side on new NFS server, similar to the old one's nfs.nfsrv.async. Please note that by enabling this option (default is disabled), the system could potentionally have silent data corruption if the server crashes before write is committed to non-volatile storage, as the client side have no way to tell if the data is already written. Submitted by: rmacklem MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdserv.c Fri Jan 18 19:11:17 2013 (r245612) +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Fri Jan 18 19:42:08 2013 (r245613) @@ -55,6 +55,11 @@ extern int nfs_rootfhset; extern int nfsrv_enable_crossmntpt; #endif /* !APPLEKEXT */ +static int nfs_async = 0; +SYSCTL_DECL(_vfs_nfsd); +SYSCTL_INT(_vfs_nfsd, OID_AUTO, async, CTLFLAG_RW, &nfs_async, 0, + "Tell client that writes were synced even though they were not"); + /* * This list defines the GSS mechanisms supported. * (Don't ask me how you get these strings from the RFC stuff like @@ -912,7 +917,13 @@ nfsrvd_write(struct nfsrv_descript *nd, goto out; NFSM_BUILD(tl, u_int32_t *, 4 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(retlen); - if (stable == NFSWRITE_UNSTABLE) + /* + * If nfs_async is set, then pretend the write was FILESYNC. + * Warning: Doing this violates RFC1813 and runs a risk + * of data written by a client being lost when the server + * crashes/reboots. + */ + if (stable == NFSWRITE_UNSTABLE && nfs_async == 0) *tl++ = txdr_unsigned(stable); else *tl++ = txdr_unsigned(NFSWRITE_FILESYNC); From owner-svn-src-head@FreeBSD.ORG Fri Jan 18 19:57:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C7E164E0 for ; Fri, 18 Jan 2013 19:57:38 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 31B552AD for ; Fri, 18 Jan 2013 19:57:37 +0000 (UTC) Received: (qmail 55687 invoked from network); 18 Jan 2013 21:19:46 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 18 Jan 2013 21:19:46 -0000 Message-ID: <50F9A92A.9040706@freebsd.org> Date: Fri, 18 Jan 2013 20:57:30 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: Alan Cox Subject: Re: svn commit: r243631 - in head/sys: kern sys References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50C1BC90.90106@freebsd.org> <50C25A27.4060007@bluezbox.com> <50C26331.6030504@freebsd.org> <50C26AE9.4020600@bluezbox.com> <50C3A3D3.9000804@freebsd.org> <50C3AF72.4010902@rice.edu> <330405A1-312A-45A5-BB86-4969478D8BBD@bluezbox.com> <50D03E83.8060908@rice.edu> <50DD081E.8000409@bluezbox.com> <50EB1841.5030006@bluezbox.com> <50F28806.10505@rice.edu> <50F41DA3.8060300@freebsd.org> In-Reply-To: <50F41DA3.8060300@freebsd.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 18 Jan 2013 19:57:38 -0000 On 14.01.2013 16:00, Andre Oppermann wrote: > On 13.01.2013 11:10, Alan Cox wrote: >> 3. The function vm_ksubmap_init() has a dependency on the global >> variable maxpipekva. vm_ksubmap_init() is executed under SI_SUB_CPU, >> which comes after SI_SUB_KMEM. >> >> Am I missing anything? >> >> I'm attaching a patch that defers the calculation of maxpipekva until we >> actually need it in vm_ksubmap_init(). Any comments on this patch are >> welcome. > > Looks good to me. Perhaps the whole calculation and setup of the pipe_map > could be moved to kern/sys_pipe.c:pipeinit() to have it all together. Attached is a patch moving the whole calculation and pipe_map creation to kern/sys_pipe.c. -- Andre Index: vm/vm_kern.c =================================================================== --- vm/vm_kern.c (revision 245601) +++ vm/vm_kern.c (working copy) @@ -88,7 +88,6 @@ vm_map_t kernel_map=0; vm_map_t kmem_map=0; vm_map_t exec_map=0; -vm_map_t pipe_map; vm_map_t buffer_map=0; const void *zero_region; Index: vm/vm_kern.h =================================================================== --- vm/vm_kern.h (revision 245601) +++ vm/vm_kern.h (working copy) @@ -68,7 +68,6 @@ extern vm_map_t kernel_map; extern vm_map_t kmem_map; extern vm_map_t exec_map; -extern vm_map_t pipe_map; extern u_long vm_kmem_size; #endif /* _VM_VM_KERN_H_ */ Index: vm/vm_init.c =================================================================== --- vm/vm_init.c (revision 245601) +++ vm/vm_init.c (working copy) @@ -73,7 +73,6 @@ #include #include #include -#include #include #include @@ -195,8 +194,6 @@ pager_map->system_map = 1; exec_map = kmem_suballoc(kernel_map, &minaddr, &maxaddr, exec_map_entries * round_page(PATH_MAX + ARG_MAX), FALSE); - pipe_map = kmem_suballoc(kernel_map, &minaddr, &maxaddr, maxpipekva, - FALSE); /* * XXX: Mbuf system machine-specific initializations should Index: sys/pipe.h =================================================================== --- sys/pipe.h (revision 245601) +++ sys/pipe.h (working copy) @@ -53,10 +53,6 @@ #define PIPENPAGES (BIG_PIPE_SIZE / PAGE_SIZE + 1) -/* - * See sys_pipe.c for info on what these limits mean. - */ -extern long maxpipekva; extern struct fileops pipeops; /* Index: kern/subr_param.c =================================================================== --- kern/subr_param.c (revision 245601) +++ kern/subr_param.c (working copy) @@ -96,7 +96,6 @@ pid_t pid_max = PID_MAX; long maxswzone; /* max swmeta KVA storage */ long maxbcache; /* max buffer cache KVA storage */ -long maxpipekva; /* Limit on pipe KVA */ int vm_guest; /* Running as virtual machine guest? */ u_long maxtsiz; /* max text size */ u_long dfldsiz; /* initial data size limit */ @@ -330,18 +329,6 @@ */ ncallout = imin(16 + maxproc + maxfiles, 18508); TUNABLE_INT_FETCH("kern.ncallout", &ncallout); - - /* - * The default for maxpipekva is min(1/64 of the kernel address space, - * max(1/64 of main memory, 512KB)). See sys_pipe.c for more details. - */ - maxpipekva = (physpages / 64) * PAGE_SIZE; - TUNABLE_LONG_FETCH("kern.ipc.maxpipekva", &maxpipekva); - if (maxpipekva < 512 * 1024) - maxpipekva = 512 * 1024; - if (maxpipekva > (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / 64) - maxpipekva = (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / - 64; } /* Index: kern/sys_pipe.c =================================================================== --- kern/sys_pipe.c (revision 245601) +++ kern/sys_pipe.c (working copy) @@ -202,6 +202,7 @@ #define MAXPIPESIZE (2*PIPE_SIZE/3) static long amountpipekva; +static long maxpipekva; static int pipefragretry; static int pipeallocfail; static int piperesizefail; @@ -220,7 +221,6 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, piperesizeallowed, CTLFLAG_RW, &piperesizeallowed, 0, "Pipe resizing allowed"); -static void pipeinit(void *dummy __unused); static void pipeclose(struct pipe *cpipe); static void pipe_free_kmem(struct pipe *cpipe); static int pipe_create(struct pipe *pipe, int backing); @@ -244,12 +244,29 @@ static struct unrhdr *pipeino_unr; static dev_t pipedev_ino; -SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_ANY, pipeinit, NULL); +static vm_map_t pipe_map; +/* + * Set up the kmem suballocation and UMA zone for the pipe memory. + */ static void pipeinit(void *dummy __unused) { + quad_t realkmem; + vm_offset_t minaddr, maxaddr; + realkmem = qmin((quad_t)physmem * PAGE_SIZE, + vm_map_max(kernel_map) - vm_map_min(kernel_map)); + + maxpipekva = realkmem / 64; + TUNABLE_LONG_FETCH("kern.ipc.maxpipekva", &maxpipekva); + if (maxpipekva > realmem / 64) + maxpipekva = realkmem / 64; + if (maxpipekva < 512 * 1024) + maxpipekva = 512 * 1024; + pipe_map = kmem_suballoc(kernel_map, &minaddr, &maxaddr, maxpipekva, + FALSE); + pipe_zone = uma_zcreate("pipe", sizeof(struct pipepair), pipe_zone_ctor, NULL, pipe_zone_init, pipe_zone_fini, UMA_ALIGN_PTR, 0); @@ -259,6 +276,7 @@ pipedev_ino = devfs_alloc_cdp_inode(); KASSERT(pipedev_ino > 0, ("pipe dev inode not initialized")); } +SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_ANY, pipeinit, NULL); static int pipe_zone_ctor(void *mem, int size, void *arg, int flags) From owner-svn-src-head@FreeBSD.ORG Fri Jan 18 20:57:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 32820F29; Fri, 18 Jan 2013 20:57:51 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 248927AF; Fri, 18 Jan 2013 20:57:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0IKvpD8039825; Fri, 18 Jan 2013 20:57:51 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0IKvoHB039818; Fri, 18 Jan 2013 20:57:50 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301182057.r0IKvoHB039818@svn.freebsd.org> From: Brooks Davis Date: Fri, 18 Jan 2013 20:57:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245617 - in 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.14 Precedence: list List-Id: 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, 18 Jan 2013 20:57:51 -0000 Author: brooks Date: Fri Jan 18 20:57:50 2013 New Revision: 245617 URL: http://svnweb.freebsd.org/changeset/base/245617 Log: Introduce six new options from NetBSD: * -M Log metadata in mtree format. * -D Log paths relative to . * -h Log digest of type . * -T Specify which mtree tags to log. * -l Create hard or symbolic links (allows logging). * -U Install without root privileges (owner, group, mode, and flags can be logged via -M NOTE: In the interest of compatibility with NetBSD and because it is the obvious letter, the nearly useless -M option (disable mmap) has been repurposed. Sponsored by: DARPA, AFRL Obtained from: NetBSD Reviewed by: bz Modified: head/UPDATING head/usr.bin/xinstall/Makefile head/usr.bin/xinstall/install.1 head/usr.bin/xinstall/xinstall.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Jan 18 20:30:15 2013 (r245616) +++ head/UPDATING Fri Jan 18 20:57:50 2013 (r245617) @@ -26,6 +26,15 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20130118: + The install(1) option -M has changed meaning and now takes an + argument that is a file or path to append logs to. In the + unlikely event that -M was the last option on the command line + and the command line contained at least two files and a target + directory the first file will have logs appended to it. The -M + option served little practical purpose in the last decade so it's + used expected to be extremely rare. + 20121223: After switching to Clang as the default compiler some users of ZFS on i386 systems started to experience stack overflow kernel panics. Modified: head/usr.bin/xinstall/Makefile ============================================================================== --- head/usr.bin/xinstall/Makefile Fri Jan 18 20:30:15 2013 (r245616) +++ head/usr.bin/xinstall/Makefile Fri Jan 18 20:57:50 2013 (r245617) @@ -10,7 +10,7 @@ MAN= install.1 CFLAGS+= -I${.CURDIR}/../../contrib/mtree CFLAGS+= -I${.CURDIR}/../../lib/libnetbsd -DPADD+= ${LIBUTIL} -LDADD+= -lutil +DPADD+= ${LIBUTIL} ${LIBMD} +LDADD+= -lutil -lmd .include Modified: head/usr.bin/xinstall/install.1 ============================================================================== --- head/usr.bin/xinstall/install.1 Fri Jan 18 20:30:15 2013 (r245616) +++ head/usr.bin/xinstall/install.1 Fri Jan 18 20:57:50 2013 (r245617) @@ -28,7 +28,7 @@ .\" From: @(#)install.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd March 6, 2006 +.Dd January 18, 2013 .Dt INSTALL 1 .Os .Sh NAME @@ -36,34 +36,50 @@ .Nd install binaries .Sh SYNOPSIS .Nm -.Op Fl bCcMpSsv +.Op Fl bCcMpSsUv .Op Fl B Ar suffix +.Op Fl D Ar destdir .Op Fl f Ar flags .Op Fl g Ar group +.Op Fl h Ar hash +.Op Fl l Ar linkflags +.Op Fl M Ar metalog .Op Fl m Ar mode .Op Fl N Ar dbdir .Op Fl o Ar owner +.Op Fl T Ar tags .Ar file1 file2 .Nm -.Op Fl bCcMpSsv +.Op Fl bCcMpSsUv .Op Fl B Ar suffix +.Op Fl D Ar destdir .Op Fl f Ar flags .Op Fl g Ar group +.Op Fl h Ar hash +.Op Fl l Ar linkflags +.Op Fl M Ar metalog .Op Fl m Ar mode .Op Fl N Ar dbdir .Op Fl o Ar owner +.Op Fl T Ar tags .Ar file1 ... fileN directory .Nm .Fl d -.Op Fl v +.Op Fl Uv +.Op Fl D Ar destdir .Op Fl g Ar group +.Op Fl h Ar hash +.Op Fl M Ar metalog .Op Fl m Ar mode .Op Fl N Ar dbdir .Op Fl o Ar owner +.Op Fl T Ar tags .Ar directory ... .Sh DESCRIPTION The file(s) are copied -to the target file or directory. +(or linked if the +.Fl l +option is specified) to the target file or directory. If the destination is a directory, then the .Ar file is copied into @@ -108,6 +124,17 @@ This is actually the default. The .Fl c option is only included for backwards compatibility. +.It Fl D Ar destdir +Specify the +.Ev DESTDIR +(top of the file hierarchy) that the items are installed in to. +If +.Fl M Ar metalog +is in use, a leading string of +.Dq Ar destdir +will be removed from the file names logged to the +.Ar metalog . +This option does not affect where the actual files are installed. .It Fl d Create directories. Missing parent directories are created as required. @@ -118,9 +145,67 @@ for a list of possible flags and their m .It Fl g Specify a group. A numeric GID is allowed. +.It Fl h Ar hash +When copying, calculate the digest of the files with +.Ar hash +to store in the +.Fl M Ar metalog . +When +.Fl d +is given no hash is emitted. +Supported digests: +.Bl -tag -width rmd160 -offset indent +.It Sy none +No hash. +This is the default. +.It Sy md5 +The MD5 cryptographic message digest. +.It Sy rmd160 +The RMD-160 cryptographic message digest. +.It Sy sha1 +The SHA-1 cryptographic message digest. +.It Sy sha256 +The 256-bits +.Tn SHA-2 +cryptographic message digest of the file. +.It Sy sha512 +The 512-bits +.Tn SHA-2 +cryptographic message digest of the file. +.El +.It Fl l Ar linkflags +Instead of copying the file make a link to the source. +The type of the link is determined by the +.Ar linkflags +argument. +Valid +.Ar linkflags +are: +.Ar a +(absolute), +.Ar r +(relative), +.Ar h +(hard), +.Ar s +(symbolic), +.Ar m +(mixed). +Absolute and relative have effect only for symbolic links. +Mixed links +are hard links for files on the same filesystem, symbolic otherwise. .It Fl M Disable all use of .Xr mmap 2 . +.It Fl M Ar metalog +Write the metadata associated with each item installed to +.Ar metalog +in an +.Xr mtree 8 +.Dq full path +specification line. +The metadata includes: the file name and file type, and depending upon +other options, the owner, group, file flags, modification time, and tags. .It Fl m Specify an alternate mode. The default mode is set to rwxr-xr-x (0755). @@ -171,6 +256,17 @@ number of systems and binary types. See below for how .Nm can be instructed to use another program to strip binaries. +.It Fl T Ar tags +Specify the +.Xr mtree 8 +tags to write out for the file when using +.Fl M Ar metalog . +.It Fl U +Indicate that install is running unprivileged, and that it should not +try to change the owner, the group, or the file flags of the destination. +The information that would have been updated can be stored in a log +file with +.Fl M Ar metalog . .It Fl v Cause .Nm @@ -255,6 +351,16 @@ The utility appeared in .Bx 4.2 . .Sh BUGS +The meaning of the +.Fl M +option has changed as of +.Fx 10 +and it now takes an argument. +Command lines that used the old +.Fl M +will get an error or in rare cases will append logs to the first of +multiple source files rather than installing it. +.Pp Temporary files may be left in the target directory if .Nm exits abnormally. Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Fri Jan 18 20:30:15 2013 (r245616) +++ head/usr.bin/xinstall/xinstall.c Fri Jan 18 20:57:50 2013 (r245617) @@ -1,4 +1,5 @@ /* + * Copyright (c) 2012, 2013 SRI International * Copyright (c) 1987, 1993 * The Regents of the University of California. All rights reserved. * @@ -53,14 +54,21 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include +#include +#include +#include +#include #include #include #include #include #include #include +#include #include "mtree.h" @@ -71,24 +79,62 @@ __FBSDID("$FreeBSD$"); #define MAX_CMP_SIZE (16 * 1024 * 1024) +#define LN_ABSOLUTE 0x01 +#define LN_RELATIVE 0x02 +#define LN_HARD 0x04 +#define LN_SYMBOLIC 0x08 +#define LN_MIXED 0x10 + #define DIRECTORY 0x01 /* Tell install it's a directory. */ #define SETFLAGS 0x02 /* Tell install to set flags. */ #define NOCHANGEBITS (UF_IMMUTABLE | UF_APPEND | SF_IMMUTABLE | SF_APPEND) #define BACKUP_SUFFIX ".old" +typedef union { + MD5_CTX MD5; + RIPEMD160_CTX RIPEMD160; + SHA1_CTX SHA1; + SHA256_CTX SHA256; + SHA512_CTX SHA512; +} DIGEST_CTX; + +static enum { + DIGEST_NONE = 0, + DIGEST_MD5, + DIGEST_RIPEMD160, + DIGEST_SHA1, + DIGEST_SHA256, + DIGEST_SHA512, +} digesttype = DIGEST_NONE; + static gid_t gid; static uid_t uid; -static int dobackup, docompare, dodir, dopreserve, dostrip, nommap, safecopy, - verbose; +static int dobackup, docompare, dodir, dolink, dopreserve, dostrip, dounpriv, + safecopy, verbose; +static int haveopt_f, haveopt_g, haveopt_m, haveopt_o; static mode_t mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; +static FILE *metafp; +static const char *group, *owner; static const char *suffix = BACKUP_SUFFIX; +static char *destdir, *digest, *fflags, *metafile, *tags; -static int compare(int, const char *, size_t, int, const char *, size_t); -static void copy(int, const char *, int, const char *, off_t); +static int compare(int, const char *, size_t, int, const char *, size_t, + char **); +static char *copy(int, const char *, int, const char *, off_t); static int create_newfile(const char *, int, struct stat *); static int create_tempfile(const char *, char *, size_t); +static char *quiet_mktemp(char *template); +static char *digest_file(const char *); +static void digest_init(DIGEST_CTX *); +static void digest_update(DIGEST_CTX *, const unsigned char *, size_t); +static char *digest_end(DIGEST_CTX *, char *); +static int do_link(const char *, const char *, const struct stat *); +static void do_symlink(const char *, const char *, const struct stat *); +static void makelink(const char *, const char *, const struct stat *); static void install(const char *, const char *, u_long, u_int); static void install_dir(char *); +static void metadata_log(const char *, const char *, struct timeval *, + const char *, const char *, off_t); static int parseid(const char *, id_t *); static void strip(const char *); static int trymmap(int); @@ -102,12 +148,13 @@ main(int argc, char *argv[]) u_long fset; int ch, no_target; u_int iflags; - char *flags; - const char *group, *owner, *to_name; + char *p; + const char *to_name; iflags = 0; group = owner = NULL; - while ((ch = getopt(argc, argv, "B:bCcdf:g:Mm:N:o:pSsv")) != -1) + while ((ch = getopt(argc, argv, "B:bCcD:df:g:h:l:M:m:N:o:pSsT:Uv")) != + -1) switch((char)ch) { case 'B': suffix = optarg; @@ -121,22 +168,56 @@ main(int argc, char *argv[]) case 'c': /* For backwards compatibility. */ break; + case 'D': + destdir = optarg; + break; case 'd': dodir = 1; break; case 'f': - flags = optarg; - if (strtofflags(&flags, &fset, NULL)) - errx(EX_USAGE, "%s: invalid flag", flags); - iflags |= SETFLAGS; + haveopt_f = 1; + fflags = optarg; break; case 'g': + haveopt_g = 1; group = optarg; break; + case 'h': + digest = optarg; + break; + case 'l': + for (p = optarg; *p != '\0'; p++) + switch (*p) { + case 's': + dolink &= ~(LN_HARD|LN_MIXED); + dolink |= LN_SYMBOLIC; + break; + case 'h': + dolink &= ~(LN_SYMBOLIC|LN_MIXED); + dolink |= LN_HARD; + break; + case 'm': + dolink &= ~(LN_SYMBOLIC|LN_HARD); + dolink |= LN_MIXED; + break; + case 'a': + dolink &= ~LN_RELATIVE; + dolink |= LN_ABSOLUTE; + break; + case 'r': + dolink &= ~LN_ABSOLUTE; + dolink |= LN_RELATIVE; + break; + default: + errx(1, "%c: invalid link type", *p); + /* NOTREACHED */ + } + break; case 'M': - nommap = 1; + metafile = optarg; break; case 'm': + haveopt_m = 1; if (!(set = setmode(optarg))) errx(EX_USAGE, "invalid file mode: %s", optarg); @@ -145,10 +226,11 @@ main(int argc, char *argv[]) break; case 'N': if (!setup_getid(optarg)) - err(1, "Unable to use user and group " + err(EX_OSERR, "Unable to use user and group " "databases in `%s'", optarg); break; case 'o': + haveopt_o = 1; owner = optarg; break; case 'p': @@ -160,6 +242,12 @@ main(int argc, char *argv[]) case 's': dostrip = 1; break; + case 'T': + tags = optarg; + break; + case 'U': + dounpriv = 1; + break; case 'v': verbose = 1; break; @@ -185,14 +273,33 @@ main(int argc, char *argv[]) if (argc == 0 || (argc == 1 && !dodir)) usage(); + if (digest != NULL) { + if (strcmp(digest, "none") == 0) { + digesttype = DIGEST_NONE; + } else if (strcmp(digest, "md5") == 0) { + digesttype = DIGEST_MD5; + } else if (strcmp(digest, "rmd160") == 0) { + digesttype = DIGEST_RIPEMD160; + } else if (strcmp(digest, "sha1") == 0) { + digesttype = DIGEST_SHA1; + } else if (strcmp(digest, "sha256") == 0) { + digesttype = DIGEST_SHA256; + } else if (strcmp(digest, "sha512") == 0) { + digesttype = DIGEST_SHA512; + } else { + warnx("unknown digest `%s'", digest); + usage(); + } + } + /* need to make a temp copy so we can compare stripped version */ if (docompare && dostrip) safecopy = 1; /* get group and owner id's */ - if (group != NULL) { + if (group != NULL && !dounpriv) { if (gid_from_group(group, &gid) == -1) { - id_t id; + id_t id; if (!parseid(group, &id)) errx(1, "unknown group %s", group); gid = id; @@ -200,7 +307,7 @@ main(int argc, char *argv[]) } else gid = (gid_t)-1; - if (owner != NULL) { + if (owner != NULL && !dounpriv) { if (uid_from_user(owner, &uid) == -1) { id_t id; if (!parseid(owner, &id)) @@ -210,6 +317,18 @@ main(int argc, char *argv[]) } else uid = (uid_t)-1; + if (fflags != NULL && !dounpriv) { + if (strtofflags(&fflags, &fset, NULL)) + errx(EX_USAGE, "%s: invalid flag", fflags); + iflags |= SETFLAGS; + } + + if (metafile != NULL) { + if ((metafp = fopen(metafile, "a")) == NULL) + warn("open %s", metafile); + } else + digesttype = DIGEST_NONE; + if (dodir) { for (; *argv != NULL; ++argv) install_dir(*argv); @@ -236,7 +355,7 @@ main(int argc, char *argv[]) usage(); } - if (!no_target) { + if (!no_target && !dolink) { if (stat(*argv, &from_sb)) err(EX_OSERR, "%s", *argv); if (!S_ISREG(to_sb.st_mode)) { @@ -253,6 +372,96 @@ main(int argc, char *argv[]) /* NOTREACHED */ } +static char * +digest_file(const char *name) +{ + + switch (digesttype) { + case DIGEST_MD5: + return (MD5File(name, NULL)); + case DIGEST_RIPEMD160: + return (RIPEMD160_File(name, NULL)); + case DIGEST_SHA1: + return (SHA1_File(name, NULL)); + case DIGEST_SHA256: + return (SHA256_File(name, NULL)); + case DIGEST_SHA512: + return (SHA512_File(name, NULL)); + default: + return (NULL); + } +} + +static void +digest_init(DIGEST_CTX *c) +{ + + switch (digesttype) { + case DIGEST_NONE: + break; + case DIGEST_MD5: + MD5Init(&(c->MD5)); + break; + case DIGEST_RIPEMD160: + RIPEMD160_Init(&(c->RIPEMD160)); + break; + case DIGEST_SHA1: + SHA1_Init(&(c->SHA1)); + break; + case DIGEST_SHA256: + SHA256_Init(&(c->SHA256)); + break; + case DIGEST_SHA512: + SHA512_Init(&(c->SHA512)); + break; + } +} + +static void +digest_update(DIGEST_CTX *c, const unsigned char *data, size_t len) +{ + + switch (digesttype) { + case DIGEST_NONE: + break; + case DIGEST_MD5: + MD5Update(&(c->MD5), data, len); + break; + case DIGEST_RIPEMD160: + RIPEMD160_Update(&(c->RIPEMD160), data, len); + break; + case DIGEST_SHA1: + SHA1_Update(&(c->SHA1), data, len); + break; + case DIGEST_SHA256: + SHA256_Update(&(c->SHA256), data, len); + break; + case DIGEST_SHA512: + SHA512_Update(&(c->SHA512), data, len); + break; + } +} + +static char * +digest_end(DIGEST_CTX *c, char *buf) +{ + + switch (digesttype) { + case DIGEST_MD5: + return (MD5End(&(c->MD5), buf)); + case DIGEST_RIPEMD160: + return (RIPEMD160_End(&(c->RIPEMD160), buf)); + case DIGEST_SHA1: + return (SHA1_End(&(c->SHA1), buf)); + case DIGEST_SHA256: + return (SHA256_End(&(c->SHA256), buf)); + case DIGEST_SHA512: + return (SHA512_End(&(c->SHA512), buf)); + default: + return (NULL); + } +} + /* * parseid -- * parse uid or gid from arg into id, returning non-zero if successful @@ -269,6 +478,224 @@ parseid(const char *name, id_t *id) } /* + * quiet_mktemp -- + * mktemp implementation used mkstemp to avoid mktemp warnings. We + * really do need mktemp semantics here as we will be creating a link. + */ +static char * +quiet_mktemp(char *template) +{ + int fd; + + if ((fd = mkstemp(template)) == -1) + return (NULL); + close (fd); + if (unlink(template) == -1) + err(EX_OSERR, "unlink %s", template); + return (template); +} + +/* + * do_link -- + * make a hard link, obeying dorename if set + * return -1 on failure + */ +static int +do_link(const char *from_name, const char *to_name, + const struct stat *target_sb) +{ + char tmpl[MAXPATHLEN]; + int ret; + + if (safecopy && target_sb != NULL) { + (void)snprintf(tmpl, sizeof(tmpl), "%s.inst.XXXXXX", to_name); + /* This usage is safe. */ + if (quiet_mktemp(tmpl) == NULL) + err(EX_OSERR, "%s: mktemp", tmpl); + ret = link(from_name, tmpl); + if (ret == 0) { + if (target_sb->st_mode & S_IFDIR && rmdir(to_name) == + -1) { + unlink(tmpl); + err(EX_OSERR, "%s", to_name); + } + if (target_sb->st_flags & NOCHANGEBITS) + (void)chflags(to_name, target_sb->st_flags & + ~NOCHANGEBITS); + unlink(to_name); + ret = rename(tmpl, to_name); + /* + * If rename has posix semantics, then the temporary + * file may still exist when from_name and to_name point + * to the same file, so unlink it unconditionally. + */ + (void)unlink(tmpl); + } + return (ret); + } else + return (link(from_name, to_name)); +} + +/* + * do_symlink -- + * Make a symbolic link, obeying dorename if set. Exit on failure. + */ +static void +do_symlink(const char *from_name, const char *to_name, + const struct stat *target_sb) +{ + char tmpl[MAXPATHLEN]; + + if (safecopy && target_sb != NULL) { + (void)snprintf(tmpl, sizeof(tmpl), "%s.inst.XXXXXX", to_name); + /* This usage is safe. */ + if (quiet_mktemp(tmpl) == NULL) + err(EX_OSERR, "%s: mktemp", tmpl); + + if (symlink(from_name, tmpl) == -1) + err(EX_OSERR, "symlink %s -> %s", from_name, tmpl); + + if (target_sb->st_mode & S_IFDIR && rmdir(to_name) == -1) { + (void)unlink(tmpl); + err(EX_OSERR, "%s", to_name); + } + if (target_sb->st_flags & NOCHANGEBITS) + (void)chflags(to_name, target_sb->st_flags & + ~NOCHANGEBITS); + unlink(to_name); + + if (rename(tmpl, to_name) == -1) { + /* Remove temporary link before exiting. */ + (void)unlink(tmpl); + err(EX_OSERR, "%s: rename", to_name); + } + } else { + if (symlink(from_name, to_name) == -1) + err(EX_OSERR, "symlink %s -> %s", from_name, to_name); + } +} + +/* + * makelink -- + * make a link from source to destination + */ +static void +makelink(const char *from_name, const char *to_name, + const struct stat *target_sb) +{ + char src[MAXPATHLEN], dst[MAXPATHLEN], lnk[MAXPATHLEN]; + struct stat to_sb; + + /* Try hard links first. */ + if (dolink & (LN_HARD|LN_MIXED)) { + if (do_link(from_name, to_name, target_sb) == -1) { + if ((dolink & LN_HARD) || errno != EXDEV) + err(EX_OSERR, "link %s -> %s", from_name, to_name); + } else { + if (stat(to_name, &to_sb)) + err(EX_OSERR, "%s: stat", to_name); + if (S_ISREG(to_sb.st_mode)) { + /* + * XXX: hard links to anything other than + * plain files are not metalogged + */ + int omode; + const char *oowner, *ogroup; + char *offlags; + char *dres; + + /* + * XXX: use underlying perms, unless + * overridden on command line. + */ + omode = mode; + if (!haveopt_m) + mode = (to_sb.st_mode & 0777); + oowner = owner; + if (!haveopt_o) + owner = NULL; + ogroup = group; + if (!haveopt_g) + group = NULL; + offlags = fflags; + if (!haveopt_f) + fflags = NULL; + dres = digest_file(from_name); + metadata_log(to_name, "file", NULL, NULL, + dres, to_sb.st_size); + free(dres); + mode = omode; + owner = oowner; + group = ogroup; + fflags = offlags; + } + return; + } + } + + /* Symbolic links. */ + if (dolink & LN_ABSOLUTE) { + /* Convert source path to absolute. */ + if (realpath(from_name, src) == NULL) + err(EX_OSERR, "%s: realpath", from_name); + do_symlink(src, to_name, target_sb); + /* XXX: src may point outside of destdir */ + metadata_log(to_name, "link", NULL, src, NULL, 0); + return; + } + + if (dolink & LN_RELATIVE) { + char *cp, *d, *s; + + /* Resolve pathnames. */ + if (realpath(from_name, src) == NULL) + err(EX_OSERR, "%s: realpath", from_name); + + /* + * The last component of to_name may be a symlink, + * so use realpath to resolve only the directory. + */ + cp = dirname(to_name); + if (realpath(cp, dst) == NULL) + err(EX_OSERR, "%s: realpath", cp); + /* .. and add the last component. */ + if (strcmp(dst, "/") != 0) { + if (strlcat(dst, "/", sizeof(dst)) > sizeof(dst)) + errx(1, "resolved pathname too long"); + } + cp = basename(to_name); + if (strlcat(dst, cp, sizeof(dst)) > sizeof(dst)) + errx(1, "resolved pathname too long"); + + /* Trim common path components. */ + for (s = src, d = dst; *s == *d; s++, d++) + continue; + while (*s != '/') + s--, d--; + + /* Count the number of directories we need to backtrack. */ + for (++d, lnk[0] = '\0'; *d; d++) + if (*d == '/') + (void)strlcat(lnk, "../", sizeof(lnk)); + + (void)strlcat(lnk, ++s, sizeof(lnk)); + + do_symlink(lnk, to_name, target_sb); + /* XXX: Link may point outside of destdir. */ + metadata_log(to_name, "link", NULL, lnk, NULL, 0); + return; + } + + /* + * If absolute or relative was not specified, try the names the + * user provided. + */ + do_symlink(from_name, to_name, target_sb); + /* XXX: from_name may point outside of destdir. */ + metadata_log(to_name, "link", NULL, from_name, NULL, 0); +} + +/* * install -- * build a path name and install the file */ @@ -280,6 +707,7 @@ install(const char *from_name, const cha int devnull, files_match, from_fd, serrno, target; int tempcopy, temp_fd, to_fd; char backup[MAXPATHLEN], *p, pathbuf[MAXPATHLEN], tempfile[MAXPATHLEN]; + char *digestresult; files_match = 0; from_fd = -1; @@ -287,11 +715,13 @@ install(const char *from_name, const cha /* If try to install NULL file to a directory, fails. */ if (flags & DIRECTORY || strcmp(from_name, _PATH_DEVNULL)) { - if (stat(from_name, &from_sb)) - err(EX_OSERR, "%s", from_name); - if (!S_ISREG(from_sb.st_mode)) { - errno = EFTYPE; - err(EX_OSERR, "%s", from_name); + if (!dolink) { + if (stat(from_name, &from_sb)) + err(EX_OSERR, "%s", from_name); + if (!S_ISREG(from_sb.st_mode)) { + errno = EFTYPE; + err(EX_OSERR, "%s", from_name); + } } /* Build the target path. */ if (flags & DIRECTORY) { @@ -305,7 +735,23 @@ install(const char *from_name, const cha devnull = 1; } - target = stat(to_name, &to_sb) == 0; + if (!dolink) + target = (stat(to_name, &to_sb) == 0); + else + target = (lstat(to_name, &to_sb) == 0); + + if (dolink) { + if (target && !safecopy) { + if (to_sb.st_mode & S_IFDIR && rmdir(to_name) == -1) + err(EX_OSERR, "%s", to_name); + if (to_sb.st_flags & NOCHANGEBITS) + (void)chflags(to_name, + to_sb.st_flags & ~NOCHANGEBITS); + unlink(to_name); + } + makelink(from_name, to_name, target ? &to_sb : NULL); + return; + } /* Only install to regular files. */ if (target && !S_ISREG(to_sb.st_mode)) { @@ -329,7 +775,7 @@ install(const char *from_name, const cha else files_match = !(compare(from_fd, from_name, (size_t)from_sb.st_size, to_fd, - to_name, (size_t)to_sb.st_size)); + to_name, (size_t)to_sb.st_size, &digestresult)); /* Close "to" file unless we match. */ if (!files_match) @@ -351,8 +797,10 @@ install(const char *from_name, const cha from_name, to_name); } if (!devnull) - copy(from_fd, from_name, to_fd, + digestresult = copy(from_fd, from_name, to_fd, tempcopy ? tempfile : to_name, from_sb.st_size); + else + digestresult = NULL; } if (dostrip) { @@ -386,7 +834,8 @@ install(const char *from_name, const cha } if (compare(temp_fd, tempfile, (size_t)temp_sb.st_size, to_fd, - to_name, (size_t)to_sb.st_size) == 0) { + to_name, (size_t)to_sb.st_size, &digestresult) + == 0) { /* * If target has more than one link we need to * replace it in order to snap the extra links. @@ -406,6 +855,9 @@ install(const char *from_name, const cha } } + if (dostrip && (!docompare || !target)) + digestresult = digest_file(tempfile); + /* * Move the new file into place if doing a safe copy * and the files are different (or just not compared). @@ -469,15 +921,16 @@ install(const char *from_name, const cha * Set owner, group, mode for target; do the chown first, * chown may lose the setuid bits. */ - if ((gid != (gid_t)-1 && gid != to_sb.st_gid) || + if (!dounpriv && ((gid != (gid_t)-1 && gid != to_sb.st_gid) || (uid != (uid_t)-1 && uid != to_sb.st_uid) || - (mode != (to_sb.st_mode & ALLPERMS))) { + (mode != (to_sb.st_mode & ALLPERMS)))) { /* Try to turn off the immutable bits. */ if (to_sb.st_flags & NOCHANGEBITS) (void)fchflags(to_fd, to_sb.st_flags & ~NOCHANGEBITS); } - if ((gid != (gid_t)-1 && gid != to_sb.st_gid) || + if (!dounpriv & + (gid != (gid_t)-1 && gid != to_sb.st_gid) || (uid != (uid_t)-1 && uid != to_sb.st_uid)) if (fchown(to_fd, uid, gid) == -1) { serrno = errno; @@ -486,13 +939,16 @@ install(const char *from_name, const cha err(EX_OSERR,"%s: chown/chgrp", to_name); } - if (mode != (to_sb.st_mode & ALLPERMS)) + if (mode != (to_sb.st_mode & ALLPERMS)) { + if (dounpriv) + mode &= S_IRWXU|S_IRWXG|S_IRWXO; if (fchmod(to_fd, mode)) { serrno = errno; (void)unlink(to_name); errno = serrno; err(EX_OSERR, "%s: chmod", to_name); } + } /* * If provided a set of flags, set them, otherwise, preserve the @@ -501,7 +957,7 @@ install(const char *from_name, const cha * trying to turn off UF_NODUMP. If we're trying to set real flags, * then warn if the fs doesn't support it, otherwise fail. */ - if (!devnull && (flags & SETFLAGS || + if (!dounpriv & !devnull && (flags & SETFLAGS || (from_sb.st_flags & ~UF_NODUMP) != to_sb.st_flags) && fchflags(to_fd, flags & SETFLAGS ? fset : from_sb.st_flags & ~UF_NODUMP)) { @@ -520,6 +976,9 @@ install(const char *from_name, const cha (void)close(to_fd); if (!devnull) (void)close(from_fd); + + metadata_log(to_name, "file", tvb, NULL, digestresult, to_sb.st_size); + free(digestresult); } /* @@ -528,29 +987,37 @@ install(const char *from_name, const cha */ static int compare(int from_fd, const char *from_name __unused, size_t from_len, - int to_fd, const char *to_name __unused, size_t to_len) + int to_fd, const char *to_name __unused, size_t to_len, + char **dresp) { char *p, *q; int rv; int done_compare; + DIGEST_CTX ctx; rv = 0; if (from_len != to_len) return 1; if (from_len <= MAX_CMP_SIZE) { + if (dresp != NULL) + digest_init(&ctx); done_compare = 0; if (trymmap(from_fd) && trymmap(to_fd)) { - p = mmap(NULL, from_len, PROT_READ, MAP_SHARED, from_fd, (off_t)0); + p = mmap(NULL, from_len, PROT_READ, MAP_SHARED, + from_fd, (off_t)0); if (p == (char *)MAP_FAILED) goto out; - q = mmap(NULL, from_len, PROT_READ, MAP_SHARED, to_fd, (off_t)0); + q = mmap(NULL, from_len, PROT_READ, MAP_SHARED, + to_fd, (off_t)0); if (q == (char *)MAP_FAILED) { munmap(p, from_len); goto out; } rv = memcmp(p, q, from_len); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Jan 18 22:17:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6EC4897D; Fri, 18 Jan 2013 22:17:22 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 62494A87; Fri, 18 Jan 2013 22:17:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0IMHMke064008; Fri, 18 Jan 2013 22:17:22 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0IMHMsw064007; Fri, 18 Jan 2013 22:17:22 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301182217.r0IMHMsw064007@svn.freebsd.org> From: Brooks Davis Date: Fri, 18 Jan 2013 22:17:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245622 - 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.14 Precedence: list List-Id: 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, 18 Jan 2013 22:17:22 -0000 Author: brooks Date: Fri Jan 18 22:17:21 2013 New Revision: 245622 URL: http://svnweb.freebsd.org/changeset/base/245622 Log: Remove a harmless (somewhat to my surprise) bogon that crept into r245440. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Jan 18 22:11:17 2013 (r245621) +++ head/Makefile.inc1 Fri Jan 18 22:17:21 2013 (r245622) @@ -704,7 +704,6 @@ distributeworld installworld: installche done); \ cp $$libs $$progs ${INSTALLTMP} cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale - rm -f ${METALOG} .if make(distributeworld) .for dist in ${EXTRA_DISTRIBUTIONS} -mkdir ${DESTDIR}/${DISTDIR}/${dist} From owner-svn-src-head@FreeBSD.ORG Fri Jan 18 22:30:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E7CE5D62; Fri, 18 Jan 2013 22:30:09 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtp3.clear.net.nz (smtp3.clear.net.nz [203.97.33.64]) by mx1.freebsd.org (Postfix) with ESMTP id AB8B9ADF; Fri, 18 Jan 2013 22:30:09 +0000 (UTC) Received: from mxin2-orange.clear.net.nz (lb2-srcnat.clear.net.nz [203.97.32.237]) by smtp3.clear.net.nz (CLEAR Net Mail) with ESMTP id <0MGU00K40EHXTI10@smtp3.clear.net.nz>; Sat, 19 Jan 2013 11:30:01 +1300 (NZDT) Received: from 202-0-48-19.paradise.net.nz (HELO localhost) ([202.0.48.19]) by smtpin2.paradise.net.nz with ESMTP; Sat, 19 Jan 2013 11:30:00 +1300 Date: Sat, 19 Jan 2013 11:29:53 +1300 From: Andrew Turner Subject: Re: svn commit: r245610 - head/bin/ps In-reply-to: <201301181824.r0IIOfxd094865@svn.freebsd.org> To: John Baldwin Message-id: <20130119112953.7a9aa66e@fubar.geek.nz> MIME-version: 1.0 X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; i386-portbld-freebsd8.1) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Pirate: Arrrr References: <201301181824.r0IIOfxd094865@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 18 Jan 2013 22:30:10 -0000 On Fri, 18 Jan 2013 18:24:41 +0000 (UTC) John Baldwin wrote: > Author: jhb > Date: Fri Jan 18 18:24:40 2013 > New Revision: 245610 > URL: http://svnweb.freebsd.org/changeset/base/245610 > > Log: > Include the thread name along with the command name when displaying > the command name of a thread from a multi-threaded process that > doesn't have an available argument list (such as kernel processes) > and threads display is enabled via -H. > > Reviewed by: alfred, delphij, eric@vangyzen.net > MFC after: 1 week This breaks usr.bin/w as it includes bin/ps/fmt.c in it's build but doesn't have the showthreads variable defined. Andrew From owner-svn-src-head@FreeBSD.ORG Fri Jan 18 22:53:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 55902935; Fri, 18 Jan 2013 22:53:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 43231BFF; Fri, 18 Jan 2013 22:53:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0IMr1cZ075115; Fri, 18 Jan 2013 22:53:01 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0IMqxLT075099; Fri, 18 Jan 2013 22:52:59 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201301182252.r0IMqxLT075099@svn.freebsd.org> From: Andrew Turner Date: Fri, 18 Jan 2013 22:52:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245628 - in head/contrib/compiler-rt: . lib lib/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 18 Jan 2013 22:53:01 -0000 Author: andrew Date: Fri Jan 18 22:52:59 2013 New Revision: 245628 URL: http://svnweb.freebsd.org/changeset/base/245628 Log: Import compiler-rt r172839. This brings in __aeabi_lcmp and __aeabi_ulcmp. It also fixes the spelling of __aeabi_f2lz. Both changes originated on the arm_eabi project branch. Modified: head/contrib/compiler-rt/LICENSE.TXT head/contrib/compiler-rt/lib/arm/divsi3.S head/contrib/compiler-rt/lib/arm/udivsi3.S head/contrib/compiler-rt/lib/cmpdi2.c head/contrib/compiler-rt/lib/fixsfdi.c head/contrib/compiler-rt/lib/int_endianness.h head/contrib/compiler-rt/lib/ucmpdi2.c Directory Properties: head/contrib/compiler-rt/ (props changed) Modified: head/contrib/compiler-rt/LICENSE.TXT ============================================================================== --- head/contrib/compiler-rt/LICENSE.TXT Fri Jan 18 22:50:29 2013 (r245627) +++ head/contrib/compiler-rt/LICENSE.TXT Fri Jan 18 22:52:59 2013 (r245628) @@ -14,7 +14,7 @@ Full text of the relevant licenses is in University of Illinois/NCSA Open Source License -Copyright (c) 2009-2012 by the contributors listed in CREDITS.TXT +Copyright (c) 2009-2013 by the contributors listed in CREDITS.TXT All rights reserved. @@ -55,7 +55,7 @@ SOFTWARE. ============================================================================== -Copyright (c) 2009-2012 by the contributors listed in CREDITS.TXT +Copyright (c) 2009-2013 by the contributors listed in CREDITS.TXT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal Modified: head/contrib/compiler-rt/lib/arm/divsi3.S ============================================================================== --- head/contrib/compiler-rt/lib/arm/divsi3.S Fri Jan 18 22:50:29 2013 (r245627) +++ head/contrib/compiler-rt/lib/arm/divsi3.S Fri Jan 18 22:52:59 2013 (r245628) @@ -25,7 +25,16 @@ // Ok, APCS and AAPCS agree on 32 bit args, so it's safe to use the same routine. DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_idiv, __divsi3) DEFINE_COMPILERRT_FUNCTION(__divsi3) - ESTABLISH_FRAME +#if __ARM_ARCH_7S__ + tst r1,r1 + beq LOCAL_LABEL(divzero) + sdiv r0, r0, r1 + bx lr +LOCAL_LABEL(divzero): + mov r0,#0 + bx lr +#else +ESTABLISH_FRAME // Set aside the sign of the quotient. eor r4, r0, r1 // Take absolute value of a and b via abs(x) = (x^(x >> 31)) - (x >> 31). @@ -39,3 +48,4 @@ DEFINE_COMPILERRT_FUNCTION(__divsi3) eor r0, r0, r4, asr #31 sub r0, r0, r4, asr #31 CLEAR_FRAME_AND_RETURN +#endif Modified: head/contrib/compiler-rt/lib/arm/udivsi3.S ============================================================================== --- head/contrib/compiler-rt/lib/arm/udivsi3.S Fri Jan 18 22:50:29 2013 (r245627) +++ head/contrib/compiler-rt/lib/arm/udivsi3.S Fri Jan 18 22:52:59 2013 (r245628) @@ -33,6 +33,15 @@ // Ok, APCS and AAPCS agree on 32 bit args, so it's safe to use the same routine. DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_uidiv, __udivsi3) DEFINE_COMPILERRT_FUNCTION(__udivsi3) +#if __ARM_ARCH_7S__ + tst r1,r1 + beq LOCAL_LABEL(divzero) + udiv r0, r0, r1 + bx lr + LOCAL_LABEL(divzero): + mov r0,#0 + bx lr +#else // We use a simple digit by digit algorithm; before we get into the actual // divide loop, we must calculate the left-shift amount necessary to align // the MSB of the divisor with that of the dividend (If this shift is @@ -78,3 +87,4 @@ LOCAL_LABEL(return): // Move the quotient to r0 and return. mov r0, q CLEAR_FRAME_AND_RETURN +#endif Modified: head/contrib/compiler-rt/lib/cmpdi2.c ============================================================================== --- head/contrib/compiler-rt/lib/cmpdi2.c Fri Jan 18 22:50:29 2013 (r245627) +++ head/contrib/compiler-rt/lib/cmpdi2.c Fri Jan 18 22:52:59 2013 (r245628) @@ -36,3 +36,16 @@ __cmpdi2(di_int a, di_int b) return 2; return 1; } + +#ifdef __ARM_EABI__ +/* Returns: if (a < b) returns -1 +* if (a == b) returns 0 +* if (a > b) returns 1 +*/ +COMPILER_RT_ABI si_int +__aeabi_lcmp(di_int a, di_int b) +{ + return __cmpdi2(a, b) - 1; +} +#endif + Modified: head/contrib/compiler-rt/lib/fixsfdi.c ============================================================================== --- head/contrib/compiler-rt/lib/fixsfdi.c Fri Jan 18 22:50:29 2013 (r245627) +++ head/contrib/compiler-rt/lib/fixsfdi.c Fri Jan 18 22:52:59 2013 (r245628) @@ -23,7 +23,7 @@ /* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */ -ARM_EABI_FNALIAS(d2lz, fixsfdi) +ARM_EABI_FNALIAS(f2lz, fixsfdi) COMPILER_RT_ABI di_int __fixsfdi(float a) Modified: head/contrib/compiler-rt/lib/int_endianness.h ============================================================================== --- head/contrib/compiler-rt/lib/int_endianness.h Fri Jan 18 22:50:29 2013 (r245627) +++ head/contrib/compiler-rt/lib/int_endianness.h Fri Jan 18 22:52:59 2013 (r245628) @@ -31,7 +31,7 @@ /* .. */ -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__minix) +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__minix) #include #if _BYTE_ORDER == _BIG_ENDIAN @@ -44,6 +44,19 @@ #endif /* *BSD */ +#if defined(__OpenBSD__) || defined(__Bitrig__) +#include + +#if _BYTE_ORDER == _BIG_ENDIAN +#define _YUGA_LITTLE_ENDIAN 0 +#define _YUGA_BIG_ENDIAN 1 +#elif _BYTE_ORDER == _LITTLE_ENDIAN +#define _YUGA_LITTLE_ENDIAN 1 +#define _YUGA_BIG_ENDIAN 0 +#endif /* _BYTE_ORDER */ + +#endif /* OpenBSD and Bitrig. */ + /* .. */ /* Mac OSX has __BIG_ENDIAN__ or __LITTLE_ENDIAN__ automatically set by the compiler (at least with GCC) */ Modified: head/contrib/compiler-rt/lib/ucmpdi2.c ============================================================================== --- head/contrib/compiler-rt/lib/ucmpdi2.c Fri Jan 18 22:50:29 2013 (r245627) +++ head/contrib/compiler-rt/lib/ucmpdi2.c Fri Jan 18 22:52:59 2013 (r245628) @@ -36,3 +36,16 @@ __ucmpdi2(du_int a, du_int b) return 2; return 1; } + +#ifdef __ARM_EABI__ +/* Returns: if (a < b) returns -1 +* if (a == b) returns 0 +* if (a > b) returns 1 +*/ +COMPILER_RT_ABI si_int +__aeabi_ulcmp(di_int a, di_int b) +{ + return __ucmpdi2(a, b) - 1; +} +#endif + From owner-svn-src-head@FreeBSD.ORG Fri Jan 18 23:08:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 682AFE71; Fri, 18 Jan 2013 23:08:41 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 50D3ECFA; Fri, 18 Jan 2013 23:08:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0IN8fmu079364; Fri, 18 Jan 2013 23:08:41 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0IN8fFo079362; Fri, 18 Jan 2013 23:08:41 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201301182308.r0IN8fFo079362@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 18 Jan 2013 23:08:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245630 - 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.14 Precedence: list List-Id: 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, 18 Jan 2013 23:08:41 -0000 Author: jilles Date: Fri Jan 18 23:08:40 2013 New Revision: 245630 URL: http://svnweb.freebsd.org/changeset/base/245630 Log: libthr: Always use the threaded rtld lock implementation. The threaded rtld lock implementation is faster even in the single-threaded case because it postpones signal handlers via THR_CRITICAL_ENTER and THR_CRITICAL_LEAVE instead of calling sigprocmask(2). As a result, exception handling becomes faster in single-threaded applications linked with libthr. Reviewed by: kib Modified: head/lib/libthr/thread/thr_init.c head/lib/libthr/thread/thr_kern.c Modified: head/lib/libthr/thread/thr_init.c ============================================================================== --- head/lib/libthr/thread/thr_init.c Fri Jan 18 23:04:05 2013 (r245629) +++ head/lib/libthr/thread/thr_init.c Fri Jan 18 23:08:40 2013 (r245630) @@ -363,6 +363,12 @@ _libpthread_init(struct pthread *curthre _thr_signal_init(); if (_thread_event_mask & TD_CREATE) _thr_report_creation(curthread, curthread); + /* + * Always use our rtld lock implementation. + * It is faster because it postpones signal handlers + * instead of calling sigprocmask(2). + */ + _thr_rtld_init(); } } Modified: head/lib/libthr/thread/thr_kern.c ============================================================================== --- head/lib/libthr/thread/thr_kern.c Fri Jan 18 23:04:05 2013 (r245629) +++ head/lib/libthr/thread/thr_kern.c Fri Jan 18 23:08:40 2013 (r245630) @@ -57,11 +57,6 @@ _thr_setthreaded(int threaded) return (0); __isthreaded = threaded; - if (threaded != 0) { - _thr_rtld_init(); - } else { - _thr_rtld_fini(); - } return (0); } From owner-svn-src-head@FreeBSD.ORG Fri Jan 18 23:54:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B167ABA5; Fri, 18 Jan 2013 23:54:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 98934E90; Fri, 18 Jan 2013 23:54:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0INsRlM093702; Fri, 18 Jan 2013 23:54:27 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0INsRAj093701; Fri, 18 Jan 2013 23:54:27 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201301182354.r0INsRAj093701@svn.freebsd.org> From: Xin LI Date: Fri, 18 Jan 2013 23:54:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245633 - head/usr.bin/w X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 18 Jan 2013 23:54:27 -0000 Author: delphij Date: Fri Jan 18 23:54:27 2013 New Revision: 245633 URL: http://svnweb.freebsd.org/changeset/base/245633 Log: Set showthread = 0 for w(1). X-MFC: together with r245610 Modified: head/usr.bin/w/w.c Modified: head/usr.bin/w/w.c ============================================================================== --- head/usr.bin/w/w.c Fri Jan 18 23:24:00 2013 (r245632) +++ head/usr.bin/w/w.c Fri Jan 18 23:54:27 2013 (r245633) @@ -96,6 +96,7 @@ static int nflag; /* true if -n flag: d static int dflag; /* true if -d flag: output debug info */ static int sortidle; /* sort by idle time */ int use_ampm; /* use AM/PM time */ +int showthreads = 0;/* will threads be shown? */ static int use_comma; /* use comma as floats separator */ static char **sel_users; /* login array of particular users selected */ From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 00:05:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 01918F6F; Sat, 19 Jan 2013 00:05:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id D29A4EF5; Sat, 19 Jan 2013 00:05:25 +0000 (UTC) Received: from John-Baldwins-MacBook-Air.local (c-68-39-198-164.hsd1.de.comcast.net [68.39.198.164]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1229CB94C; Fri, 18 Jan 2013 19:05:25 -0500 (EST) Message-ID: <50F9E354.1070709@FreeBSD.org> Date: Fri, 18 Jan 2013 19:05:40 -0500 From: John Baldwin User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Andrew Turner Subject: Re: svn commit: r245610 - head/bin/ps References: <201301181824.r0IIOfxd094865@svn.freebsd.org> <20130119112953.7a9aa66e@fubar.geek.nz> In-Reply-To: <20130119112953.7a9aa66e@fubar.geek.nz> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 18 Jan 2013 19:05:25 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 19 Jan 2013 00:05:26 -0000 On 1/18/13 5:29 PM, Andrew Turner wrote: > On Fri, 18 Jan 2013 18:24:41 +0000 (UTC) > John Baldwin wrote: > >> Author: jhb >> Date: Fri Jan 18 18:24:40 2013 >> New Revision: 245610 >> URL: http://svnweb.freebsd.org/changeset/base/245610 >> >> Log: >> Include the thread name along with the command name when displaying >> the command name of a thread from a multi-threaded process that >> doesn't have an available argument list (such as kernel processes) >> and threads display is enabled via -H. >> >> Reviewed by: alfred, delphij, eric@vangyzen.net >> MFC after: 1 week > > This breaks usr.bin/w as it includes bin/ps/fmt.c in it's build but > doesn't have the showthreads variable defined. Ugh. It requires a bit more fixing than that even since w uses fmt_argv() directly (and it had a stale prototype to boot). I have a fix to get both ps and w to build but am waiting for a full world to finish first in case some other place (ab)uses this. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 00:07:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9ADF6170; Sat, 19 Jan 2013 00:07:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 5928BF04; Sat, 19 Jan 2013 00:07:01 +0000 (UTC) Received: from John-Baldwins-MacBook-Air.local (c-68-39-198-164.hsd1.de.comcast.net [68.39.198.164]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A9FD2B94C; Fri, 18 Jan 2013 19:07:00 -0500 (EST) Message-ID: <50F9E3B4.2090408@FreeBSD.org> Date: Fri, 18 Jan 2013 19:07:16 -0500 From: John Baldwin User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Xin LI Subject: Re: svn commit: r245633 - head/usr.bin/w References: <201301182354.r0INsRAj093701@svn.freebsd.org> In-Reply-To: <201301182354.r0INsRAj093701@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 18 Jan 2013 19:07:00 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 19 Jan 2013 00:07:01 -0000 On 1/18/13 6:54 PM, Xin LI wrote: > Author: delphij > Date: Fri Jan 18 23:54:27 2013 > New Revision: 245633 > URL: http://svnweb.freebsd.org/changeset/base/245633 > > Log: > Set showthread = 0 for w(1). > > X-MFC: together with r245610 Please no, this is not the correct fix. Note that w is now using the wrong function signature for fmt_argv() entirely. I will revert this with the correct fix. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 00:21:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3B6AF897; Sat, 19 Jan 2013 00:21:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F1EFEF93; Sat, 19 Jan 2013 00:21:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0J0Lt3a002675; Sat, 19 Jan 2013 00:21:55 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0J0Lt4j002672; Sat, 19 Jan 2013 00:21:55 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201301190021.r0J0Lt4j002672@svn.freebsd.org> From: John Baldwin Date: Sat, 19 Jan 2013 00:21:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245635 - in head: bin/ps usr.bin/w X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 19 Jan 2013 00:21:56 -0000 Author: jhb Date: Sat Jan 19 00:21:55 2013 New Revision: 245635 URL: http://svnweb.freebsd.org/changeset/base/245635 Log: - Move 'showthreads' check out of fmt.c. - Update shadow copy of fmt_argv() prototype in w.c and fix calls for additional parameter. Modified: head/bin/ps/fmt.c head/bin/ps/ps.c head/usr.bin/w/w.c Modified: head/bin/ps/fmt.c ============================================================================== --- head/bin/ps/fmt.c Fri Jan 18 23:59:22 2013 (r245634) +++ head/bin/ps/fmt.c Sat Jan 19 00:21:55 2013 (r245635) @@ -123,7 +123,7 @@ fmt_argv(char **argv, char *cmd, char *t if (cp == NULL) errx(1, "malloc failed"); if (ap == NULL) { - if (showthreads && thread != NULL) { + if (thread != NULL) { asprintf(&ap, "%s/%s", cmd, thread); sprintf(cp, "[%.*s]", (int)maxlen, ap); free(ap); Modified: head/bin/ps/ps.c ============================================================================== --- head/bin/ps/ps.c Fri Jan 18 23:59:22 2013 (r245634) +++ head/bin/ps/ps.c Sat Jan 19 00:21:55 2013 (r245635) @@ -1168,7 +1168,7 @@ fmt(char **(*fn)(kvm_t *, const struct k const char *s; s = fmt_argv((*fn)(kd, ki->ki_p, termwidth), comm, - ki->ki_p->ki_numthreads > 1 ? thread : NULL, maxlen); + showthreads && ki->ki_p->ki_numthreads > 1 ? thread : NULL, maxlen); return (s); } Modified: head/usr.bin/w/w.c ============================================================================== --- head/usr.bin/w/w.c Fri Jan 18 23:59:22 2013 (r245634) +++ head/usr.bin/w/w.c Sat Jan 19 00:21:55 2013 (r245635) @@ -96,7 +96,6 @@ static int nflag; /* true if -n flag: d static int dflag; /* true if -d flag: output debug info */ static int sortidle; /* sort by idle time */ int use_ampm; /* use AM/PM time */ -int showthreads = 0;/* will threads be shown? */ static int use_comma; /* use comma as floats separator */ static char **sel_users; /* login array of particular users selected */ @@ -124,7 +123,7 @@ static struct stat *ttystat(char *); static void usage(int); static int this_is_uptime(const char *s); -char *fmt_argv(char **, char *, int); /* ../../bin/ps/fmt.c */ +char *fmt_argv(char **, char *, char *, size_t); /* ../../bin/ps/fmt.c */ int main(int argc, char *argv[]) @@ -321,7 +320,7 @@ main(int argc, char *argv[]) continue; } ep->args = fmt_argv(kvm_getargv(kd, ep->kp, argwidth), - ep->kp->ki_comm, MAXCOMLEN); + ep->kp->ki_comm, NULL, MAXCOMLEN); if (ep->args == NULL) err(1, NULL); } @@ -405,7 +404,7 @@ main(int argc, char *argv[]) const char *ptr; ptr = fmt_argv(kvm_getargv(kd, dkp, argwidth), - dkp->ki_comm, MAXCOMLEN); + dkp->ki_comm, NULL, MAXCOMLEN); if (ptr == NULL) ptr = "-"; (void)printf("\t\t%-9d %s\n", From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 00:37:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4D951CA4; Sat, 19 Jan 2013 00:37:18 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3F16781; Sat, 19 Jan 2013 00:37:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0J0bIRo006496; Sat, 19 Jan 2013 00:37:18 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0J0bI5u006495; Sat, 19 Jan 2013 00:37:18 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201301190037.r0J0bI5u006495@svn.freebsd.org> From: Jung-uk Kim Date: Sat, 19 Jan 2013 00:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245636 - head/sys/contrib/dev/acpica/components/disassembler X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 19 Jan 2013 00:37:18 -0000 Author: jkim Date: Sat Jan 19 00:37:17 2013 New Revision: 245636 URL: http://svnweb.freebsd.org/changeset/base/245636 Log: Work around build breakage with GCC 4.2. Modified: head/sys/contrib/dev/acpica/components/disassembler/dmresrc.c Modified: head/sys/contrib/dev/acpica/components/disassembler/dmresrc.c ============================================================================== --- head/sys/contrib/dev/acpica/components/disassembler/dmresrc.c Sat Jan 19 00:21:55 2013 (r245635) +++ head/sys/contrib/dev/acpica/components/disassembler/dmresrc.c Sat Jan 19 00:37:17 2013 (r245636) @@ -416,7 +416,7 @@ AcpiDmIsResourceTemplate ( /* Walk the byte list, abort on any invalid descriptor type or length */ Status = AcpiUtWalkAmlResources (WalkState, Aml, Length, - NULL, (void **) &EndAml); + NULL, ACPI_CAST_INDIRECT_PTR (void, &EndAml)); if (ACPI_FAILURE (Status)) { return (AE_TYPE); From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 00:50:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 04BCE25A; Sat, 19 Jan 2013 00:50:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EB7E3FB; Sat, 19 Jan 2013 00:50:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0J0oDjg009840; Sat, 19 Jan 2013 00:50:13 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0J0oDmG009837; Sat, 19 Jan 2013 00:50:13 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201301190050.r0J0oDmG009837@svn.freebsd.org> From: Ian Lepore Date: Sat, 19 Jan 2013 00:50:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245637 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 19 Jan 2013 00:50:14 -0000 Author: ian Date: Sat Jan 19 00:50:12 2013 New Revision: 245637 URL: http://svnweb.freebsd.org/changeset/base/245637 Log: Eliminate the need for an intermediate array of indices into the arrays of interrupt counts and names, by making the names into an array of fixed-length strings that can be directly indexed. This eliminates extra memory accesses on every interrupt to increment the counts. As a side effect, it also fixes a bug that would corrupt the names data if a name was longer than MAXCOMLEN, which led to incorrect vmstat -i output. Approved by: cognet (mentor) Modified: head/sys/arm/arm/intr.c head/sys/arm/arm/machdep.c head/sys/arm/include/intr.h Modified: head/sys/arm/arm/intr.c ============================================================================== --- head/sys/arm/arm/intr.c Sat Jan 19 00:37:17 2013 (r245636) +++ head/sys/arm/arm/intr.c Sat Jan 19 00:50:12 2013 (r245637) @@ -50,23 +50,40 @@ __FBSDID("$FreeBSD$"); #include #include +#define INTRNAME_LEN (MAXCOMLEN + 1) + typedef void (*mask_fn)(void *); static struct intr_event *intr_events[NIRQ]; -static int intrcnt_tab[NIRQ]; -static int intrcnt_index = 0; -static int last_printed = 0; void arm_handler_execute(struct trapframe *, int); void (*arm_post_filter)(void *) = NULL; +/* + * Pre-format intrnames into an array of fixed-size strings containing spaces. + * This allows us to avoid the need for an intermediate table of indices into + * the names and counts arrays, while still meeting the requirements and + * assumptions of vmstat(8) and the kdb "show intrcnt" command, the two + * consumers of this data. + */ +void +arm_intrnames_init() +{ + int i; + + memset(intrnames, ' ', NIRQ * INTRNAME_LEN); + for (i = 0; i < NIRQ; ++i) + intrnames[i * INTRNAME_LEN - 1] = 0; +} + void arm_setup_irqhandler(const char *name, driver_filter_t *filt, void (*hand)(void*), void *arg, int irq, int flags, void **cookiep) { struct intr_event *event; int error; + char namebuf[INTRNAME_LEN]; if (irq < 0 || irq >= NIRQ) return; @@ -78,14 +95,9 @@ arm_setup_irqhandler(const char *name, d if (error) return; intr_events[irq] = event; - last_printed += - snprintf(intrnames + last_printed, - MAXCOMLEN + 1, - "irq%d: %s", irq, name); - last_printed++; - intrcnt_tab[irq] = intrcnt_index; - intrcnt_index++; - + snprintf(namebuf, sizeof(namebuf), "irq%d: %s", irq, name); + sprintf(intrnames + INTRNAME_LEN * irq, "%-*s", + INTRNAME_LEN - 1, namebuf); } intr_event_add_handler(event, name, filt, hand, arg, intr_priority(flags), flags, cookiep); @@ -122,7 +134,7 @@ arm_handler_execute(struct trapframe *fr PCPU_INC(cnt.v_intr); i = -1; while ((i = arm_get_next_irq(i)) != -1) { - intrcnt[intrcnt_tab[i]]++; + intrcnt[i]++; event = intr_events[i]; if (intr_event_handle(event, frame) != 0) { /* XXX: Log stray IRQs */ Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sat Jan 19 00:37:17 2013 (r245636) +++ head/sys/arm/arm/machdep.c Sat Jan 19 00:50:12 2013 (r245637) @@ -1474,6 +1474,7 @@ initarm(struct arm_boot_params *abp) init_proc0(kernelstack.pv_va); + arm_intrnames_init(); arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); arm_dump_avail_init(memsize, sizeof(dump_avail) / sizeof(dump_avail[0])); pmap_bootstrap(freemempos, pmap_bootstrap_lastaddr, &kernel_l1pt); Modified: head/sys/arm/include/intr.h ============================================================================== --- head/sys/arm/include/intr.h Sat Jan 19 00:37:17 2013 (r245636) +++ head/sys/arm/include/intr.h Sat Jan 19 00:50:12 2013 (r245637) @@ -70,6 +70,7 @@ int arm_get_next_irq(int); void arm_mask_irq(uintptr_t); void arm_unmask_irq(uintptr_t); +void arm_intrnames_init(void); void arm_setup_irqhandler(const char *, int (*)(void*), void (*)(void*), void *, int, int, void **); int arm_remove_irqhandler(int, void *); From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 01:18:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DB34F8EE; Sat, 19 Jan 2013 01:18:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CBF471DD; Sat, 19 Jan 2013 01:18:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0J1IMxb018823; Sat, 19 Jan 2013 01:18:22 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0J1IMdK018821; Sat, 19 Jan 2013 01:18:22 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201301190118.r0J1IMdK018821@svn.freebsd.org> From: John Baldwin Date: Sat, 19 Jan 2013 01:18:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245640 - in head/sys: amd64/amd64 i386/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.14 Precedence: list List-Id: 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, 19 Jan 2013 01:18:22 -0000 Author: jhb Date: Sat Jan 19 01:18:22 2013 New Revision: 245640 URL: http://svnweb.freebsd.org/changeset/base/245640 Log: Fix build with SMP disabled.` Reported by: bf Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat Jan 19 00:53:36 2013 (r245639) +++ head/sys/amd64/amd64/pmap.c Sat Jan 19 01:18:22 2013 (r245640) @@ -102,6 +102,7 @@ __FBSDID("$FreeBSD$"); #include "opt_vm.h" #include +#include #include #include #include @@ -133,6 +134,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sat Jan 19 00:53:36 2013 (r245639) +++ head/sys/i386/i386/pmap.c Sat Jan 19 01:18:22 2013 (r245640) @@ -136,6 +136,11 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef DEV_APIC +#include +#include +#include +#endif #include #include #include From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 01:19:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E08A3A7A; Sat, 19 Jan 2013 01:19:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id AF4881F1; Sat, 19 Jan 2013 01:19:26 +0000 (UTC) Received: from John-Baldwins-MacBook-Air.local (c-68-39-198-164.hsd1.de.comcast.net [68.39.198.164]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 02F31B91E; Fri, 18 Jan 2013 20:19:25 -0500 (EST) Message-ID: <50F9F49D.5040000@FreeBSD.org> Date: Fri, 18 Jan 2013 20:19:25 -0500 From: John Baldwin User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Andrew Turner Subject: Re: svn commit: r245610 - head/bin/ps References: <201301181824.r0IIOfxd094865@svn.freebsd.org> <20130119112953.7a9aa66e@fubar.geek.nz> <50F9E354.1070709@FreeBSD.org> In-Reply-To: <50F9E354.1070709@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 18 Jan 2013 20:19:26 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 19 Jan 2013 01:19:27 -0000 On 1/18/13 7:05 PM, John Baldwin wrote: > On 1/18/13 5:29 PM, Andrew Turner wrote: >> On Fri, 18 Jan 2013 18:24:41 +0000 (UTC) >> John Baldwin wrote: >> >>> Author: jhb >>> Date: Fri Jan 18 18:24:40 2013 >>> New Revision: 245610 >>> URL: http://svnweb.freebsd.org/changeset/base/245610 >>> >>> Log: >>> Include the thread name along with the command name when displaying >>> the command name of a thread from a multi-threaded process that >>> doesn't have an available argument list (such as kernel processes) >>> and threads display is enabled via -H. >>> >>> Reviewed by: alfred, delphij, eric@vangyzen.net >>> MFC after: 1 week >> >> This breaks usr.bin/w as it includes bin/ps/fmt.c in it's build but >> doesn't have the showthreads variable defined. > > Ugh. It requires a bit more fixing than that even since w uses > fmt_argv() directly (and it had a stale prototype to boot). I have > a fix to get both ps and w to build but am waiting for a full world > to finish first in case some other place (ab)uses this. This should be fixed, sorry for the breakage. :( -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 02:22:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EB72A46D; Sat, 19 Jan 2013 02:22:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DD806398; Sat, 19 Jan 2013 02:22:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0J2M1pv039014; Sat, 19 Jan 2013 02:22:01 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0J2M1no039012; Sat, 19 Jan 2013 02:22:01 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201301190222.r0J2M1no039012@svn.freebsd.org> From: Andrew Turner Date: Sat, 19 Jan 2013 02:22:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245641 - head/contrib/compiler-rt/lib/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 19 Jan 2013 02:22:02 -0000 Author: andrew Date: Sat Jan 19 02:22:01 2013 New Revision: 245641 URL: http://svnweb.freebsd.org/changeset/base/245641 Log: Add a newline at the end of the file to stop gcc from complaining Modified: head/contrib/compiler-rt/lib/arm/aeabi_uldivmod.S Modified: head/contrib/compiler-rt/lib/arm/aeabi_uldivmod.S ============================================================================== --- head/contrib/compiler-rt/lib/arm/aeabi_uldivmod.S Sat Jan 19 01:18:22 2013 (r245640) +++ head/contrib/compiler-rt/lib/arm/aeabi_uldivmod.S Sat Jan 19 02:22:01 2013 (r245641) @@ -27,4 +27,5 @@ DEFINE_COMPILERRT_FUNCTION(__aeabi_uldiv ldr r2, [sp, #8] ldr r3, [sp, #12] add sp, sp, #16 - pop {r11, pc} \ No newline at end of file + pop {r11, pc} + From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 02:24:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 368265F7; Sat, 19 Jan 2013 02:24:15 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2865C3D2; Sat, 19 Jan 2013 02:24:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0J2OFRB039335; Sat, 19 Jan 2013 02:24:15 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0J2OFn6039334; Sat, 19 Jan 2013 02:24:15 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201301190224.r0J2OFn6039334@svn.freebsd.org> From: Andrew Turner Date: Sat, 19 Jan 2013 02:24:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245642 - head/contrib/compiler-rt/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.14 Precedence: list List-Id: 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, 19 Jan 2013 02:24:15 -0000 Author: andrew Date: Sat Jan 19 02:24:14 2013 New Revision: 245642 URL: http://svnweb.freebsd.org/changeset/base/245642 Log: Don't use the pcs attribute on compilers that don't support it. We can revert this when we stop supporting old versions of gcc. Modified: head/contrib/compiler-rt/lib/int_lib.h Modified: head/contrib/compiler-rt/lib/int_lib.h ============================================================================== --- head/contrib/compiler-rt/lib/int_lib.h Sat Jan 19 02:22:01 2013 (r245641) +++ head/contrib/compiler-rt/lib/int_lib.h Sat Jan 19 02:24:14 2013 (r245642) @@ -25,7 +25,15 @@ #if __ARM_EABI__ # define ARM_EABI_FNALIAS(aeabi_name, name) \ void __aeabi_##aeabi_name() __attribute__((alias("__" #name))); -# define COMPILER_RT_ABI __attribute__((pcs("aapcs"))) + +# if !defined(__clang__) && defined(__GNUC__) && \ + (__GNUC__ < 4 || __GNUC__ == 4 && __GNUC_MINOR__ < 5) +/* The pcs attribute was introduced in GCC 4.5.0 */ +# define COMPILER_RT_ABI +# else +# define COMPILER_RT_ABI __attribute__((pcs("aapcs"))) +# endif + #else # define ARM_EABI_FNALIAS(aeabi_name, name) # define COMPILER_RT_ABI From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 02:28:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 20CF0857; Sat, 19 Jan 2013 02:28:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 139273F6; Sat, 19 Jan 2013 02:28:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0J2Si22040079; Sat, 19 Jan 2013 02:28:44 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0J2Si4W040078; Sat, 19 Jan 2013 02:28:44 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201301190228.r0J2Si4W040078@svn.freebsd.org> From: Andrew Turner Date: Sat, 19 Jan 2013 02:28:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245643 - head/lib/libcompiler_rt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 19 Jan 2013 02:28:45 -0000 Author: andrew Date: Sat Jan 19 02:28:44 2013 New Revision: 245643 URL: http://svnweb.freebsd.org/changeset/base/245643 Log: Add the __aeabi_*divmod functions to the compiler-rt build Modified: head/lib/libcompiler_rt/Makefile Modified: head/lib/libcompiler_rt/Makefile ============================================================================== --- head/lib/libcompiler_rt/Makefile Sat Jan 19 02:24:14 2013 (r245642) +++ head/lib/libcompiler_rt/Makefile Sat Jan 19 02:28:44 2013 (r245643) @@ -181,6 +181,13 @@ SRCS+= ${file}.c . endif .endfor +.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +SRCS+= aeabi_idivmod.S \ + aeabi_ldivmod.S \ + aeabi_uidivmod.S \ + aeabi_uldivmod.S +.endif + .if ${MACHINE_CPUARCH} != "mips" . if ${MK_INSTALLLIB} != "no" SYMLINKS+=libcompiler_rt.a ${LIBDIR}/libgcc.a From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 02:33:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CF8DEBDE; Sat, 19 Jan 2013 02:33:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C1A1563B; Sat, 19 Jan 2013 02:33:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0J2Xvar042644; Sat, 19 Jan 2013 02:33:57 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0J2Xvvn042643; Sat, 19 Jan 2013 02:33:57 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201301190233.r0J2Xvvn042643@svn.freebsd.org> From: Andrew Turner Date: Sat, 19 Jan 2013 02:33:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245644 - head/lib/libc/quad X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 19 Jan 2013 02:33:57 -0000 Author: andrew Date: Sat Jan 19 02:33:57 2013 New Revision: 245644 URL: http://svnweb.freebsd.org/changeset/base/245644 Log: For ARM EABI we only need a subset of the quad functions, the rest are provided by libgcc. Modified: head/lib/libc/quad/Makefile.inc Modified: head/lib/libc/quad/Makefile.inc ============================================================================== --- head/lib/libc/quad/Makefile.inc Sat Jan 19 02:28:44 2013 (r245643) +++ head/lib/libc/quad/Makefile.inc Sat Jan 19 02:33:57 2013 (r245644) @@ -8,6 +8,10 @@ SRCS+= cmpdi2.c divdi3.c moddi3.c qdivrem.c ucmpdi2.c udivdi3.c umoddi3.c +.elif ${LIBC_ARCH} == "arm" && ${MK_ARM_EABI} != "no" + +SRCS+= adddi3.c anddi3.c floatunsdidf.c iordi3.c lshldi3.c notdi2.c \ + qdivrem.c subdi3.c xordi3.c .else SRCS+= adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c fixdfdi.c \ From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 03:19:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C3533976; Sat, 19 Jan 2013 03:19:40 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9294F81C; Sat, 19 Jan 2013 03:19:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0J3Jeps056379; Sat, 19 Jan 2013 03:19:40 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0J3Jeu0056377; Sat, 19 Jan 2013 03:19:40 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201301190319.r0J3Jeu0056377@svn.freebsd.org> From: Alexander Kabaev Date: Sat, 19 Jan 2013 03:19:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245647 - in head/sys: cam/scsi dev/usb/storage X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 19 Jan 2013 03:19:40 -0000 Author: kan Date: Sat Jan 19 03:19:39 2013 New Revision: 245647 URL: http://svnweb.freebsd.org/changeset/base/245647 Log: Do not pretend to have autosense data when no such data is available. Make umass return an error code if SCSI sense retrieval request has failed. Make sure scsi_error_action honors SF_NO_RETRY and SF_NO_RECOVERY in all cases, even if it cannot parse sense bytes. Reviewed by: hselasky (umass), scottl (cam) Modified: head/sys/cam/scsi/scsi_all.c head/sys/dev/usb/storage/umass.c Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Sat Jan 19 03:13:04 2013 (r245646) +++ head/sys/cam/scsi/scsi_all.c Sat Jan 19 03:19:39 2013 (r245647) @@ -3071,16 +3071,15 @@ scsi_error_action(struct ccb_scsiio *csi SSQ_PRINT_SENSE; } } - if ((action & SS_MASK) >= SS_START && - (sense_flags & SF_NO_RECOVERY)) { - action &= ~SS_MASK; - action |= SS_FAIL; - } else if ((action & SS_MASK) == SS_RETRY && - (sense_flags & SF_NO_RETRY)) { - action &= ~SS_MASK; - action |= SS_FAIL; - } - + } + if ((action & SS_MASK) >= SS_START && + (sense_flags & SF_NO_RECOVERY)) { + action &= ~SS_MASK; + action |= SS_FAIL; + } else if ((action & SS_MASK) == SS_RETRY && + (sense_flags & SF_NO_RETRY)) { + action &= ~SS_MASK; + action |= SS_FAIL; } if ((sense_flags & SF_PRINT_ALWAYS) != 0) action |= SSQ_PRINT_SENSE; Modified: head/sys/dev/usb/storage/umass.c ============================================================================== --- head/sys/dev/usb/storage/umass.c Sat Jan 19 03:13:04 2013 (r245646) +++ head/sys/dev/usb/storage/umass.c Sat Jan 19 03:19:39 2013 (r245647) @@ -2602,9 +2602,13 @@ umass_cam_sense_cb(struct umass_softc *s } } else { xpt_freeze_devq(ccb->ccb_h.path, 1); - ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR - | CAM_AUTOSNS_VALID | CAM_DEV_QFRZN; - ccb->csio.scsi_status = SCSI_STATUS_CHECK_COND; + if (key >= 0) { + ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR + | CAM_AUTOSNS_VALID | CAM_DEV_QFRZN; + ccb->csio.scsi_status = SCSI_STATUS_CHECK_COND; + } else + ccb->ccb_h.status = CAM_AUTOSENSE_FAIL + | CAM_DEV_QFRZN; } xpt_done(ccb); break; From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 03:34:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DEF3CD5E; Sat, 19 Jan 2013 03:34:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D0D7E87C; Sat, 19 Jan 2013 03:34:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0J3Y2A0061477; Sat, 19 Jan 2013 03:34:02 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0J3Y2Hh061476; Sat, 19 Jan 2013 03:34:02 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201301190334.r0J3Y2Hh061476@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 19 Jan 2013 03:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245648 - head/sbin/newfs_msdos X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 19 Jan 2013 03:34:02 -0000 Author: pfg Date: Sat Jan 19 03:34:02 2013 New Revision: 245648 URL: http://svnweb.freebsd.org/changeset/base/245648 Log: newfs_msdos: cosmetical cleanups - Simplify diagnostic messages. - Adopt lowercase first letters to make the messages more canonical. PR: bin/175404 Submitted by: Christoph Mallon Reviewed by: bde MFC after: 3 days Modified: head/sbin/newfs_msdos/newfs_msdos.c Modified: head/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.c Sat Jan 19 03:19:39 2013 (r245647) +++ head/sbin/newfs_msdos/newfs_msdos.c Sat Jan 19 03:34:02 2013 (r245648) @@ -808,7 +808,7 @@ getdiskinfo(int fd, const char *fname, c struct stat st; if (fstat(fd, &st)) - err(1, "Cannot get disk size"); + err(1, "cannot get disk size"); /* create a fake geometry for a file image */ ms = st.st_size; dlp.d_secsize = 512; @@ -832,18 +832,18 @@ getdiskinfo(int fd, const char *fname, c if (ioctl(fd, DIOCGDINFO, &dlp) == -1) { if (bpb->bpbBytesPerSec == 0 && ioctl(fd, DIOCGSECTORSIZE, &dlp.d_secsize) == -1) - errx(1, "Cannot get sector size, %s", strerror(errno)); + err(1, "cannot get sector size"); dlp.d_secperunit = ms / dlp.d_secsize; if (bpb->bpbSecPerTrack == 0 && ioctl(fd, DIOCGFWSECTORS, &dlp.d_nsectors) == -1) { - warnx("Cannot get number of sectors per track, %s", strerror(errno)); + warn("cannot get number of sectors per track"); dlp.d_nsectors = 63; } if (bpb->bpbHeads == 0 && ioctl(fd, DIOCGFWHEADS, &dlp.d_ntracks) == -1) { - warnx("Cannot get number of heads, %s", strerror(errno)); + warn("cannot get number of heads"); if (dlp.d_secperunit <= 63*1*1024) dlp.d_ntracks = 1; else if (dlp.d_secperunit <= 63*16*1024) From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 03:47:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EECA7132; Sat, 19 Jan 2013 03:47:18 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D6E228CE; Sat, 19 Jan 2013 03:47:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0J3lIaA064832; Sat, 19 Jan 2013 03:47:18 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0J3lIBf064831; Sat, 19 Jan 2013 03:47:18 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201301190347.r0J3lIBf064831@svn.freebsd.org> From: Andrew Turner Date: Sat, 19 Jan 2013 03:47:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245649 - head/lib/libcompiler_rt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 19 Jan 2013 03:47:19 -0000 Author: andrew Date: Sat Jan 19 03:47:18 2013 New Revision: 245649 URL: http://svnweb.freebsd.org/changeset/base/245649 Log: There should have been a tab after SRCS+= Modified: head/lib/libcompiler_rt/Makefile Modified: head/lib/libcompiler_rt/Makefile ============================================================================== --- head/lib/libcompiler_rt/Makefile Sat Jan 19 03:34:02 2013 (r245648) +++ head/lib/libcompiler_rt/Makefile Sat Jan 19 03:47:18 2013 (r245649) @@ -182,7 +182,7 @@ SRCS+= ${file}.c .endfor .if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" -SRCS+= aeabi_idivmod.S \ +SRCS+= aeabi_idivmod.S \ aeabi_ldivmod.S \ aeabi_uidivmod.S \ aeabi_uldivmod.S From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 04:03:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A58A73DA; Sat, 19 Jan 2013 04:03:19 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8CCF190A; Sat, 19 Jan 2013 04:03:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0J43J3N070272; Sat, 19 Jan 2013 04:03:19 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0J43JpQ070271; Sat, 19 Jan 2013 04:03:19 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201301190403.r0J43JpQ070271@svn.freebsd.org> From: Andrew Turner Date: Sat, 19 Jan 2013 04:03:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245650 - head/lib/libc/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 19 Jan 2013 04:03:19 -0000 Author: andrew Date: Sat Jan 19 04:03:18 2013 New Revision: 245650 URL: http://svnweb.freebsd.org/changeset/base/245650 Log: Update the syscall calling convention for ARM EABI. We store the syscall in r7 and use ip to store the old version of r7 as it is not guaranteed to be kept when calling a subroutine. The kernel will preserve the register across system calls. Modified: head/lib/libc/arm/SYS.h Modified: head/lib/libc/arm/SYS.h ============================================================================== --- head/lib/libc/arm/SYS.h Sat Jan 19 03:47:18 2013 (r245649) +++ head/lib/libc/arm/SYS.h Sat Jan 19 04:03:18 2013 (r245650) @@ -39,7 +39,15 @@ #include #include +#ifdef __ARM_EABI__ +#define SYSTRAP(x) \ + mov ip, r7; \ + ldr r7, =SYS_ ## x; \ + swi 0; \ + mov r7, ip +#else #define SYSTRAP(x) swi 0 | SYS_ ## x +#endif #define CERROR _C_LABEL(cerror) #define CURBRK _C_LABEL(curbrk) From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 04:11:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DC57967C; Sat, 19 Jan 2013 04:11:46 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B5FAA93D; Sat, 19 Jan 2013 04:11:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0J4Bkld073396; Sat, 19 Jan 2013 04:11:46 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0J4Bjm0073391; Sat, 19 Jan 2013 04:11:45 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201301190411.r0J4Bjm0073391@svn.freebsd.org> From: Andrew Turner Date: Sat, 19 Jan 2013 04:11:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245651 - in head/lib: libc/arm libc/arm/gen libcompiler_rt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 19 Jan 2013 04:11:46 -0000 Author: andrew Date: Sat Jan 19 04:11:45 2013 New Revision: 245651 URL: http://svnweb.freebsd.org/changeset/base/245651 Log: Use the compiler-rt version __{u,}divsi3 and __{u,}modsi3 on ARM EABI Added: head/lib/libc/arm/Symbol_oabi.map (contents, props changed) Modified: head/lib/libc/arm/Makefile.inc head/lib/libc/arm/Symbol.map head/lib/libc/arm/gen/Makefile.inc head/lib/libcompiler_rt/Makefile Modified: head/lib/libc/arm/Makefile.inc ============================================================================== --- head/lib/libc/arm/Makefile.inc Sat Jan 19 04:03:18 2013 (r245650) +++ head/lib/libc/arm/Makefile.inc Sat Jan 19 04:11:45 2013 (r245651) @@ -8,3 +8,9 @@ SOFTFLOAT_BITS=32 # Long double is just double precision. MDSRCS+=machdep_ldisd.c SYM_MAPS+=${.CURDIR}/arm/Symbol.map + +.if ${MK_ARM_EABI} == "no" +# This contains the symbols that were removed when moving to the ARM EABI +SYM_MAPS+=${.CURDIR}/arm/Symbol_oabi.map +.endif + Modified: head/lib/libc/arm/Symbol.map ============================================================================== --- head/lib/libc/arm/Symbol.map Sat Jan 19 04:03:18 2013 (r245650) +++ head/lib/libc/arm/Symbol.map Sat Jan 19 04:11:45 2013 (r245651) @@ -46,10 +46,6 @@ FBSDprivate_1.0 { _set_tp; __aeabi_read_tp; ___longjmp; - __umodsi3; - __modsi3; - __udivsi3; - __divsi3; __makecontext; __longjmp; signalcontext; Added: head/lib/libc/arm/Symbol_oabi.map ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/Symbol_oabi.map Sat Jan 19 04:11:45 2013 (r245651) @@ -0,0 +1,16 @@ +/* + * $FreeBSD$ + */ + +/* + * This only needs to contain symbols that are not listed in + * symbol maps from other parts of libc (i.e., not found in + * stdlib/Symbol.map, string/Symbol.map, sys/Symbol.map, ...) + * and are not used in the ARM EABI. + */ +FBSDprivate_1.0 { + __umodsi3; + __modsi3; + __udivsi3; + __divsi3; +}; Modified: head/lib/libc/arm/gen/Makefile.inc ============================================================================== --- head/lib/libc/arm/gen/Makefile.inc Sat Jan 19 04:03:18 2013 (r245650) +++ head/lib/libc/arm/gen/Makefile.inc Sat Jan 19 04:11:45 2013 (r245651) @@ -3,4 +3,8 @@ SRCS+= _ctx_start.S _setjmp.S _set_tp.c alloca.S fabs.c \ getcontextx.c infinity.c ldexp.c makecontext.c \ - __aeabi_read_tp.S setjmp.S signalcontext.c sigsetjmp.S divsi3.S flt_rounds.c + __aeabi_read_tp.S setjmp.S signalcontext.c sigsetjmp.S flt_rounds.c + +.if ${MK_ARM_EABI} == "no" +SRCS+= divsi3.S +.endif Modified: head/lib/libcompiler_rt/Makefile ============================================================================== --- head/lib/libcompiler_rt/Makefile Sat Jan 19 04:03:18 2013 (r245650) +++ head/lib/libcompiler_rt/Makefile Sat Jan 19 04:11:45 2013 (r245651) @@ -136,18 +136,22 @@ SRCF+= adddf3 \ addsf3 \ divdf3 \ divsf3 \ - divsi3 \ extendsfdf2 \ fixdfsi \ fixsfsi \ floatsidf \ floatsisf \ - modsi3 \ muldf3 \ mulsf3 \ subdf3 \ subsf3 \ - truncdfsf2 \ + truncdfsf2 +.endif + +.if ${MACHINE_CPUARCH} != "mips" && \ + (${MACHINE_CPUARCH} != "arm" || ${MK_ARM_EABI} != "no") +SRCF+= divsi3 \ + modsi3 \ udivsi3 \ umodsi3 .endif From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 04:18:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5062587D; Sat, 19 Jan 2013 04:18:54 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 40AF99A0; Sat, 19 Jan 2013 04:18:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0J4Is7b074583; Sat, 19 Jan 2013 04:18:54 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0J4IquZ074573; Sat, 19 Jan 2013 04:18:52 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201301190418.r0J4IquZ074573@svn.freebsd.org> From: Neel Natu Date: Sat, 19 Jan 2013 04:18:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245652 - in head: lib share/man/man4 share/mk sys/amd64/include sys/conf sys/modules 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.14 Precedence: list List-Id: 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, 19 Jan 2013 04:18:54 -0000 Author: neel Date: Sat Jan 19 04:18:52 2013 New Revision: 245652 URL: http://svnweb.freebsd.org/changeset/base/245652 Log: Merge projects/bhyve to head. 'bhyve' was developed by grehan@ and myself at NetApp (thanks!). Special thanks to Peter Snyder, Joe Caradonna and Michael Dexter for their support and encouragement. Obtained from: NetApp Added: - copied from r245640, projects/bhyve/lib/libvmmapi/ - copied unchanged from r245640, projects/bhyve/share/man/man4/bhyve.4 - copied unchanged from r245640, projects/bhyve/sys/amd64/include/vmm.h - copied unchanged from r245640, projects/bhyve/sys/amd64/include/vmm_dev.h - copied unchanged from r245640, projects/bhyve/sys/amd64/include/vmm_instruction_emul.h - copied from r245640, projects/bhyve/sys/amd64/vmm/ - copied from r245640, projects/bhyve/sys/dev/blackhole/ - copied from r245640, projects/bhyve/sys/dev/bvm/ - copied from r245640, projects/bhyve/sys/modules/blackhole/ - copied from r245640, projects/bhyve/sys/modules/vmm/ - copied from r245640, projects/bhyve/usr.sbin/bhyve/ - copied from r245640, projects/bhyve/usr.sbin/bhyvectl/ - copied from r245640, projects/bhyve/usr.sbin/bhyveload/ Directory Properties: head/lib/libvmmapi/ (props changed) head/share/man/man4/bhyve.4 (props changed) head/sys/amd64/include/vmm.h (props changed) head/sys/amd64/include/vmm_dev.h (props changed) head/sys/amd64/include/vmm_instruction_emul.h (props changed) head/sys/amd64/vmm/ (props changed) head/sys/dev/blackhole/ (props changed) head/sys/dev/bvm/ (props changed) head/sys/modules/blackhole/ (props changed) head/sys/modules/vmm/ (props changed) head/usr.sbin/bhyve/ (props changed) head/usr.sbin/bhyvectl/ (props changed) head/usr.sbin/bhyveload/ (props changed) Modified: head/lib/Makefile head/share/mk/bsd.libnames.mk head/sys/conf/files.amd64 head/sys/modules/Makefile head/usr.sbin/Makefile.amd64 Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Sat Jan 19 04:11:45 2013 (r245651) +++ head/lib/Makefile Sat Jan 19 04:18:52 2013 (r245652) @@ -115,6 +115,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_libusbhid} \ ${_libusb} \ ${_libvgl} \ + ${_libvmmapi} \ libwrap \ liby \ libz \ @@ -198,6 +199,10 @@ _libproc= libproc _librtld_db= librtld_db .endif +.if ${MACHINE_CPUARCH} == "amd64" +_libvmmapi= libvmmapi +.endif + .if ${MACHINE_CPUARCH} == "ia64" _libefi= libefi .endif Copied: head/share/man/man4/bhyve.4 (from r245640, projects/bhyve/share/man/man4/bhyve.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/bhyve.4 Sat Jan 19 04:18:52 2013 (r245652, copy of r245640, projects/bhyve/share/man/man4/bhyve.4) @@ -0,0 +1,68 @@ +.\" +.\" Copyright (c) 2012 NetApp Inc +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 5, 2013 +.Dt BHYVE 4 +.Os +.Sh NAME +.Nm bhyve +.Nd virtual machine monitor +.Sh SYNOPSIS +.Cd "/usr/sbin/bhyve" +.Cd "/usr/sbin/bhyveload" +.Cd "/usr/sbin/bhyvectl" +.Cd "/boot/kernel/vmm.ko" +.Sh DESCRIPTION +.Nm +is a virtual machine monitor that is hosted by FreeBSD. It is used to host +unmodified guest operating systems on top of FreeBSD. +.Pp +.Nm +relies heavily on hardware assist provided by the CPU and chipset to virtualize +processor and memory resources. +.Sh SEE ALSO +.Xr bhyve 8 , +.Xr bhyveload 8 , +.Xr bhyvectl 8 , +.Xr vmm 4 +.Sh HISTORY +.Nm +first appeared in +.Fx 10.0 , +and was developed at NetApp Inc. +.Sh AUTHORS +.Nm +was developed by +.An -nosplit +.An "Peter Grehan" Aq grehan@FreeBSD.org +and +.An "Neel Natu" Aq neel@FreeBSD.org +at NetApp Inc. +.Sh BUGS +.Nm +is considered experimental in +.Fx . Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Sat Jan 19 04:11:45 2013 (r245651) +++ head/share/mk/bsd.libnames.mk Sat Jan 19 04:18:52 2013 (r245652) @@ -162,6 +162,7 @@ LIBULOG?= ${DESTDIR}${LIBDIR}/libulog.a LIBUTIL?= ${DESTDIR}${LIBDIR}/libutil.a LIBUUTIL?= ${DESTDIR}${LIBDIR}/libuutil.a LIBVGL?= ${DESTDIR}${LIBDIR}/libvgl.a +LIBVMMAPI?= ${DESTDIR}${LIBDIR}/libvmmapi.a LIBWIND?= ${DESTDIR}${LIBDIR}/libwind.a LIBWRAP?= ${DESTDIR}${LIBDIR}/libwrap.a LIBXPG4?= ${DESTDIR}${LIBDIR}/libxpg4.a Copied: head/sys/amd64/include/vmm.h (from r245640, projects/bhyve/sys/amd64/include/vmm.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/include/vmm.h Sat Jan 19 04:18:52 2013 (r245652, copy of r245640, projects/bhyve/sys/amd64/include/vmm.h) @@ -0,0 +1,293 @@ +/*- + * Copyright (c) 2011 NetApp, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``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 NETAPP, INC OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: vmm.h 482 2011-05-09 21:22:43Z grehan $ + */ + +#ifndef _VMM_H_ +#define _VMM_H_ + +#ifdef _KERNEL + +#define VM_MAX_NAMELEN 32 + +struct vm; +struct vm_memory_segment; +struct seg_desc; +struct vm_exit; +struct vm_run; +struct vlapic; + +enum x2apic_state; + +typedef int (*vmm_init_func_t)(void); +typedef int (*vmm_cleanup_func_t)(void); +typedef void * (*vmi_init_func_t)(struct vm *vm); /* instance specific apis */ +typedef int (*vmi_run_func_t)(void *vmi, int vcpu, register_t rip); +typedef void (*vmi_cleanup_func_t)(void *vmi); +typedef int (*vmi_mmap_set_func_t)(void *vmi, vm_paddr_t gpa, + vm_paddr_t hpa, size_t length, + vm_memattr_t attr, int prot, + boolean_t superpages_ok); +typedef vm_paddr_t (*vmi_mmap_get_func_t)(void *vmi, vm_paddr_t gpa); +typedef int (*vmi_get_register_t)(void *vmi, int vcpu, int num, + uint64_t *retval); +typedef int (*vmi_set_register_t)(void *vmi, int vcpu, int num, + uint64_t val); +typedef int (*vmi_get_desc_t)(void *vmi, int vcpu, int num, + struct seg_desc *desc); +typedef int (*vmi_set_desc_t)(void *vmi, int vcpu, int num, + struct seg_desc *desc); +typedef int (*vmi_inject_event_t)(void *vmi, int vcpu, + int type, int vector, + uint32_t code, int code_valid); +typedef int (*vmi_get_cap_t)(void *vmi, int vcpu, int num, int *retval); +typedef int (*vmi_set_cap_t)(void *vmi, int vcpu, int num, int val); + +struct vmm_ops { + vmm_init_func_t init; /* module wide initialization */ + vmm_cleanup_func_t cleanup; + + vmi_init_func_t vminit; /* vm-specific initialization */ + vmi_run_func_t vmrun; + vmi_cleanup_func_t vmcleanup; + vmi_mmap_set_func_t vmmmap_set; + vmi_mmap_get_func_t vmmmap_get; + vmi_get_register_t vmgetreg; + vmi_set_register_t vmsetreg; + vmi_get_desc_t vmgetdesc; + vmi_set_desc_t vmsetdesc; + vmi_inject_event_t vminject; + vmi_get_cap_t vmgetcap; + vmi_set_cap_t vmsetcap; +}; + +extern struct vmm_ops vmm_ops_intel; +extern struct vmm_ops vmm_ops_amd; + +struct vm *vm_create(const char *name); +void vm_destroy(struct vm *vm); +const char *vm_name(struct vm *vm); +int vm_malloc(struct vm *vm, vm_paddr_t gpa, size_t len); +int vm_map_mmio(struct vm *vm, vm_paddr_t gpa, size_t len, vm_paddr_t hpa); +int vm_unmap_mmio(struct vm *vm, vm_paddr_t gpa, size_t len); +vm_paddr_t vm_gpa2hpa(struct vm *vm, vm_paddr_t gpa, size_t size); +int vm_gpabase2memseg(struct vm *vm, vm_paddr_t gpabase, + struct vm_memory_segment *seg); +int vm_get_register(struct vm *vm, int vcpu, int reg, uint64_t *retval); +int vm_set_register(struct vm *vm, int vcpu, int reg, uint64_t val); +int vm_get_seg_desc(struct vm *vm, int vcpu, int reg, + struct seg_desc *ret_desc); +int vm_set_seg_desc(struct vm *vm, int vcpu, int reg, + struct seg_desc *desc); +int vm_get_pinning(struct vm *vm, int vcpu, int *cpuid); +int vm_set_pinning(struct vm *vm, int vcpu, int cpuid); +int vm_run(struct vm *vm, struct vm_run *vmrun); +int vm_inject_event(struct vm *vm, int vcpu, int type, + int vector, uint32_t error_code, int error_code_valid); +int vm_inject_nmi(struct vm *vm, int vcpu); +int vm_nmi_pending(struct vm *vm, int vcpuid); +void vm_nmi_clear(struct vm *vm, int vcpuid); +uint64_t *vm_guest_msrs(struct vm *vm, int cpu); +struct vlapic *vm_lapic(struct vm *vm, int cpu); +int vm_get_capability(struct vm *vm, int vcpu, int type, int *val); +int vm_set_capability(struct vm *vm, int vcpu, int type, int val); +int vm_get_x2apic_state(struct vm *vm, int vcpu, enum x2apic_state *state); +int vm_set_x2apic_state(struct vm *vm, int vcpu, enum x2apic_state state); +void vm_activate_cpu(struct vm *vm, int vcpu); +cpuset_t vm_active_cpus(struct vm *vm); +struct vm_exit *vm_exitinfo(struct vm *vm, int vcpuid); + +/* + * Return 1 if device indicated by bus/slot/func is supposed to be a + * pci passthrough device. + * + * Return 0 otherwise. + */ +int vmm_is_pptdev(int bus, int slot, int func); + +void *vm_iommu_domain(struct vm *vm); + +enum vcpu_state { + VCPU_IDLE, + VCPU_RUNNING, + VCPU_CANNOT_RUN, +}; + +int vcpu_set_state(struct vm *vm, int vcpu, enum vcpu_state state); +enum vcpu_state vcpu_get_state(struct vm *vm, int vcpu); + +static int __inline +vcpu_is_running(struct vm *vm, int vcpu) +{ + return (vcpu_get_state(vm, vcpu) == VCPU_RUNNING); +} + +void *vcpu_stats(struct vm *vm, int vcpu); +void vm_interrupt_hostcpu(struct vm *vm, int vcpu); + +#endif /* KERNEL */ + +#include + +#define VM_MAXCPU 8 /* maximum virtual cpus */ + +/* + * Identifiers for events that can be injected into the VM + */ +enum vm_event_type { + VM_EVENT_NONE, + VM_HW_INTR, + VM_NMI, + VM_HW_EXCEPTION, + VM_SW_INTR, + VM_PRIV_SW_EXCEPTION, + VM_SW_EXCEPTION, + VM_EVENT_MAX +}; + +/* + * Identifiers for architecturally defined registers. + */ +enum vm_reg_name { + VM_REG_GUEST_RAX, + VM_REG_GUEST_RBX, + VM_REG_GUEST_RCX, + VM_REG_GUEST_RDX, + VM_REG_GUEST_RSI, + VM_REG_GUEST_RDI, + VM_REG_GUEST_RBP, + VM_REG_GUEST_R8, + VM_REG_GUEST_R9, + VM_REG_GUEST_R10, + VM_REG_GUEST_R11, + VM_REG_GUEST_R12, + VM_REG_GUEST_R13, + VM_REG_GUEST_R14, + VM_REG_GUEST_R15, + VM_REG_GUEST_CR0, + VM_REG_GUEST_CR3, + VM_REG_GUEST_CR4, + VM_REG_GUEST_DR7, + VM_REG_GUEST_RSP, + VM_REG_GUEST_RIP, + VM_REG_GUEST_RFLAGS, + VM_REG_GUEST_ES, + VM_REG_GUEST_CS, + VM_REG_GUEST_SS, + VM_REG_GUEST_DS, + VM_REG_GUEST_FS, + VM_REG_GUEST_GS, + VM_REG_GUEST_LDTR, + VM_REG_GUEST_TR, + VM_REG_GUEST_IDTR, + VM_REG_GUEST_GDTR, + VM_REG_GUEST_EFER, + VM_REG_LAST +}; + +/* + * Identifiers for optional vmm capabilities + */ +enum vm_cap_type { + VM_CAP_HALT_EXIT, + VM_CAP_MTRAP_EXIT, + VM_CAP_PAUSE_EXIT, + VM_CAP_UNRESTRICTED_GUEST, + VM_CAP_MAX +}; + +enum x2apic_state { + X2APIC_ENABLED, + X2APIC_AVAILABLE, + X2APIC_DISABLED, + X2APIC_STATE_LAST +}; + +/* + * The 'access' field has the format specified in Table 21-2 of the Intel + * Architecture Manual vol 3b. + * + * XXX The contents of the 'access' field are architecturally defined except + * bit 16 - Segment Unusable. + */ +struct seg_desc { + uint64_t base; + uint32_t limit; + uint32_t access; +}; + +enum vm_exitcode { + VM_EXITCODE_INOUT, + VM_EXITCODE_VMX, + VM_EXITCODE_BOGUS, + VM_EXITCODE_RDMSR, + VM_EXITCODE_WRMSR, + VM_EXITCODE_HLT, + VM_EXITCODE_MTRAP, + VM_EXITCODE_PAUSE, + VM_EXITCODE_PAGING, + VM_EXITCODE_SPINUP_AP, + VM_EXITCODE_MAX +}; + +struct vm_exit { + enum vm_exitcode exitcode; + int inst_length; /* 0 means unknown */ + uint64_t rip; + union { + struct { + uint16_t bytes:3; /* 1 or 2 or 4 */ + uint16_t in:1; /* out is 0, in is 1 */ + uint16_t string:1; + uint16_t rep:1; + uint16_t port; + uint32_t eax; /* valid for out */ + } inout; + struct { + uint64_t gpa; + struct vie vie; + } paging; + /* + * VMX specific payload. Used when there is no "better" + * exitcode to represent the VM-exit. + */ + struct { + int error; /* vmx inst error */ + uint32_t exit_reason; + uint64_t exit_qualification; + } vmx; + struct { + uint32_t code; /* ecx value */ + uint64_t wval; + } msr; + struct { + int vcpu; + uint64_t rip; + } spinup_ap; + } u; +}; + +#endif /* _VMM_H_ */ Copied: head/sys/amd64/include/vmm_dev.h (from r245640, projects/bhyve/sys/amd64/include/vmm_dev.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/include/vmm_dev.h Sat Jan 19 04:18:52 2013 (r245652, copy of r245640, projects/bhyve/sys/amd64/include/vmm_dev.h) @@ -0,0 +1,215 @@ +/*- + * Copyright (c) 2011 NetApp, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``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 NETAPP, INC OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: vmm_dev.h 482 2011-05-09 21:22:43Z grehan $ + */ + +#ifndef _VMM_DEV_H_ +#define _VMM_DEV_H_ + +#ifdef _KERNEL +void vmmdev_init(void); +int vmmdev_cleanup(void); +#endif + +struct vm_memory_segment { + vm_paddr_t gpa; /* in */ + size_t len; /* in */ +}; + +struct vm_register { + int cpuid; + int regnum; /* enum vm_reg_name */ + uint64_t regval; +}; + +struct vm_seg_desc { /* data or code segment */ + int cpuid; + int regnum; /* enum vm_reg_name */ + struct seg_desc desc; +}; + +struct vm_pin { + int vm_cpuid; + int host_cpuid; /* -1 to unpin */ +}; + +struct vm_run { + int cpuid; + uint64_t rip; /* start running here */ + struct vm_exit vm_exit; +}; + +struct vm_event { + int cpuid; + enum vm_event_type type; + int vector; + uint32_t error_code; + int error_code_valid; +}; + +struct vm_lapic_irq { + int cpuid; + int vector; +}; + +struct vm_capability { + int cpuid; + enum vm_cap_type captype; + int capval; + int allcpus; +}; + +struct vm_pptdev { + int bus; + int slot; + int func; +}; + +struct vm_pptdev_mmio { + int bus; + int slot; + int func; + vm_paddr_t gpa; + vm_paddr_t hpa; + size_t len; +}; + +struct vm_pptdev_msi { + int vcpu; + int bus; + int slot; + int func; + int numvec; /* 0 means disabled */ + int vector; + int destcpu; +}; + +struct vm_pptdev_msix { + int vcpu; + int bus; + int slot; + int func; + int idx; + uint32_t msg; + uint32_t vector_control; + uint64_t addr; +}; + +struct vm_nmi { + int cpuid; +}; + +#define MAX_VM_STATS 64 +struct vm_stats { + int cpuid; /* in */ + int num_entries; /* out */ + struct timeval tv; + uint64_t statbuf[MAX_VM_STATS]; +}; + +struct vm_stat_desc { + int index; /* in */ + char desc[128]; /* out */ +}; + +struct vm_x2apic { + int cpuid; + enum x2apic_state state; +}; + +enum { + IOCNUM_RUN, + IOCNUM_SET_PINNING, + IOCNUM_GET_PINNING, + IOCNUM_MAP_MEMORY, + IOCNUM_GET_MEMORY_SEG, + IOCNUM_SET_REGISTER, + IOCNUM_GET_REGISTER, + IOCNUM_SET_SEGMENT_DESCRIPTOR, + IOCNUM_GET_SEGMENT_DESCRIPTOR, + IOCNUM_INJECT_EVENT, + IOCNUM_LAPIC_IRQ, + IOCNUM_SET_CAPABILITY, + IOCNUM_GET_CAPABILITY, + IOCNUM_BIND_PPTDEV, + IOCNUM_UNBIND_PPTDEV, + IOCNUM_MAP_PPTDEV_MMIO, + IOCNUM_PPTDEV_MSI, + IOCNUM_PPTDEV_MSIX, + IOCNUM_INJECT_NMI, + IOCNUM_VM_STATS, + IOCNUM_VM_STAT_DESC, + IOCNUM_SET_X2APIC_STATE, + IOCNUM_GET_X2APIC_STATE, +}; + +#define VM_RUN \ + _IOWR('v', IOCNUM_RUN, struct vm_run) +#define VM_SET_PINNING \ + _IOW('v', IOCNUM_SET_PINNING, struct vm_pin) +#define VM_GET_PINNING \ + _IOWR('v', IOCNUM_GET_PINNING, struct vm_pin) +#define VM_MAP_MEMORY \ + _IOWR('v', IOCNUM_MAP_MEMORY, struct vm_memory_segment) +#define VM_GET_MEMORY_SEG \ + _IOWR('v', IOCNUM_GET_MEMORY_SEG, struct vm_memory_segment) +#define VM_SET_REGISTER \ + _IOW('v', IOCNUM_SET_REGISTER, struct vm_register) +#define VM_GET_REGISTER \ + _IOWR('v', IOCNUM_GET_REGISTER, struct vm_register) +#define VM_SET_SEGMENT_DESCRIPTOR \ + _IOW('v', IOCNUM_SET_SEGMENT_DESCRIPTOR, struct vm_seg_desc) +#define VM_GET_SEGMENT_DESCRIPTOR \ + _IOWR('v', IOCNUM_GET_SEGMENT_DESCRIPTOR, struct vm_seg_desc) +#define VM_INJECT_EVENT \ + _IOW('v', IOCNUM_INJECT_EVENT, struct vm_event) +#define VM_LAPIC_IRQ \ + _IOW('v', IOCNUM_LAPIC_IRQ, struct vm_lapic_irq) +#define VM_SET_CAPABILITY \ + _IOW('v', IOCNUM_SET_CAPABILITY, struct vm_capability) +#define VM_GET_CAPABILITY \ + _IOWR('v', IOCNUM_GET_CAPABILITY, struct vm_capability) +#define VM_BIND_PPTDEV \ + _IOW('v', IOCNUM_BIND_PPTDEV, struct vm_pptdev) +#define VM_UNBIND_PPTDEV \ + _IOW('v', IOCNUM_UNBIND_PPTDEV, struct vm_pptdev) +#define VM_MAP_PPTDEV_MMIO \ + _IOW('v', IOCNUM_MAP_PPTDEV_MMIO, struct vm_pptdev_mmio) +#define VM_PPTDEV_MSI \ + _IOW('v', IOCNUM_PPTDEV_MSI, struct vm_pptdev_msi) +#define VM_PPTDEV_MSIX \ + _IOW('v', IOCNUM_PPTDEV_MSIX, struct vm_pptdev_msix) +#define VM_INJECT_NMI \ + _IOW('v', IOCNUM_INJECT_NMI, struct vm_nmi) +#define VM_STATS \ + _IOWR('v', IOCNUM_VM_STATS, struct vm_stats) +#define VM_STAT_DESC \ + _IOWR('v', IOCNUM_VM_STAT_DESC, struct vm_stat_desc) +#define VM_SET_X2APIC_STATE \ + _IOW('v', IOCNUM_SET_X2APIC_STATE, struct vm_x2apic) +#define VM_GET_X2APIC_STATE \ + _IOWR('v', IOCNUM_GET_X2APIC_STATE, struct vm_x2apic) +#endif Copied: head/sys/amd64/include/vmm_instruction_emul.h (from r245640, projects/bhyve/sys/amd64/include/vmm_instruction_emul.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/include/vmm_instruction_emul.h Sat Jan 19 04:18:52 2013 (r245652, copy of r245640, projects/bhyve/sys/amd64/include/vmm_instruction_emul.h) @@ -0,0 +1,113 @@ +/*- + * Copyright (c) 2012 NetApp, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``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 NETAPP, INC OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _VMM_INSTRUCTION_EMUL_H_ +#define _VMM_INSTRUCTION_EMUL_H_ + +/* + * The data structures 'vie' and 'vie_op' are meant to be opaque to the + * consumers of instruction decoding. The only reason why their contents + * need to be exposed is because they are part of the 'vm_exit' structure. + */ +struct vie_op { + uint8_t op_byte; /* actual opcode byte */ + uint8_t op_type; /* type of operation (e.g. MOV) */ + uint16_t op_flags; +}; + +#define VIE_INST_SIZE 15 +struct vie { + uint8_t inst[VIE_INST_SIZE]; /* instruction bytes */ + uint8_t num_valid; /* size of the instruction */ + uint8_t num_processed; + + uint8_t rex_w:1, /* REX prefix */ + rex_r:1, + rex_x:1, + rex_b:1; + + uint8_t mod:2, /* ModRM byte */ + reg:4, + rm:4; + + uint8_t ss:2, /* SIB byte */ + index:4, + base:4; + + uint8_t disp_bytes; + uint8_t imm_bytes; + + uint8_t scale; + int base_register; /* VM_REG_GUEST_xyz */ + int index_register; /* VM_REG_GUEST_xyz */ + + int64_t displacement; /* optional addr displacement */ + int64_t immediate; /* optional immediate operand */ + + uint8_t decoded; /* set to 1 if successfully decoded */ + + struct vie_op op; /* opcode description */ +}; + +/* + * Callback functions to read and write memory regions. + */ +typedef int (*mem_region_read_t)(void *vm, int cpuid, uint64_t gpa, + uint64_t *rval, int rsize, void *arg); + +typedef int (*mem_region_write_t)(void *vm, int cpuid, uint64_t gpa, + uint64_t wval, int wsize, void *arg); + +/* + * Emulate the decoded 'vie' instruction. + * + * The callbacks 'mrr' and 'mrw' emulate reads and writes to the memory region + * containing 'gpa'. 'mrarg' is an opaque argument that is passed into the + * callback functions. + * + * 'void *vm' should be 'struct vm *' when called from kernel context and + * 'struct vmctx *' when called from user context. + * s + */ +int vmm_emulate_instruction(void *vm, int cpuid, uint64_t gpa, struct vie *vie, + mem_region_read_t mrr, mem_region_write_t mrw, + void *mrarg); + +#ifdef _KERNEL +/* + * APIs to fetch and decode the instruction from nested page fault handler. + */ +int vmm_fetch_instruction(struct vm *vm, int cpuid, + uint64_t rip, int inst_length, uint64_t cr3, + struct vie *vie); + +int vmm_decode_instruction(struct vm *vm, int cpuid, + uint64_t gla, struct vie *vie); +#endif /* _KERNEL */ + +#endif /* _VMM_INSTRUCTION_EMUL_H_ */ Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sat Jan 19 04:11:45 2013 (r245651) +++ head/sys/conf/files.amd64 Sat Jan 19 04:18:52 2013 (r245652) @@ -464,6 +464,11 @@ libkern/memset.c standard compat/x86bios/x86bios.c optional x86bios | atkbd | dpms | vesa contrib/x86emu/x86emu.c optional x86bios | atkbd | dpms | vesa # +# bvm console +# +dev/bvm/bvm_console.c optional bvmconsole +dev/bvm/bvm_dbg.c optional bvmdebug +# # x86 shared code between IA32, AMD64 and PC98 architectures # x86/acpica/OsdEnvironment.c optional acpi Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sat Jan 19 04:11:45 2013 (r245651) +++ head/sys/modules/Makefile Sat Jan 19 04:18:52 2013 (r245652) @@ -48,6 +48,7 @@ SUBDIR= \ ${_bxe} \ ${_bios} \ ${_bktr} \ + ${_blackhole} \ ${_bm} \ bridgestp \ bwi \ @@ -335,6 +336,7 @@ SUBDIR= \ vge \ ${_viawd} \ vkbd \ + ${_vmm} \ ${_vpo} \ vr \ vte \ @@ -624,6 +626,7 @@ _amdtemp= amdtemp _arcmsr= arcmsr _asmc= asmc _bktr= bktr +_blackhole= blackhole _bxe= bxe _cardbus= cardbus _cbb= cbb @@ -720,6 +723,7 @@ _twa= twa _vesa= vesa _viawd= viawd _virtio= virtio +_vmm= vmm _vxge= vxge _x86bios= x86bios _wbwd= wbwd Modified: head/usr.sbin/Makefile.amd64 ============================================================================== --- head/usr.sbin/Makefile.amd64 Sat Jan 19 04:11:45 2013 (r245651) +++ head/usr.sbin/Makefile.amd64 Sat Jan 19 04:18:52 2013 (r245652) @@ -10,6 +10,9 @@ SUBDIR+= acpi SUBDIR+= apm .endif SUBDIR+= asf +SUBDIR+= bhyve +SUBDIR+= bhyvectl +SUBDIR+= bhyveload SUBDIR+= boot0cfg .if ${MK_TOOLCHAIN} != "no" SUBDIR+= btxld From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 04:34:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 43DB8A8E; Sat, 19 Jan 2013 04:34:34 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1FC179F8; Sat, 19 Jan 2013 04:34:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0J4YYXL081343; Sat, 19 Jan 2013 04:34:34 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0J4YXQC081342; Sat, 19 Jan 2013 04:34:33 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201301190434.r0J4YXQC081342@svn.freebsd.org> From: Andrew Turner Date: Sat, 19 Jan 2013 04:34:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245653 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 19 Jan 2013 04:34:34 -0000 Author: andrew Date: Sat Jan 19 04:34:33 2013 New Revision: 245653 URL: http://svnweb.freebsd.org/changeset/base/245653 Log: When building for ARM EABI link against libgcc for the __aeabi_* functions. Modified: head/libexec/rtld-elf/Makefile Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Sat Jan 19 04:18:52 2013 (r245652) +++ head/libexec/rtld-elf/Makefile Sat Jan 19 04:34:33 2013 (r245653) @@ -42,6 +42,16 @@ LDFLAGS+= -shared -Wl,-Bsymbolic DPADD= ${LIBC_PIC} LDADD= -lc_pic +.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +# Some of the required math functions (div & mod) are implemented in libgcc +# on ARM. The library also needs to be placed first to be correctly linked. +# As some of the functions are used before we have shared libraries. +DPADD+= ${LIBGCC} +LDADD+= -lgcc +.endif + + + .if ${MK_SYMVER} == "yes" LIBCDIR= ${TOPSRCDIR}/lib/libc VERSION_DEF= ${LIBCDIR}/Versions.def From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 05:33:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B5E24297; Sat, 19 Jan 2013 05:33:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8E2ABAF9; Sat, 19 Jan 2013 05:33:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0J5XvYR000347; Sat, 19 Jan 2013 05:33:57 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0J5XuV0000337; Sat, 19 Jan 2013 05:33:56 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201301190533.r0J5XuV0000337@svn.freebsd.org> From: Andrew Turner Date: Sat, 19 Jan 2013 05:33:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245655 - in head/lib/libc/arm: . aeabi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 19 Jan 2013 05:33:57 -0000 Author: andrew Date: Sat Jan 19 05:33:55 2013 New Revision: 245655 URL: http://svnweb.freebsd.org/changeset/base/245655 Log: Add the required __aeabi_* functions to libc. The floating point functions are here rather than compiler-rt because the libc softfloat code allows us to set the rounding mode. Added: head/lib/libc/arm/aeabi/ head/lib/libc/arm/aeabi/Makefile.inc (contents, props changed) head/lib/libc/arm/aeabi/Symbol.map (contents, props changed) head/lib/libc/arm/aeabi/aeabi_atexit.c (contents, props changed) head/lib/libc/arm/aeabi/aeabi_double.c (contents, props changed) head/lib/libc/arm/aeabi/aeabi_float.c (contents, props changed) head/lib/libc/arm/aeabi/aeabi_unwind_cpp.c (contents, props changed) Modified: head/lib/libc/arm/Makefile.inc Modified: head/lib/libc/arm/Makefile.inc ============================================================================== --- head/lib/libc/arm/Makefile.inc Sat Jan 19 04:46:18 2013 (r245654) +++ head/lib/libc/arm/Makefile.inc Sat Jan 19 05:33:55 2013 (r245655) @@ -12,5 +12,7 @@ SYM_MAPS+=${.CURDIR}/arm/Symbol.map .if ${MK_ARM_EABI} == "no" # This contains the symbols that were removed when moving to the ARM EABI SYM_MAPS+=${.CURDIR}/arm/Symbol_oabi.map +.else +.include "${.CURDIR}/arm/aeabi/Makefile.inc" .endif Added: head/lib/libc/arm/aeabi/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/aeabi/Makefile.inc Sat Jan 19 05:33:55 2013 (r245655) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/arm/aeabi + +SRCS+= aeabi_atexit.c \ + aeabi_double.c \ + aeabi_float.c \ + aeabi_unwind_cpp.c + +SYM_MAPS+=${.CURDIR}/arm/aeabi/Symbol.map + Added: head/lib/libc/arm/aeabi/Symbol.map ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/aeabi/Symbol.map Sat Jan 19 05:33:55 2013 (r245655) @@ -0,0 +1,47 @@ +/* + * $FreeBSD$ + */ + +/* + * This only needs to contain AEABI symbols that are not listed in + * symbol maps from other parts of libc (i.e., not found in + * stdlib/Symbol.map, string/Symbol.map, sys/Symbol.map, ...). + */ +FBSDprivate_1.0 { + __aeabi_atexit; + + __aeabi_dcmpeq; + __aeabi_dcmplt; + __aeabi_dcmple; + __aeabi_dcmpge; + __aeabi_dcmpgt; + __aeabi_dcmpun; + + __aeabi_d2iz; + __aeabi_d2f; + + __aeabi_dadd; + __aeabi_ddiv; + __aeabi_dmul; + __aeabi_dsub; + + + __aeabi_fcmpeq; + __aeabi_fcmplt; + __aeabi_fcmple; + __aeabi_fcmpge; + __aeabi_fcmpgt; + __aeabi_fcmpun; + + __aeabi_f2iz; + __aeabi_f2d; + + __aeabi_fadd; + __aeabi_fdiv; + __aeabi_fmul; + __aeabi_fsub; + + + __aeabi_i2d; + __aeabi_i2f; +}; Added: head/lib/libc/arm/aeabi/aeabi_atexit.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/aeabi/aeabi_atexit.c Sat Jan 19 05:33:55 2013 (r245655) @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2012 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +int __cxa_atexit(void (*)(void *), void *, void *); + +int +__aeabi_atexit(void *object, void (*func)(void*), void *dso) +{ + return __cxa_atexit(func, object, dso); +} + Added: head/lib/libc/arm/aeabi/aeabi_double.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/aeabi/aeabi_double.c Sat Jan 19 05:33:55 2013 (r245655) @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2012 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "softfloat-for-gcc.h" +#include "milieu.h" +#include "softfloat.h" + +flag __unorddf2(float64, float64); + +int __aeabi_dcmpeq(float64 a, float64 b) +{ + return float64_eq(a, b); +} + +int __aeabi_dcmplt(float64 a, float64 b) +{ + return float64_lt(a, b); +} + +int __aeabi_dcmple(float64 a, float64 b) +{ + return float64_le(a, b); +} + +int __aeabi_dcmpge(float64 a, float64 b) +{ + return float64_le(b, a); +} + +int __aeabi_dcmpgt(float64 a, float64 b) +{ + return float64_lt(b, a); +} + +int __aeabi_dcmpun(float64 a, float64 b) +{ + return __unorddf2(a, b); +} + +int __aeabi_d2iz(float64 a) +{ + return float64_to_int32_round_to_zero(a); +} + +float32 __aeabi_d2f(float64 a) +{ + return float64_to_float32(a); +} + +float64 __aeabi_i2d(int a) +{ + return int32_to_float64(a); +} + +float64 __aeabi_dadd(float64 a, float64 b) +{ + return float64_add(a, b); +} + +float64 __aeabi_ddiv(float64 a, float64 b) +{ + return float64_div(a, b); +} + +float64 __aeabi_dmul(float64 a, float64 b) +{ + return float64_mul(a, b); +} + +float64 __aeabi_dsub(float64 a, float64 b) +{ + return float64_sub(a, b); +} + Added: head/lib/libc/arm/aeabi/aeabi_float.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/aeabi/aeabi_float.c Sat Jan 19 05:33:55 2013 (r245655) @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2012 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "softfloat-for-gcc.h" +#include "milieu.h" +#include "softfloat.h" + +flag __unordsf2(float32, float32); + +int __aeabi_fcmpeq(float32 a, float32 b) +{ + return float32_eq(a, b); +} + +int __aeabi_fcmplt(float32 a, float32 b) +{ + return float32_lt(a, b); +} + +int __aeabi_fcmple(float32 a, float32 b) +{ + return float32_le(a, b); +} + +int __aeabi_fcmpge(float32 a, float32 b) +{ + return float32_le(b, a); +} + +int __aeabi_fcmpgt(float32 a, float32 b) +{ + return float32_lt(b, a); +} + +int __aeabi_fcmpun(float32 a, float32 b) +{ + return __unordsf2(a, b); +} + +int __aeabi_f2iz(float32 a) +{ + return float32_to_int32_round_to_zero(a); +} + +float32 __aeabi_f2d(float32 a) +{ + return float32_to_float64(a); +} + +float32 __aeabi_i2f(int a) +{ + return int32_to_float32(a); +} + +float32 __aeabi_fadd(float32 a, float32 b) +{ + return float32_add(a, b); +} + +float32 __aeabi_fdiv(float32 a, float32 b) +{ + return float32_div(a, b); +} + +float32 __aeabi_fmul(float32 a, float32 b) +{ + return float32_mul(a, b); +} + +float32 __aeabi_fsub(float32 a, float32 b) +{ + return float32_sub(a, b); +} + Added: head/lib/libc/arm/aeabi/aeabi_unwind_cpp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/aeabi/aeabi_unwind_cpp.c Sat Jan 19 05:33:55 2013 (r245655) @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2011 Andrew Turner + * 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. + * + */ + +/* + * Provide an implementation of __aeabi_unwind_cpp_pr{0,1,2}. These are + * required by libc but are implemented in libgcc_eh.a which we don't link + * against. The libgcc_eh.a version will be called so we call abort to + * check this. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +void __aeabi_unwind_cpp_pr0(void) __hidden; +void __aeabi_unwind_cpp_pr1(void) __hidden; +void __aeabi_unwind_cpp_pr2(void) __hidden; + +void +__aeabi_unwind_cpp_pr0(void) +{ + abort(); +} + +void +__aeabi_unwind_cpp_pr1(void) +{ + abort(); +} + +void +__aeabi_unwind_cpp_pr2(void) +{ + abort(); +} + From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 06:07:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3ECA4A1B; Sat, 19 Jan 2013 06:07:34 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 8F857C29; Sat, 19 Jan 2013 06:07:33 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r0J67TMZ078114; Sat, 19 Jan 2013 08:07:29 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.4 kib.kiev.ua r0J67TMZ078114 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r0J67TEV078113; Sat, 19 Jan 2013 08:07:29 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 19 Jan 2013 08:07:29 +0200 From: Konstantin Belousov To: John Baldwin Subject: Re: svn commit: r245577 - in head/sys: amd64/amd64 i386/i386 x86/x86 Message-ID: <20130119060729.GB2522@kib.kiev.ua> References: <201301172132.r0HLWQHD004835@svn.freebsd.org> <20130118040332.GT2522@kib.kiev.ua> <201301181052.54464.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NctWKJLgDreUm1FS" Content-Disposition: inline In-Reply-To: <201301181052.54464.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) 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 version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 19 Jan 2013 06:07:34 -0000 --NctWKJLgDreUm1FS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 18, 2013 at 10:52:54AM -0500, John Baldwin wrote: > On Thursday, January 17, 2013 11:03:32 pm Konstantin Belousov wrote: > > On Thu, Jan 17, 2013 at 09:32:26PM +0000, John Baldwin wrote: > > > Author: jhb > > > Date: Thu Jan 17 21:32:25 2013 > > > New Revision: 245577 > > > URL: http://svnweb.freebsd.org/changeset/base/245577 > > >=20 > > > Log: > > > Don't attempt to use clflush on the local APIC register window. Va= rious > > > CPUs exhibit bad behavior if this is done (Intel Errata AAJ3, hangs= on > > > Pentium-M, and trashing of the local APIC registers on a VIA C7). = The > > > local APIC is implicitly mapped UC already via MTRRs, so the clflus= h isn't > > > necessary anyway. > > > =20 > > > MFC after: 2 weeks > > I am curious, was there a case where the clflush was really executed > > on the LAPIC register window with the pristine HEAD code ? I think > > that there is no Intel processors which support clflush instruction > > and do not have self-snoop. >=20 > The VIA CPUs. I had a submitter report that a clflush against the local = APIC > range would sometimes cause the entire local APIC range to get overwritte= n with > a single cacheline (repeated throughout the window). Also, in theory we = could > perhaps stop masking CLFLUSH in VM's when SS is masked. So VIAs are bug-to-bug compatible with Intels ? Weird. Regarding reverting of the VM workaround, I am not sure. It could be tried, but as I remember, the cause of the workaround were AMD processors and some hypervisors. It was long time ago, it might indeed be that it worth a try. >=20 > > On the other hand, please note that the same change could be due for the > > pmap_invalidate_cache_pages(). Unlike pmap_invalidate_cache_range(), > > _pages() uses clflush unconditionally on purpose, since it is intended > > for devices which do not snoop. >=20 > Hmm, maybe. I'm not sure that call is ever used on the local APIC since = the > relevant page should already be UC from the boot-time call? I noted this for completeness. You did the change in the pmap_invalidate_cache_range(), and not in the pmap_mapdev*. The KPI becomes somewhat rough due to inequality of the two cache flush methods now. But I definitely do not insist, since the ony real user of _pages() right now is GEM, which only calls it on the real physical memory. --NctWKJLgDreUm1FS Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQ+jggAAoJEJDCuSvBvK1BmqoP/2BAK/anJZiO1yQ3aaFTi6Hp FK09zHXM8qQ5amiE4wZ+MiT2ZOtuUVZkQo8VccNU/H0YeBBbVNBq5S70mTXqsVVI 4ldskC5y9dNl/IipKMhddofD6SuBM0vLR2hezt6MN26NhgTaLYqGfnDokCy7TDBJ 1FBMQcERck21ktzMhlTBYVLk6rLkbj3S01un3H+fZPXPV+jdZr0J0ytt9ZL++eZC orsCtAZNM+Ztt8l+JWfZTjbpfEyZenR8yMqiLh/zUHWmx2cD9rX0t6AhnyfbnqeG m+mVggLG6nNoddrWhGGLsQZurp5jaY4wu1cRGiM23WRoVzqTEFhRW4awC16VKg0K P59qFrxeEBe15fX+wr4Rw7ConVyYr18uWwBCc8YB3N2anz74i9/88MrYZ8t+YVNW mzBM4f8W4RNUY6aWXcOuPH5HUeDAVPWV8vNqpzIpNL9XEWNhipNRrrIUzXgOPknk 4N2lDvJ1UdxT3H1KMv8B6NHNToXN+oa2NmD+VCnNe90BnZAJQqTM0/R1nPU35YAE lpeJY4wHvmfSwN9Y3a0BLJP0G+b4rrpFhyts7Vi2sKuZSF4V6UqSULD5q1wd7iHk jhLMTuQec/usg/0smu7VKqzrVKwuE/9kS7PcjmrPFy5xnja9F0OnmTy/5mFOiq/n iCNKuo5Lj8E8DNLn/40t =80tV -----END PGP SIGNATURE----- --NctWKJLgDreUm1FS-- From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 07:04:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CE8C8B02; Sat, 19 Jan 2013 07:04:30 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AB2AFE9E; Sat, 19 Jan 2013 07:04:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0J74U9H027342; Sat, 19 Jan 2013 07:04:30 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0J74Um6027340; Sat, 19 Jan 2013 07:04:30 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201301190704.r0J74Um6027340@svn.freebsd.org> From: Joel Dahl Date: Sat, 19 Jan 2013 07:04:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245666 - head/usr.sbin/bhyveload X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 19 Jan 2013 07:04:30 -0000 Author: joel (doc committer) Date: Sat Jan 19 07:04:30 2013 New Revision: 245666 URL: http://svnweb.freebsd.org/changeset/base/245666 Log: Minor mdoc fixes. Modified: head/usr.sbin/bhyveload/bhyveload.8 Modified: head/usr.sbin/bhyveload/bhyveload.8 ============================================================================== --- head/usr.sbin/bhyveload/bhyveload.8 Sat Jan 19 06:39:49 2013 (r245665) +++ head/usr.sbin/bhyveload/bhyveload.8 Sat Jan 19 07:04:30 2013 (r245666) @@ -51,7 +51,7 @@ virtual machine. .Nm is based on .Xr loader 8 -and will present an interface identical to +and will present an interface identical to the .Fx loader on the user's terminal. .Pp @@ -85,36 +85,34 @@ is the pathname of the guest's boot disk The .Ar host-path is the directory at the top of the guest's boot filesystem. - +.El .Sh EXAMPLES To create a virtual machine named .Ar freebsd-vm that boots off the ISO image .Pa /freebsd/release.iso and has 1GB memory allocated to it: - -.Dl "bhyveload -m 256 -M 768 -d /freebsd/release.iso freebsd-vm - +.Pp +.Dl "bhyveload -m 256 -M 768 -d /freebsd/release.iso freebsd-vm" +.Pp In the example above the 1GB allocation is split in two segments: +.Pp .Bl -dash -compact .It 256MB below the 4GB boundary (0MB - 256MB) .It 768MB above the 4GB boundary (4096MB - 4864MB) .El - .Sh SEE ALSO .Xr bhyve 4 , .Xr bhyve 8 , .Xr loader 8 , .Xr vmm 4 - .Sh HISTORY .Nm first appeared in .Fx 10.0 , and was developed at NetApp Inc. - .Sh AUTHORS .Nm was developed by @@ -122,9 +120,8 @@ was developed by .An "Neel Natu" Aq neel@FreeBSD.org at NetApp Inc with a lot of help from .An Doug Rabson Aq dfr@FreeBSD.org - .Sh BUGS .Nm -can load only +can only load .Fx as a guest. From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 07:07:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0C0C3C80; Sat, 19 Jan 2013 07:07:06 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F3504EAC; Sat, 19 Jan 2013 07:07:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0J775SR027879; Sat, 19 Jan 2013 07:07:05 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0J775eK027877; Sat, 19 Jan 2013 07:07:05 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201301190707.r0J775eK027877@svn.freebsd.org> From: Joel Dahl Date: Sat, 19 Jan 2013 07:07:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245667 - in head: usr.bin/xinstall usr.sbin/bhyveload X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 19 Jan 2013 07:07:06 -0000 Author: joel (doc committer) Date: Sat Jan 19 07:07:05 2013 New Revision: 245667 URL: http://svnweb.freebsd.org/changeset/base/245667 Log: Remove EOL whitespace. Modified: head/usr.bin/xinstall/install.1 head/usr.sbin/bhyveload/bhyveload.8 Modified: head/usr.bin/xinstall/install.1 ============================================================================== --- head/usr.bin/xinstall/install.1 Sat Jan 19 07:04:30 2013 (r245666) +++ head/usr.bin/xinstall/install.1 Sat Jan 19 07:07:05 2013 (r245667) @@ -145,7 +145,7 @@ for a list of possible flags and their m .It Fl g Specify a group. A numeric GID is allowed. -.It Fl h Ar hash +.It Fl h Ar hash When copying, calculate the digest of the files with .Ar hash to store in the @@ -199,7 +199,7 @@ Disable all use of .Xr mmap 2 . .It Fl M Ar metalog Write the metadata associated with each item installed to -.Ar metalog +.Ar metalog in an .Xr mtree 8 .Dq full path Modified: head/usr.sbin/bhyveload/bhyveload.8 ============================================================================== --- head/usr.sbin/bhyveload/bhyveload.8 Sat Jan 19 07:04:30 2013 (r245666) +++ head/usr.sbin/bhyveload/bhyveload.8 Sat Jan 19 07:07:05 2013 (r245667) @@ -88,9 +88,9 @@ is the directory at the top of the guest .El .Sh EXAMPLES To create a virtual machine named -.Ar freebsd-vm +.Ar freebsd-vm that boots off the ISO image -.Pa /freebsd/release.iso +.Pa /freebsd/release.iso and has 1GB memory allocated to it: .Pp .Dl "bhyveload -m 256 -M 768 -d /freebsd/release.iso freebsd-vm" From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 16:39:25 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4FA8E7DE; Sat, 19 Jan 2013 16:39:25 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id CDD6C35F; Sat, 19 Jan 2013 16:39:24 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.6/8.14.6) with ESMTP id r0JGdHCH023846; Sat, 19 Jan 2013 20:39:17 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.6/8.14.6/Submit) id r0JGdHvM023845; Sat, 19 Jan 2013 20:39:17 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 19 Jan 2013 20:39:17 +0400 From: Gleb Smirnoff To: Neel Natu Subject: Re: svn commit: r245652 - in head: lib share/man/man4 share/mk sys/amd64/include sys/conf sys/modules usr.sbin Message-ID: <20130119163917.GD14114@FreeBSD.org> References: <201301190418.r0J4IquZ074573@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201301190418.r0J4IquZ074573@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 19 Jan 2013 16:39:25 -0000 On Sat, Jan 19, 2013 at 04:18:52AM +0000, Neel Natu wrote: N> Author: neel N> Date: Sat Jan 19 04:18:52 2013 N> New Revision: 245652 N> URL: http://svnweb.freebsd.org/changeset/base/245652 N> N> Log: N> Merge projects/bhyve to head. N> N> 'bhyve' was developed by grehan@ and myself at NetApp (thanks!). N> N> Special thanks to Peter Snyder, Joe Caradonna and Michael Dexter for their N> support and encouragement. N> N> Obtained from: NetApp Thank you, Neel and Peter! -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 17:12:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CDE2B41F; Sat, 19 Jan 2013 17:12:23 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B68088BC; Sat, 19 Jan 2013 17:12:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0JHCNUt018567; Sat, 19 Jan 2013 17:12:23 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0JHCNch018566; Sat, 19 Jan 2013 17:12:23 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201301191712.r0JHCNch018566@svn.freebsd.org> From: Tim Kientzle Date: Sat, 19 Jan 2013 17:12:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245672 - 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.14 Precedence: list List-Id: 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, 19 Jan 2013 17:12:23 -0000 Author: kientzle Date: Sat Jan 19 17:12:23 2013 New Revision: 245672 URL: http://svnweb.freebsd.org/changeset/base/245672 Log: Clarify the error messages for unrecognized pins and muxtypes. Modified: head/sys/arm/ti/ti_scm.c Modified: head/sys/arm/ti/ti_scm.c ============================================================================== --- head/sys/arm/ti/ti_scm.c Sat Jan 19 16:22:41 2013 (r245671) +++ head/sys/arm/ti/ti_scm.c Sat Jan 19 17:12:23 2013 (r245672) @@ -155,8 +155,10 @@ ti_scm_padconf_set_internal(struct ti_sc } /* couldn't find the mux mode */ - if (mode >= 8) + if (mode >= 8) { + printf("Invalid mode \"%s\"\n", muxmode); return (EINVAL); + } /* set the mux mode */ reg_val |= (uint16_t)(mode & ti_scm_dev.padconf_muxmode_mask); @@ -391,13 +393,16 @@ ti_scm_padconf_init_from_fdt(struct ti_s while (padstates->state != NULL) { if (strcmp(padstates->state, padstate) == 0) { err = ti_scm_padconf_set_internal(sc, - padconf, muxname, padstates->reg); + padconf, muxname, padstates->reg); } padstates++; } if (err) - device_printf(sc->sc_dev, "err: failed to configure" - "pin \"%s\"\n", padconf->ballname); + device_printf(sc->sc_dev, + "err: failed to configure " + "pin \"%s\" as \"%s\"\n", + padconf->ballname, + muxname); } padconf++; } From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 17:22:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9D20373F; Sat, 19 Jan 2013 17:22:13 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 85573952; Sat, 19 Jan 2013 17:22:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0JHMDwQ023054; Sat, 19 Jan 2013 17:22:13 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0JHMD3p023053; Sat, 19 Jan 2013 17:22:13 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201301191722.r0JHMD3p023053@svn.freebsd.org> From: Tim Kientzle Date: Sat, 19 Jan 2013 17:22:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245673 - head/sys/boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 19 Jan 2013 17:22:13 -0000 Author: kientzle Date: Sat Jan 19 17:22:12 2013 New Revision: 245673 URL: http://svnweb.freebsd.org/changeset/base/245673 Log: Use correct GPIO interrupt lines. Modified: head/sys/boot/fdt/dts/beaglebone.dts Modified: head/sys/boot/fdt/dts/beaglebone.dts ============================================================================== --- head/sys/boot/fdt/dts/beaglebone.dts Sat Jan 19 17:12:23 2013 (r245672) +++ head/sys/boot/fdt/dts/beaglebone.dts Sat Jan 19 17:22:12 2013 (r245673) @@ -125,7 +125,7 @@ 0x4804C000 0x1000 0x481AC000 0x1000 0x481AE000 0x1000 >; - interrupts = < 17 19 21 23 >; + interrupts = < 96 97 98 99 32 33 62 63 >; interrupt-parent = <&AINTC>; }; From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 22:08:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3EC09F54; Sat, 19 Jan 2013 22:08:17 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 315451D9; Sat, 19 Jan 2013 22:08:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0JM8HIJ006827; Sat, 19 Jan 2013 22:08:17 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0JM8GZa006825; Sat, 19 Jan 2013 22:08:16 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201301192208.r0JM8GZa006825@svn.freebsd.org> From: Andrew Turner Date: Sat, 19 Jan 2013 22:08:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245675 - 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.14 Precedence: list List-Id: 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, 19 Jan 2013 22:08:17 -0000 Author: andrew Date: Sat Jan 19 22:08:16 2013 New Revision: 245675 URL: http://svnweb.freebsd.org/changeset/base/245675 Log: When DDB is enabled and we are building for the ARM EABI include the unwind tables in the kernel. Modified: head/sys/conf/Makefile.arm head/sys/conf/ldscript.arm Modified: head/sys/conf/Makefile.arm ============================================================================== --- head/sys/conf/Makefile.arm Sat Jan 19 21:57:25 2013 (r245674) +++ head/sys/conf/Makefile.arm Sat Jan 19 22:08:16 2013 (r245675) @@ -41,6 +41,8 @@ STRIP_FLAGS = -S .if empty(DDB_ENABLED) CFLAGS += -mno-apcs-frame +.elif defined(WITH_ARM_EABI) +CFLAGS += -funwind-tables .endif SYSTEM_LD_ = ${LD} -Bdynamic -T ldscript.$M.noheader ${LDFLAGS} \ Modified: head/sys/conf/ldscript.arm ============================================================================== --- head/sys/conf/ldscript.arm Sat Jan 19 21:57:25 2013 (r245674) +++ head/sys/conf/ldscript.arm Sat Jan 19 22:08:16 2013 (r245675) @@ -56,6 +56,18 @@ SECTIONS .init : { *(.init) } =0x9090 .plt : { *(.plt) } + _extab_start = .; + PROVIDE(extab_start = .); + .ARM.extab : { *(.ARM.extab) } + _extab.end = .; + PROVIDE(extab_end = .); + + _exidx_start = .; + PROVIDE(exidx_start = .); + .ARM.exidx : { *(.ARM.exidx) } + _exidx_end = .; + PROVIDE(exidx_end = .); + /* Adjust the address for the data segment. We want to adjust up to the same address within the page on the next page up. */ . = ALIGN(0x1000) + (. & (0x1000 - 1)) ; From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 22:12:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 69EE2166; Sat, 19 Jan 2013 22:12:09 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4472B1EF; Sat, 19 Jan 2013 22:12:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0JMC9xf009111; Sat, 19 Jan 2013 22:12:09 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0JMC96J009110; Sat, 19 Jan 2013 22:12:09 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201301192212.r0JMC96J009110@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 19 Jan 2013 22:12:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245676 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 19 Jan 2013 22:12:09 -0000 Author: jilles Date: Sat Jan 19 22:12:08 2013 New Revision: 245676 URL: http://svnweb.freebsd.org/changeset/base/245676 Log: sh: Replace an mkinit use with an initialization. Modified: head/bin/sh/input.c Modified: head/bin/sh/input.c ============================================================================== --- head/bin/sh/input.c Sat Jan 19 22:08:16 2013 (r245675) +++ head/bin/sh/input.c Sat Jan 19 22:12:08 2013 (r245676) @@ -64,7 +64,6 @@ __FBSDID("$FreeBSD$"); #define EOF_NLEFT -99 /* value of parsenleft when EOF pushed back */ -MKINIT struct strpush { struct strpush *prev; /* preceding string on stack */ char *prevstring; @@ -78,7 +77,6 @@ struct strpush { * contains information about the current file being read. */ -MKINIT struct parsefile { struct parsefile *prev; /* preceding file on stack */ int linno; /* current line */ @@ -96,8 +94,11 @@ int plinno = 1; /* input line number * int parsenleft; /* copy of parsefile->nleft */ MKINIT int parselleft; /* copy of parsefile->lleft */ char *parsenextc; /* copy of parsefile->nextc */ -MKINIT struct parsefile basepf; /* top level input file */ -char basebuf[BUFSIZ + 1]; /* buffer for top level input file */ +static char basebuf[BUFSIZ + 1];/* buffer for top level input file */ +static struct parsefile basepf = { /* top level input file */ + .nextc = basebuf, + .buf = basebuf +}; static struct parsefile *parsefile = &basepf; /* current input file */ int whichprompt; /* 1 == PS1, 2 == PS2 */ @@ -111,12 +112,6 @@ static void popstring(void); INCLUDE "input.h" INCLUDE "error.h" -MKINIT char basebuf[]; - -INIT { - basepf.nextc = basepf.buf = basebuf; -} - RESET { popallfiles(); parselleft = parsenleft = 0; /* clear input buffer */ From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 22:12:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C9B4A2D6; Sat, 19 Jan 2013 22:12:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B25141F7; Sat, 19 Jan 2013 22:12:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0JMCv1Z009264; Sat, 19 Jan 2013 22:12:57 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0JMCv5x009263; Sat, 19 Jan 2013 22:12:57 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201301192212.r0JMCv5x009263@svn.freebsd.org> From: Andrew Turner Date: Sat, 19 Jan 2013 22:12:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245677 - head/sys/boot/arm/uboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 19 Jan 2013 22:12:57 -0000 Author: andrew Date: Sat Jan 19 22:12:57 2013 New Revision: 245677 URL: http://svnweb.freebsd.org/changeset/base/245677 Log: Link against compiler-rt to pull in the required __aeabi_* functions Modified: head/sys/boot/arm/uboot/Makefile Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Sat Jan 19 22:12:08 2013 (r245676) +++ head/sys/boot/arm/uboot/Makefile Sat Jan 19 22:12:57 2013 (r245677) @@ -112,8 +112,8 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/li # clang doesn't understand %D as a specifier to printf NO_WERROR.clang= -DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} -lstand +DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND} ${LIBGCC} +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} -lstand -lgcc vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}